@ar.io/sdk 2.4.0-alpha.13 → 2.4.0-alpha.15
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 +69 -0
- package/bundles/web.bundle.min.js +10 -10
- package/lib/cjs/common/contracts/ao-process.js +6 -5
- package/lib/cjs/common/io.js +21 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/contracts/ao-process.js +6 -5
- package/lib/esm/common/io.js +21 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +9 -3
- package/lib/types/types/io.d.ts +16 -6
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,8 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
29
29
|
- [`getTokenSupply()`](#gettokensupply)
|
|
30
30
|
- [`getBalance({ address })`](#getbalance-address-)
|
|
31
31
|
- [`getBalances({ cursor, limit, sortBy, sortOrder })`](#getbalances-cursor-limit-sortby-sortorder-)
|
|
32
|
+
- [`getVault({ address, vaultId })`](#getvault-address-vaultid-)
|
|
33
|
+
- [`getVaults({ cursor, limit, sortBy, sortOrder })`](#getvaults-cursor-limit-sortby-sortorder-)
|
|
32
34
|
- [`getGateway({ address })`](#getgateway-address-)
|
|
33
35
|
- [`getGateways({ cursor, limit, sortBy, sortOrder })`](#getgateways-cursor-limit-sortby-sortorder-)
|
|
34
36
|
- [`getArNSRecord({ name })`](#getarnsrecord-name-)
|
|
@@ -395,6 +397,73 @@ const balances = await io.getBalances({
|
|
|
395
397
|
```
|
|
396
398
|
|
|
397
399
|
</details>
|
|
400
|
+
|
|
401
|
+
#### `getVault({ address, vaultId })`
|
|
402
|
+
|
|
403
|
+
Retrieves the locked-balance user vault of the IO process by the specified wallet address and vault ID.
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
const io = IO.init();
|
|
407
|
+
const vault = await io.getVault({
|
|
408
|
+
address: 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ',
|
|
409
|
+
vaultId: 'vaultIdOne',
|
|
410
|
+
});
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
<details>
|
|
414
|
+
<summary>Output</summary>
|
|
415
|
+
|
|
416
|
+
```json
|
|
417
|
+
{
|
|
418
|
+
"balance": 1000000,
|
|
419
|
+
"startTimestamp": 123,
|
|
420
|
+
"endTimestamp": 4567
|
|
421
|
+
}
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
#### `getVaults({ cursor, limit, sortBy, sortOrder })`
|
|
425
|
+
|
|
426
|
+
Retrieves all locked-balance user vaults of the IO process, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last wallet address from the previous request.
|
|
427
|
+
|
|
428
|
+
```typescript
|
|
429
|
+
const io = IO.init();
|
|
430
|
+
const vaults = await io.getVaults({
|
|
431
|
+
cursor: '0',
|
|
432
|
+
limit: 100,
|
|
433
|
+
sortBy: 'balance',
|
|
434
|
+
sortOrder: 'desc',
|
|
435
|
+
});
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
<details>
|
|
439
|
+
<summary>Output</summary>
|
|
440
|
+
|
|
441
|
+
```json
|
|
442
|
+
{
|
|
443
|
+
"items": [
|
|
444
|
+
{
|
|
445
|
+
"address": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
446
|
+
"vaultId": "vaultIdOne",
|
|
447
|
+
"balance": 1000000,
|
|
448
|
+
"startTimestamp": 123,
|
|
449
|
+
"endTimestamp": 4567
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"address": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
453
|
+
"vaultId": "vaultIdTwo",
|
|
454
|
+
"balance": 1000000,
|
|
455
|
+
"startTimestamp": 123,
|
|
456
|
+
"endTimestamp": 4567
|
|
457
|
+
}
|
|
458
|
+
// ...98 other addresses with vaults
|
|
459
|
+
],
|
|
460
|
+
"hasMore": true,
|
|
461
|
+
"nextCursor": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
462
|
+
"totalItems": 1789,
|
|
463
|
+
"sortBy": "balance",
|
|
464
|
+
"sortOrder": "desc"
|
|
465
|
+
}
|
|
466
|
+
```
|
|
398
467
|
|
|
399
468
|
#### `getGateway({ address })`
|
|
400
469
|
|