@ar.io/sdk 2.3.2 → 2.4.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.
- package/README.md +37 -3
- package/bundles/web.bundle.min.js +63 -63
- package/lib/cjs/common/ant-registry.js +8 -8
- package/lib/cjs/common/ant.js +47 -24
- package/lib/cjs/common/io.js +14 -1
- package/lib/cjs/node/index.js +1 -1
- package/lib/cjs/types/ant.js +122 -0
- package/lib/cjs/types/common.js +2 -0
- package/lib/cjs/{io.js → types/io.js} +1 -1
- package/lib/cjs/{token.js → types/token.js} +1 -1
- package/lib/cjs/utils/ao.js +1 -35
- package/lib/cjs/utils/arweave.js +15 -0
- package/lib/cjs/utils/index.js +1 -0
- package/lib/cjs/utils/processes.js +1 -0
- package/lib/cjs/utils/schema.js +17 -0
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/web/index.js +1 -1
- package/lib/esm/common/ant-registry.js +1 -1
- package/lib/esm/common/ant.js +40 -17
- package/lib/esm/common/io.js +14 -1
- package/lib/esm/node/index.js +1 -1
- package/lib/esm/types/ant.js +118 -0
- package/lib/esm/types/common.js +1 -0
- package/lib/esm/{io.js → types/io.js} +1 -1
- package/lib/esm/{token.js → types/token.js} +1 -1
- package/lib/esm/utils/ao.js +0 -33
- package/lib/esm/utils/arweave.js +15 -0
- package/lib/esm/utils/index.js +1 -0
- package/lib/esm/utils/processes.js +1 -0
- package/lib/esm/utils/schema.js +13 -0
- package/lib/esm/version.js +1 -1
- package/lib/esm/web/index.js +1 -1
- package/lib/types/common/ant-registry.d.ts +2 -1
- package/lib/types/common/ant.d.ts +23 -29
- package/lib/types/common/contracts/ao-process.d.ts +1 -1
- package/lib/types/common/http.d.ts +1 -1
- package/lib/types/common/io.d.ts +8 -3
- package/lib/types/node/index.d.ts +1 -1
- package/lib/types/types/ant-registry.d.ts +29 -0
- package/lib/types/types/ant.d.ts +190 -0
- package/lib/types/{common.d.ts → types/common.d.ts} +20 -0
- package/lib/types/{io.d.ts → types/io.d.ts} +7 -103
- package/lib/types/utils/ao.d.ts +2 -60
- package/lib/types/utils/arweave.d.ts +1 -16
- package/lib/types/utils/index.d.ts +1 -0
- package/lib/types/utils/processes.d.ts +2 -1
- package/lib/types/utils/schema.d.ts +23 -0
- package/lib/types/version.d.ts +1 -1
- package/lib/types/web/index.d.ts +1 -1
- package/package.json +1 -1
- /package/lib/cjs/{common.js → types/ant-registry.js} +0 -0
- /package/lib/cjs/{types.js → types/index.js} +0 -0
- /package/lib/esm/{common.js → types/ant-registry.js} +0 -0
- /package/lib/esm/{types.js → types/index.js} +0 -0
- /package/lib/types/{types.d.ts → types/index.d.ts} +0 -0
- /package/lib/types/{token.d.ts → types/token.d.ts} +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
import { AoMessageResult, WalletAddress, WriteOptions } from './common.js';
|
|
18
|
+
/**
|
|
19
|
+
* example error:
|
|
20
|
+
* {
|
|
21
|
+
"code": "custom",
|
|
22
|
+
"message": "Must be an Arweave Transaction ID",
|
|
23
|
+
"path": [
|
|
24
|
+
"Records",
|
|
25
|
+
"record1",
|
|
26
|
+
"transactionId"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
*/
|
|
30
|
+
export declare const ArweaveTxIdSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
31
|
+
export declare const IntegerStringSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
32
|
+
export declare const AntRecordSchema: z.ZodObject<{
|
|
33
|
+
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
34
|
+
ttlSeconds: z.ZodNumber;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
transactionId: string;
|
|
37
|
+
ttlSeconds: number;
|
|
38
|
+
}, {
|
|
39
|
+
transactionId: string;
|
|
40
|
+
ttlSeconds: number;
|
|
41
|
+
}>;
|
|
42
|
+
export type AoANTRecord = z.infer<typeof AntRecordSchema>;
|
|
43
|
+
export declare const AntRecordsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
44
|
+
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
45
|
+
ttlSeconds: z.ZodNumber;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
transactionId: string;
|
|
48
|
+
ttlSeconds: number;
|
|
49
|
+
}, {
|
|
50
|
+
transactionId: string;
|
|
51
|
+
ttlSeconds: number;
|
|
52
|
+
}>>;
|
|
53
|
+
export declare const AntControllersSchema: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
54
|
+
export declare const AntBalancesSchema: z.ZodRecord<z.ZodEffects<z.ZodString, string, string>, z.ZodNumber>;
|
|
55
|
+
export declare const AntStateSchema: z.ZodObject<{
|
|
56
|
+
Name: z.ZodString;
|
|
57
|
+
Ticker: z.ZodString;
|
|
58
|
+
Denomination: z.ZodNumber;
|
|
59
|
+
Owner: z.ZodEffects<z.ZodString, string, string>;
|
|
60
|
+
Controllers: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
61
|
+
Records: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
62
|
+
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
63
|
+
ttlSeconds: z.ZodNumber;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
transactionId: string;
|
|
66
|
+
ttlSeconds: number;
|
|
67
|
+
}, {
|
|
68
|
+
transactionId: string;
|
|
69
|
+
ttlSeconds: number;
|
|
70
|
+
}>>;
|
|
71
|
+
Balances: z.ZodRecord<z.ZodEffects<z.ZodString, string, string>, z.ZodNumber>;
|
|
72
|
+
Logo: z.ZodEffects<z.ZodString, string, string>;
|
|
73
|
+
TotalSupply: z.ZodNumber;
|
|
74
|
+
Initialized: z.ZodBoolean;
|
|
75
|
+
"Source-Code-TX-ID": z.ZodEffects<z.ZodString, string, string>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
"Source-Code-TX-ID": string;
|
|
78
|
+
Name: string;
|
|
79
|
+
Ticker: string;
|
|
80
|
+
Denomination: number;
|
|
81
|
+
Owner: string;
|
|
82
|
+
Controllers: string[];
|
|
83
|
+
Records: Record<string, {
|
|
84
|
+
transactionId: string;
|
|
85
|
+
ttlSeconds: number;
|
|
86
|
+
}>;
|
|
87
|
+
Balances: Record<string, number>;
|
|
88
|
+
Logo: string;
|
|
89
|
+
TotalSupply: number;
|
|
90
|
+
Initialized: boolean;
|
|
91
|
+
}, {
|
|
92
|
+
"Source-Code-TX-ID": string;
|
|
93
|
+
Name: string;
|
|
94
|
+
Ticker: string;
|
|
95
|
+
Denomination: number;
|
|
96
|
+
Owner: string;
|
|
97
|
+
Controllers: string[];
|
|
98
|
+
Records: Record<string, {
|
|
99
|
+
transactionId: string;
|
|
100
|
+
ttlSeconds: number;
|
|
101
|
+
}>;
|
|
102
|
+
Balances: Record<string, number>;
|
|
103
|
+
Logo: string;
|
|
104
|
+
TotalSupply: number;
|
|
105
|
+
Initialized: boolean;
|
|
106
|
+
}>;
|
|
107
|
+
export type AoANTState = z.infer<typeof AntStateSchema>;
|
|
108
|
+
export declare const AntHandlerNames: string[];
|
|
109
|
+
export declare const AntHandlersSchema: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
110
|
+
export declare const AntInfoSchema: z.ZodObject<{
|
|
111
|
+
Name: z.ZodString;
|
|
112
|
+
Owner: z.ZodEffects<z.ZodString, string, string>;
|
|
113
|
+
"Source-Code-TX-ID": z.ZodEffects<z.ZodString, string, string>;
|
|
114
|
+
Ticker: z.ZodString;
|
|
115
|
+
"Total-Supply": z.ZodEffects<z.ZodString, string, string>;
|
|
116
|
+
Logo: z.ZodEffects<z.ZodString, string, string>;
|
|
117
|
+
Denomination: z.ZodEffects<z.ZodString, string, string>;
|
|
118
|
+
Handlers: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
119
|
+
HandlerNames: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
"Source-Code-TX-ID": string;
|
|
122
|
+
Name: string;
|
|
123
|
+
Ticker: string;
|
|
124
|
+
Denomination: string;
|
|
125
|
+
Owner: string;
|
|
126
|
+
Logo: string;
|
|
127
|
+
"Total-Supply": string;
|
|
128
|
+
Handlers?: string[] | undefined;
|
|
129
|
+
HandlerNames?: string[] | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
"Source-Code-TX-ID": string;
|
|
132
|
+
Name: string;
|
|
133
|
+
Ticker: string;
|
|
134
|
+
Denomination: string;
|
|
135
|
+
Owner: string;
|
|
136
|
+
Logo: string;
|
|
137
|
+
"Total-Supply": string;
|
|
138
|
+
Handlers?: string[] | undefined;
|
|
139
|
+
HandlerNames?: string[] | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
export type AoANTInfo = z.infer<typeof AntInfoSchema>;
|
|
142
|
+
/**
|
|
143
|
+
* @param state {object}
|
|
144
|
+
* @returns {boolean}
|
|
145
|
+
*/
|
|
146
|
+
export declare function isAoANTState(state: object): state is AoANTState;
|
|
147
|
+
export type AntReadOptions = {
|
|
148
|
+
strict?: boolean;
|
|
149
|
+
};
|
|
150
|
+
export interface AoANTRead {
|
|
151
|
+
getState(opts?: AntReadOptions): Promise<AoANTState>;
|
|
152
|
+
getInfo(opts?: AntReadOptions): Promise<AoANTInfo>;
|
|
153
|
+
getRecord({ undername }: {
|
|
154
|
+
undername: string;
|
|
155
|
+
}, opts?: AntReadOptions): Promise<AoANTRecord | undefined>;
|
|
156
|
+
getRecords(opts?: AntReadOptions): Promise<Record<string, AoANTRecord>>;
|
|
157
|
+
getOwner(opts?: AntReadOptions): Promise<WalletAddress>;
|
|
158
|
+
getControllers(): Promise<WalletAddress[]>;
|
|
159
|
+
getTicker(opts?: AntReadOptions): Promise<string>;
|
|
160
|
+
getName(opts?: AntReadOptions): Promise<string>;
|
|
161
|
+
getBalance({ address }: {
|
|
162
|
+
address: WalletAddress;
|
|
163
|
+
}, opts?: AntReadOptions): Promise<number>;
|
|
164
|
+
getBalances(opts?: AntReadOptions): Promise<Record<WalletAddress, number>>;
|
|
165
|
+
}
|
|
166
|
+
export interface AoANTWrite extends AoANTRead {
|
|
167
|
+
transfer({ target }: {
|
|
168
|
+
target: WalletAddress;
|
|
169
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
170
|
+
addController({ controller, }: {
|
|
171
|
+
controller: WalletAddress;
|
|
172
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
173
|
+
removeController({ controller, }: {
|
|
174
|
+
controller: WalletAddress;
|
|
175
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
176
|
+
setRecord({ undername, transactionId, ttlSeconds, }: {
|
|
177
|
+
undername: string;
|
|
178
|
+
transactionId: string;
|
|
179
|
+
ttlSeconds: number;
|
|
180
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
181
|
+
removeRecord({ undername }: {
|
|
182
|
+
undername: string;
|
|
183
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
184
|
+
setTicker({ ticker }: {
|
|
185
|
+
ticker: string;
|
|
186
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
187
|
+
setName({ name }: {
|
|
188
|
+
name: string;
|
|
189
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
190
|
+
}
|
|
@@ -65,3 +65,23 @@ export interface AoClient {
|
|
|
65
65
|
unmonitor: typeof unmonitor;
|
|
66
66
|
dryrun: typeof dryrun;
|
|
67
67
|
}
|
|
68
|
+
export interface AOContract {
|
|
69
|
+
read<K>({ tags, retries, }: {
|
|
70
|
+
tags?: {
|
|
71
|
+
name: string;
|
|
72
|
+
value: string;
|
|
73
|
+
}[];
|
|
74
|
+
retries?: number;
|
|
75
|
+
}): Promise<K>;
|
|
76
|
+
send<K>({ tags, data, signer, }: {
|
|
77
|
+
tags: {
|
|
78
|
+
name: string;
|
|
79
|
+
value: string;
|
|
80
|
+
}[];
|
|
81
|
+
data: string | undefined;
|
|
82
|
+
signer: AoSigner;
|
|
83
|
+
}): Promise<{
|
|
84
|
+
id: string;
|
|
85
|
+
result?: K;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { AOProcess } from '
|
|
16
|
+
import { AOProcess } from '../common/index.js';
|
|
17
|
+
import { AoMessageResult, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './index.js';
|
|
17
18
|
import { mIOToken } from './token.js';
|
|
18
|
-
import { AoMessageResult, AoSigner, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './types.js';
|
|
19
19
|
export type PaginationParams = {
|
|
20
20
|
cursor?: string;
|
|
21
21
|
limit?: number;
|
|
@@ -203,55 +203,8 @@ export type AoBalanceWithAddress = {
|
|
|
203
203
|
address: WalletAddress;
|
|
204
204
|
balance: number;
|
|
205
205
|
};
|
|
206
|
-
export type AoANTState = {
|
|
207
|
-
Name: string;
|
|
208
|
-
Ticker: string;
|
|
209
|
-
Denomination: number;
|
|
210
|
-
Owner: WalletAddress;
|
|
211
|
-
Controllers: WalletAddress[];
|
|
212
|
-
Records: Record<string, AoANTRecord>;
|
|
213
|
-
Balances: Record<WalletAddress, number>;
|
|
214
|
-
Logo: string;
|
|
215
|
-
TotalSupply: number;
|
|
216
|
-
Initialized: boolean;
|
|
217
|
-
['Source-Code-TX-ID']: string;
|
|
218
|
-
};
|
|
219
|
-
export type AoANTInfo = {
|
|
220
|
-
Name: string;
|
|
221
|
-
Owner: string;
|
|
222
|
-
Handlers: string[];
|
|
223
|
-
['Source-Code-TX-ID']: string;
|
|
224
|
-
Ticker: string;
|
|
225
|
-
['Total-Supply']: string;
|
|
226
|
-
Logo: string;
|
|
227
|
-
Denomination: string;
|
|
228
|
-
};
|
|
229
|
-
export type AoANTRecord = {
|
|
230
|
-
transactionId: string;
|
|
231
|
-
ttlSeconds: number;
|
|
232
|
-
};
|
|
233
206
|
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake' | 'observerAddress'> & Partial<AoGatewaySettings>;
|
|
234
207
|
export type AoUpdateGatewaySettingsParams = AtLeastOne<AoJoinNetworkParams>;
|
|
235
|
-
export interface AOContract {
|
|
236
|
-
read<K>({ tags, retries, }: {
|
|
237
|
-
tags?: {
|
|
238
|
-
name: string;
|
|
239
|
-
value: string;
|
|
240
|
-
}[];
|
|
241
|
-
retries?: number;
|
|
242
|
-
}): Promise<K>;
|
|
243
|
-
send<K>({ tags, data, signer, }: {
|
|
244
|
-
tags: {
|
|
245
|
-
name: string;
|
|
246
|
-
value: string;
|
|
247
|
-
}[];
|
|
248
|
-
data: string | undefined;
|
|
249
|
-
signer: AoSigner;
|
|
250
|
-
}): Promise<{
|
|
251
|
-
id: string;
|
|
252
|
-
result?: K;
|
|
253
|
-
}>;
|
|
254
|
-
}
|
|
255
208
|
export interface AoIORead {
|
|
256
209
|
getInfo(): Promise<{
|
|
257
210
|
Ticker: string;
|
|
@@ -316,6 +269,11 @@ export interface AoIOWrite extends AoIORead {
|
|
|
316
269
|
decreaseDelegateStake(params: {
|
|
317
270
|
target: WalletAddress;
|
|
318
271
|
decreaseQty: number | mIOToken;
|
|
272
|
+
instant?: boolean;
|
|
273
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
274
|
+
instantDelegateWithdrawal(params: {
|
|
275
|
+
target: WalletAddress;
|
|
276
|
+
vaultId: string;
|
|
319
277
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
320
278
|
saveObservations(params: {
|
|
321
279
|
reportTxId: TransactionId;
|
|
@@ -340,60 +298,6 @@ export interface AoIOWrite extends AoIORead {
|
|
|
340
298
|
vaultId: string;
|
|
341
299
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
342
300
|
}
|
|
343
|
-
export interface AoANTRead {
|
|
344
|
-
getState(): Promise<AoANTState>;
|
|
345
|
-
getInfo(): Promise<AoANTInfo>;
|
|
346
|
-
getRecord({ undername }: {
|
|
347
|
-
undername: any;
|
|
348
|
-
}): Promise<AoANTRecord | undefined>;
|
|
349
|
-
getRecords(): Promise<Record<string, AoANTRecord>>;
|
|
350
|
-
getOwner(): Promise<WalletAddress>;
|
|
351
|
-
getControllers(): Promise<WalletAddress[]>;
|
|
352
|
-
getTicker(): Promise<string>;
|
|
353
|
-
getName(): Promise<string>;
|
|
354
|
-
getBalance({ address }: {
|
|
355
|
-
address: WalletAddress;
|
|
356
|
-
}): Promise<number>;
|
|
357
|
-
getBalances(): Promise<Record<WalletAddress, number>>;
|
|
358
|
-
}
|
|
359
|
-
export interface AoANTWrite extends AoANTRead {
|
|
360
|
-
transfer({ target }: {
|
|
361
|
-
target: WalletAddress;
|
|
362
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
363
|
-
addController({ controller, }: {
|
|
364
|
-
controller: WalletAddress;
|
|
365
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
366
|
-
removeController({ controller, }: {
|
|
367
|
-
controller: WalletAddress;
|
|
368
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
369
|
-
setRecord({ undername, transactionId, ttlSeconds, }: {
|
|
370
|
-
undername: string;
|
|
371
|
-
transactionId: string;
|
|
372
|
-
ttlSeconds: number;
|
|
373
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
374
|
-
removeRecord({ undername }: {
|
|
375
|
-
undername: string;
|
|
376
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
377
|
-
setTicker({ ticker }: {
|
|
378
|
-
ticker: string;
|
|
379
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
380
|
-
setName({ name }: {
|
|
381
|
-
name: string;
|
|
382
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
383
|
-
}
|
|
384
|
-
export interface AoANTRegistryRead {
|
|
385
|
-
accessControlList(params: {
|
|
386
|
-
address: string;
|
|
387
|
-
}): Promise<{
|
|
388
|
-
Owned: string[];
|
|
389
|
-
Controlled: string[];
|
|
390
|
-
}>;
|
|
391
|
-
}
|
|
392
|
-
export interface AoANTRegistryWrite extends AoANTRegistryRead {
|
|
393
|
-
register(params: {
|
|
394
|
-
processId: string;
|
|
395
|
-
}): Promise<AoMessageResult>;
|
|
396
|
-
}
|
|
397
301
|
export declare function isProcessConfiguration(config: object): config is {
|
|
398
302
|
process: AOProcess;
|
|
399
303
|
};
|
package/lib/types/utils/ao.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Arweave from 'arweave';
|
|
2
|
-
import { z } from 'zod';
|
|
3
2
|
import { Logger } from '../common/index.js';
|
|
4
|
-
import { AoANTRecord
|
|
3
|
+
import { AoANTRecord } from '../types/ant.js';
|
|
4
|
+
import { AoClient, AoSigner, ContractSigner, WalletAddress } from '../types/index.js';
|
|
5
5
|
export declare function spawnANT({ signer, module, luaCodeTxId, ao, scheduler, state, stateContractTxId, antRegistryId, logger, arweave, }: {
|
|
6
6
|
signer: AoSigner;
|
|
7
7
|
module?: string;
|
|
@@ -31,61 +31,3 @@ export declare function evolveANT({ signer, processId, luaCodeTxId, ao, logger,
|
|
|
31
31
|
}): Promise<string>;
|
|
32
32
|
export declare function isAoSigner(value: unknown): value is AoSigner;
|
|
33
33
|
export declare function createAoSigner(signer: ContractSigner): AoSigner;
|
|
34
|
-
export declare const AntStateSchema: z.ZodObject<{
|
|
35
|
-
Name: z.ZodString;
|
|
36
|
-
Ticker: z.ZodString;
|
|
37
|
-
Owner: z.ZodString;
|
|
38
|
-
Controllers: z.ZodArray<z.ZodString, "many">;
|
|
39
|
-
Records: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
40
|
-
transactionId: z.ZodString;
|
|
41
|
-
ttlSeconds: z.ZodNumber;
|
|
42
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
43
|
-
transactionId: z.ZodString;
|
|
44
|
-
ttlSeconds: z.ZodNumber;
|
|
45
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
46
|
-
transactionId: z.ZodString;
|
|
47
|
-
ttlSeconds: z.ZodNumber;
|
|
48
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
49
|
-
Balances: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
50
|
-
"Source-Code-TX-ID": z.ZodString;
|
|
51
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
52
|
-
Name: z.ZodString;
|
|
53
|
-
Ticker: z.ZodString;
|
|
54
|
-
Owner: z.ZodString;
|
|
55
|
-
Controllers: z.ZodArray<z.ZodString, "many">;
|
|
56
|
-
Records: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
57
|
-
transactionId: z.ZodString;
|
|
58
|
-
ttlSeconds: z.ZodNumber;
|
|
59
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
60
|
-
transactionId: z.ZodString;
|
|
61
|
-
ttlSeconds: z.ZodNumber;
|
|
62
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
63
|
-
transactionId: z.ZodString;
|
|
64
|
-
ttlSeconds: z.ZodNumber;
|
|
65
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
66
|
-
Balances: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
67
|
-
"Source-Code-TX-ID": z.ZodString;
|
|
68
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
69
|
-
Name: z.ZodString;
|
|
70
|
-
Ticker: z.ZodString;
|
|
71
|
-
Owner: z.ZodString;
|
|
72
|
-
Controllers: z.ZodArray<z.ZodString, "many">;
|
|
73
|
-
Records: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
74
|
-
transactionId: z.ZodString;
|
|
75
|
-
ttlSeconds: z.ZodNumber;
|
|
76
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
77
|
-
transactionId: z.ZodString;
|
|
78
|
-
ttlSeconds: z.ZodNumber;
|
|
79
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
80
|
-
transactionId: z.ZodString;
|
|
81
|
-
ttlSeconds: z.ZodNumber;
|
|
82
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
83
|
-
Balances: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
84
|
-
"Source-Code-TX-ID": z.ZodString;
|
|
85
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
86
|
-
/**
|
|
87
|
-
* @param state
|
|
88
|
-
* @returns {boolean}
|
|
89
|
-
* @throws {z.ZodError} if the state object does not match the expected schema
|
|
90
|
-
*/
|
|
91
|
-
export declare function isAoANTState(state: object, logger?: Logger): state is AoANTState;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { BlockHeight } from '../common.js';
|
|
1
|
+
import { BlockHeight } from '../types/common.js';
|
|
17
2
|
export declare const validateArweaveId: (id: string) => boolean;
|
|
18
3
|
export declare function isBlockHeight(height: string | number): height is BlockHeight;
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { EventEmitter } from 'eventemitter3';
|
|
17
17
|
import { ILogger } from '../common/logger.js';
|
|
18
|
-
import { AoANTRegistryRead
|
|
18
|
+
import { AoANTRegistryRead } from '../types/ant-registry.js';
|
|
19
|
+
import { AoArNSNameData, AoIORead, ProcessId, WalletAddress } from '../types/index.js';
|
|
19
20
|
/**
|
|
20
21
|
* @beta This API is in beta and may change in the future.
|
|
21
22
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param schema - zod schema
|
|
20
|
+
* @param v - value to parse
|
|
21
|
+
* @throws {z.SafeParseError<any>} - if the value fails to parse
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseSchemaResult(schema: z.ZodTypeAny, v: unknown): z.SafeParseSuccess<any>;
|
package/lib/types/version.d.ts
CHANGED
package/lib/types/web/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export { ArweaveSigner, ArconnectSigner } from '@dha-team/arbundles';
|
|
17
|
-
export * from '../types.js';
|
|
17
|
+
export * from '../types/index.js';
|
|
18
18
|
export * from '../common/index.js';
|
|
19
19
|
export * from '../constants.js';
|
|
20
20
|
export * from '../utils/index.js';
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|