@ar.io/sdk 2.2.0-alpha.3 → 2.2.0
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 +50 -50
- package/lib/cjs/utils/ao.js +7 -11
- package/lib/cjs/version.js +1 -1
- package/lib/esm/utils/ao.js +8 -12
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant-registry.d.ts +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/utils/ao.js
CHANGED
|
@@ -24,10 +24,12 @@ const arweave_js_1 = require("../common/arweave.js");
|
|
|
24
24
|
const index_js_1 = require("../common/index.js");
|
|
25
25
|
const constants_js_1 = require("../constants.js");
|
|
26
26
|
async function spawnANT({ signer, module = constants_js_1.AOS_MODULE_ID, luaCodeTxId = constants_js_1.ANT_LUA_ID, ao = (0, aoconnect_1.connect)(), scheduler = constants_js_1.DEFAULT_SCHEDULER_ID, state, stateContractTxId, antRegistryId = constants_js_1.ANT_REGISTRY_ID, }) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const registryClient = index_js_1.ANTRegistry.init({
|
|
28
|
+
process: new index_js_1.AOProcess({
|
|
29
|
+
processId: antRegistryId,
|
|
30
|
+
ao,
|
|
31
|
+
}),
|
|
32
|
+
signer: signer,
|
|
31
33
|
});
|
|
32
34
|
//TODO: cache locally and only fetch if not cached
|
|
33
35
|
const luaString = (await arweave_js_1.defaultArweave.transactions.getData(luaCodeTxId, {
|
|
@@ -70,13 +72,7 @@ async function spawnANT({ signer, module = constants_js_1.AOS_MODULE_ID, luaCode
|
|
|
70
72
|
signer,
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
|
-
await registryClient.
|
|
74
|
-
tags: [
|
|
75
|
-
{ name: 'Action', value: 'Register' },
|
|
76
|
-
{ name: 'Process-Id', value: processId },
|
|
77
|
-
],
|
|
78
|
-
signer,
|
|
79
|
-
});
|
|
75
|
+
await registryClient.register({ processId });
|
|
80
76
|
return processId;
|
|
81
77
|
}
|
|
82
78
|
exports.spawnANT = spawnANT;
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/utils/ao.js
CHANGED
|
@@ -18,13 +18,15 @@ import { connect, createDataItemSigner } from '@permaweb/aoconnect';
|
|
|
18
18
|
import { createData } from 'arbundles';
|
|
19
19
|
import { z } from 'zod';
|
|
20
20
|
import { defaultArweave } from '../common/arweave.js';
|
|
21
|
-
import { AOProcess, Logger } from '../common/index.js';
|
|
21
|
+
import { ANTRegistry, AOProcess, Logger } from '../common/index.js';
|
|
22
22
|
import { ANT_LUA_ID, ANT_REGISTRY_ID, AOS_MODULE_ID, DEFAULT_SCHEDULER_ID, } from '../constants.js';
|
|
23
23
|
export async function spawnANT({ signer, module = AOS_MODULE_ID, luaCodeTxId = ANT_LUA_ID, ao = connect(), scheduler = DEFAULT_SCHEDULER_ID, state, stateContractTxId, antRegistryId = ANT_REGISTRY_ID, }) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const registryClient = ANTRegistry.init({
|
|
25
|
+
process: new AOProcess({
|
|
26
|
+
processId: antRegistryId,
|
|
27
|
+
ao,
|
|
28
|
+
}),
|
|
29
|
+
signer: signer,
|
|
28
30
|
});
|
|
29
31
|
//TODO: cache locally and only fetch if not cached
|
|
30
32
|
const luaString = (await defaultArweave.transactions.getData(luaCodeTxId, {
|
|
@@ -67,13 +69,7 @@ export async function spawnANT({ signer, module = AOS_MODULE_ID, luaCodeTxId = A
|
|
|
67
69
|
signer,
|
|
68
70
|
});
|
|
69
71
|
}
|
|
70
|
-
await registryClient.
|
|
71
|
-
tags: [
|
|
72
|
-
{ name: 'Action', value: 'Register' },
|
|
73
|
-
{ name: 'Process-Id', value: processId },
|
|
74
|
-
],
|
|
75
|
-
signer,
|
|
76
|
-
});
|
|
72
|
+
await registryClient.register({ processId });
|
|
77
73
|
return processId;
|
|
78
74
|
}
|
|
79
75
|
export async function evolveANT({ signer, processId, luaCodeTxId = ANT_LUA_ID, ao = connect(), }) {
|
package/lib/esm/version.js
CHANGED
|
@@ -5,7 +5,7 @@ export declare class ANTRegistry {
|
|
|
5
5
|
static init(config: Required<ProcessConfiguration> & {
|
|
6
6
|
signer?: undefined;
|
|
7
7
|
}): AoANTRegistryRead;
|
|
8
|
-
static init({ signer, ...config }: WithSigner<Required<ProcessConfiguration>>):
|
|
8
|
+
static init({ signer, ...config }: WithSigner<Required<ProcessConfiguration>>): AoANTRegistryWrite;
|
|
9
9
|
}
|
|
10
10
|
export declare class AoANTRegistryReadable implements AoANTRegistryRead {
|
|
11
11
|
protected process: AOProcess;
|
package/lib/types/version.d.ts
CHANGED