@ar.io/sdk 2.4.0-alpha.6 → 2.4.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 +40 -10
- package/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/ant.js +23 -0
- package/lib/cjs/common/io.js +18 -8
- package/lib/cjs/types/ant.js +1 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +23 -0
- package/lib/esm/common/io.js +18 -8
- package/lib/esm/types/ant.js +1 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant.d.ts +16 -0
- package/lib/types/common/io.d.ts +11 -3
- package/lib/types/types/ant.d.ts +5 -0
- package/lib/types/types/io.d.ts +3 -3
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,14 +48,14 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
48
48
|
- [`updateGatewaySettings(gatewaySettings)`](#updategatewaysettingsgatewaysettings)
|
|
49
49
|
- [`increaseDelegateStake({ target, qty })`](#increasedelegatestake-target-qty-)
|
|
50
50
|
- [`decreaseDelegateStake({ target, qty, instant })`](#decreasedelegatestake-target-qty-instant-)
|
|
51
|
-
- [`
|
|
51
|
+
- [`instantWithdrawal({ gatewayAddress, vaultId })`](#instantwithdrawal-gatewayaddress-vaultid-)
|
|
52
52
|
- [`increaseOperatorStake({ qty })`](#increaseoperatorstake-qty-)
|
|
53
53
|
- [`decreaseOperatorStake({ qty })`](#decreaseoperatorstake-qty-)
|
|
54
54
|
- [`saveObservations({ reportTxId, failedGateways })`](#saveobservations-reporttxid-failedgateways-)
|
|
55
55
|
- [`transfer({ target, qty })`](#transfer-target-qty-)
|
|
56
56
|
- [`increaseUndernameLimit({ name, qty })`](#increaseundernamelimit-name-qty-)
|
|
57
57
|
- [`extendLease({ name, years })`](#extendlease-name-years-)
|
|
58
|
-
- [`
|
|
58
|
+
- [`cancelWithdrawal({ gatewayAddress, vaultId })`](#cancelwithdrawal-gatewayaddress-vaultid-)
|
|
59
59
|
- [`submitAuctionBid({ name, type, years, processId })`](#submitauctionbid-name-type-years-processid-)
|
|
60
60
|
- [Configuration](#configuration)
|
|
61
61
|
- [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)
|
|
@@ -76,6 +76,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
76
76
|
- [`setDescription({ description })`](#setdescription-description-)
|
|
77
77
|
- [`setKeywords({ keywords })`](#setkeywords-keywords-)
|
|
78
78
|
- [`releaseName({ name, ioProcessId })`](#releasename-name-ioprocessid-)
|
|
79
|
+
- [`reassignName({ name, ioProcessId, antProcessId })`](#reassignname-name-ioprocessid-antprocessid-)
|
|
79
80
|
- [Configuration](#configuration-1)
|
|
80
81
|
- [Logging](#logging)
|
|
81
82
|
- [Configuration](#configuration-2)
|
|
@@ -1109,18 +1110,19 @@ const { id: txId } = await io.decreaseDelegateStake({
|
|
|
1109
1110
|
});
|
|
1110
1111
|
```
|
|
1111
1112
|
|
|
1112
|
-
#### `
|
|
1113
|
+
#### `instantWithdrawal({ gatewayAddress, vaultId })`
|
|
1113
1114
|
|
|
1114
|
-
Instantly withdraws
|
|
1115
|
+
Instantly withdraws an existing vault on a gateway. If no `gatewayAddress` is provided, the signer's address will be used.
|
|
1115
1116
|
|
|
1116
1117
|
_Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
|
|
1117
1118
|
|
|
1118
1119
|
```typescript
|
|
1119
1120
|
const io = IO.init({ signer: new ArweaveSigner(jwk) });
|
|
1120
|
-
|
|
1121
|
+
// removes a delegated vault from a gateway
|
|
1122
|
+
const { id: txId } = await io.instantWithdrawal(
|
|
1121
1123
|
{
|
|
1122
1124
|
// gateway address where delegate vault exists
|
|
1123
|
-
|
|
1125
|
+
gatewayAddress: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3',
|
|
1124
1126
|
// delegated vault id to cancel
|
|
1125
1127
|
vaultId: 'fDrr0_J4Iurt7caNST02cMotaz2FIbWQ4Kcj616RHl3',
|
|
1126
1128
|
},
|
|
@@ -1129,6 +1131,12 @@ const { id: txId } = await io.instantDelegateWithdrawal(
|
|
|
1129
1131
|
tags: [{ name: 'App-Name', value: 'My-Awesome-App' }],
|
|
1130
1132
|
},
|
|
1131
1133
|
);
|
|
1134
|
+
// removes an operator vault from a gateway
|
|
1135
|
+
const { id: txId } = await io.instantWithdrawal(
|
|
1136
|
+
{
|
|
1137
|
+
vaultId: 'fDrr0_J4Iurt7caNST02cMotaz2FIbWQ4Kcj616RHl3',
|
|
1138
|
+
},
|
|
1139
|
+
);
|
|
1132
1140
|
```
|
|
1133
1141
|
|
|
1134
1142
|
#### `increaseOperatorStake({ qty })`
|
|
@@ -1238,24 +1246,32 @@ const { id: txId } = await io.extendLease(
|
|
|
1238
1246
|
);
|
|
1239
1247
|
```
|
|
1240
1248
|
|
|
1241
|
-
#### `
|
|
1249
|
+
#### `cancelWithdrawal({ gatewayAddress, vaultId })`
|
|
1242
1250
|
|
|
1243
|
-
Cancels a
|
|
1251
|
+
Cancels an existing vault on a gateway. The vaulted stake will be returned to the callers stake. If no `gatewayAddress` is provided, the signer's address will be used.
|
|
1244
1252
|
|
|
1245
1253
|
_Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
|
|
1246
1254
|
|
|
1247
1255
|
```typescript
|
|
1248
1256
|
const io = IO.init({ signer: new ArweaveSigner(jwk) });
|
|
1249
|
-
|
|
1257
|
+
// cancels a delegated vault from a gateway
|
|
1258
|
+
const { id: txId } = await io.cancelWithdrawal(
|
|
1250
1259
|
{
|
|
1251
1260
|
// gateway address where vault exists
|
|
1252
|
-
|
|
1261
|
+
gatewayAddress: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3',
|
|
1253
1262
|
// vault id to cancel
|
|
1254
1263
|
vaultId: 'fDrr0_J4Iurt7caNST02cMotaz2FIbWQ4Kcj616RHl3',
|
|
1255
1264
|
},
|
|
1256
1265
|
// optional additional tags
|
|
1257
1266
|
{ tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] },
|
|
1258
1267
|
);
|
|
1268
|
+
// cancels an operator vault from a gateway
|
|
1269
|
+
const { id: txId } = await io.cancelWithdrawal(
|
|
1270
|
+
{
|
|
1271
|
+
// operator vault id to cancel
|
|
1272
|
+
vaultId: 'fDrr0_J4Iurt7caNST02cMotaz2FIbWQ4Kcj616RHl3',
|
|
1273
|
+
},
|
|
1274
|
+
);
|
|
1259
1275
|
```
|
|
1260
1276
|
|
|
1261
1277
|
#### `submitAuctionBid({ name, type, years, processId })`
|
|
@@ -1621,6 +1637,20 @@ const { id: txId } = await ant.releaseName({
|
|
|
1621
1637
|
});
|
|
1622
1638
|
```
|
|
1623
1639
|
|
|
1640
|
+
#### `reassignName({ name, ioProcessId, antProcessId })`
|
|
1641
|
+
|
|
1642
|
+
Reassigns a name to a new ANT. This can only be done by the current owner of the ANT.
|
|
1643
|
+
|
|
1644
|
+
_Note: Requires `signer` to be provided on `ANT.init` to sign the transaction._
|
|
1645
|
+
|
|
1646
|
+
```typescript
|
|
1647
|
+
const { id: txId } = await ant.reassignName({
|
|
1648
|
+
name: 'ardrive',
|
|
1649
|
+
ioProcessId: IO_TESTNET_PROCESS_ID,
|
|
1650
|
+
antProcessId: NEW_ANT_PROCESS_ID, // the new ANT process id that will take over ownership of the name
|
|
1651
|
+
});
|
|
1652
|
+
```
|
|
1653
|
+
|
|
1624
1654
|
### Configuration
|
|
1625
1655
|
|
|
1626
1656
|
ANT clients can be configured to use custom AO process. Refer to [AO Connect] for more information on how to configure the AO process to use specific AO infrastructure.
|