@ar.io/sdk 2.4.0 → 2.5.0-alpha.1

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 CHANGED
@@ -51,6 +51,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
51
51
  - [`updateGatewaySettings(gatewaySettings)`](#updategatewaysettingsgatewaysettings)
52
52
  - [`increaseDelegateStake({ target, qty })`](#increasedelegatestake-target-qty-)
53
53
  - [`decreaseDelegateStake({ target, qty, instant })`](#decreasedelegatestake-target-qty-instant-)
54
+ - [`getDelegations({ address, cursor, limit, sortBy, sortOrder })`](#getdelegations-address-cursor-limit-sortby-sortorder-)
54
55
  - [`instantWithdrawal({ gatewayAddress, vaultId })`](#instantwithdrawal-gatewayaddress-vaultid-)
55
56
  - [`increaseOperatorStake({ qty })`](#increaseoperatorstake-qty-)
56
57
  - [`decreaseOperatorStake({ qty })`](#decreaseoperatorstake-qty-)
@@ -422,6 +423,8 @@ const vault = await io.getVault({
422
423
  }
423
424
  ```
424
425
 
426
+ </details>
427
+
425
428
  #### `getVaults({ cursor, limit, sortBy, sortOrder })`
426
429
 
427
430
  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.
@@ -466,6 +469,8 @@ const vaults = await io.getVaults({
466
469
  }
467
470
  ```
468
471
 
472
+ </details>
473
+
469
474
  #### `getGateway({ address })`
470
475
 
471
476
  Retrieves a gateway's info by its staking wallet address.
@@ -1197,6 +1202,53 @@ const { id: txId } = await io.decreaseDelegateStake({
1197
1202
  });
1198
1203
  ```
1199
1204
 
1205
+ #### `getDelegations({ address, cursor, limit, sortBy, sortOrder })`
1206
+
1207
+ Retrieves all active and vaulted stakes across all gateways for a specific address, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last delegationId (concatenated gateway and startTimestamp of the delgation) from the previous request.
1208
+
1209
+ ```typescript
1210
+ const io = IO.init();
1211
+ const vaults = await io.getDelegations({
1212
+ address: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3',
1213
+ cursor: 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ_123456789',
1214
+ limit: 2,
1215
+ sortBy: 'startTimestamp',
1216
+ sortOrder: 'asc',
1217
+ });
1218
+ ```
1219
+
1220
+ <details>
1221
+ <summary>Output</summary>
1222
+
1223
+ ```json
1224
+ {
1225
+ "sortOrder": "asc",
1226
+ "hasMore": true,
1227
+ "totalItems": 95,
1228
+ "limit": 2,
1229
+ "sortBy": "startTimestamp",
1230
+ "items": [
1231
+ {
1232
+ "type": "stake",
1233
+ "startTimestamp": 1727815440632,
1234
+ "gatewayAddress": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
1235
+ "delegationId": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ_1727815440632",
1236
+ "balance": 1383212512
1237
+ },
1238
+ {
1239
+ "type": "vault",
1240
+ "startTimestamp": 1730996691117,
1241
+ "gatewayAddress": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
1242
+ "delegationId": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ_1730996691117",
1243
+ "vaultId": "_sGDS7X1hyLCVpfe40GWioH9BSOb7f0XWbhHBa1q4-g",
1244
+ "balance": 50000000,
1245
+ "endTimestamp": 1733588691117
1246
+ }
1247
+ ],
1248
+ "nextCursor": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ_1730996691117"
1249
+ }
1250
+ ```
1251
+
1200
1252
  #### `instantWithdrawal({ gatewayAddress, vaultId })`
1201
1253
 
1202
1254
  Instantly withdraws an existing vault on a gateway. If no `gatewayAddress` is provided, the signer's address will be used.