@ar.io/sdk 2.4.0-alpha.8 → 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 +11 -10
- package/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/io.js +3 -3
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +3 -3
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +3 -3
- 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-)
|
|
@@ -606,13 +606,13 @@ Available `sortBy` options are any of the keys on the record object, e.g. `name`
|
|
|
606
606
|
|
|
607
607
|
</details>
|
|
608
608
|
|
|
609
|
-
#### `
|
|
609
|
+
#### `getArNSAuctions({ cursor, limit, sortBy, sortOrder })`
|
|
610
610
|
|
|
611
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.
|
|
612
612
|
|
|
613
613
|
```typescript
|
|
614
614
|
const io = IO.init();
|
|
615
|
-
const auctions = await io.
|
|
615
|
+
const auctions = await io.getArNSAuctions({
|
|
616
616
|
limit: 100,
|
|
617
617
|
sortBy: 'endTimestamp',
|
|
618
618
|
sortOrder: 'asc', // return the auctions ending soonest first
|
|
@@ -649,13 +649,13 @@ const auctions = await io.getAuctions({
|
|
|
649
649
|
|
|
650
650
|
</details>
|
|
651
651
|
|
|
652
|
-
#### `
|
|
652
|
+
#### `getArNSAuction({ name })`
|
|
653
653
|
|
|
654
654
|
Retrieves the auction data for the specified auction name.
|
|
655
655
|
|
|
656
656
|
```typescript
|
|
657
657
|
const io = IO.init();
|
|
658
|
-
const auction = await io.
|
|
658
|
+
const auction = await io.getArNSAuction({ name: 'permalink' });
|
|
659
659
|
```
|
|
660
660
|
|
|
661
661
|
<details>
|
|
@@ -680,13 +680,13 @@ const auction = await io.getAuction({ name: 'permalink' });
|
|
|
680
680
|
|
|
681
681
|
</details>
|
|
682
682
|
|
|
683
|
-
#### `
|
|
683
|
+
#### `getArNSAuctionPrices({ name, type, years, intervalMs })`
|
|
684
684
|
|
|
685
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.
|
|
686
686
|
|
|
687
687
|
```typescript
|
|
688
688
|
const io = IO.init();
|
|
689
|
-
const priceCurve = await io.
|
|
689
|
+
const priceCurve = await io.getArNSAuctionPrices({
|
|
690
690
|
name: 'permalink',
|
|
691
691
|
type: 'lease',
|
|
692
692
|
years: 1,
|
|
@@ -1283,7 +1283,7 @@ _Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
|
|
|
1283
1283
|
```typescript
|
|
1284
1284
|
const io = IO.init({ signer: new ArweaveSigner(jwk) });
|
|
1285
1285
|
|
|
1286
|
-
const auction = await io.
|
|
1286
|
+
const auction = await io.getArNSAuction({ name: 'permalink' });
|
|
1287
1287
|
|
|
1288
1288
|
// check the current price is under some threshold
|
|
1289
1289
|
if (auction && auction.currentPrice <= new IOToken(20_000).toMIO().valueOf()) {
|
|
@@ -1758,6 +1758,7 @@ For more information on how to use AO and AO Connect within this library, please
|
|
|
1758
1758
|
- `yarn example:web` - opens up the example web page
|
|
1759
1759
|
- `yarn example:cjs` - runs example CJS node script
|
|
1760
1760
|
- `yarn example:esm` - runs example ESM node script
|
|
1761
|
+
- `yarn example:vite` - runs example Vite web page
|
|
1761
1762
|
|
|
1762
1763
|
### Linting & Formatting
|
|
1763
1764
|
|