@ar.io/sdk 3.22.0-alpha.2 → 3.22.0-alpha.4
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/bundles/web.bundle.min.js +27 -27
- package/lib/cjs/cli/utils.js +2 -0
- package/lib/cjs/common/ant.js +10 -2
- package/lib/cjs/common/io.js +2 -0
- package/lib/cjs/utils/ao.js +10 -3
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/utils.js +2 -0
- package/lib/esm/common/ant.js +10 -2
- package/lib/esm/common/io.js +2 -0
- package/lib/esm/utils/ao.js +10 -3
- package/lib/esm/version.js +1 -1
- package/lib/types/utils/ao.d.ts +4 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +4 -4
package/lib/cjs/cli/utils.js
CHANGED
|
@@ -489,6 +489,7 @@ function ANTProcessFromOptions(options) {
|
|
|
489
489
|
function readANTFromOptions(options) {
|
|
490
490
|
return index_js_1.ANT.init({
|
|
491
491
|
process: ANTProcessFromOptions(options),
|
|
492
|
+
hyperbeamUrl: options.hyperbeamUrl,
|
|
492
493
|
});
|
|
493
494
|
}
|
|
494
495
|
function writeANTFromOptions(options, signer) {
|
|
@@ -496,6 +497,7 @@ function writeANTFromOptions(options, signer) {
|
|
|
496
497
|
return index_js_1.ANT.init({
|
|
497
498
|
process: ANTProcessFromOptions(options),
|
|
498
499
|
signer,
|
|
500
|
+
hyperbeamUrl: options.hyperbeamUrl,
|
|
499
501
|
});
|
|
500
502
|
}
|
|
501
503
|
function booleanFromOptions(options, key) {
|
package/lib/cjs/common/ant.js
CHANGED
|
@@ -67,6 +67,7 @@ class ANT {
|
|
|
67
67
|
: false;
|
|
68
68
|
const ario = index_js_2.ARIO.init({
|
|
69
69
|
process: new index_js_2.AOProcess({ processId: arioProcessId, ao }),
|
|
70
|
+
hyperbeamUrl,
|
|
70
71
|
});
|
|
71
72
|
const getAllAffiliatedNames = async () => {
|
|
72
73
|
let cursor = undefined;
|
|
@@ -147,6 +148,7 @@ class ANT {
|
|
|
147
148
|
logger,
|
|
148
149
|
antRegistryId,
|
|
149
150
|
onSigningProgress,
|
|
151
|
+
hyperbeamUrl,
|
|
150
152
|
});
|
|
151
153
|
// we could parallelize this, but then signing progress would be harder to track
|
|
152
154
|
const reassignedNames = {};
|
|
@@ -471,7 +473,10 @@ class AoANTReadable {
|
|
|
471
473
|
const currentModuleId = await this.getModuleId({ graphqlUrl, retries });
|
|
472
474
|
// Get all versions from the ANT registry
|
|
473
475
|
const antVersions = ant_versions_js_1.ANTVersions.init({
|
|
474
|
-
|
|
476
|
+
process: new index_js_2.AOProcess({
|
|
477
|
+
processId: antRegistryId,
|
|
478
|
+
ao: this.process.ao,
|
|
479
|
+
}),
|
|
475
480
|
});
|
|
476
481
|
const versions = await antVersions.getANTVersions();
|
|
477
482
|
// Find the version that matches our module ID
|
|
@@ -510,7 +515,10 @@ class AoANTReadable {
|
|
|
510
515
|
});
|
|
511
516
|
// Get all versions from the ANT registry
|
|
512
517
|
const antVersions = ant_versions_js_1.ANTVersions.init({
|
|
513
|
-
|
|
518
|
+
process: new index_js_2.AOProcess({
|
|
519
|
+
processId: antRegistryId,
|
|
520
|
+
ao: this.process.ao,
|
|
521
|
+
}),
|
|
514
522
|
});
|
|
515
523
|
const latestVersion = await antVersions.getLatestANTVersion();
|
|
516
524
|
return currentVersion === latestVersion.version;
|
package/lib/cjs/common/io.js
CHANGED
|
@@ -681,6 +681,7 @@ class ARIOReadable {
|
|
|
681
681
|
ao: this.process.ao,
|
|
682
682
|
processId: nameData.processId,
|
|
683
683
|
}),
|
|
684
|
+
hyperbeamUrl: this.hyperbeamUrl,
|
|
684
685
|
});
|
|
685
686
|
const [owner, antRecord] = await Promise.all([
|
|
686
687
|
ant.getOwner(),
|
|
@@ -1318,6 +1319,7 @@ class ARIOWriteable extends ARIOReadable {
|
|
|
1318
1319
|
ao: this.process.ao,
|
|
1319
1320
|
}),
|
|
1320
1321
|
signer: this.signer,
|
|
1322
|
+
hyperbeamUrl: this.hyperbeamUrl,
|
|
1321
1323
|
});
|
|
1322
1324
|
// approve the primary name request with the ant
|
|
1323
1325
|
const approveResult = await antClient.approvePrimaryNameRequest({
|
package/lib/cjs/utils/ao.js
CHANGED
|
@@ -39,7 +39,7 @@ async function spawnANT({ signer, module, ao = (0, aoconnect_1.connect)({
|
|
|
39
39
|
MODE: 'legacy',
|
|
40
40
|
}), scheduler = constants_js_1.DEFAULT_SCHEDULER_ID, state, tags = [], antRegistryId = constants_js_1.ANT_REGISTRY_ID, logger = index_js_1.Logger.default, authority = constants_js_1.AO_AUTHORITY, onSigningProgress = (name, payload) => {
|
|
41
41
|
logger.debug('Signing progress', { name, payload });
|
|
42
|
-
}, }) {
|
|
42
|
+
}, hyperbeamUrl, }) {
|
|
43
43
|
if (state) {
|
|
44
44
|
(0, schema_js_1.parseSchemaResult)(ant_js_1.SpawnANTStateSchema, state);
|
|
45
45
|
}
|
|
@@ -194,7 +194,12 @@ async function spawnANT({ signer, module, ao = (0, aoconnect_1.connect)({
|
|
|
194
194
|
// check the ACL for the owner
|
|
195
195
|
const antRegistry = ant_registry_js_1.ANTRegistry.init({
|
|
196
196
|
signer,
|
|
197
|
-
|
|
197
|
+
process: new index_js_1.AOProcess({
|
|
198
|
+
processId: antRegistryId,
|
|
199
|
+
ao,
|
|
200
|
+
logger,
|
|
201
|
+
}),
|
|
202
|
+
hyperbeamUrl,
|
|
198
203
|
});
|
|
199
204
|
let attempts = 0;
|
|
200
205
|
const maxAttempts = 5;
|
|
@@ -225,7 +230,7 @@ async function spawnANT({ signer, module, ao = (0, aoconnect_1.connect)({
|
|
|
225
230
|
}
|
|
226
231
|
async function forkANT({ signer, antProcessId, logger = index_js_1.Logger.default, ao, moduleId, antRegistryId = constants_js_1.ANT_REGISTRY_ID, onSigningProgress = (name, payload) => {
|
|
227
232
|
logger.debug('Forking ANT', { name, payload });
|
|
228
|
-
}, }) {
|
|
233
|
+
}, hyperbeamUrl, }) {
|
|
229
234
|
// get the state of the current ANT and use it to spawn a new ANT
|
|
230
235
|
const ant = index_js_1.ANT.init({
|
|
231
236
|
process: new index_js_1.AOProcess({
|
|
@@ -233,6 +238,7 @@ async function forkANT({ signer, antProcessId, logger = index_js_1.Logger.defaul
|
|
|
233
238
|
ao,
|
|
234
239
|
logger,
|
|
235
240
|
}),
|
|
241
|
+
hyperbeamUrl,
|
|
236
242
|
});
|
|
237
243
|
const state = await ant.getState();
|
|
238
244
|
if (state === undefined) {
|
|
@@ -256,6 +262,7 @@ async function forkANT({ signer, antProcessId, logger = index_js_1.Logger.defaul
|
|
|
256
262
|
balances: state.Balances,
|
|
257
263
|
logo: state.Logo,
|
|
258
264
|
},
|
|
265
|
+
hyperbeamUrl,
|
|
259
266
|
});
|
|
260
267
|
return forkedProcessId;
|
|
261
268
|
}
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/cli/utils.js
CHANGED
|
@@ -435,6 +435,7 @@ function ANTProcessFromOptions(options) {
|
|
|
435
435
|
export function readANTFromOptions(options) {
|
|
436
436
|
return ANT.init({
|
|
437
437
|
process: ANTProcessFromOptions(options),
|
|
438
|
+
hyperbeamUrl: options.hyperbeamUrl,
|
|
438
439
|
});
|
|
439
440
|
}
|
|
440
441
|
export function writeANTFromOptions(options, signer) {
|
|
@@ -442,6 +443,7 @@ export function writeANTFromOptions(options, signer) {
|
|
|
442
443
|
return ANT.init({
|
|
443
444
|
process: ANTProcessFromOptions(options),
|
|
444
445
|
signer,
|
|
446
|
+
hyperbeamUrl: options.hyperbeamUrl,
|
|
445
447
|
});
|
|
446
448
|
}
|
|
447
449
|
export function booleanFromOptions(options, key) {
|
package/lib/esm/common/ant.js
CHANGED
|
@@ -64,6 +64,7 @@ export class ANT {
|
|
|
64
64
|
: false;
|
|
65
65
|
const ario = ARIO.init({
|
|
66
66
|
process: new AOProcess({ processId: arioProcessId, ao }),
|
|
67
|
+
hyperbeamUrl,
|
|
67
68
|
});
|
|
68
69
|
const getAllAffiliatedNames = async () => {
|
|
69
70
|
let cursor = undefined;
|
|
@@ -144,6 +145,7 @@ export class ANT {
|
|
|
144
145
|
logger,
|
|
145
146
|
antRegistryId,
|
|
146
147
|
onSigningProgress,
|
|
148
|
+
hyperbeamUrl,
|
|
147
149
|
});
|
|
148
150
|
// we could parallelize this, but then signing progress would be harder to track
|
|
149
151
|
const reassignedNames = {};
|
|
@@ -467,7 +469,10 @@ export class AoANTReadable {
|
|
|
467
469
|
const currentModuleId = await this.getModuleId({ graphqlUrl, retries });
|
|
468
470
|
// Get all versions from the ANT registry
|
|
469
471
|
const antVersions = ANTVersions.init({
|
|
470
|
-
|
|
472
|
+
process: new AOProcess({
|
|
473
|
+
processId: antRegistryId,
|
|
474
|
+
ao: this.process.ao,
|
|
475
|
+
}),
|
|
471
476
|
});
|
|
472
477
|
const versions = await antVersions.getANTVersions();
|
|
473
478
|
// Find the version that matches our module ID
|
|
@@ -506,7 +511,10 @@ export class AoANTReadable {
|
|
|
506
511
|
});
|
|
507
512
|
// Get all versions from the ANT registry
|
|
508
513
|
const antVersions = ANTVersions.init({
|
|
509
|
-
|
|
514
|
+
process: new AOProcess({
|
|
515
|
+
processId: antRegistryId,
|
|
516
|
+
ao: this.process.ao,
|
|
517
|
+
}),
|
|
510
518
|
});
|
|
511
519
|
const latestVersion = await antVersions.getLatestANTVersion();
|
|
512
520
|
return currentVersion === latestVersion.version;
|
package/lib/esm/common/io.js
CHANGED
|
@@ -677,6 +677,7 @@ export class ARIOReadable {
|
|
|
677
677
|
ao: this.process.ao,
|
|
678
678
|
processId: nameData.processId,
|
|
679
679
|
}),
|
|
680
|
+
hyperbeamUrl: this.hyperbeamUrl,
|
|
680
681
|
});
|
|
681
682
|
const [owner, antRecord] = await Promise.all([
|
|
682
683
|
ant.getOwner(),
|
|
@@ -1313,6 +1314,7 @@ export class ARIOWriteable extends ARIOReadable {
|
|
|
1313
1314
|
ao: this.process.ao,
|
|
1314
1315
|
}),
|
|
1315
1316
|
signer: this.signer,
|
|
1317
|
+
hyperbeamUrl: this.hyperbeamUrl,
|
|
1316
1318
|
});
|
|
1317
1319
|
// approve the primary name request with the ant
|
|
1318
1320
|
const approveResult = await antClient.approvePrimaryNameRequest({
|
package/lib/esm/utils/ao.js
CHANGED
|
@@ -27,7 +27,7 @@ export async function spawnANT({ signer, module, ao = connect({
|
|
|
27
27
|
MODE: 'legacy',
|
|
28
28
|
}), scheduler = DEFAULT_SCHEDULER_ID, state, tags = [], antRegistryId = ANT_REGISTRY_ID, logger = Logger.default, authority = AO_AUTHORITY, onSigningProgress = (name, payload) => {
|
|
29
29
|
logger.debug('Signing progress', { name, payload });
|
|
30
|
-
}, }) {
|
|
30
|
+
}, hyperbeamUrl, }) {
|
|
31
31
|
if (state) {
|
|
32
32
|
parseSchemaResult(SpawnANTStateSchema, state);
|
|
33
33
|
}
|
|
@@ -182,7 +182,12 @@ export async function spawnANT({ signer, module, ao = connect({
|
|
|
182
182
|
// check the ACL for the owner
|
|
183
183
|
const antRegistry = ANTRegistry.init({
|
|
184
184
|
signer,
|
|
185
|
-
|
|
185
|
+
process: new AOProcess({
|
|
186
|
+
processId: antRegistryId,
|
|
187
|
+
ao,
|
|
188
|
+
logger,
|
|
189
|
+
}),
|
|
190
|
+
hyperbeamUrl,
|
|
186
191
|
});
|
|
187
192
|
let attempts = 0;
|
|
188
193
|
const maxAttempts = 5;
|
|
@@ -213,7 +218,7 @@ export async function spawnANT({ signer, module, ao = connect({
|
|
|
213
218
|
}
|
|
214
219
|
export async function forkANT({ signer, antProcessId, logger = Logger.default, ao, moduleId, antRegistryId = ANT_REGISTRY_ID, onSigningProgress = (name, payload) => {
|
|
215
220
|
logger.debug('Forking ANT', { name, payload });
|
|
216
|
-
}, }) {
|
|
221
|
+
}, hyperbeamUrl, }) {
|
|
217
222
|
// get the state of the current ANT and use it to spawn a new ANT
|
|
218
223
|
const ant = ANT.init({
|
|
219
224
|
process: new AOProcess({
|
|
@@ -221,6 +226,7 @@ export async function forkANT({ signer, antProcessId, logger = Logger.default, a
|
|
|
221
226
|
ao,
|
|
222
227
|
logger,
|
|
223
228
|
}),
|
|
229
|
+
hyperbeamUrl,
|
|
224
230
|
});
|
|
225
231
|
const state = await ant.getState();
|
|
226
232
|
if (state === undefined) {
|
|
@@ -244,6 +250,7 @@ export async function forkANT({ signer, antProcessId, logger = Logger.default, a
|
|
|
244
250
|
balances: state.Balances,
|
|
245
251
|
logo: state.Logo,
|
|
246
252
|
},
|
|
253
|
+
hyperbeamUrl,
|
|
247
254
|
});
|
|
248
255
|
return forkedProcessId;
|
|
249
256
|
}
|
package/lib/esm/version.js
CHANGED
package/lib/types/utils/ao.d.ts
CHANGED
|
@@ -28,9 +28,10 @@ export type SpawnANTParams = {
|
|
|
28
28
|
* Callback function to be called when signing progress is made
|
|
29
29
|
*/
|
|
30
30
|
onSigningProgress?: (name: keyof SpawnAntProgressEvent, payload: SpawnAntProgressEvent[keyof SpawnAntProgressEvent]) => void;
|
|
31
|
+
hyperbeamUrl?: string;
|
|
31
32
|
};
|
|
32
|
-
export declare function spawnANT({ signer, module, ao, scheduler, state, tags, antRegistryId, logger, authority, onSigningProgress, }: SpawnANTParams): Promise<ProcessId>;
|
|
33
|
-
export declare function forkANT({ signer, antProcessId, logger, ao, moduleId, antRegistryId, onSigningProgress, }: {
|
|
33
|
+
export declare function spawnANT({ signer, module, ao, scheduler, state, tags, antRegistryId, logger, authority, onSigningProgress, hyperbeamUrl, }: SpawnANTParams): Promise<ProcessId>;
|
|
34
|
+
export declare function forkANT({ signer, antProcessId, logger, ao, moduleId, antRegistryId, onSigningProgress, hyperbeamUrl, }: {
|
|
34
35
|
signer: AoSigner;
|
|
35
36
|
antProcessId: string;
|
|
36
37
|
moduleId?: string;
|
|
@@ -38,6 +39,7 @@ export declare function forkANT({ signer, antProcessId, logger, ao, moduleId, an
|
|
|
38
39
|
ao?: AoClient;
|
|
39
40
|
antRegistryId?: string;
|
|
40
41
|
onSigningProgress?: (name: keyof SpawnAntProgressEvent, payload: SpawnAntProgressEvent[keyof SpawnAntProgressEvent]) => void;
|
|
42
|
+
hyperbeamUrl?: string;
|
|
41
43
|
}): Promise<string>;
|
|
42
44
|
/**
|
|
43
45
|
* @deprecated
|
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": "3.22.0-alpha.
|
|
3
|
+
"version": "3.22.0-alpha.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"@commitlint/config-conventional": "^17.1.0",
|
|
90
90
|
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
91
91
|
"@semantic-release/changelog": "^6.0.3",
|
|
92
|
-
"@semantic-release/exec": "^
|
|
92
|
+
"@semantic-release/exec": "^7.1.0",
|
|
93
93
|
"@semantic-release/git": "^10.0.1",
|
|
94
|
-
"@semantic-release/npm": "^
|
|
94
|
+
"@semantic-release/npm": "^13.1.1",
|
|
95
95
|
"@swc/core": "^1.11.22",
|
|
96
96
|
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
|
97
97
|
"@types/node": "^22.14.1",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"nock": "^13.5.5",
|
|
122
122
|
"prettier": "^3.0.2",
|
|
123
123
|
"rimraf": "^5.0.1",
|
|
124
|
-
"semantic-release": "^
|
|
124
|
+
"semantic-release": "^25.0.1",
|
|
125
125
|
"sinon": "^15.2.0",
|
|
126
126
|
"testcontainers": "^10.13.1",
|
|
127
127
|
"ts-node": "^10.9.2",
|