@ar.io/sdk 3.10.0-alpha.6 → 3.10.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 (104) hide show
  1. package/README.md +66 -125
  2. package/bundles/web.bundle.min.js +147 -126
  3. package/lib/cjs/cli/commands/antCommands.js +3 -4
  4. package/lib/cjs/cli/commands/arnsPurchaseCommands.js +5 -6
  5. package/lib/cjs/cli/commands/gatewayWriteCommands.js +11 -12
  6. package/lib/cjs/cli/commands/readCommands.js +21 -22
  7. package/lib/cjs/cli/commands/transfer.js +6 -7
  8. package/lib/cjs/cli/options.js +0 -12
  9. package/lib/cjs/cli/utils.js +52 -74
  10. package/lib/cjs/common/ant-versions.js +5 -5
  11. package/lib/cjs/common/faucet.js +2 -2
  12. package/lib/cjs/common/index.js +0 -2
  13. package/lib/cjs/common/io.js +5 -64
  14. package/lib/cjs/types/ant.js +2 -13
  15. package/lib/cjs/types/index.js +0 -1
  16. package/lib/cjs/types/io.js +5 -5
  17. package/lib/cjs/utils/ao.js +9 -14
  18. package/lib/cjs/utils/arweave.js +4 -4
  19. package/lib/cjs/utils/base64.js +4 -5
  20. package/lib/cjs/utils/json.js +1 -2
  21. package/lib/cjs/utils/schema.js +1 -2
  22. package/lib/cjs/version.js +1 -1
  23. package/lib/cjs/web/index.js +1 -3
  24. package/lib/esm/cli/options.js +0 -12
  25. package/lib/esm/cli/utils.js +10 -31
  26. package/lib/esm/common/ant-versions.js +5 -5
  27. package/lib/esm/common/index.js +0 -2
  28. package/lib/esm/common/io.js +5 -64
  29. package/lib/esm/types/ant.js +0 -11
  30. package/lib/esm/types/index.js +0 -1
  31. package/lib/esm/types/io.js +1 -1
  32. package/lib/esm/utils/ao.js +0 -5
  33. package/lib/esm/version.js +1 -1
  34. package/lib/esm/web/index.js +1 -1
  35. package/lib/types/cli/commands/antCommands.d.ts +3 -3
  36. package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +1 -1
  37. package/lib/types/cli/commands/gatewayWriteCommands.d.ts +9 -9
  38. package/lib/types/cli/commands/readCommands.d.ts +3 -4
  39. package/lib/types/cli/commands/transfer.d.ts +3 -3
  40. package/lib/types/cli/options.d.ts +0 -9
  41. package/lib/types/cli/types.d.ts +0 -3
  42. package/lib/types/cli/utils.d.ts +0 -4
  43. package/lib/types/common/ant-versions.d.ts +6 -3
  44. package/lib/types/common/http.d.ts +0 -1
  45. package/lib/types/common/index.d.ts +0 -1
  46. package/lib/types/common/io.d.ts +9 -15
  47. package/lib/types/types/ant.d.ts +1 -53
  48. package/lib/types/types/common.d.ts +2 -8
  49. package/lib/types/types/index.d.ts +0 -1
  50. package/lib/types/types/io.d.ts +7 -9
  51. package/lib/types/types/token.d.ts +0 -2
  52. package/lib/types/utils/ao.d.ts +12 -1
  53. package/lib/types/utils/base64.d.ts +0 -2
  54. package/lib/types/version.d.ts +1 -1
  55. package/lib/types/web/index.d.ts +1 -1
  56. package/package.json +3 -5
  57. package/lib/cjs/common/turbo.js +0 -208
  58. package/lib/cjs/common/wayfinder/gateways.js +0 -75
  59. package/lib/cjs/common/wayfinder/index.js +0 -36
  60. package/lib/cjs/common/wayfinder/routers/fixed.js +0 -14
  61. package/lib/cjs/common/wayfinder/routers/fixed.test.js +0 -14
  62. package/lib/cjs/common/wayfinder/routers/priority.js +0 -38
  63. package/lib/cjs/common/wayfinder/routers/priority.test.js +0 -155
  64. package/lib/cjs/common/wayfinder/routers/random.js +0 -23
  65. package/lib/cjs/common/wayfinder/routers/random.test.js +0 -104
  66. package/lib/cjs/common/wayfinder/routers/simple-cache.js +0 -25
  67. package/lib/cjs/common/wayfinder/routers/simple-cache.test.js +0 -41
  68. package/lib/cjs/common/wayfinder/wayfinder.js +0 -194
  69. package/lib/cjs/common/wayfinder/wayfinder.test.js +0 -254
  70. package/lib/cjs/types/wayfinder.js +0 -2
  71. package/lib/cjs/utils/url.js +0 -28
  72. package/lib/cjs/utils/url.test.js +0 -24
  73. package/lib/esm/common/turbo.js +0 -200
  74. package/lib/esm/common/wayfinder/gateways.js +0 -69
  75. package/lib/esm/common/wayfinder/index.js +0 -20
  76. package/lib/esm/common/wayfinder/routers/fixed.js +0 -10
  77. package/lib/esm/common/wayfinder/routers/fixed.test.js +0 -12
  78. package/lib/esm/common/wayfinder/routers/priority.js +0 -34
  79. package/lib/esm/common/wayfinder/routers/priority.test.js +0 -153
  80. package/lib/esm/common/wayfinder/routers/random.js +0 -19
  81. package/lib/esm/common/wayfinder/routers/random.test.js +0 -102
  82. package/lib/esm/common/wayfinder/routers/simple-cache.js +0 -21
  83. package/lib/esm/common/wayfinder/routers/simple-cache.test.js +0 -39
  84. package/lib/esm/common/wayfinder/wayfinder.js +0 -187
  85. package/lib/esm/common/wayfinder/wayfinder.test.js +0 -249
  86. package/lib/esm/types/wayfinder.js +0 -1
  87. package/lib/esm/utils/url.js +0 -24
  88. package/lib/esm/utils/url.test.js +0 -19
  89. package/lib/types/common/turbo.d.ts +0 -62
  90. package/lib/types/common/wayfinder/gateways.d.ts +0 -44
  91. package/lib/types/common/wayfinder/index.d.ts +0 -19
  92. package/lib/types/common/wayfinder/routers/fixed.d.ts +0 -25
  93. package/lib/types/common/wayfinder/routers/fixed.test.d.ts +0 -1
  94. package/lib/types/common/wayfinder/routers/priority.d.ts +0 -34
  95. package/lib/types/common/wayfinder/routers/priority.test.d.ts +0 -1
  96. package/lib/types/common/wayfinder/routers/random.d.ts +0 -28
  97. package/lib/types/common/wayfinder/routers/random.test.d.ts +0 -1
  98. package/lib/types/common/wayfinder/routers/simple-cache.d.ts +0 -29
  99. package/lib/types/common/wayfinder/routers/simple-cache.test.d.ts +0 -1
  100. package/lib/types/common/wayfinder/wayfinder.d.ts +0 -106
  101. package/lib/types/common/wayfinder/wayfinder.test.d.ts +0 -1
  102. package/lib/types/types/wayfinder.d.ts +0 -20
  103. package/lib/types/utils/url.d.ts +0 -19
  104. package/lib/types/utils/url.test.d.ts +0 -1
