@ar.io/sdk 2.7.0-alpha.6 → 3.0.0-alpha.1

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.
Files changed (39) hide show
  1. package/README.md +155 -239
  2. package/bundles/web.bundle.min.js +74 -74
  3. package/lib/cjs/cli/cli.js +32 -38
  4. package/lib/cjs/cli/commands/gatewayWriteCommands.js +39 -39
  5. package/lib/cjs/cli/commands/readCommands.js +28 -45
  6. package/lib/cjs/cli/commands/transfer.js +7 -7
  7. package/lib/cjs/cli/options.js +4 -11
  8. package/lib/cjs/cli/utils.js +22 -22
  9. package/lib/cjs/common/ant.js +18 -14
  10. package/lib/cjs/common/io.js +15 -68
  11. package/lib/cjs/constants.js +5 -5
  12. package/lib/cjs/types/token.js +14 -14
  13. package/lib/cjs/utils/processes.js +4 -4
  14. package/lib/cjs/version.js +1 -1
  15. package/lib/esm/cli/cli.js +36 -42
  16. package/lib/esm/cli/commands/gatewayWriteCommands.js +41 -41
  17. package/lib/esm/cli/commands/readCommands.js +27 -43
  18. package/lib/esm/cli/commands/transfer.js +8 -8
  19. package/lib/esm/cli/options.js +3 -10
  20. package/lib/esm/cli/utils.js +18 -18
  21. package/lib/esm/common/ant.js +18 -14
  22. package/lib/esm/common/io.js +12 -65
  23. package/lib/esm/constants.js +4 -4
  24. package/lib/esm/types/token.js +12 -12
  25. package/lib/esm/utils/processes.js +6 -6
  26. package/lib/esm/version.js +1 -1
  27. package/lib/types/cli/commands/readCommands.d.ts +3 -4
  28. package/lib/types/cli/options.d.ts +1 -5
  29. package/lib/types/cli/types.d.ts +2 -4
  30. package/lib/types/cli/utils.d.ts +10 -10
  31. package/lib/types/common/ant.d.ts +14 -14
  32. package/lib/types/common/io.d.ts +20 -45
  33. package/lib/types/constants.d.ts +4 -4
  34. package/lib/types/types/ant.d.ts +8 -8
  35. package/lib/types/types/io.d.ts +14 -49
  36. package/lib/types/types/token.d.ts +8 -8
  37. package/lib/types/utils/processes.d.ts +4 -4
  38. package/lib/types/version.d.ts +1 -1
  39. package/package.json +1 -1
@@ -3,23 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transfer = void 0;
4
4
  const utils_js_1 = require("../utils.js");
