@ar.io/sdk 2.1.0-alpha.6 → 2.1.0-alpha.8
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/README.md +62 -15
- package/bundles/web.bundle.min.js +68 -68
- package/lib/cjs/common/ant-registry.js +87 -0
- package/lib/cjs/common/ant.js +0 -7
- package/lib/cjs/common/contracts/ao-process.js +1 -1
- package/lib/cjs/common/index.js +1 -0
- package/lib/cjs/common/io.js +0 -4
- package/lib/cjs/constants.js +2 -1
- package/lib/cjs/utils/ao.js +7 -1
- package/lib/cjs/utils/json.js +3 -2
- package/lib/cjs/utils/processes.js +21 -40
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant-registry.js +81 -0
- package/lib/esm/common/ant.js +0 -7
- package/lib/esm/common/contracts/ao-process.js +1 -1
- package/lib/esm/common/index.js +1 -0
- package/lib/esm/common/io.js +0 -4
- package/lib/esm/constants.js +1 -0
- package/lib/esm/utils/ao.js +8 -2
- package/lib/esm/utils/json.js +1 -0
- package/lib/esm/utils/processes.js +21 -40
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant-registry.d.ts +26 -0
- package/lib/types/common/contracts/ao-process.d.ts +2 -2
- package/lib/types/common/index.d.ts +1 -0
- package/lib/types/constants.d.ts +1 -0
- package/lib/types/io.d.ts +15 -2
- package/lib/types/utils/ao.d.ts +2 -1
- package/lib/types/utils/processes.d.ts +8 -4
- package/lib/types/version.d.ts +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AoANTRegistryRead, AoANTRegistryWrite, AoMessageResult, ProcessConfiguration, WithSigner } from '../types.js';
|
|
2
|
+
import { AOProcess } from './index.js';
|
|
3
|
+
export declare class ANTRegistry {
|
|
4
|
+
static init(): AoANTRegistryRead;
|
|
5
|
+
static init(config: Required<ProcessConfiguration> & {
|
|
6
|
+
signer?: undefined;
|
|
7
|
+
}): AoANTRegistryRead;
|
|
8
|
+
static init({ signer, ...config }: WithSigner<Required<ProcessConfiguration>>): AoANTRegistryRead;
|
|
9
|
+
}
|
|
10
|
+
export declare class AoANTRegistryReadable implements AoANTRegistryRead {
|
|
11
|
+
protected process: AOProcess;
|
|
12
|
+
constructor(config?: ProcessConfiguration);
|
|
13
|
+
accessControlList({ address, }: {
|
|
14
|
+
address: string;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
Owned: string[];
|
|
17
|
+
Controlled: string[];
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export declare class AoANTRegistryWriteable extends AoANTRegistryReadable implements AoANTRegistryWrite {
|
|
21
|
+
private signer;
|
|
22
|
+
constructor({ signer, ...config }: WithSigner<ProcessConfiguration>);
|
|
23
|
+
register({ processId, }: {
|
|
24
|
+
processId: string;
|
|
25
|
+
}): Promise<AoMessageResult>;
|
|
26
|
+
}
|
|
@@ -16,12 +16,12 @@ export declare class AOProcess implements AOContract {
|
|
|
16
16
|
}>;
|
|
17
17
|
retries?: number;
|
|
18
18
|
}): Promise<K>;
|
|
19
|
-
send<
|
|
19
|
+
send<K>({ tags, data, signer, retries, }: {
|
|
20
20
|
tags: Array<{
|
|
21
21
|
name: string;
|
|
22
22
|
value: string;
|
|
23
23
|
}>;
|
|
24
|
-
data?:
|
|
24
|
+
data?: string | undefined;
|
|
25
25
|
signer: AoSigner;
|
|
26
26
|
retries?: number;
|
|
27
27
|
}): Promise<{
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare const ARNS_DEVNET_REGISTRY_TX = "_NctcA2sRy1-J4OmIQZbYFPM17piNcbd
|
|
|
23
23
|
export declare const IO_DEVNET_PROCESS_ID = "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc";
|
|
24
24
|
export declare const ioDevnetProcessId = "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc";
|
|
25
25
|
export declare const IO_TESTNET_PROCESS_ID = "agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA";
|
|
26
|
+
export declare const ANT_REGISTRY_ID = "i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc";
|
|
26
27
|
export declare const MIO_PER_IO = 1000000;
|
|
27
28
|
export declare const AOS_MODULE_ID = "cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk";
|
|
28
29
|
export declare const ANT_LUA_ID = "Flwio4Lr08g6s6uim6lEJNnVGD9ylvz0_aafvpiL8FI";
|
package/lib/types/io.d.ts
CHANGED
|
@@ -57,12 +57,12 @@ export interface AOContract {
|
|
|
57
57
|
}[];
|
|
58
58
|
retries?: number;
|
|
59
59
|
}): Promise<K>;
|
|
60
|
-
send<
|
|
60
|
+
send<K>({ tags, data, signer, }: {
|
|
61
61
|
tags: {
|
|
62
62
|
name: string;
|
|
63
63
|
value: string;
|
|
64
64
|
}[];
|
|
65
|
-
data:
|
|
65
|
+
data: string | undefined;
|
|
66
66
|
signer: AoSigner;
|
|
67
67
|
}): Promise<{
|
|
68
68
|
id: string;
|
|
@@ -199,6 +199,19 @@ export interface AoANTWrite extends AoANTRead {
|
|
|
199
199
|
name: any;
|
|
200
200
|
}): Promise<AoMessageResult>;
|
|
201
201
|
}
|
|
202
|
+
export interface AoANTRegistryRead {
|
|
203
|
+
accessControlList(params: {
|
|
204
|
+
address: string;
|
|
205
|
+
}): Promise<{
|
|
206
|
+
Owned: string[];
|
|
207
|
+
Controlled: string[];
|
|
208
|
+
}>;
|
|
209
|
+
}
|
|
210
|
+
export interface AoANTRegistryWrite extends AoANTRegistryRead {
|
|
211
|
+
register(params: {
|
|
212
|
+
processId: string;
|
|
213
|
+
}): Promise<AoMessageResult>;
|
|
214
|
+
}
|
|
202
215
|
export interface AoIOState {
|
|
203
216
|
GatewayRegistry: Record<WalletAddress, AoGateway>;
|
|
204
217
|
Epochs: Record<AoEpochIndex, AoEpochData>;
|
package/lib/types/utils/ao.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ANTState } from '../contract-state.js';
|
|
2
2
|
import { AoClient, AoSigner, ContractSigner } from '../types.js';
|
|
3
|
-
export declare function spawnANT({ signer, module, luaCodeTxId, ao, scheduler, state, stateContractTxId, }: {
|
|
3
|
+
export declare function spawnANT({ signer, module, luaCodeTxId, ao, scheduler, state, stateContractTxId, antRegistryId, }: {
|
|
4
4
|
signer: AoSigner;
|
|
5
5
|
module?: string;
|
|
6
6
|
luaCodeTxId?: string;
|
|
@@ -8,6 +8,7 @@ export declare function spawnANT({ signer, module, luaCodeTxId, ao, scheduler, s
|
|
|
8
8
|
scheduler?: string;
|
|
9
9
|
state?: ANTState;
|
|
10
10
|
stateContractTxId?: string;
|
|
11
|
+
antRegistryId?: string;
|
|
11
12
|
}): Promise<string>;
|
|
12
13
|
export declare function evolveANT({ signer, processId, luaCodeTxId, ao, }: {
|
|
13
14
|
signer: AoSigner;
|
|
@@ -16,10 +16,13 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { EventEmitter } from 'eventemitter3';
|
|
18
18
|
import { ILogger } from '../common/logger.js';
|
|
19
|
-
import { AoArNSNameData, AoIORead, ProcessId, WalletAddress } from '../types.js';
|
|
20
|
-
|
|
19
|
+
import { AoANTRegistryRead, AoArNSNameData, AoIORead, ProcessId, WalletAddress } from '../types.js';
|
|
20
|
+
/**
|
|
21
|
+
* @beta This API is in beta and may change in the future.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getANTProcessesOwnedByWallet: ({ address, registry, }: {
|
|
21
24
|
address: WalletAddress;
|
|
22
|
-
|
|
25
|
+
registry?: AoANTRegistryRead;
|
|
23
26
|
}) => Promise<ProcessId[]>;
|
|
24
27
|
export declare class ArNSEventEmitter extends EventEmitter {
|
|
25
28
|
protected contract: AoIORead;
|
|
@@ -32,9 +35,10 @@ export declare class ArNSEventEmitter extends EventEmitter {
|
|
|
32
35
|
concurrency?: number;
|
|
33
36
|
logger?: ILogger;
|
|
34
37
|
});
|
|
35
|
-
fetchProcessesOwnedByWallet({ address, pageSize, }: {
|
|
38
|
+
fetchProcessesOwnedByWallet({ address, pageSize, antRegistry, }: {
|
|
36
39
|
address: WalletAddress;
|
|
37
40
|
pageSize?: number;
|
|
41
|
+
antRegistry?: AoANTRegistryRead;
|
|
38
42
|
}): Promise<void>;
|
|
39
43
|
}
|
|
40
44
|
export declare const fetchAllArNSRecords: ({ contract, emitter, logger, pageSize, }: {
|
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": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
"husky": "^8.0.3",
|
|
110
110
|
"jest": "^29.7.0",
|
|
111
111
|
"lint-staged": "^15.2.2",
|
|
112
|
+
"markdown-toc-gen": "^1.0.1",
|
|
112
113
|
"prettier": "^3.0.2",
|
|
113
114
|
"rimraf": "^5.0.1",
|
|
114
115
|
"semantic-release": "^21.0.7",
|
|
@@ -131,6 +132,9 @@
|
|
|
131
132
|
"lint-staged": {
|
|
132
133
|
"**/*.{ts,js,mjs,cjs,md,json}": [
|
|
133
134
|
"prettier --write ."
|
|
135
|
+
],
|
|
136
|
+
"**/*.md": [
|
|
137
|
+
"markdown-toc-gen insert"
|
|
134
138
|
]
|
|
135
139
|
}
|
|
136
140
|
}
|