@ar.io/sdk 3.6.1 → 3.7.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 +34 -6
- package/bundles/web.bundle.min.js +53 -53
- package/lib/cjs/cli/cli.js +46 -14
- package/lib/cjs/cli/commands/antCommands.js +3 -3
- package/lib/cjs/cli/commands/arnsPurchaseCommands.js +4 -4
- package/lib/cjs/cli/commands/gatewayWriteCommands.js +9 -9
- package/lib/cjs/cli/commands/transfer.js +6 -6
- package/lib/cjs/cli/utils.js +3 -3
- package/lib/cjs/common/io.js +21 -1
- package/lib/cjs/types/io.js +11 -1
- package/lib/cjs/utils/arweave.js +84 -1
- package/lib/cjs/utils/utils.test.js +98 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +47 -15
- package/lib/esm/cli/commands/antCommands.js +4 -4
- package/lib/esm/cli/commands/arnsPurchaseCommands.js +5 -5
- package/lib/esm/cli/commands/gatewayWriteCommands.js +10 -10
- package/lib/esm/cli/commands/transfer.js +7 -7
- package/lib/esm/cli/utils.js +1 -1
- package/lib/esm/common/io.js +22 -2
- package/lib/esm/types/io.js +8 -0
- package/lib/esm/utils/arweave.js +81 -0
- package/lib/esm/utils/utils.test.js +99 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/readCommands.d.ts +1 -1
- package/lib/types/cli/utils.d.ts +1 -1
- package/lib/types/common/io.d.ts +2 -1
- package/lib/types/types/io.d.ts +37 -23
- package/lib/types/utils/arweave.d.ts +3 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,6 +72,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
72
72
|
- [Epochs](#epochs)
|
|
73
73
|
- [`getCurrentEpoch()`](#getcurrentepoch)
|
|
74
74
|
- [`getEpoch({ epochIndex })`](#getepoch-epochindex-)
|
|
75
|
+
- [`getEligibleEpochRewards({ epochIndex }, { cursor, limit, sortBy, sortOrder })](#geteligibleepochrewards-epochindex---cursor-limit-sortby-sortorder-)
|
|
75
76
|
- [`getObservations({ epochIndex })`](#getobservations-epochindex-)
|
|
76
77
|
- [`getDistributions({ epochIndex })`](#getdistributions-epochindex-)
|
|
77
78
|
- [`saveObservations({ reportTxId, failedGateways })`](#saveobservations-reporttxid-failedgateways-)
|
|
@@ -1615,12 +1616,6 @@ const epoch = await ario.getEpoch({ epochIndex: 0 });
|
|
|
1615
1616
|
"totalDistributedRewards": 100000000,
|
|
1616
1617
|
"distributedTimestamp": 1720720621424,
|
|
1617
1618
|
"rewards": {
|
|
1618
|
-
"eligible": {
|
|
1619
|
-
"IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs": {
|
|
1620
|
-
"operatorReward": 100000000,
|
|
1621
|
-
"delegateRewards": {}
|
|
1622
|
-
}
|
|
1623
|
-
},
|
|
1624
1619
|
"distributed": {
|
|
1625
1620
|
"IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs": 100000000
|
|
1626
1621
|
}
|
|
@@ -1631,6 +1626,39 @@ const epoch = await ario.getEpoch({ epochIndex: 0 });
|
|
|
1631
1626
|
|
|
1632
1627
|
</details>
|
|
1633
1628
|
|
|
1629
|
+
#### `getEligibleEpochRewards({ epochIndex }, { cursor, limit, sortBy, sortOrder })
|
|
1630
|
+
|
|
1631
|
+
Returns the eligible epoch rewards for the specified block height. If no epoch index is provided, the current epoch is used.
|
|
1632
|
+
|
|
1633
|
+
```typescript
|
|
1634
|
+
const ario = ARIO.init();
|
|
1635
|
+
const rewards = await ario.getEligibleEpochRewards({ epochIndex: 0 });
|
|
1636
|
+
```
|
|
1637
|
+
|
|
1638
|
+
<details>
|
|
1639
|
+
<summary>Output</summary>
|
|
1640
|
+
|
|
1641
|
+
```json
|
|
1642
|
+
{
|
|
1643
|
+
"sortOrder": "desc",
|
|
1644
|
+
"hasMore": true,
|
|
1645
|
+
"totalItems": 37,
|
|
1646
|
+
"limit": 1,
|
|
1647
|
+
"sortBy": "cursorId",
|
|
1648
|
+
"items": [
|
|
1649
|
+
{
|
|
1650
|
+
"cursorId": "xN_aVln30LmoCffwmk5_kRkcyQZyZWy1o_TNtM_CTm0_xN_aVln30LmoCffwmk5_kRkcyQZyZWy1o_TNtM_CTm0",
|
|
1651
|
+
"recipient": "xN_aVln30LmoCffwmk5_kRkcyQZyZWy1o_TNtM_CTm0",
|
|
1652
|
+
"gatewayAddress": "xN_aVln30LmoCffwmk5_kRkcyQZyZWy1o_TNtM_CTm0",
|
|
1653
|
+
"eligibleReward": 2627618704,
|
|
1654
|
+
"type": "operatorReward"
|
|
1655
|
+
}
|
|
1656
|
+
],
|
|
1657
|
+
"nextCursor": "xN_aVln30LmoCffwmk5_kRkcyQZyZWy1o_TNtM_CTm0_xN_aVln30LmoCffwmk5_kRkcyQZyZWy1o_TNtM_CTm0"
|
|
1658
|
+
}
|
|
1659
|
+
```
|
|
1660
|
+
</details>
|
|
1661
|
+
|
|
1634
1662
|
#### `getObservations({ epochIndex })`
|
|
1635
1663
|
|
|
1636
1664
|
Returns the epoch-indexed observation list. If no epoch index is provided, the current epoch is used.
|