@@ -1,6 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeUnicodeFromError = exports.errorMessageFromOutput = exports.parseAoEpochData = exports.initANTStateForAddress = exports.defaultANTLogoId = exports.defaultTargetManifestId = exports.createAoSigner = exports.isAoSigner = exports.evolveANT = exports.spawnANT = void 0;
3
+ exports.defaultANTLogoId = exports.defaultTargetManifestId = void 0;
4
+ exports.spawnANT = spawnANT;
5
+ exports.evolveANT = evolveANT;
6
+ exports.isAoSigner = isAoSigner;
7
+ exports.createAoSigner = createAoSigner;
8
+ exports.initANTStateForAddress = initANTStateForAddress;
9
+ exports.parseAoEpochData = parseAoEpochData;
10
+ exports.errorMessageFromOutput = errorMessageFromOutput;
11
+ exports.removeUnicodeFromError = removeUnicodeFromError;
4
12
  /**
5
13
  * Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
6
14
  *
@@ -22,13 +30,8 @@ const zod_1 = require("zod");
22
30
  const arweave_js_1 = require("../common/arweave.js");
23
31
  const index_js_1 = require("../common/index.js");
24
32
  const constants_js_1 = require("../constants.js");
25
- const ant_js_1 = require("../types/ant.js");
26
- const schema_js_1 = require("./schema.js");
27
33
  async function spawnANT({ signer, module = constants_js_1.AOS_MODULE_ID, ao = (0, aoconnect_1.connect)(), scheduler = constants_js_1.DEFAULT_SCHEDULER_ID, state, antRegistryId = constants_js_1.ANT_REGISTRY_ID, logger = index_js_1.Logger.default, authority = constants_js_1.AO_AUTHORITY, }) {
28
34
  // TODO: use On-Boot data handler for bootstrapping state instead of initialize-state
29
- if (state) {
30
- (0, schema_js_1.parseSchemaResult)(ant_js_1.SpawnANTStateSchema, state);
31
- }
32
35
  const processId = await ao.spawn({
33
36
  module,
34
37
  scheduler,
@@ -53,7 +56,6 @@ async function spawnANT({ signer, module = constants_js_1.AOS_MODULE_ID, ao = (0
53
56
  });
54
57
  return processId;
55
58
  }
56
- exports.spawnANT = spawnANT;
57
59
  async function evolveANT({ signer, processId, luaCodeTxId = constants_js_1.ANT_LUA_ID, ao = (0, aoconnect_1.connect)(), logger = index_js_1.Logger.default, arweave = arweave_js_1.defaultArweave, }) {
58
60
  const aosClient = new index_js_1.AOProcess({
59
61
  processId,
@@ -80,7 +82,6 @@ async function evolveANT({ signer, processId, luaCodeTxId = constants_js_1.ANT_L
80
82
  });
81
83
  return evolveMsgId;
82
84
  }
83
- exports.evolveANT = evolveANT;
84
85
  function isAoSigner(value) {
85
86
  const TagSchema = zod_1.z.object({
86
87
  name: zod_1.z.string(),
@@ -106,7 +107,6 @@ function isAoSigner(value) {
106
107
  return false;
107
108
  }
108
109
  }
109
- exports.isAoSigner = isAoSigner;
110
110
  function createAoSigner(signer) {
111
111
  if (isAoSigner(signer)) {
112
112
  return signer;
@@ -146,7 +146,6 @@ function createAoSigner(signer) {
146
146
  // @ts-ignore Buffer vs ArrayBuffer type mismatch
147
147
  return aoSigner;
148
148
  }
149
- exports.createAoSigner = createAoSigner;
150
149
  exports.defaultTargetManifestId = '-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI';
151
150
  exports.defaultANTLogoId = 'Sie_26dvgyok0PZD_-iQAFOhOd5YxDTkczOLoqTTL_A';
152
151
  function initANTStateForAddress({ owner, targetId, ttlSeconds = 3600, keywords = [], controllers = [], description = '', ticker = 'aos', name = 'ANT', logo = exports.defaultANTLogoId, }) {
@@ -167,7 +166,6 @@ function initANTStateForAddress({ owner, targetId, ttlSeconds = 3600, keywords =
167
166
  logo,
168
167
  };
169
168
  }
170
- exports.initANTStateForAddress = initANTStateForAddress;
171
169
  /**
172
170
  * Uses zod schema to parse the epoch data
173
171
  */
