@ar.io/sdk 2.4.0-alpha.7 → 2.4.0-alpha.9
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 +26 -10
- package/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/ant.js +23 -0
- package/lib/cjs/common/io.js +3 -3
- 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 +3 -3
- 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 +3 -3
- package/lib/types/types/ant.d.ts +5 -0
- package/lib/types/types/io.d.ts +11 -11
- package/lib/types/version.d.ts +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -33,9 +33,9 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
33
33
|
- [`getGateways({ cursor, limit, sortBy, sortOrder })`](#getgateways-cursor-limit-sortby-sortorder-)
|
|
34
34
|
- [`getArNSRecord({ name })`](#getarnsrecord-name-)
|
|
35
35
|
- [`getArNSRecords({ cursor, limit, sortBy, sortOrder })`](#getarnsrecords-cursor-limit-sortby-sortorder-)
|
|
36
|
-
- [`
|
|
37
|
-
- [`
|
|
38
|
-
- [`
|
|
36
|
+
- [`getArNSAuctions({ cursor, limit, sortBy, sortOrder })`](#getarnsauctions-cursor-limit-sortby-sortorder-)
|
|
37
|
+
- [`getArNSAuction({ name })`](#getarnsauction-name-)
|
|
38
|
+
- [`getArNSAuctionPrices({ name, type, years, intervalMs })`](#getarnsauctionprices-name-type-years-intervalms-)
|
|
39
39
|
- [`getDemandFactor()`](#getdemandfactor)
|
|
40
40
|
- [`getObservations({ epochIndex })`](#getobservations-epochindex-)
|
|
41
41
|
- [`getDistributions({ epochIndex })`](#getdistributions-epochindex-)
|
|
@@ -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)
|
|
@@ -605,13 +606,13 @@ Available `sortBy` options are any of the keys on the record object, e.g. `name`
|
|
|
605
606
|
|
|
606
607
|
</details>
|
|
607
608
|
|
|
608
|
-
#### `
|
|
609
|
+
#### `getArNSAuctions({ cursor, limit, sortBy, sortOrder })`
|
|
609
610
|
|
|
610
611
|
Retrieves all active auctions of the IO process, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last auction name from the previous request.
|
|
611
612
|
|
|
612
613
|
```typescript
|
|
613
614
|
const io = IO.init();
|
|
614
|
-
const auctions = await io.
|
|
615
|
+
const auctions = await io.getArNSAuctions({
|
|
615
616
|
limit: 100,
|
|
616
617
|
sortBy: 'endTimestamp',
|
|
617
618
|
sortOrder: 'asc', // return the auctions ending soonest first
|
|
@@ -648,13 +649,13 @@ const auctions = await io.getAuctions({
|
|
|
648
649
|
|
|
649
650
|
</details>
|
|
650
651
|
|
|
651
|
-
#### `
|
|
652
|
+
#### `getArNSAuction({ name })`
|
|
652
653
|
|
|
653
654
|
Retrieves the auction data for the specified auction name.
|
|
654
655
|
|
|
655
656
|
```typescript
|
|
656
657
|
const io = IO.init();
|
|
657
|
-
const auction = await io.
|
|
658
|
+
const auction = await io.getArNSAuction({ name: 'permalink' });
|
|
658
659
|
```
|
|
659
660
|
|
|
660
661
|
<details>
|
|
@@ -679,13 +680,13 @@ const auction = await io.getAuction({ name: 'permalink' });
|
|
|
679
680
|
|
|
680
681
|
</details>
|
|
681
682
|
|
|
682
|
-
#### `
|
|
683
|
+
#### `getArNSAuctionPrices({ name, type, years, intervalMs })`
|
|
683
684
|
|
|
684
685
|
Retrieves the auction price curve of the specified auction name for the specified type, duration, and interval. The `intervalMs` is the number of milliseconds between price points on the curve. The default interval is 15 minutes.
|
|
685
686
|
|
|
686
687
|
```typescript
|
|
687
688
|
const io = IO.init();
|
|
688
|
-
const priceCurve = await io.
|
|
689
|
+
const priceCurve = await io.getArNSAuctionPrices({
|
|
689
690
|
name: 'permalink',
|
|
690
691
|
type: 'lease',
|
|
691
692
|
years: 1,
|
|
@@ -1282,7 +1283,7 @@ _Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
|
|
|
1282
1283
|
```typescript
|
|
1283
1284
|
const io = IO.init({ signer: new ArweaveSigner(jwk) });
|
|
1284
1285
|
|
|
1285
|
-
const auction = await io.
|
|
1286
|
+
const auction = await io.getArNSAuction({ name: 'permalink' });
|
|
1286
1287
|
|
|
1287
1288
|
// check the current price is under some threshold
|
|
1288
1289
|
if (auction && auction.currentPrice <= new IOToken(20_000).toMIO().valueOf()) {
|
|
@@ -1636,6 +1637,20 @@ const { id: txId } = await ant.releaseName({
|
|
|
1636
1637
|
});
|
|
1637
1638
|
```
|
|
1638
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
|
+
|
|
1639
1654
|
### Configuration
|
|
1640
1655
|
|
|
1641
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.
|
|
@@ -1743,6 +1758,7 @@ For more information on how to use AO and AO Connect within this library, please
|
|
|
1743
1758
|
- `yarn example:web` - opens up the example web page
|
|
1744
1759
|
- `yarn example:cjs` - runs example CJS node script
|
|
1745
1760
|
- `yarn example:esm` - runs example ESM node script
|
|
1761
|
+
- `yarn example:vite` - runs example Vite web page
|
|
1746
1762
|
|
|
1747
1763
|
### Linting & Formatting
|
|
1748
1764
|
|