@ar.io/sdk 2.5.0-alpha.7 → 2.5.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 +92 -0
- package/bundles/web.bundle.min.js +35 -35
- package/lib/cjs/common/contracts/ao-process.js +12 -11
- package/lib/cjs/common/io.js +3 -9
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/contracts/ao-process.js +12 -11
- package/lib/esm/common/io.js +3 -9
- package/lib/esm/version.js +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,6 +61,9 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
61
61
|
- [`extendLease({ name, years })`](#extendlease-name-years-)
|
|
62
62
|
- [`cancelWithdrawal({ gatewayAddress, vaultId })`](#cancelwithdrawal-gatewayaddress-vaultid-)
|
|
63
63
|
- [`submitAuctionBid({ name, type, years, processId })`](#submitauctionbid-name-type-years-processid-)
|
|
64
|
+
- [`getPrimaryNames({ cursor, limit, sortBy, sortOrder })`](#getprimarynames-cursor-limit-sortby-sortorder-)
|
|
65
|
+
- [`getPrimaryName({ name, address })`](#getprimaryname-name-address-)
|
|
66
|
+
- [`requestPrimaryName({ name, address })`](#requestprimaryname-name-address-)
|
|
64
67
|
- [Configuration](#configuration)
|
|
65
68
|
- [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)
|
|
66
69
|
- [ANT APIs](#ant-apis)
|
|
@@ -83,6 +86,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
83
86
|
- [`setLogo({ txId })`](#setlogo-txid-)
|
|
84
87
|
- [`releaseName({ name, ioProcessId })`](#releasename-name-ioprocessid-)
|
|
85
88
|
- [`reassignName({ name, ioProcessId, antProcessId })`](#reassignname-name-ioprocessid-antprocessid-)
|
|
89
|
+
- [`approvePrimaryNameRequest({ name, address })`](#approveprimarynamerequest-name-address-)
|
|
86
90
|
- [Configuration](#configuration-1)
|
|
87
91
|
- [Logging](#logging)
|
|
88
92
|
- [Configuration](#configuration-2)
|
|
@@ -1443,6 +1447,81 @@ if (auction && auction.currentPrice <= new IOToken(20_000).toMIO().valueOf()) {
|
|
|
1443
1447
|
}
|
|
1444
1448
|
```
|
|
1445
1449
|
|
|
1450
|
+
#### `getPrimaryNames({ cursor, limit, sortBy, sortOrder })`
|
|
1451
|
+
|
|
1452
|
+
Retrieves all primary names across all gateways, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last name from the previous request.
|
|
1453
|
+
|
|
1454
|
+
```typescript
|
|
1455
|
+
const io = IO.init();
|
|
1456
|
+
const names = await io.getPrimaryNames({
|
|
1457
|
+
cursor: 'ar-io',
|
|
1458
|
+
limit: 2,
|
|
1459
|
+
});
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
<details>
|
|
1463
|
+
<summary>Output</summary>
|
|
1464
|
+
|
|
1465
|
+
```json
|
|
1466
|
+
{
|
|
1467
|
+
"sortOrder": "desc",
|
|
1468
|
+
"hasMore": false,
|
|
1469
|
+
"totalItems": 1,
|
|
1470
|
+
"limit": 100,
|
|
1471
|
+
"sortBy": "name",
|
|
1472
|
+
"items": [
|
|
1473
|
+
{
|
|
1474
|
+
"owner": "HwFceQaMQnOBgKDpnFqCqgwKwEU5LBme1oXRuQOWSRA",
|
|
1475
|
+
"startTimestamp": 1719356032297,
|
|
1476
|
+
"name": "arns"
|
|
1477
|
+
}
|
|
1478
|
+
]
|
|
1479
|
+
}
|
|
1480
|
+
```
|
|
1481
|
+
|
|
1482
|
+
</details>
|
|
1483
|
+
|
|
1484
|
+
#### `getPrimaryName({ name, address })`
|
|
1485
|
+
|
|
1486
|
+
Retrieves the primary name for a given name or address.
|
|
1487
|
+
|
|
1488
|
+
```typescript
|
|
1489
|
+
const io = IO.init();
|
|
1490
|
+
const name = await io.getPrimaryName({
|
|
1491
|
+
name: 'arns',
|
|
1492
|
+
});
|
|
1493
|
+
// or
|
|
1494
|
+
const name = await io.getPrimaryName({
|
|
1495
|
+
address: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3',
|
|
1496
|
+
});
|
|
1497
|
+
```
|
|
1498
|
+
|
|
1499
|
+
<details>
|
|
1500
|
+
<summary>Output</summary>
|
|
1501
|
+
|
|
1502
|
+
```json
|
|
1503
|
+
{
|
|
1504
|
+
"owner": "HwFceQaMQnOBgKDpnFqCqgwKwEU5LBme1oXRuQOWSRA",
|
|
1505
|
+
"startTimestamp": 1719356032297,
|
|
1506
|
+
"name": "arns"
|
|
1507
|
+
}
|
|
1508
|
+
```
|
|
1509
|
+
|
|
1510
|
+
</details>
|
|
1511
|
+
|
|
1512
|
+
#### `requestPrimaryName({ name, address })`
|
|
1513
|
+
|
|
1514
|
+
Requests a primary name for the caller's address. The request must be approved by the new owner of the requested name via the `approvePrimaryNameRequest`[#approveprimarynamerequest-name-address-] API.
|
|
1515
|
+
|
|
1516
|
+
_Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
|
|
1517
|
+
|
|
1518
|
+
```typescript
|
|
1519
|
+
const io = IO.init({ signer: new ArweaveSigner(jwk) });
|
|
1520
|
+
const { id: txId } = await io.requestPrimaryName({
|
|
1521
|
+
name: 'arns',
|
|
1522
|
+
});
|
|
1523
|
+
```
|
|
1524
|
+
|
|
1446
1525
|
### Configuration
|
|
1447
1526
|
|
|
1448
1527
|
The IO client class exposes APIs relevant to the ar.io process. It can be configured to use any AO Process ID that adheres to the [IO Network Spec]. By default, it will use the current [IO Testnet Process]. Refer to [AO Connect] for more information on how to configure an IO process to use specific AO infrastructure.
|
|
@@ -1852,6 +1931,19 @@ const { id: txId } = await ant.reassignName({
|
|
|
1852
1931
|
});
|
|
1853
1932
|
```
|
|
1854
1933
|
|
|
1934
|
+
#### `approvePrimaryNameRequest({ name, address })`
|
|
1935
|
+
|
|
1936
|
+
Approves a primary name request for a given name or address.
|
|
1937
|
+
|
|
1938
|
+
_Note: Requires `signer` to be provided on `ANT.init` to sign the transaction._
|
|
1939
|
+
|
|
1940
|
+
```typescript
|
|
1941
|
+
const { id: txId } = await ant.approvePrimaryNameRequest({
|
|
1942
|
+
name: 'arns',
|
|
1943
|
+
owner: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3', // must match the request initiator address
|
|
1944
|
+
});
|
|
1945
|
+
```
|
|
1946
|
+
|
|
1855
1947
|
### Configuration
|
|
1856
1948
|
|
|
1857
1949
|
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.
|