@ar.io/sdk 2.0.0-alpha.7 → 2.0.0-alpha.8
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 +18 -0
- package/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/io.js +7 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +7 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +1 -0
- package/lib/types/io.d.ts +1 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
32
32
|
- [`getCurrentEpoch()`](#getcurrentepoch)
|
|
33
33
|
- [`getPrescribedObservers({ epochIndex })`](#getprescribedobservers-epochindex-)
|
|
34
34
|
- [`joinNetwork(params)`](#joinnetworkparams)
|
|
35
|
+
- [`leaveNetwork()`](#leavenetwork)
|
|
35
36
|
- [`updateGatewaySettings(gatewaySettings)`](#updategatewaysettingsgatewaysettings)
|
|
36
37
|
- [`increaseDelegateStake({ target, qty })`](#increasedelegatestake-target-qty-)
|
|
37
38
|
- [`decreaseDelegateStake({ target, qty })`](#decreasedelegatestake-target-qty-)
|
|
@@ -39,6 +40,8 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
39
40
|
- [`decreaseOperatorStake({ qty })`](#decreaseoperatorstake-qty-)
|
|
40
41
|
- [`saveObservations({ reportTxId, failedGateways })`](#saveobservations-reporttxid-failedgateways-)
|
|
41
42
|
- [`transfer({ target, qty, denomination })`](#transfer-target-qty-denomination-)
|
|
43
|
+
- [`increaseUndernameLimit({ name, qty })`](#increaseundernamelimit-name-qty-)
|
|
44
|
+
- [`extendLease({ name, years })`](#extendlease-name-years-)
|
|
42
45
|
- [Configuration](#custom-configuration)
|
|
43
46
|
|
|
44
47
|
- [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)
|
|
@@ -711,6 +714,21 @@ const { id: txId } = await io.joinNetwork(
|
|
|
711
714
|
);
|
|
712
715
|
```
|
|
713
716
|
|
|
717
|
+
#### `leaveNetwork()`
|
|
718
|
+
|
|
719
|
+
Sets the gateway as `leaving` on the ar.io network. Requires `signer` to be provided on `IO.init` to sign the transaction. The gateways operator and delegate stakes are vaulted and will be returned after leave periods. The gateway will be removed from the network after the leave period.
|
|
720
|
+
|
|
721
|
+
_Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
|
|
722
|
+
|
|
723
|
+
```typescript
|
|
724
|
+
const io = IO.init({ signer: new ArweaveSigner(jwk) });
|
|
725
|
+
|
|
726
|
+
const { id: txId } = await io.leaveNetwork(
|
|
727
|
+
// optional additional tags
|
|
728
|
+
{ tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] },
|
|
729
|
+
);
|
|
730
|
+
```
|
|
731
|
+
|
|
714
732
|
#### `updateGatewaySettings(gatewaySettings)`
|
|
715
733
|
|
|
716
734
|
Writes new gateway settings to the callers gateway configuration.
|