@ar.io/sdk 2.3.3-alpha.1 → 2.4.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 +37 -3
- package/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/io.js +13 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +13 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +5 -0
- package/lib/types/types/io.d.ts +5 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,8 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
44
44
|
- [`leaveNetwork()`](#leavenetwork)
|
|
45
45
|
- [`updateGatewaySettings(gatewaySettings)`](#updategatewaysettingsgatewaysettings)
|
|
46
46
|
- [`increaseDelegateStake({ target, qty })`](#increasedelegatestake-target-qty-)
|
|
47
|
-
- [`decreaseDelegateStake({ target, qty })`](#decreasedelegatestake-target-qty-)
|
|
47
|
+
- [`decreaseDelegateStake({ target, qty, instant })`](#decreasedelegatestake-target-qty-instant-)
|
|
48
|
+
- [`instantDelegateWithdrawal({ target, vaultId })`](#instantdelegatewithdrawal-target-vaultid-)
|
|
48
49
|
- [`increaseOperatorStake({ qty })`](#increaseoperatorstake-qty-)
|
|
49
50
|
- [`decreaseOperatorStake({ qty })`](#decreaseoperatorstake-qty-)
|
|
50
51
|
- [`saveObservations({ reportTxId, failedGateways })`](#saveobservations-reporttxid-failedgateways-)
|
|
@@ -941,9 +942,9 @@ const { id: txId } = await io.increaseDelegateStake(
|
|
|
941
942
|
);
|
|
942
943
|
```
|
|
943
944
|
|
|
944
|
-
#### `decreaseDelegateStake({ target, qty })`
|
|
945
|
+
#### `decreaseDelegateStake({ target, qty, instant })`
|
|
945
946
|
|
|
946
|
-
Decreases the callers stake on the target gateway.
|
|
947
|
+
Decreases the callers stake on the target gateway. Can instantly decrease stake by setting instant to `true`.
|
|
947
948
|
|
|
948
949
|
_Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
|
|
949
950
|
|
|
@@ -960,6 +961,39 @@ const { id: txId } = await io.decreaseDelegateStake(
|
|
|
960
961
|
);
|
|
961
962
|
```
|
|
962
963
|
|
|
964
|
+
Pay the early withdrawal fee and withdraw instantly.
|
|
965
|
+
|
|
966
|
+
```typescript
|
|
967
|
+
const io = IO.init({ signer: new ArweaveSigner(jwk) });
|
|
968
|
+
const { id: txId } = await io.decreaseDelegateStake({
|
|
969
|
+
target: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3',
|
|
970
|
+
qty: new IOToken(100).toMIO(),
|
|
971
|
+
instant: true, // Immediately withdraw this stake and pay the instant withdrawal fee
|
|
972
|
+
});
|
|
973
|
+
```
|
|
974
|
+
|
|
975
|
+
#### `instantDelegateWithdrawal({ target, vaultId })`
|
|
976
|
+
|
|
977
|
+
Instantly withdraws vaulted delegate tokens at the cost of the early withdrawal fee.
|
|
978
|
+
|
|
979
|
+
_Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
|
|
980
|
+
|
|
981
|
+
```typescript
|
|
982
|
+
const io = IO.init({ signer: new ArweaveSigner(jwk) });
|
|
983
|
+
const { id: txId } = await io.instantDelegateWithdrawal(
|
|
984
|
+
{
|
|
985
|
+
// gateway address where delegate vault exists
|
|
986
|
+
target: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3',
|
|
987
|
+
// delegated vault id to cancel
|
|
988
|
+
vaultId: 'fDrr0_J4Iurt7caNST02cMotaz2FIbWQ4Kcj616RHl3',
|
|
989
|
+
},
|
|
990
|
+
// optional additional tags
|
|
991
|
+
{
|
|
992
|
+
tags: [{ name: 'App-Name', value: 'My-Awesome-App' }],
|
|
993
|
+
},
|
|
994
|
+
);
|
|
995
|
+
```
|
|
996
|
+
|
|
963
997
|
#### `increaseOperatorStake({ qty })`
|
|
964
998
|
|
|
965
999
|
Increases the callers operator stake. Must be executed with a wallet registered as a gateway operator.
|