@ar.io/sdk 3.4.0-alpha.2 → 3.4.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/bundles/web.bundle.min.js +65 -65
- package/lib/cjs/cli/cli.js +34 -19
- package/lib/cjs/cli/commands/antCommands.js +48 -0
- package/lib/cjs/cli/commands/transfer.js +83 -1
- package/lib/cjs/cli/options.js +16 -2
- package/lib/cjs/cli/utils.js +19 -2
- package/lib/cjs/common/ant.js +11 -17
- package/lib/cjs/common/io.js +36 -0
- package/lib/cjs/types/io.js +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +36 -21
- package/lib/esm/cli/commands/antCommands.js +42 -0
- package/lib/esm/cli/commands/transfer.js +80 -1
- package/lib/esm/cli/options.js +15 -1
- package/lib/esm/cli/utils.js +17 -1
- package/lib/esm/common/ant.js +11 -17
- package/lib/esm/common/io.js +36 -0
- package/lib/esm/types/io.js +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/antCommands.d.ts +21 -0
- package/lib/types/cli/commands/transfer.d.ts +16 -1
- package/lib/types/cli/options.d.ts +12 -0
- package/lib/types/cli/types.d.ts +3 -0
- package/lib/types/cli/utils.d.ts +2 -0
- package/lib/types/common/ant.d.ts +5 -19
- package/lib/types/common/io.d.ts +4 -1
- package/lib/types/types/ant.d.ts +42 -44
- package/lib/types/types/common.d.ts +2 -0
- package/lib/types/types/io.d.ts +43 -31
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,9 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
35
35
|
- [`getVaults({ cursor, limit, sortBy, sortOrder })`](#getvaults-cursor-limit-sortby-sortorder-)
|
|
36
36
|
- [`vaultedTransfer({ recipient, quantity, lockLengthMs, revokable })`](#vaultedtransfer-recipient-quantity-locklengthms-revokable-)
|
|
37
37
|
- [`revokeVault({ recipient, vaultId })`](#revokevault-recipient-vaultid-)
|
|
38
|
+
- [`createVault({ lockLengthMs, quantity })`](#createvault-locklengthms-quantity-)
|
|
39
|
+
- [`extendVault({ vaultId, extendLengthMs })`](#extendvault-vaultid-extendlengthms-)
|
|
40
|
+
- [`increaseVault({ vaultId, quantity })`](#increasevault-vaultid-quantity-)
|
|
38
41
|
- [Gateways](#gateways)
|
|
39
42
|
- [`getGateway({ address })`](#getgateway-address-)
|
|
40
43
|
- [`getGateways({ cursor, limit, sortBy, sortOrder })`](#getgateways-cursor-limit-sortby-sortorder-)
|
|
@@ -550,6 +553,45 @@ const { id: txId } = await ario.revokeVault({
|
|
|
550
553
|
});
|
|
551
554
|
```
|
|
552
555
|
|
|
556
|
+
#### `createVault({ lockLengthMs, quantity })`
|
|
557
|
+
|
|
558
|
+
Creates a vault for the specified `quantity` of mARIO from the signer's balance and locks it for the specified `lockLengthMs` milliseconds.
|
|
559
|
+
|
|
560
|
+
```typescript
|
|
561
|
+
const ario = ARIO.init({ signer: new ArweaveSigner(jwk) });
|
|
562
|
+
|
|
563
|
+
const { id: txId } = await ario.createVault({
|
|
564
|
+
lockLengthMs: 1000 * 60 * 60 * 24 * 365, // 1 year
|
|
565
|
+
quantity: new ARIOToken(1000).toMARIO(),
|
|
566
|
+
});
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
#### `extendVault({ vaultId, extendLengthMs })`
|
|
570
|
+
|
|
571
|
+
Extends the lock length of a signer's vault by the specified `extendLengthMs` milliseconds.
|
|
572
|
+
|
|
573
|
+
```typescript
|
|
574
|
+
const ario = ARIO.init({ signer: new ArweaveSigner(jwk) });
|
|
575
|
+
|
|
576
|
+
const { id: txId } = await ario.extendVault({
|
|
577
|
+
vaultId: 'vaultIdOne',
|
|
578
|
+
extendLengthMs: 1000 * 60 * 60 * 24 * 365, // 1 year
|
|
579
|
+
});
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
#### `increaseVault({ vaultId, quantity })`
|
|
583
|
+
|
|
584
|
+
Increases the balance of a signer's vault by the specified `quantity` of mARIO.
|
|
585
|
+
|
|
586
|
+
```typescript
|
|
587
|
+
const ario = ARIO.init({ signer: new ArweaveSigner(jwk) });
|
|
588
|
+
|
|
589
|
+
const { id: txId } = await ario.increaseVault({
|
|
590
|
+
vaultId: 'vaultIdOne',
|
|
591
|
+
quantity: new ARIOToken(1000).toMARIO(),
|
|
592
|
+
});
|
|
593
|
+
```
|
|
594
|
+
|
|
553
595
|
### Gateways
|
|
554
596
|
|
|
555
597
|
#### `getGateway({ address })`
|