5
5
  async function transfer(options) {
6
- const { target, ioQuantity } = (0, utils_js_1.requiredTargetAndQuantityFromOptions)(options);
7
- const { io, signerAddress } = (0, utils_js_1.writeIOFromOptions)(options);
6
+ const { target, arioQuantity } = (0, utils_js_1.requiredTargetAndQuantityFromOptions)(options);
7
+ const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(options);
8
8
  if (!options.skipConfirmation) {
9
- await (0, utils_js_1.assertEnoughBalance)(io, signerAddress, ioQuantity);
10
- const confirm = await (0, utils_js_1.confirmationPrompt)(`Are you sure you want to transfer ${(0, utils_js_1.formatIOWithCommas)(ioQuantity)} IO to ${target}?`);
9
+ await (0, utils_js_1.assertEnoughBalance)(ario, signerAddress, arioQuantity);
10
+ const confirm = await (0, utils_js_1.confirmationPrompt)(`Are you sure you want to transfer ${(0, utils_js_1.formatARIOWithCommas)(arioQuantity)} ARIO to ${target}?`);
11
11
  if (!confirm) {
12
12
  return { message: 'Transfer aborted by user' };
13
13
  }
14
14
  }
15
- const result = await io.transfer({
15
+ const result = await ario.transfer({
16
16
  target,
17
- qty: ioQuantity.toMIO().valueOf(),
17
+ qty: arioQuantity.toMARIO().valueOf(),
18
18
  }, (0, utils_js_1.writeActionTagsFromOptions)(options));
19
19
  const output = {
20
20
  senderAddress: signerAddress,
21
21
  transferResult: result,
22
- message: `Successfully transferred ${(0, utils_js_1.formatIOWithCommas)(ioQuantity)} IO to ${target}`,
22
+ message: `Successfully transferred ${(0, utils_js_1.formatARIOWithCommas)(arioQuantity)} ARIO to ${target}`,
23
23
  };
24
24
  return output;
25
25
  }
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.antStateOptions = exports.buyRecordOptions = exports.joinNetworkOptions = exports.updateGatewaySettingsOptions = exports.decreaseDelegateStakeOptions = exports.delegateStakeOptions = exports.redelegateStakeOptions = exports.operatorStakeOptions = exports.transferOptions = exports.arNSAuctionPricesOptions = exports.tokenCostOptions = exports.getVaultOptions = exports.paginationAddressOptions = exports.paginationOptions = exports.nameWriteOptions = exports.addressAndVaultIdOptions = exports.epochOptions = exports.initiatorOptions = exports.nameOptions = exports.addressOptions = exports.writeActionOptions = exports.globalOptions = exports.walletOptions = exports.optionMap = void 0;
18
+ exports.antStateOptions = exports.buyRecordOptions = exports.joinNetworkOptions = exports.updateGatewaySettingsOptions = exports.decreaseDelegateStakeOptions = exports.delegateStakeOptions = exports.redelegateStakeOptions = exports.operatorStakeOptions = exports.transferOptions = exports.tokenCostOptions = exports.getVaultOptions = exports.paginationAddressOptions = exports.paginationOptions = exports.nameWriteOptions = exports.addressAndVaultIdOptions = exports.epochOptions = exports.initiatorOptions = exports.nameOptions = exports.addressOptions = exports.writeActionOptions = exports.globalOptions = exports.walletOptions = exports.optionMap = void 0;
19
19
  exports.optionMap = {
20
20
  walletFile: {
21
21
  alias: '-w, --wallet-file <walletFilePath>',
@@ -34,8 +34,8 @@ exports.optionMap = {
34
34
  description: 'Run against the AR.IO devnet process',
35
35
  type: 'boolean',
36
36
  },
37
- ioProcessId: {
38
- alias: '--io-process-id',
37
+ arioProcessId: {
38
+ alias: '--ario-process-id <arioProcessId>',
39
39
  description: 'Run against a custom AR.IO process id',
40
40
  },
41
41
  cuUrl: {
@@ -247,7 +247,7 @@ exports.globalOptions = [
247
247
  ...exports.walletOptions,
248
248
  exports.optionMap.dev,
249
249
  exports.optionMap.debug,
250
- exports.optionMap.ioProcessId,
250
+ exports.optionMap.arioProcessId,
251
251
  exports.optionMap.cuUrl,
252
252
  ];
253
253
  exports.writeActionOptions = [exports.optionMap.skipConfirmation, exports.optionMap.tags];
@@ -275,13 +275,6 @@ exports.tokenCostOptions = [
275
275
  exports.optionMap.years,
276
276
  exports.optionMap.quantity,
277
277
  ];
278
- exports.arNSAuctionPricesOptions = [
279
- exports.optionMap.name,
280
- exports.optionMap.type,
281
- exports.optionMap.years,
282
- exports.optionMap.timestamp,
283
- exports.optionMap.intervalMs,
284
- ];
285
278
  exports.transferOptions = [
286
279
  ...exports.writeActionOptions,
287
280
  exports.optionMap.quantity,
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getANTStateFromOptions = exports.requiredPositiveIntegerFromOptions = exports.positiveIntegerFromOptions = exports.requiredStringArrayFromOptions = exports.requiredStringFromOptions = exports.writeANTFromOptions = exports.readANTFromOptions = exports.requiredProcessIdFromOptions = exports.assertConfirmationPrompt = exports.confirmationPrompt = exports.assertEnoughBalance = exports.requiredMIOFromOptions = exports.recordTypeFromOptions = exports.redelegateParamsFromOptions = exports.requiredTargetAndQuantityFromOptions = exports.gatewaySettingsFromOptions = exports.writeActionTagsFromOptions = exports.requiredInitiatorFromOptions = exports.epochInputFromOptions = exports.paginationParamsFromOptions = exports.requiredAddressFromOptions = exports.addressFromOptions = exports.formatIOWithCommas = exports.writeIOFromOptions = exports.requiredAoSignerFromOptions = exports.requiredContractSignerFromOptions = exports.readIOFromOptions = exports.getLoggerFromOptions = exports.jwkToAddress = exports.requiredJwkFromOptions = exports.ioProcessIdFromOptions = exports.makeCommand = exports.applyOptions = exports.runCommand = exports.stringifyJsonForCLIDisplay = void 0;
6
+ exports.getANTStateFromOptions = exports.requiredPositiveIntegerFromOptions = exports.positiveIntegerFromOptions = exports.requiredStringArrayFromOptions = exports.requiredStringFromOptions = exports.writeANTFromOptions = exports.readANTFromOptions = exports.requiredProcessIdFromOptions = exports.assertConfirmationPrompt = exports.confirmationPrompt = exports.assertEnoughBalance = exports.requiredMIOFromOptions = exports.recordTypeFromOptions = exports.redelegateParamsFromOptions = exports.requiredTargetAndQuantityFromOptions = exports.gatewaySettingsFromOptions = exports.writeActionTagsFromOptions = exports.requiredInitiatorFromOptions = exports.epochInputFromOptions = exports.paginationParamsFromOptions = exports.requiredAddressFromOptions = exports.addressFromOptions = exports.formatARIOWithCommas = exports.writeARIOFromOptions = exports.requiredAoSignerFromOptions = exports.requiredContractSignerFromOptions = exports.readARIOFromOptions = exports.getLoggerFromOptions = exports.jwkToAddress = exports.requiredJwkFromOptions = exports.arioProcessIdFromOptions = exports.makeCommand = exports.applyOptions = exports.runCommand = exports.stringifyJsonForCLIDisplay = void 0;
7
7
  /**
8
8
  * Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
9
9
  *
@@ -74,14 +74,14 @@ function makeCommand({ description, name, options = [], action, }) {
74
74
  return appliedCommand;
75
75
  }
76
76
  exports.makeCommand = makeCommand;
77
- function ioProcessIdFromOptions({ ioProcessId, dev, }) {
78
- return ioProcessId !== undefined
79
- ? ioProcessId
77
+ function arioProcessIdFromOptions({ arioProcessId, dev, }) {
78
+ return arioProcessId !== undefined
79
+ ? arioProcessId
80
80
  : dev
81
- ? index_js_1.IO_DEVNET_PROCESS_ID
82
- : index_js_1.IO_TESTNET_PROCESS_ID;
81
+ ? index_js_1.ARIO_DEVNET_PROCESS_ID
82
+ : index_js_1.ARIO_TESTNET_PROCESS_ID;
83
83
  }
84
- exports.ioProcessIdFromOptions = ioProcessIdFromOptions;
84
+ exports.arioProcessIdFromOptions = arioProcessIdFromOptions;
85
85
  function jwkFromOptions({ privateKey, walletFile, }) {
86
86
  if (privateKey !== undefined) {
87
87
  return JSON.parse(privateKey);
@@ -115,19 +115,19 @@ function getLoggerFromOptions(options) {
115
115
  exports.getLoggerFromOptions = getLoggerFromOptions;
116
116
  function aoProcessFromOptions(options) {
117
117
  return new index_js_1.AOProcess({
118
- processId: ioProcessIdFromOptions(options),
118
+ processId: arioProcessIdFromOptions(options),
119
119
  ao: (0, aoconnect_1.connect)({
120
120
  CU_URL: options.cuUrl,
121
121
  }),
122
122
  });
123
123
  }
124
- function readIOFromOptions(options) {
124
+ function readARIOFromOptions(options) {
125
125
  setLoggerIfDebug(options);
126
- return index_js_1.IO.init({
126
+ return index_js_1.ARIO.init({
127
127
  process: aoProcessFromOptions(options),
128
128
  });
129
129
  }
130
- exports.readIOFromOptions = readIOFromOptions;
130
+ exports.readARIOFromOptions = readARIOFromOptions;
131
131
  function requiredContractSignerFromOptions(options) {
132
132
  // TODO: Support other wallet types
133
133
  const jwk = requiredJwkFromOptions(options);
@@ -139,19 +139,19 @@ function requiredAoSignerFromOptions(options) {
139
139
  return (0, index_js_1.createAoSigner)(requiredContractSignerFromOptions(options).signer);
140
140
  }
141
141
  exports.requiredAoSignerFromOptions = requiredAoSignerFromOptions;
142
- function writeIOFromOptions(options) {
142
+ function writeARIOFromOptions(options) {
143
143
  const { signer, signerAddress } = requiredContractSignerFromOptions(options);
144
144
  setLoggerIfDebug(options);
145
145
  return {
146
- io: index_js_1.IO.init({
146
+ ario: index_js_1.ARIO.init({
147
147
  process: aoProcessFromOptions(options),
148
148
  signer,
149
149
  }),
150
150
  signerAddress,
151
151
  };
152
152
  }
153
- exports.writeIOFromOptions = writeIOFromOptions;
154
- function formatIOWithCommas(value) {
153
+ exports.writeARIOFromOptions = writeARIOFromOptions;
154
+ function formatARIOWithCommas(value) {
155
155
  const [integerPart, decimalPart] = value.toString().split('.');
156
156
  const integerWithCommas = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
157
157
  if (decimalPart === undefined) {
@@ -159,7 +159,7 @@ function formatIOWithCommas(value) {
159
159
  }
160
160
  return integerWithCommas + '.' + decimalPart;
161
161
  }
162
- exports.formatIOWithCommas = formatIOWithCommas;
162
+ exports.formatARIOWithCommas = formatARIOWithCommas;
163
163
  /** helper to get address from --address option first, then check wallet options */
164
164
  function addressFromOptions(options) {
165
165
  if (options.address !== undefined) {
@@ -268,12 +268,12 @@ function requiredTargetAndQuantityFromOptions(options) {
268
268
  }
269
269
  return {
270
270
  target: options.target,
271
- ioQuantity: new index_js_1.IOToken(+options.quantity),
271
+ arioQuantity: new index_js_1.ARIOToken(+options.quantity),
272
272
  };
273
273
  }
274
274
  exports.requiredTargetAndQuantityFromOptions = requiredTargetAndQuantityFromOptions;
275
275
  function redelegateParamsFromOptions(options) {
276
- const { target, ioQuantity } = requiredTargetAndQuantityFromOptions(options);
276
+ const { target, arioQuantity: aRIOQuantity } = requiredTargetAndQuantityFromOptions(options);
277
277
  const source = options.source;
278
278
  if (source === undefined) {
279
279
  throw new Error('No source provided. Use --source');
@@ -282,7 +282,7 @@ function redelegateParamsFromOptions(options) {
282
282
  target,
283
283
  source,
284
284
  vaultId: options.vaultId,
285
- stakeQty: ioQuantity.toMIO(),
285
+ stakeQty: aRIOQuantity.toMARIO(),
286
286
  };
287
287
  }
288
288
  exports.redelegateParamsFromOptions = redelegateParamsFromOptions;
@@ -298,13 +298,13 @@ function requiredMIOFromOptions(options, key) {
298
298
  if (options[key] === undefined) {
299
299
  throw new Error(`No ${key} provided. Use --${key} denominated in IO`);
300
300
  }
301
- return new index_js_1.IOToken(+options[key]).toMIO();
301
+ return new index_js_1.ARIOToken(+options[key]).toMARIO();
302
302
  }
303
303
  exports.requiredMIOFromOptions = requiredMIOFromOptions;
304
304
  async function assertEnoughBalance(io, address, ioQuantity) {
305
305
  const balance = await io.getBalance({ address });
306
- if (balance < ioQuantity.toMIO().valueOf()) {
307
- throw new Error(`Insufficient IO balance for action. Balance available: ${new index_js_1.mIOToken(balance).toIO()} IO`);
306
+ if (balance < ioQuantity.toMARIO().valueOf()) {
307
+ throw new Error(`Insufficient IO balance for action. Balance available: ${new index_js_1.mARIOToken(balance).toARIO()} IO`);
308
308
  }
309
309
  }
310
310
  exports.assertEnoughBalance = assertEnoughBalance;
@@ -412,43 +412,45 @@ class AoANTWriteable extends AoANTReadable {
412
412
  });
413
413
  }
414
414
  /**
415
- * @param name @type {string} The name you want to release. The name will be put up for auction on the IO contract. 50% of the winning bid will be distributed to the ANT owner at the time of release. If no bids, the name will be released and can be reregistered by anyone.
416
- * @param ioProcessId @type {string} The processId of the IO contract. This is where the ANT will send the message to release the name.
415
+ * @param name @type {string} The name you want to release. The name will be put up for as a recently returned name on the ARIO contract. 50% of the winning bid will be distributed to the ANT owner at the time of purchase. If no purchase in the recently returned name period (14 epochs), the name will be released and can be reregistered by anyone.
416
+ * @param arioProcessId @type {string} The processId of the ARIO contract. This is where the ANT will send the message to release the name.
417
417
  * @returns {Promise<AoMessageResult>} The result of the interaction.
418
418
  * @example
419
419
  * ```ts
420
- * ant.releaseName({ name: "ardrive", ioProcessId: IO_TESTNET_PROCESS_ID });
420
+ * ant.releaseName({ name: "ardrive", arioProcessId: AR_TESTNET_PROCESS_ID });
421
421
  * ```
422
422
  */
423
- async releaseName({ name, ioProcessId }, options) {
423
+ async releaseName({ name, arioProcessId }, options) {
424
424
  return this.process.send({
425
425
  tags: [
426
426
  ...(options?.tags ?? []),
427
427
  { name: 'Action', value: 'Release-Name' },
428
428
  { name: 'Name', value: name },
429
- { name: 'IO-Process-Id', value: ioProcessId },
429
+ { name: 'IO-Process-Id', value: arioProcessId },
430
+ { name: 'ARIO-Process-Id', value: arioProcessId },
430
431
  ],
431
432
  signer: this.signer,
432
433
  });
433
434
  }
434
435
  /**
435
- * 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.
436
+ * Sends a message to the ARIO contract to reassign the name to a new ANT. This can only be done by the current owner of the ANT.
436
437
  * @param name @type {string} The name you want to reassign.
437
- * @param ioProcessId @type {string} The processId of the IO contract.
438
+ * @param arioProcessId @type {string} The processId of the ARIO contract.
438
439
  * @param antProcessId @type {string} The processId of the ANT contract.
439
440
  * @returns {Promise<AoMessageResult>} The result of the interaction.
440
441
  * @example
441
442
  * ```ts
442
- * ant.reassignName({ name: "ardrive", ioProcessId: IO_TESTNET_PROCESS_ID, antProcessId: NEW_ANT_PROCESS_ID });
443
+ * ant.reassignName({ name: "ardrive", arioProcessId: ARIO_TESTNET_PROCESS_ID, antProcessId: NEW_ANT_PROCESS_ID });
443
444
  * ```
444
445
  */
445
- async reassignName({ name, ioProcessId, antProcessId, }, options) {
446
+ async reassignName({ name, arioProcessId, antProcessId, }, options) {
446
447
  return this.process.send({
447
448
  tags: [
448
449
  ...(options?.tags ?? []),
449
450
  { name: 'Action', value: 'Reassign-Name' },
450
451
  { name: 'Name', value: name },
451
- { name: 'IO-Process-Id', value: ioProcessId },
452
+ { name: 'IO-Process-Id', value: arioProcessId },
453
+ { name: 'ARIO-Process-Id', value: arioProcessId },
452
454
  { name: 'Process-Id', value: antProcessId },
453
455
  ],
454
456
  signer: this.signer,
@@ -457,25 +459,27 @@ class AoANTWriteable extends AoANTReadable {
457
459
  /**
458
460
  * Approves a primary name request for a given name or address.
459
461
  */
460
- async approvePrimaryNameRequest({ name, address, ioProcessId, }, options) {
462
+ async approvePrimaryNameRequest({ name, address, arioProcessId, }, options) {
461
463
  return this.process.send({
462
464
  tags: [
463
465
  ...(options?.tags ?? []),
464
466
  { name: 'Action', value: 'Approve-Primary-Name' },
465
467
  { name: 'Name', value: name },
466
468
  { name: 'Recipient', value: address },
467
- { name: 'IO-Process-Id', value: ioProcessId },
469
+ { name: 'IO-Process-Id', value: arioProcessId },
470
+ { name: 'ARIO-Process-Id', value: arioProcessId },
468
471
  ],
469
472
  signer: this.signer,
470
473
  });
471
474
  }
472
- async removePrimaryNames({ names, ioProcessId }, options) {
475
+ async removePrimaryNames({ names, arioProcessId }, options) {
473
476
  return this.process.send({
474
477
  tags: [
475
478
  ...(options?.tags ?? []),
476
479
  { name: 'Action', value: 'Remove-Primary-Names' },
477
480
  { name: 'Names', value: names.join(',') },
478
- { name: 'IO-Process-Id', value: ioProcessId },
481
+ { name: 'IO-Process-Id', value: arioProcessId },
482
+ { name: 'ARIO-Process-Id', value: arioProcessId },
479
483
  ],
480
484
  signer: this.signer,
481
485
  });
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IOWriteable = exports.IOReadable = exports.IO = void 0;
3
+ exports.ARIOWriteable = exports.ARIOReadable = exports.ARIO = void 0;
4
4
  const constants_js_1 = require("../constants.js");
5
5
  const io_js_1 = require("../types/io.js");
6
6
  const ao_js_1 = require("../utils/ao.js");
@@ -8,26 +8,26 @@ const arweave_js_1 = require("../utils/arweave.js");
8
8
  const arweave_js_2 = require("./arweave.js");
9
9
  const ao_process_js_1 = require("./contracts/ao-process.js");
10
10
  const error_js_1 = require("./error.js");
11
- class IO {
11
+ class ARIO {
12
12
  static init(config) {
13
13
  if (config && config.signer) {
14
14
  const { signer, ...rest } = config;
15
- return new IOWriteable({
15
+ return new ARIOWriteable({
16
16
  ...rest,
17
17
  signer,
18
18
  });
19
19
  }
20
- return new IOReadable(config);
20
+ return new ARIOReadable(config);
21
21
  }
22
22
  }
23
- exports.IO = IO;
24
- class IOReadable {
23
+ exports.ARIO = ARIO;
24
+ class ARIOReadable {
25
25
  process;
26
26
  arweave;
27
27
  constructor(config, arweave = arweave_js_2.defaultArweave) {
28
28
  if (!config) {
29
29
  this.process = new ao_process_js_1.AOProcess({
30
- processId: constants_js_1.IO_TESTNET_PROCESS_ID,
30
+ processId: constants_js_1.ARIO_TESTNET_PROCESS_ID,
31
31
  });
32
32
  }
33
33
  else if ((0, io_js_1.isProcessConfiguration)(config)) {
@@ -319,60 +319,23 @@ class IOReadable {
319
319
  tags: [{ name: 'Action', value: 'Demand-Factor-Settings' }],
320
320
  });
321
321
  }
322
- // Auctions
323
- async getArNSAuctions(params) {
322
+ async getArNSReturnedNames(params) {
324
323
  return this.process.read({
325
324
  tags: [
326
- { name: 'Action', value: 'Auctions' },
325
+ { name: 'Action', value: 'Returned-Names' },
327
326
  ...(0, arweave_js_1.paginationParamsToTags)(params),
328
327
  ],
329
328
  });
330
329
  }
331
- async getArNSAuction({ name, }) {
330
+ async getArNSReturnedName({ name, }) {
332
331
  const allTags = [
333
- { name: 'Action', value: 'Auction-Info' },
332
+ { name: 'Action', value: 'Returned-Name' },
334
333
  { name: 'Name', value: name },
335
334
  ];
336
335
  return this.process.read({
337
336
  tags: allTags,
338
337
  });
339
338
  }
340
- /**
341
- * Get auction prices for a given auction at the provided intervals
342
- *
343
- * @param {Object} params - The parameters for fetching auction prices
344
- * @param {string} params.name - The name of the auction
345
- * @param {('permabuy'|'lease')} [params.type='lease'] - The type of purchase
346
- * @param {number} [params.years=1] - The number of years for lease (only applicable if type is 'lease')
347
- * @param {number} [params.timestamp=Date.now()] - The timestamp to fetch prices for
348
- * @param {number} [params.intervalMs=900000] - The interval in milliseconds between price points (default is 15 minutes)
349
- * @returns {Promise<AoAuctionPriceData>} The auction price data
350
- */
351
- async getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }) {
352
- const prunedPriceTags = [
353
- { name: 'Action', value: 'Auction-Prices' },
354
- { name: 'Name', value: name },
355
- {
356
- name: 'Timestamp',
357
- value: timestamp?.toString() ??
358
- (await (0, arweave_js_1.getCurrentBlockUnixTimestampMs)(this.arweave)).toString(),
359
- },
360
- { name: 'Purchase-Type', value: type ?? 'lease' },
361
- {
362
- name: 'Years',
363
- value: type == undefined || type === 'lease'
364
- ? years?.toString() ?? '1'
365
- : undefined,
366
- },
367
- {
368
- name: 'Price-Interval-Ms',
369
- value: intervalMs?.toString() ?? '900000',
370
- },
371
- ].filter((tag) => tag.value !== undefined);
372
- return this.process.read({
373
- tags: prunedPriceTags,
374
- });
375
- }
376
339
  async getDelegations(params) {
377
340
  const allTags = [
378
341
  { name: 'Action', value: 'Paginated-Delegations' },
@@ -457,14 +420,14 @@ class IOReadable {
457
420
  });
458
421
  }
459
422
  }
460
- exports.IOReadable = IOReadable;
461
- class IOWriteable extends IOReadable {
423
+ exports.ARIOReadable = ARIOReadable;
424
+ class ARIOWriteable extends ARIOReadable {
462
425
  signer;
463
426
  constructor({ signer, ...config }) {
464
427
  if (Object.keys(config).length === 0) {
465
428
  super({
466
429
  process: new ao_process_js_1.AOProcess({
467
- processId: constants_js_1.IO_TESTNET_PROCESS_ID,
430
+ processId: constants_js_1.ARIO_TESTNET_PROCESS_ID,
468
431
  }),
469
432
  });
470
433
  this.signer = (0, ao_js_1.createAoSigner)(signer);
@@ -784,22 +747,6 @@ class IOWriteable extends IOReadable {
784
747
  tags: (0, arweave_js_1.pruneTags)(allTags),
785
748
  });
786
749
  }
787
- async submitAuctionBid(params, options) {
788
- const { tags = [] } = options || {};
789
- const allTags = [
790
- ...tags,
791
- { name: 'Action', value: 'Auction-Bid' },
792
- { name: 'Name', value: params.name },
793
- { name: 'Process-Id', value: params.processId },
794
- { name: 'Quantity', value: params.quantity?.toString() ?? undefined },
795
- { name: 'Purchase-Type', value: params.type || 'lease' },
796
- { name: 'Years', value: params.years?.toString() ?? undefined },
797
- ];
798
- return this.process.send({
799
- signer: this.signer,
800
- tags: (0, arweave_js_1.pruneTags)(allTags),
801
- });
802
- }
803
750
  async requestPrimaryName(params) {
804
751
  return this.process.send({
805
752
  signer: this.signer,
@@ -836,4 +783,4 @@ class IOWriteable extends IOReadable {
836
783
  });
837
784
  }
838
785
  }
839
- exports.IOWriteable = IOWriteable;
786
+ exports.ARIOWriteable = ARIOWriteable;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_SCHEDULER_ID = exports.ANT_LUA_ID = exports.AOS_MODULE_ID = exports.MIO_PER_IO = exports.ANT_REGISTRY_ID = exports.IO_TESTNET_PROCESS_ID = exports.ioDevnetProcessId = exports.IO_DEVNET_PROCESS_ID = exports.ARNS_DEVNET_REGISTRY_TX = exports.ARNS_TESTNET_REGISTRY_TX = exports.SORT_KEY_REGEX = exports.FQDN_REGEX = exports.ARWEAVE_TX_REGEX = void 0;
3
+ exports.DEFAULT_SCHEDULER_ID = exports.ANT_LUA_ID = exports.AOS_MODULE_ID = exports.MARIO_PER_ARIO = exports.ANT_REGISTRY_ID = exports.ARIO_TESTNET_PROCESS_ID = exports.arioDevnetProcessId = exports.ARIO_DEVNET_PROCESS_ID = exports.ARNS_DEVNET_REGISTRY_TX = exports.ARNS_TESTNET_REGISTRY_TX = exports.SORT_KEY_REGEX = exports.FQDN_REGEX = exports.ARWEAVE_TX_REGEX = void 0;
4
4
  /**
5
5
  * Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
6
6
  *
@@ -23,12 +23,12 @@ exports.FQDN_REGEX = new RegExp('^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{
23
23
  exports.SORT_KEY_REGEX = new RegExp('^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$');
24
24
  exports.ARNS_TESTNET_REGISTRY_TX = process.env.ARNS_REGISTRY_TX ?? 'bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U';
25
25
  exports.ARNS_DEVNET_REGISTRY_TX = '_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8';
26
- exports.IO_DEVNET_PROCESS_ID = 'GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc';
26
+ exports.ARIO_DEVNET_PROCESS_ID = 'GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc';
27
27
  // backwards compatibility - TODO: remove in v2.0.0
28
- exports.ioDevnetProcessId = exports.IO_DEVNET_PROCESS_ID;
29
- exports.IO_TESTNET_PROCESS_ID = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA';
28
+ exports.arioDevnetProcessId = exports.ARIO_DEVNET_PROCESS_ID;
29
+ exports.ARIO_TESTNET_PROCESS_ID = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA';
30
30
  exports.ANT_REGISTRY_ID = 'i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc';
31
- exports.MIO_PER_IO = 1_000_000;
31
+ exports.MARIO_PER_ARIO = 1_000_000;
32
32
  exports.AOS_MODULE_ID = 'cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk';
33
33
  exports.ANT_LUA_ID = '16_FyX-V2QU0RPSh1GIaEETSaUjNb0oVjCFpVbAfQq4';
34
34
  exports.DEFAULT_SCHEDULER_ID = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mIOToken = exports.IOToken = void 0;
3
+ exports.mARIOToken = exports.ARIOToken = void 0;
4
4
  /**
5
5
  * Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
6
6
  *
@@ -64,33 +64,33 @@ class PositiveFiniteInteger {
64
64
  return this.positiveFiniteInteger === other.positiveFiniteInteger;
65
65
  }
66
66
  }
67
- class IOToken {
67
+ class ARIOToken {
68
68
  value;
69
69
  constructor(value) {
70
70
  if (!Number.isFinite(value) || value < 0) {
71
- throw new Error('IOToken must be a non-negative finite number');
71
+ throw new Error('ARIOToken must be a non-negative finite number');
72
72
  }
73
73
  this.value = +value.toFixed(6);
74
74
  }
75
75
  valueOf() {
76
76
  return this.value;
77
77
  }
78
- toMIO() {
79
- return new mIOToken(Math.floor(this.value * constants_js_1.MIO_PER_IO));
78
+ toMARIO() {
79
+ return new mARIOToken(Math.floor(this.value * constants_js_1.MARIO_PER_ARIO));
80
80
  }
81
81
  toString() {
82
82
  return `${this.value}`;
83
83
  }
84
84
  }
85
- exports.IOToken = IOToken;
86
- class mIOToken extends PositiveFiniteInteger {
85
+ exports.ARIOToken = ARIOToken;
86
+ class mARIOToken extends PositiveFiniteInteger {
87
87
  constructor(value) {
88
88
  super(value);
89
89
  }
90
90
  multiply(multiplier) {
91
91
  // always round down on multiplication and division
92
92
  const result = Math.floor(this.valueOf() * multiplier.valueOf());
93
- return new mIOToken(result);
93
+ return new mARIOToken(result);
94
94
  }
95
95
  divide(divisor) {
96
96
  if (divisor.valueOf() === 0) {
@@ -99,18 +99,18 @@ class mIOToken extends PositiveFiniteInteger {
99
99
  }
100
100
  // always round down on multiplication and division
101
101
  const result = Math.floor(this.valueOf() / divisor.valueOf());
102
- return new mIOToken(result);
102
+ return new mARIOToken(result);
103
103
  }
104
104
  plus(addend) {
105
105
  const result = super.plus(addend);
106
- return new mIOToken(result.valueOf());
106
+ return new mARIOToken(result.valueOf());
107
107
  }
108
108
  minus(subtractHend) {
109
109
  const result = super.minus(subtractHend);
110
- return new mIOToken(result.valueOf());
110
+ return new mARIOToken(result.valueOf());
111
111
  }
112
- toIO() {
113
- return new IOToken(this.valueOf() / constants_js_1.MIO_PER_IO);
112
+ toARIO() {
113
+ return new ARIOToken(this.valueOf() / constants_js_1.MARIO_PER_ARIO);
114
114
  }
115
115
  }
116
- exports.mIOToken = mIOToken;
116
+ exports.mARIOToken = mARIOToken;
@@ -53,8 +53,8 @@ class ArNSEventEmitter extends eventemitter3_1.EventEmitter {
53
53
  throttle;
54
54
  logger;
55
55
  strict;
56
- constructor({ contract = io_js_1.IO.init({
57
- processId: constants_js_1.IO_TESTNET_PROCESS_ID,
56
+ constructor({ contract = io_js_1.ARIO.init({
57
+ processId: constants_js_1.ARIO_TESTNET_PROCESS_ID,
58
58
  }), timeoutMs = 60_000, concurrency = 30, logger = logger_js_1.Logger.default, strict = false, } = {}) {
59
59
  super();
60
60
  this.contract = contract;
@@ -117,8 +117,8 @@ class ArNSEventEmitter extends eventemitter3_1.EventEmitter {
117
117
  }
118
118
  }
119
119
  exports.ArNSEventEmitter = ArNSEventEmitter;
120
- const fetchAllArNSRecords = async ({ contract = io_js_1.IO.init({
121
- processId: constants_js_1.IO_TESTNET_PROCESS_ID,
120
+ const fetchAllArNSRecords = async ({ contract = io_js_1.ARIO.init({
121
+ processId: constants_js_1.ARIO_TESTNET_PROCESS_ID,
122
122
  }), emitter, logger = logger_js_1.Logger.default, pageSize = 50_000, }) => {
123
123
  let cursor;
124
124
  const startTimestamp = Date.now();
@@ -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.7.0-alpha.6';
20
+ exports.version = '3.0.0-alpha.1';