@ar.io/sdk 3.3.0-alpha.1 → 3.3.0-alpha.11

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
  - [`decreaseOperatorStake({ qty })`](#decreaseoperatorstake-qty-)
52
52
  - [`redelegateStake({ target, source, stakeQty, vaultId })`](#redelegatestake-target-source-stakeqty-vaultid-)
53
53
  - [`getRedelegationFee({ address })`](#getredelegationfee-address-)
54
+ - [`getAllDelegates({ cursor, limit, sortBy, sortOrder })`](#getalldelegates-cursor-limit-sortby-sortorder-)
54
55
  - [Arweave Name System (ArNS)](#arweave-name-system-arns)
55
56
  - [`buyRecord({ name, type, years, processId })`](#buyrecord-name-type-years-processid-)
56
57
  - [`getArNSRecord({ name })`](#getarnsrecord-name-)
@@ -1028,6 +1029,51 @@ const fee = await ario.getRedelegationFee({
1028
1029
 
1029
1030
  </details>
1030
1031
 
1032
+ #### `getAllDelegates({ cursor, limit, sortBy, sortOrder })`
1033
+
1034
+ Retrieves all delegates across all gateways, paginated and sorted by the specified criteria. The `cursor` used for pagination is a `cursorId` derived from delegate address and the gatewayAddress from the previous request. e.g `address_gatewayAddress`.
1035
+
1036
+ ```typescript
1037
+ const ario = ARIO.init();
1038
+ const delegates = await ario.getAllDelegates({
1039
+ limit: 2,
1040
+ sortBy: 'startTimestamp',
1041
+ sortOrder: 'desc',
1042
+ });
1043
+ ```
1044
+
1045
+ <details>
1046
+ <summary>Output</summary>
1047
+
1048
+ ```json
1049
+ {
1050
+ "sortOrder": "desc",
1051
+ "hasMore": true,
1052
+ "totalItems": 95,
1053
+ "limit": 2,
1054
+ "sortBy": "startTimestamp",
1055
+ "items": [
1056
+ {
1057
+ "startTimestamp": 1734709397622,
1058
+ "cursorId": "9jfM0uzGNc9Mkhjo1ixGoqM7ygSem9wx_EokiVgi0Bs_E-QVU3dta36Wia2uQw6tQLjQk7Qw5uN0Z6fUzsoqzUc",
1059
+ "gatewayAddress": "E-QVU3dta36Wia2uQw6tQLjQk7Qw5uN0Z6fUzsoqzUc",
1060
+ "address": "9jfM0uzGNc9Mkhjo1ixGoqM7ygSem9wx_EokiVgi0Bs",
1061
+ "delegatedStake": 2521349108,
1062
+ "vaultedStake": 0
1063
+ },
1064
+ {
1065
+ "startTimestamp": 1734593229454,
1066
+ "cursorId": "LtV0aSqgK3YI7c5FmfvZd-wG95TJ9sezj_a4syaLMS8_M0WP8KSzCvKpzC-HPF1WcddLgGaL9J4DGi76iMnhrN4",
1067
+ "gatewayAddress": "M0WP8KSzCvKpzC-HPF1WcddLgGaL9J4DGi76iMnhrN4",
1068
+ "address": "LtV0aSqgK3YI7c5FmfvZd-wG95TJ9sezj_a4syaLMS8",
1069
+ "delegatedStake": 1685148110,
1070
+ "vaultedStake": 10000000
1071
+ }
1072
+ ],
1073
+ "nextCursor": "PZ5vIhHf8VY969TxBPQN-rYY9CNFP9ggNsMBqlWUzWM_QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ"
1074
+ }
1075
+ ```
1076
+
1031
1077
  ### Arweave Name System (ArNS)
1032
1078
 
1033
1079
  #### `buyRecord({ name, type, years, processId })`