@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.
@@ -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;
@@ -347,7 +347,7 @@ class IOReadable {
347
347
  });
348
348
  }
349
349
  // Auctions
350
- async getAuctions(params) {
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 getAuction({ name }) {
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 getAuctionPrices({ name, type, years, timestamp, intervalMs, }) {
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 },
@@ -100,6 +100,7 @@ exports.AntHandlerNames = [
100
100
  'initializeState',
101
101
  'state',
102
102
  'releaseName',
103
+ 'reassignName',
103
104
  ];
104
105
  exports.AntHandlersSchema = zod_1.z
105
106
  .array(zod_1.z.string({ description: 'Handler Name' }))
@@ -17,4 +17,4 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.version = void 0;
19
19
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
20
- exports.version = '2.4.0-alpha.7';
20
+ exports.version = '2.4.0-alpha.9';
@@ -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
  }
@@ -343,7 +343,7 @@ export class IOReadable {
343
343
  });
344
344
  }
345
345
  // Auctions
346
- async getAuctions(params) {
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 getAuction({ name }) {
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 getAuctionPrices({ name, type, years, timestamp, intervalMs, }) {
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 },
@@ -97,6 +97,7 @@ export const AntHandlerNames = [
97
97
  'initializeState',
98
98
  'state',
99
99
  'releaseName',
100
+ 'reassignName',
100
101
  ];
101
102
  export const AntHandlersSchema = z
102
103
  .array(z.string({ description: 'Handler Name' }))
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '2.4.0-alpha.7';
17
+ export const version = '2.4.0-alpha.9';
@@ -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
  }
@@ -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
- getAuctions(params?: PaginationParams): Promise<PaginationResult<AoAuction>>;
95
- getAuction({ name }: {
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
- getAuctionPrices({ name, type, years, timestamp, intervalMs, }: {
109
+ getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }: {
110
110
  name: string;
111
111
  type?: 'permabuy' | 'lease';
112
112
  years?: number;
@@ -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
  }
@@ -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, }: {
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "2.4.0-alpha.6";
16
+ export declare const version = "2.4.0-alpha.8";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "2.4.0-alpha.7",
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 test:link && cd ./tests/e2e/cjs && yarn && yarn test",
70
- "test:esm": "yarn test:link && cd ./tests/e2e/esm && yarn && yarn test",
71
- "test:web": "yarn test:link && cd ./tests/e2e/web && yarn && yarn test",
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 test:link && cd examples/cjs && yarn && node index.cjs",
79
- "example:web": "yarn test:link && build:web && http-server --port 8080 --host -o examples/web"
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",