@@ -184,7 +182,6 @@ function parseAoEpochData(value) {
184
182
  });
185
183
  return epochDataSchema.parse(value);
186
184
  }
187
- exports.parseAoEpochData = parseAoEpochData;
188
185
  function errorMessageFromOutput(output) {
189
186
  const errorData = output.Error;
190
187
  // Attempt to extract error details from Messages.Tags if Error is undefined
@@ -203,7 +200,6 @@ function errorMessageFromOutput(output) {
203
200
  }
204
201
  return undefined;
205
202
  }
206
- exports.errorMessageFromOutput = errorMessageFromOutput;
207
203
  function removeUnicodeFromError(error) {
208
204
  //The regular expression /[\u001b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g is designed to match ANSI escape codes used for terminal formatting. These are sequences that begin with \u001b (ESC character) and are often followed by [ and control codes.
209
205
  const ESC = String.fromCharCode(27); // Represents '\u001b' or '\x1b'
@@ -211,4 +207,3 @@ function removeUnicodeFromError(error) {
211
207
  .replace(new RegExp(`${ESC}[\\[\\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]`, 'g'), '')
212
208
  .trim();
213
209
  }
214
- exports.removeUnicodeFromError = removeUnicodeFromError;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeEligibleRewardsFromEpochData = exports.sortAndPaginateEpochDataIntoEligibleDistributions = exports.epochDistributionNoticeGqlQueryFallback = exports.epochDistributionNoticeGqlQuery = exports.getEpochDataFromGqlFallback = exports.getEpochDataFromGqlWithCUFallback = exports.getEpochDataFromGql = exports.paginationParamsToTags = exports.pruneTags = exports.isBlockHeight = exports.validateArweaveId = void 0;
3
+ exports.epochDistributionNoticeGqlQueryFallback = exports.epochDistributionNoticeGqlQuery = exports.getEpochDataFromGqlFallback = exports.getEpochDataFromGqlWithCUFallback = exports.getEpochDataFromGql = exports.paginationParamsToTags = exports.pruneTags = exports.validateArweaveId = void 0;
4
+ exports.isBlockHeight = isBlockHeight;
5
+ exports.sortAndPaginateEpochDataIntoEligibleDistributions = sortAndPaginateEpochDataIntoEligibleDistributions;
6
+ exports.removeEligibleRewardsFromEpochData = removeEligibleRewardsFromEpochData;
4
7
  const constants_js_1 = require("../constants.js");
5
8
  const io_js_1 = require("../types/io.js");
6
9
  const ao_js_1 = require("./ao.js");
@@ -11,7 +14,6 @@ exports.validateArweaveId = validateArweaveId;
11
14
  function isBlockHeight(height) {
12
15
  return height !== undefined && !isNaN(parseInt(height.toString()));
13
16
  }
14
- exports.isBlockHeight = isBlockHeight;
15
17
  /**
16
18
  * Prune tags that are undefined or empty.
17
19
  * @param tags - The tags to prune.
@@ -251,7 +253,6 @@ function sortAndPaginateEpochDataIntoEligibleDistributions(epochData, params) {
251
253
  sortBy,
252
254
  };
253
255
  }
254
- exports.sortAndPaginateEpochDataIntoEligibleDistributions = sortAndPaginateEpochDataIntoEligibleDistributions;
255
256
  function removeEligibleRewardsFromEpochData(epochData) {
256
257
  if (!(0, io_js_1.isDistributedEpoch)(epochData)) {
257
258
  return epochData;
@@ -268,4 +269,3 @@ function removeEligibleRewardsFromEpochData(epochData) {
268
269
  },
269
270
  };
270
271
  }
271
- exports.removeEligibleRewardsFromEpochData = removeEligibleRewardsFromEpochData;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRandomText = exports.sha256B64Url = exports.toB64Url = exports.fromB64Url = void 0;
3
+ exports.fromB64Url = fromB64Url;
4
+ exports.toB64Url = toB64Url;
5
+ exports.sha256B64Url = sha256B64Url;
6
+ exports.getRandomText = getRandomText;
4
7
  /**
5
8
  * Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
6
9
  *
@@ -42,16 +45,13 @@ function fromB64Url(str) {
42
45
  const b64Str = base64urlToBase64(str);
43
46
  return Buffer.from(b64Str, 'base64');
44
47
  }
45
- exports.fromB64Url = fromB64Url;
46
48
  function toB64Url(buffer) {
47
49
  const b64Str = buffer.toString('base64');
48
50
  return base64urlFromBase64(b64Str);
49
51
  }
50
- exports.toB64Url = toB64Url;
51
52
  function sha256B64Url(input) {
52
53
  return toB64Url((0, crypto_1.createHash)('sha256').update(Uint8Array.from(input)).digest());
53
54
  }
54
- exports.sha256B64Url = sha256B64Url;
55
55
  function getRandomText(length = 32) {
56
56
  // Generate a buffer of random bytes
57
57
  const buffer = (0, crypto_1.randomBytes)(length);
@@ -60,4 +60,3 @@ function getRandomText(length = 32) {
60
60
  .join('')
61
61
  .slice(0, length);
62
62
  }
63
- exports.getRandomText = getRandomText;
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.safeDecode = void 0;
18
+ exports.safeDecode = safeDecode;
19
19
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
20
  function safeDecode(data) {
21
21
  try {
@@ -25,4 +25,3 @@ function safeDecode(data) {
25
25
  return data;
26
26
  }
27
27
  }
28
- exports.safeDecode = safeDecode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseSchemaResult = void 0;
3
+ exports.parseSchemaResult = parseSchemaResult;
4
4
  /**
5
5
  * @param schema - zod schema
6
6
  * @param v - value to parse
@@ -13,4 +13,3 @@ function parseSchemaResult(schema, v) {
13
13
  }
14
14
  return schemaResult;
15
15
  }
16
- exports.parseSchemaResult = parseSchemaResult;
@@ -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 = '3.10.0-alpha.6';
20
+ exports.version = '3.10.1';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.EthereumSigner = exports.InjectedEthereumSigner = exports.ArconnectSigner = exports.ArweaveSigner = void 0;
17
+ exports.ArconnectSigner = exports.ArweaveSigner = void 0;
18
18
  /**
19
19
  * Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
20
20
  *
@@ -33,8 +33,6 @@ exports.EthereumSigner = exports.InjectedEthereumSigner = exports.ArconnectSigne
33
33
  var arbundles_1 = require("@dha-team/arbundles");
34
34
  Object.defineProperty(exports, "ArweaveSigner", { enumerable: true, get: function () { return arbundles_1.ArweaveSigner; } });
35
35
  Object.defineProperty(exports, "ArconnectSigner", { enumerable: true, get: function () { return arbundles_1.ArconnectSigner; } });
36
- Object.defineProperty(exports, "InjectedEthereumSigner", { enumerable: true, get: function () { return arbundles_1.InjectedEthereumSigner; } });
37
- Object.defineProperty(exports, "EthereumSigner", { enumerable: true, get: function () { return arbundles_1.EthereumSigner; } });
38
36
  __exportStar(require("../types/index.js"), exports);
39
37
  __exportStar(require("../common/index.js"), exports);
40
38
  __exportStar(require("../constants.js"), exports);
@@ -49,10 +49,6 @@ export const optionMap = {
49
49
  alias: '--cu-url <cuUrl>',
50
50
  description: 'The URL for a custom compute unit',
51
51
  },
52
- paymentUrl: {
53
- alias: '--payment-url <paymentUrl>',
54
- description: 'The URL for a custom turbo payment service',
55
- },
56
52
  processId: {
57
53
  alias: '--process-id <processId>',
58
54
  description: 'The process ID to interact with',
@@ -273,15 +269,9 @@ export const optionMap = {
273
269
  alias: '--logo <logo>',
274
270
  description: 'The ANT logo',
275
271
  },
276
- token: {
277
- alias: '-t, --token <type>',
278
- description: 'Crypto token type for wallet or action',
279
- default: 'arweave',
280
- },
281
272
  };
282
273
  export const walletOptions = [
283
274
  optionMap.walletFile,
284
- optionMap.token,
285
275
  // optionMap.mnemonic,
286
276
  optionMap.privateKey,
287
277
  ];
@@ -299,7 +289,6 @@ export const arnsPurchaseOptions = [
299
289
  ...writeActionOptions,
300
290
  optionMap.name,
301
291
  optionMap.fundFrom,
302
- optionMap.paymentUrl,
303
292
  ];
304
293
  export const epochOptions = [optionMap.epochIndex, optionMap.timestamp];
305
294
  export const addressAndVaultIdOptions = [optionMap.address, optionMap.vaultId];
@@ -323,7 +312,6 @@ export const tokenCostOptions = [
323
312
  optionMap.quantity,
324
313
  optionMap.address,
325
314
  optionMap.fundFrom,
326
- optionMap.paymentUrl,
327
315
  ];
328
316
  export const transferOptions = [
329
317
  ...writeActionOptions,
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { EthereumSigner } from '@dha-team/arbundles';
17
16
  import { connect } from '@permaweb/aoconnect';
18
17
  import { program } from 'commander';
19
18
  import { readFileSync } from 'fs';
@@ -78,7 +77,7 @@ export function arioProcessIdFromOptions({ arioProcessId, devnet, testnet, }) {
78
77
  }
79
78
  return ARIO_MAINNET_PROCESS_ID;
80
79
  }
81
- function walletFromOptions({ privateKey, walletFile, }) {
80
+ function jwkFromOptions({ privateKey, walletFile, }) {
82
81
  if (privateKey !== undefined) {
83
82
  return JSON.parse(privateKey);
84
83
  }
@@ -88,7 +87,7 @@ function walletFromOptions({ privateKey, walletFile, }) {
88
87
  return undefined;
89
88
  }
90
89
  export function requiredJwkFromOptions(options) {
91
- const jwk = walletFromOptions(options);
90
+ const jwk = jwkFromOptions(options);
92
91
  if (jwk === undefined) {
93
92
  throw new Error('No JWK provided for signing!\nPlease provide a stringified JWK with `--private-key` or the file path of a jwk.json file with `--wallet-file`');
94
93
  }
@@ -118,30 +117,13 @@ export function readARIOFromOptions(options) {
118
117
  setLoggerIfDebug(options);
119
118
  return ARIO.init({
120
119
  process: aoProcessFromOptions(options),
121
- paymentUrl: options.paymentUrl,
122
120
  });
123
121
  }
124
- export function contractSignerFromOptions(options) {
125
- const wallet = walletFromOptions(options);
126
- if (wallet === undefined) {
127
- return undefined;
128
- }
129
- const token = options.token ?? 'arweave';
130
- if (token === 'ethereum') {
131
- const signer = new EthereumSigner(wallet);
132
- // For EthereumSigner, we need to convert the JWK to a string
133
- return { signer, signerAddress: signer.publicKey.toString('hex') };
134
- }
135
- // TODO: Support other wallet types
136
- const signer = new ArweaveSigner(wallet);
137
- return { signer, signerAddress: jwkToAddress(wallet) };
138
- }
139
122
  export function requiredContractSignerFromOptions(options) {
140
- const contractSigner = contractSignerFromOptions(options);
141
- if (contractSigner === undefined) {
142
- throw new Error('No signer provided for signing!\nPlease provide a stringified JWK or Ethereum private key with `--private-key` or the file path of an arweave.jwk.json or eth.private.key.txt file with `--wallet-file`');
143
- }
144
- return contractSigner;
123
+ // TODO: Support other wallet types
124
+ const jwk = requiredJwkFromOptions(options);
125
+ const signer = new ArweaveSigner(jwk);
126
+ return { signer, signerAddress: jwkToAddress(jwk) };
145
127
  }
146
128
  export function requiredAoSignerFromOptions(options) {
147
129
  return createAoSigner(requiredContractSignerFromOptions(options).signer);
@@ -153,7 +135,6 @@ export function writeARIOFromOptions(options) {
153
135
  ario: ARIO.init({
154
136
  process: aoProcessFromOptions(options),
155
137
  signer,
156
- paymentUrl: options.paymentUrl,
157
138
  }),
158
139
  signerAddress,
159
140
  };
@@ -174,9 +155,10 @@ export function addressFromOptions(options) {
174
155
  if (options.address !== undefined) {
175
156
  return options.address;
176
157
  }
177
- const signer = contractSignerFromOptions(options);
178
- if (signer !== undefined) {
179
- return signer.signerAddress;
158
+ // TODO: Support other wallet types
159
+ const jwk = jwkFromOptions(options);
160
+ if (jwk !== undefined) {
161
+ return jwkToAddress(jwk);
180
162
  }
181
163
  return undefined;
182
164
  }
@@ -299,9 +281,6 @@ export function requiredMARIOFromOptions(options, key) {
299
281
  return new ARIOToken(+options[key]).toMARIO();
300
282
  }
301
283
  export async function assertEnoughBalanceForArNSPurchase({ ario, address, costDetailsParams, }) {
302
- if (costDetailsParams.fundFrom === 'turbo') {
303
- return;
304
- }
305
284
  const costDetails = await ario.getCostDetails(costDetailsParams);
306
285
  if (costDetails.fundingPlan) {
307
286
  if (costDetails.fundingPlan.shortfall > 0) {
@@ -70,14 +70,14 @@ export class ANTVersionsWritable extends ANTVersionsReadable {
70
70
  super(config);
71
71
  this.signer = createAoSigner(signer);
72
72
  }
73
- async addVersion({ version, moduleId, luaSourceId, notes, }, { tags }) {
73
+ async addVersion(params, { tags }) {
74
74
  return this.process.send({
75
75
  tags: pruneTags([
76
76
  { name: 'Action', value: 'Add-Version' },
77
- { name: 'Version', value: version },
78
- { name: 'Module-Id', value: moduleId },
79
- { name: 'Lua-Source-Id', value: luaSourceId },
80
- { name: 'Notes', value: notes },
77
+ { name: 'Version', value: params.version },
78
+ { name: 'Module-Id', value: params.moduleId },
79
+ { name: 'Lua-Source-Id', value: params.luaSourceId },
80
+ { name: 'Notes', value: params.notes },
81
81
  ...(tags ?? []),
82
82
  ]),
83
83
  signer: this.signer,
@@ -22,5 +22,3 @@ export * from './faucet.js';
22
22
  // ao
23
23
  export * from './io.js';
24
24
  export * from './contracts/ao-process.js';
25
- // wayfinder
26
- export * from './wayfinder/index.js';
@@ -22,7 +22,6 @@ import { defaultArweave } from './arweave.js';
22
22
  import { AOProcess } from './contracts/ao-process.js';
23
23
  import { InvalidContractConfigurationError } from './error.js';
24
24
  import { createFaucet } from './faucet.js';
25
- import { TurboArNSPaymentFactory, TurboArNSPaymentProviderAuthenticated, isTurboArNSSigner, } from './turbo.js';
26
25
  export class ARIO {
27
26
  // Implementation
28
27
  static init(config) {
@@ -48,6 +47,10 @@ export class ARIO {
48
47
  ...config,
49
48
  process: new AOProcess({
50
49
  processId: ARIO_MAINNET_PROCESS_ID,
50
+ ao: connect({
51
+ CU_URL: 'https://cu.ardrive.io',
52
+ ...config?.process?.ao,
53
+ }),
51
54
  }),
52
55
  });
53
56
  }
@@ -86,7 +89,6 @@ export class ARIOReadable {
86
89
  process;
87
90
  epochSettings;
88
91
  arweave;
89
- paymentProvider; // TODO: this could be an array/map of payment providers
90
92
  constructor(config) {
91
93
  this.arweave = config?.arweave ?? defaultArweave;
92
94
  if (config === undefined || Object.keys(config).length === 0) {
@@ -105,9 +107,6 @@ export class ARIOReadable {
105
107
  else {
106
108
  throw new InvalidContractConfigurationError();
107
109
  }
108
- this.paymentProvider = TurboArNSPaymentFactory.init({
109
- paymentUrl: config?.paymentUrl,
110
- });
111
110
  }
112
111
  async getInfo() {
113
112
  return this.process.read({
@@ -439,20 +438,6 @@ export class ARIOReadable {
439
438
  // TODO: Can overload this function to refine different types of cost details params
440
439
  async getCostDetails({ intent, type, years, name, quantity, fromAddress, fundFrom, }) {
441
440
  const replacedBuyRecordWithBuyName = intent === 'Buy-Record' ? 'Buy-Name' : intent;
442
- if (fundFrom === 'turbo') {
443
- const { mARIO, winc } = await this.paymentProvider.getArNSPriceDetails({
444
- intent: replacedBuyRecordWithBuyName,
445
- name,
446
- quantity,
447
- type,
448
- years,
449
- });
450
- return {
451
- tokenCost: +mARIO,
452
- wincQty: winc,
453
- discounts: [],
454
- };
455
- }
456
441
  const allTags = [
457
442
  { name: 'Action', value: 'Cost-Details' },
458
443
  {
@@ -619,8 +604,7 @@ export class ARIOReadable {
619
604
  }
620
605
  export class ARIOWriteable extends ARIOReadable {
621
606
  signer;
622
- paymentProvider;
623
- constructor({ signer, paymentUrl, ...config }) {
607
+ constructor({ signer, ...config }) {
624
608
  if (config === undefined) {
625
609
  super({
626
610
  process: new AOProcess({
@@ -632,10 +616,6 @@ export class ARIOWriteable extends ARIOReadable {
632
616
  super(config);
633
617
  }
634
618
  this.signer = createAoSigner(signer);
635
- this.paymentProvider = TurboArNSPaymentFactory.init({
636
- signer: isTurboArNSSigner(signer) ? signer : undefined,
637
- paymentUrl,
638
- });
639
619
  }
640
620
  async transfer({ target, qty, }, options) {
641
621
  const { tags = [] } = options || {};
@@ -910,15 +890,6 @@ export class ARIOWriteable extends ARIOReadable {
910
890
  });
911
891
  }
912
892
  async buyRecord(params, options) {
913
- if (params.fundFrom === 'turbo') {
914
- if (!(this.paymentProvider instanceof TurboArNSPaymentProviderAuthenticated)) {
915
- throw new Error('Turbo funding is not supported for this payment provider');
916
- }
917
- return this.paymentProvider.initiateArNSPurchase({
918
- intent: 'Buy-Name',
919
- ...params,
920
- });
921
- }
922
893
  const { tags = [] } = options || {};
923
894
  const allTags = [
924
895
  ...tags,
@@ -943,15 +914,6 @@ export class ARIOWriteable extends ARIOReadable {
943
914
  * @returns {Promise<AoMessageResult>} The result of the upgrade
944
915
  */
945
916
  async upgradeRecord(params, options) {
946
- if (params.fundFrom === 'turbo') {
947
- if (!(this.paymentProvider instanceof TurboArNSPaymentProviderAuthenticated)) {
948
- throw new Error('Turbo funding is not supported for this payment provider');
949
- }
950
- return this.paymentProvider.initiateArNSPurchase({
951
- intent: 'Upgrade-Name',
952
- name: params.name,
953
- });
954
- }
955
917
  const { tags = [] } = options || {};
956
918
  const allTags = [
957
919
  ...tags,
@@ -974,15 +936,6 @@ export class ARIOWriteable extends ARIOReadable {
974
936
  * @returns {Promise<AoMessageResult>} The result of the extension
975
937
  */
976
938
  async extendLease(params, options) {
977
- if (params.fundFrom === 'turbo') {
978
- if (!(this.paymentProvider instanceof TurboArNSPaymentProviderAuthenticated)) {
979
- throw new Error('Turbo funding is not supported for this payment provider');
980
- }
981
- return this.paymentProvider.initiateArNSPurchase({
982
- intent: 'Extend-Lease',
983
- ...params,
984
- });
985
- }
986
939
  const { tags = [] } = options || {};
987
940
  const allTags = [
988
941
  ...tags,
@@ -997,15 +950,6 @@ export class ARIOWriteable extends ARIOReadable {
997
950
  });
998
951
  }
999
952
  async increaseUndernameLimit(params, options) {
1000
- if (params.fundFrom === 'turbo') {
1001
- if (!(this.paymentProvider instanceof TurboArNSPaymentProviderAuthenticated)) {
1002
- throw new Error('Turbo funding is not supported for this payment provider');
1003
- }
1004
- return this.paymentProvider.initiateArNSPurchase({
1005
- intent: 'Increase-Undername-Limit',
1006
- ...params,
1007
- });
1008
- }
1009
953
  const { tags = [] } = options || {};
1010
954
  const allTags = [
1011
955
  ...tags,
@@ -1042,9 +986,6 @@ export class ARIOWriteable extends ARIOReadable {
1042
986
  });
1043
987
  }
1044
988
  async requestPrimaryName(params, options) {
1045
- if (params.fundFrom === 'turbo') {
1046
- throw new Error('Turbo funding is not yet supported for primary name requests');
1047
- }
1048
989
  const { tags = [] } = options || {};
1049
990
  const allTags = [
1050
991
  ...tags,
@@ -77,17 +77,6 @@ export const AntStateSchema = z.object({
77
77
  .boolean()
78
78
  .describe('Flag indicating whether the ANT has been initialized.'),
79
79
  });
80
- export const SpawnANTStateSchema = z.object({
81
- name: z.string().describe('The name of the ANT.'),
82
- ticker: z.string().describe('The ticker symbol for the ANT.'),
83
- description: z.string().describe('The description for the ANT.'),
84
- keywords: AntKeywordsSchema.describe('The keywords for the ANT.'),
85
- owner: AOAddressSchema.describe('The Owners address.'),
86
- controllers: AntControllersSchema.describe('Controllers of the ANT who have administrative privileges.'),
87
- records: AntRecordsSchema.describe('Records associated with the ANT.'),
88
- balances: AntBalancesSchema.describe('Balance details for each address holding the ANT.'),
89
- logo: ArweaveTxIdSchema.describe('Transaction ID of the ANT logo.'),
90
- });
91
80
  export const AntReadHandlers = [
92
81
  'balance',
93
82
  'balances',
@@ -19,4 +19,3 @@ export * from './common.js';
19
19
  export * from './faucet.js';
20
20
  export * from './io.js';
21
21
  export * from './token.js';
22
- export * from './wayfinder.js';
@@ -22,7 +22,7 @@ export const intentsUsingYears = [
22
22
  export const isValidIntent = (intent) => {
23
23
  return validIntents.indexOf(intent) !== -1;
24
24
  };
25
- export const fundFromOptions = ['balance', 'stakes', 'any', 'turbo'];
25
+ export const fundFromOptions = ['balance', 'stakes', 'any'];
26
26
  export const isValidFundFrom = (fundFrom) => {
27
27
  return fundFromOptions.indexOf(fundFrom) !== -1;
28
28
  };
@@ -19,13 +19,8 @@ import { z } from 'zod';
19
19
  import { defaultArweave } from '../common/arweave.js';
20
20
  import { AOProcess, Logger } from '../common/index.js';
21
21
  import { ANT_LUA_ID, ANT_REGISTRY_ID, AOS_MODULE_ID, AO_AUTHORITY, DEFAULT_SCHEDULER_ID, } from '../constants.js';
22
- import { SpawnANTStateSchema } from '../types/ant.js';
23
- import { parseSchemaResult } from './schema.js';
24
22
  export async function spawnANT({ signer, module = AOS_MODULE_ID, ao = connect(), scheduler = DEFAULT_SCHEDULER_ID, state, antRegistryId = ANT_REGISTRY_ID, logger = Logger.default, authority = AO_AUTHORITY, }) {
25
23
  // TODO: use On-Boot data handler for bootstrapping state instead of initialize-state
26
- if (state) {
27
- parseSchemaResult(SpawnANTStateSchema, state);
28
- }
29
24
  const processId = await ao.spawn({
30
25
  module,
31
26
  scheduler,
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '3.10.0-alpha.6';
17
+ export const version = '3.10.1';
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { ArweaveSigner, ArconnectSigner, InjectedEthereumSigner, EthereumSigner, } from '@dha-team/arbundles';
16
+ export { ArweaveSigner, ArconnectSigner } from '@dha-team/arbundles';
17
17
  export * from '../types/index.js';
18
18
  export * from '../common/index.js';
19
19
  export * from '../constants.js';
@@ -16,6 +16,6 @@
16
16
  import { AoANTSetBaseNameRecordParams, AoANTSetUndernameRecordParams } from '../../types/ant.js';
17
17
  import { CLIWriteOptionsFromAoAntParams } from '../types.js';
18
18
  /** @deprecated -- use set-ant-base-name and set-ant-undername */
19
- export declare function setAntRecordCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetUndernameRecordParams>): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
20
- export declare function setAntBaseNameCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetBaseNameRecordParams>): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
21
- export declare function setAntUndernameCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetUndernameRecordParams>): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
19
+ export declare function setAntRecordCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetUndernameRecordParams>): Promise<import("../../types/common.js").AoMessageResult>;
20
+ export declare function setAntBaseNameCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetBaseNameRecordParams>): Promise<import("../../types/common.js").AoMessageResult>;
21
+ export declare function setAntUndernameCLICommand(o: CLIWriteOptionsFromAoAntParams<AoANTSetUndernameRecordParams>): Promise<import("../../types/common.js").AoMessageResult>;
@@ -19,4 +19,4 @@ export declare function buyRecordCLICommand(o: CLIWriteOptionsFromAoParams<AoBuy
19
19
  export declare function upgradeRecordCLICommand(o: CLIWriteOptionsFromAoParams<AoArNSPurchaseParams>): Promise<import("../../types/common.js").AoMessageResult>;
20
20
  export declare function extendLeaseCLICommand(o: CLIWriteOptionsFromAoParams<AoExtendLeaseParams>): Promise<import("../../types/common.js").AoMessageResult>;
21
21
  export declare function increaseUndernameLimitCLICommand(o: CLIWriteOptionsFromAoParams<AoIncreaseUndernameLimitParams>): Promise<import("../../types/common.js").AoMessageResult>;
22
- export declare function requestPrimaryNameCLICommand(o: CLIWriteOptionsFromAoParams<AoArNSPurchaseParams>): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
22
+ export declare function requestPrimaryNameCLICommand(o: CLIWriteOptionsFromAoParams<AoArNSPurchaseParams>): Promise<import("../../types/common.js").AoMessageResult>;
@@ -1,11 +1,11 @@
1
1
  import { AddressAndVaultIdCLIWriteOptions, DecreaseDelegateStakeCLIOptions, JoinNetworkCLIOptions, OperatorStakeCLIOptions, RedelegateStakeCLIOptions, TransferCLIOptions, UpdateGatewaySettingsCLIOptions, WriteActionCLIOptions } from '../types.js';
2
2
  export declare function joinNetwork(options: JoinNetworkCLIOptions): Promise<{
3
- joinNetworkResult: import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>;
3
+ joinNetworkResult: import("../../types/common.js").AoMessageResult;
4
4
  joinedAddress: string;
5
5
  message: string;
6
6
  }>;
7
7
  export declare function updateGatewaySettings(options: UpdateGatewaySettingsCLIOptions): Promise<{
8
- updateGatewaySettingsResult: import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>;
8
+ updateGatewaySettingsResult: import("../../types/common.js").AoMessageResult;
9
9
  updatedGatewayAddress: string;
10
10
  message: string;
11
11
  }>;
@@ -13,26 +13,26 @@ export declare function leaveNetwork(options: WriteActionCLIOptions): Promise<im
13
13
  export declare function saveObservations(o: WriteActionCLIOptions & {
14
14
  failedGateways?: string[];
15
15
  transactionId?: string;
16
- }): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
16
+ }): Promise<import("../../types/common.js").AoMessageResult>;
17
17
  export declare function increaseOperatorStake(o: OperatorStakeCLIOptions): Promise<import("../../types/common.js").WriteOptions>;
18
- export declare function decreaseOperatorStake(o: OperatorStakeCLIOptions): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
19
- export declare function instantWithdrawal(o: AddressAndVaultIdCLIWriteOptions): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
20
- export declare function cancelWithdrawal(o: AddressAndVaultIdCLIWriteOptions): Promise<import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>>;
18
+ export declare function decreaseOperatorStake(o: OperatorStakeCLIOptions): Promise<import("../../types/common.js").AoMessageResult>;
19
+ export declare function instantWithdrawal(o: AddressAndVaultIdCLIWriteOptions): Promise<import("../../types/common.js").AoMessageResult>;
20
+ export declare function cancelWithdrawal(o: AddressAndVaultIdCLIWriteOptions): Promise<import("../../types/common.js").AoMessageResult>;
21
21
  export declare function delegateStake(options: TransferCLIOptions): Promise<{
22
22
  senderAddress: string;
23
- transferResult: import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>;
23
+ transferResult: import("../../types/common.js").AoMessageResult;
24
24
  message: string;
25
25
  } | {
26
26
  message: string;
27
27
  }>;
28
28
  export declare function decreaseDelegateStake(options: DecreaseDelegateStakeCLIOptions): Promise<{
29
29
  targetGateway: string;
30
- decreaseDelegateStakeResult: import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>;
30
+ decreaseDelegateStakeResult: import("../../types/common.js").AoMessageResult;
31
31
  message: string;
32
32
  }>;
33
33
  export declare function redelegateStake(options: RedelegateStakeCLIOptions): Promise<{
34
34
  sourceGateway: string;
35
35
  targetGateway: string;
36
- redelegateStakeResult: import("../../types/common.js").AoMessageResult<Record<string, string | number | boolean | null>>;
36
+ redelegateStakeResult: import("../../types/common.js").AoMessageResult;
37
37
  message: string;
38
38
  }>;