@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/lib/cjs/common/ant.js
CHANGED
|
@@ -400,5 +400,28 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
400
400
|
signer: this.signer,
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Sends a message to the IO contract to reassign the name to a new ANT. This can only be done by the current owner of the ANT.
|
|
405
|
+
* @param name @type {string} The name you want to reassign.
|
|
406
|
+
* @param ioProcessId @type {string} The processId of the IO contract.
|
|
407
|
+
* @param antProcessId @type {string} The processId of the ANT contract.
|
|
408
|
+
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
409
|
+
* @example
|
|
410
|
+
* ```ts
|
|
411
|
+
* ant.reassignName({ name: "ardrive", ioProcessId: IO_TESTNET_PROCESS_ID, antProcessId: NEW_ANT_PROCESS_ID });
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
async reassignName({ name, ioProcessId, antProcessId, }, options) {
|
|
415
|
+
return this.process.send({
|
|
416
|
+
tags: [
|
|
417
|
+
...(options?.tags ?? []),
|
|
418
|
+
{ name: 'Action', value: 'Reassign-Name' },
|
|
419
|
+
{ name: 'Name', value: name },
|
|
420
|
+
{ name: 'IO-Process-Id', value: ioProcessId },
|
|
421
|
+
{ name: 'Process-Id', value: antProcessId },
|
|
422
|
+
],
|
|
423
|
+
signer: this.signer,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
403
426
|
}
|
|
404
427
|
exports.AoANTWriteable = AoANTWriteable;
|
package/lib/cjs/common/io.js
CHANGED
|
@@ -347,7 +347,7 @@ class IOReadable {
|
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
349
|
// Auctions
|
|
350
|
-
async
|
|
350
|
+
async getArNSAuctions(params) {
|
|
351
351
|
const allTags = [
|
|
352
352
|
{ name: 'Action', value: 'Auctions' },
|
|
353
353
|
{ name: 'Cursor', value: params?.cursor?.toString() },
|
|
@@ -360,7 +360,7 @@ class IOReadable {
|
|
|
360
360
|
tags: prunedTags,
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
async
|
|
363
|
+
async getArNSAuction({ name, }) {
|
|
364
364
|
const allTags = [
|
|
365
365
|
{ name: 'Action', value: 'Auction-Info' },
|
|
366
366
|
{ name: 'Name', value: name },
|
|
@@ -380,7 +380,7 @@ class IOReadable {
|
|
|
380
380
|
* @param {number} [params.intervalMs=900000] - The interval in milliseconds between price points (default is 15 minutes)
|
|
381
381
|
* @returns {Promise<AoAuctionPriceData>} The auction price data
|
|
382
382
|
*/
|
|
383
|
-
async
|
|
383
|
+
async getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }) {
|
|
384
384
|
const prunedPriceTags = [
|
|
385
385
|
{ name: 'Action', value: 'Auction-Prices' },
|
|
386
386
|
{ name: 'Name', value: name },
|
package/lib/cjs/types/ant.js
CHANGED
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/ant.js
CHANGED
|
@@ -395,4 +395,27 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
395
395
|
signer: this.signer,
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* Sends a message to the IO contract to reassign the name to a new ANT. This can only be done by the current owner of the ANT.
|
|
400
|
+
* @param name @type {string} The name you want to reassign.
|
|
401
|
+
* @param ioProcessId @type {string} The processId of the IO contract.
|
|
402
|
+
* @param antProcessId @type {string} The processId of the ANT contract.
|
|
403
|
+
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
404
|
+
* @example
|
|
405
|
+
* ```ts
|
|
406
|
+
* ant.reassignName({ name: "ardrive", ioProcessId: IO_TESTNET_PROCESS_ID, antProcessId: NEW_ANT_PROCESS_ID });
|
|
407
|
+
* ```
|
|
408
|
+
*/
|
|
409
|
+
async reassignName({ name, ioProcessId, antProcessId, }, options) {
|
|
410
|
+
return this.process.send({
|
|
411
|
+
tags: [
|
|
412
|
+
...(options?.tags ?? []),
|
|
413
|
+
{ name: 'Action', value: 'Reassign-Name' },
|
|
414
|
+
{ name: 'Name', value: name },
|
|
415
|
+
{ name: 'IO-Process-Id', value: ioProcessId },
|
|
416
|
+
{ name: 'Process-Id', value: antProcessId },
|
|
417
|
+
],
|
|
418
|
+
signer: this.signer,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
398
421
|
}
|
package/lib/esm/common/io.js
CHANGED
|
@@ -343,7 +343,7 @@ export class IOReadable {
|
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
// Auctions
|
|
346
|
-
async
|
|
346
|
+
async getArNSAuctions(params) {
|
|
347
347
|
const allTags = [
|
|
348
348
|
{ name: 'Action', value: 'Auctions' },
|
|
349
349
|
{ name: 'Cursor', value: params?.cursor?.toString() },
|
|
@@ -356,7 +356,7 @@ export class IOReadable {
|
|
|
356
356
|
tags: prunedTags,
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
async
|
|
359
|
+
async getArNSAuction({ name, }) {
|
|
360
360
|
const allTags = [
|
|
361
361
|
{ name: 'Action', value: 'Auction-Info' },
|
|
362
362
|
{ name: 'Name', value: name },
|
|
@@ -376,7 +376,7 @@ export class IOReadable {
|
|
|
376
376
|
* @param {number} [params.intervalMs=900000] - The interval in milliseconds between price points (default is 15 minutes)
|
|
377
377
|
* @returns {Promise<AoAuctionPriceData>} The auction price data
|
|
378
378
|
*/
|
|
379
|
-
async
|
|
379
|
+
async getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }) {
|
|
380
380
|
const prunedPriceTags = [
|
|
381
381
|
{ name: 'Action', value: 'Auction-Prices' },
|
|
382
382
|
{ name: 'Name', value: name },
|
package/lib/esm/types/ant.js
CHANGED
package/lib/esm/version.js
CHANGED
|
@@ -218,4 +218,20 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
218
218
|
name: string;
|
|
219
219
|
ioProcessId: string;
|
|
220
220
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
221
|
+
/**
|
|
222
|
+
* Sends a message to the IO contract to reassign the name to a new ANT. This can only be done by the current owner of the ANT.
|
|
223
|
+
* @param name @type {string} The name you want to reassign.
|
|
224
|
+
* @param ioProcessId @type {string} The processId of the IO contract.
|
|
225
|
+
* @param antProcessId @type {string} The processId of the ANT contract.
|
|
226
|
+
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
227
|
+
* @example
|
|
228
|
+
* ```ts
|
|
229
|
+
* ant.reassignName({ name: "ardrive", ioProcessId: IO_TESTNET_PROCESS_ID, antProcessId: NEW_ANT_PROCESS_ID });
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
reassignName({ name, ioProcessId, antProcessId, }: {
|
|
233
|
+
name: string;
|
|
234
|
+
ioProcessId: string;
|
|
235
|
+
antProcessId: string;
|
|
236
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
221
237
|
}
|
package/lib/types/common/io.d.ts
CHANGED
|
@@ -91,8 +91,8 @@ export declare class IOReadable implements AoIORead {
|
|
|
91
91
|
}): Promise<number>;
|
|
92
92
|
getRegistrationFees(): Promise<AoRegistrationFees>;
|
|
93
93
|
getDemandFactor(): Promise<number>;
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
getArNSAuctions(params?: PaginationParams): Promise<PaginationResult<AoAuction>>;
|
|
95
|
+
getArNSAuction({ name, }: {
|
|
96
96
|
name: string;
|
|
97
97
|
}): Promise<AoAuction | undefined>;
|
|
98
98
|
/**
|
|
@@ -106,7 +106,7 @@ export declare class IOReadable implements AoIORead {
|
|
|
106
106
|
* @param {number} [params.intervalMs=900000] - The interval in milliseconds between price points (default is 15 minutes)
|
|
107
107
|
* @returns {Promise<AoAuctionPriceData>} The auction price data
|
|
108
108
|
*/
|
|
109
|
-
|
|
109
|
+
getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }: {
|
|
110
110
|
name: string;
|
|
111
111
|
type?: 'permabuy' | 'lease';
|
|
112
112
|
years?: number;
|
package/lib/types/types/ant.d.ts
CHANGED
|
@@ -211,4 +211,9 @@ export interface AoANTWrite extends AoANTRead {
|
|
|
211
211
|
name: string;
|
|
212
212
|
ioProcessId: string;
|
|
213
213
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
214
|
+
reassignName({ name, ioProcessId, antProcessId, }: {
|
|
215
|
+
name: string;
|
|
216
|
+
ioProcessId: string;
|
|
217
|
+
antProcessId: string;
|
|
218
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
214
219
|
}
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -253,6 +253,17 @@ export interface AoIORead {
|
|
|
253
253
|
getArNSReservedName({ name, }: {
|
|
254
254
|
name: string;
|
|
255
255
|
}): Promise<AoArNSReservedNameData | undefined>;
|
|
256
|
+
getArNSAuctions(params?: PaginationParams): Promise<PaginationResult<AoAuction>>;
|
|
257
|
+
getArNSAuction({ name }: {
|
|
258
|
+
name: string;
|
|
259
|
+
}): Promise<AoAuction | undefined>;
|
|
260
|
+
getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }: {
|
|
261
|
+
name: string;
|
|
262
|
+
type: 'lease' | 'permabuy';
|
|
263
|
+
years?: number;
|
|
264
|
+
timestamp?: number;
|
|
265
|
+
intervalMs?: number;
|
|
266
|
+
}): Promise<AoAuctionPriceData>;
|
|
256
267
|
getEpoch(epoch?: EpochInput): Promise<AoEpochData>;
|
|
257
268
|
getCurrentEpoch(): Promise<AoEpochData>;
|
|
258
269
|
getPrescribedObservers(epoch?: EpochInput): Promise<AoWeightedObserver[]>;
|
|
@@ -268,17 +279,6 @@ export interface AoIORead {
|
|
|
268
279
|
}): Promise<number>;
|
|
269
280
|
getRegistrationFees(): Promise<AoRegistrationFees>;
|
|
270
281
|
getDemandFactor(): Promise<number>;
|
|
271
|
-
getAuctions(params?: PaginationParams): Promise<PaginationResult<AoAuction>>;
|
|
272
|
-
getAuction({ name }: {
|
|
273
|
-
name: string;
|
|
274
|
-
}): Promise<AoAuction | undefined>;
|
|
275
|
-
getAuctionPrices({ name, type, years, timestamp, intervalMs, }: {
|
|
276
|
-
name: string;
|
|
277
|
-
type: 'lease' | 'permabuy';
|
|
278
|
-
years?: number;
|
|
279
|
-
timestamp?: number;
|
|
280
|
-
intervalMs?: number;
|
|
281
|
-
}): Promise<AoAuctionPriceData>;
|
|
282
282
|
}
|
|
283
283
|
export interface AoIOWrite extends AoIORead {
|
|
284
284
|
transfer({ target, qty, }: {
|
package/lib/types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ar.io/sdk",
|
|
3
|
-
"version": "2.4.0-alpha.
|
|
3
|
+
"version": "2.4.0-alpha.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -66,17 +66,18 @@
|
|
|
66
66
|
"format": "prettier --check .",
|
|
67
67
|
"format:fix": "prettier --write .",
|
|
68
68
|
"test": "yarn test:unit && yarn test:e2e",
|
|
69
|
-
"test:cjs": "yarn
|
|
70
|
-
"test:esm": "yarn
|
|
71
|
-
"test:web": "yarn
|
|
69
|
+
"test:cjs": "yarn build:cjs && yarn link && cd ./tests/e2e/cjs && yarn && yarn test",
|
|
70
|
+
"test:esm": "yarn build:esm && yarn link && cd ./tests/e2e/esm && yarn && yarn test",
|
|
71
|
+
"test:web": "yarn build:esm && yarn link && cd ./tests/e2e/web && yarn && yarn test",
|
|
72
72
|
"test:unit": "NODE_OPTIONS=\"--import=./register.mjs\" node --test tests/unit/**.test.ts",
|
|
73
73
|
"test:link": "yarn build && yarn link",
|
|
74
74
|
"test:e2e": "yarn test:cjs && yarn test:esm && yarn test:web",
|
|
75
75
|
"prepare": "husky install",
|
|
76
76
|
"docs:update": "markdown-toc-gen insert README.md",
|
|
77
77
|
"example:esm": "cd examples/esm && yarn && node index.mjs",
|
|
78
|
-
"example:cjs": "yarn
|
|
79
|
-
"example:web": "yarn
|
|
78
|
+
"example:cjs": "yarn build:cjs && yarn link && cd examples/cjs && yarn && node index.cjs",
|
|
79
|
+
"example:web": "yarn build:web && http-server --port 8080 --host -o examples/web",
|
|
80
|
+
"example:vite": "yarn build:esm && yarn link && cd examples/vite && yarn && yarn start"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
83
|
"@commitlint/cli": "^17.1.2",
|