Skip to content

Commit

Permalink
docs(vault apis): add readme updates for new apisPE-7541
Browse files Browse the repository at this point in the history
  • Loading branch information
fedellen committed Jan 30, 2025
1 parent 3585643 commit fb60beb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ Commands:
transfer [options] Transfer ARIO to another address
vaulted-transfer [options] Transfer ARIO to another address into a locked vault
revoke-vault [options] Revoke a vaulted transfer as the controller
create-vault [options] Create a locked vault with balance from the sender
extend-vault [options] Extend the lock length of a vault as the recipient
increase-vault [options] Increase the balance of a locked vault as the recipient
join-network [options] Join a gateway to the AR.IO network
leave-network [options] Leave a gateway from the AR.IO network
update-gateway-settings [options] Update AR.IO gateway settings
Expand Down
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
- [`getVaults({ cursor, limit, sortBy, sortOrder })`](#getvaults-cursor-limit-sortby-sortorder-)
- [`vaultedTransfer({ recipient, quantity, lockLengthMs, revokable })`](#vaultedtransfer-recipient-quantity-locklengthms-revokable-)
- [`revokeVault({ recipient, vaultId })`](#revokevault-recipient-vaultid-)
- [`createVault({ lockLengthMs, quantity })`](#createvault-locklengthms-quantity-)
- [`extendVault({ vaultId, extendLengthMs })`](#extendvault-vaultid-extendlengthms-)
- [`increaseVault({ vaultId, quantity })`](#increasevault-vaultid-quantity-)
- [Gateways](#gateways)
- [`getGateway({ address })`](#getgateway-address-)
- [`getGateways({ cursor, limit, sortBy, sortOrder })`](#getgateways-cursor-limit-sortby-sortorder-)
Expand Down Expand Up @@ -550,6 +553,45 @@ const { id: txId } = await ario.revokeVault({
});
```

#### `createVault({ lockLengthMs, quantity })`

Creates a vault for the specified `quantity` of mARIO from the signer's balance and locks it for the specified `lockLengthMs` milliseconds.

```typescript
const ario = ARIO.init({ signer: new ArweaveSigner(jwk) });

const { id: txId } = await ario.createVault({
lockLengthMs: 1000 * 60 * 60 * 24 * 365, // 1 year
quantity: new ARIOToken(1000).toMARIO(),
});
```

#### `extendVault({ vaultId, extendLengthMs })`

Extends the lock length of a signer's vault by the specified `extendLengthMs` milliseconds.

```typescript
const ario = ARIO.init({ signer: new ArweaveSigner(jwk) });

const { id: txId } = await ario.extendVault({
vaultId: 'vaultIdOne',
extendLengthMs: 1000 * 60 * 60 * 24 * 365, // 1 year
});
```

#### `increaseVault({ vaultId, quantity })`

Increases the balance of a signer's vault by the specified `quantity` of mARIO.

```typescript
const ario = ARIO.init({ signer: new ArweaveSigner(jwk) });

const { id: txId } = await ario.increaseVault({
vaultId: 'vaultIdOne',
quantity: new ARIOToken(1000).toMARIO(),
});
```

### Gateways

#### `getGateway({ address })`
Expand Down

0 comments on commit fb60beb

Please sign in to comment.