@ar.io/sdk 2.5.0-alpha.1 → 2.5.0-alpha.11
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 +246 -9
- package/bundles/web.bundle.min.js +69 -69
- package/lib/cjs/common/ant.js +61 -3
- package/lib/cjs/common/contracts/ao-process.js +12 -11
- package/lib/cjs/common/io.js +109 -81
- package/lib/cjs/constants.js +1 -1
- package/lib/cjs/types/ant.js +16 -12
- package/lib/cjs/utils/ao.js +31 -1
- package/lib/cjs/utils/arweave.js +11 -1
- package/lib/cjs/utils/schema.js +0 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +63 -5
- package/lib/esm/common/contracts/ao-process.js +12 -11
- package/lib/esm/common/io.js +110 -82
- package/lib/esm/constants.js +1 -1
- package/lib/esm/types/ant.js +15 -11
- package/lib/esm/utils/ao.js +29 -0
- package/lib/esm/utils/arweave.js +9 -0
- package/lib/esm/utils/schema.js +0 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant.d.ts +36 -3
- package/lib/types/common/io.d.ts +24 -3
- package/lib/types/constants.d.ts +1 -1
- package/lib/types/types/ant.d.ts +53 -8
- package/lib/types/types/common.d.ts +10 -0
- package/lib/types/types/io.d.ts +41 -18
- package/lib/types/utils/ao.d.ts +6 -1
- package/lib/types/utils/arweave.d.ts +5 -0
- package/lib/types/utils/schema.d.ts +0 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/types/common/io.d.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
|
-
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoAuction, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoTokenSupplyData, AoUpdateGatewaySettingsParams, AoWeightedObserver, ContractSigner, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types/index.js';
|
|
18
|
-
import { AoArNSNameData, AoAuctionPriceData, AoDelegation, AoEpochData, AoEpochSettings, AoGateway, AoGatewayDelegateWithAddress, AoIORead, AoIOWrite, AoRegistrationFees, AoVaultData, AoWalletVault, EpochInput } from '../types/io.js';
|
|
17
|
+
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoAuction, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AoTokenSupplyData, AoUpdateGatewaySettingsParams, AoWeightedObserver, ContractSigner, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types/index.js';
|
|
18
|
+
import { AoArNSNameData, AoArNSReservedNameDataWithName, AoAuctionPriceData, AoDelegation, AoEpochData, AoEpochSettings, AoGateway, AoGatewayDelegateWithAddress, AoGatewayVault, AoIORead, AoIOWrite, AoRegistrationFees, AoVaultData, AoWalletVault, EpochInput } from '../types/io.js';
|
|
19
19
|
import { mIOToken } from '../types/token.js';
|
|
20
20
|
import { AOProcess } from './contracts/ao-process.js';
|
|
21
21
|
export declare class IO {
|
|
@@ -56,7 +56,7 @@ export declare class IOReadable implements AoIORead {
|
|
|
56
56
|
name: string;
|
|
57
57
|
}): Promise<AoArNSNameData | undefined>;
|
|
58
58
|
getArNSRecords(params?: PaginationParams<AoArNSNameDataWithName>): Promise<PaginationResult<AoArNSNameDataWithName>>;
|
|
59
|
-
getArNSReservedNames(): Promise<
|
|
59
|
+
getArNSReservedNames(params?: PaginationParams<AoArNSReservedNameDataWithName>): Promise<PaginationResult<AoArNSReservedNameDataWithName>>;
|
|
60
60
|
getArNSReservedName({ name, }: {
|
|
61
61
|
name: string;
|
|
62
62
|
}): Promise<AoArNSReservedNameData | undefined>;
|
|
@@ -128,6 +128,24 @@ export declare class IOReadable implements AoIORead {
|
|
|
128
128
|
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
129
129
|
address: WalletAddress;
|
|
130
130
|
}): Promise<PaginationResult<AoDelegation>>;
|
|
131
|
+
getAllowedDelegates(params: PaginationParams & {
|
|
132
|
+
address: WalletAddress;
|
|
133
|
+
}): Promise<PaginationResult<WalletAddress>>;
|
|
134
|
+
getGatewayVaults(params: PaginationParams<AoGatewayVault> & {
|
|
135
|
+
address: WalletAddress;
|
|
136
|
+
}): Promise<PaginationResult<AoGatewayVault>>;
|
|
137
|
+
getPrimaryNameRequest(params: {
|
|
138
|
+
initiator: WalletAddress;
|
|
139
|
+
} | {
|
|
140
|
+
name: string;
|
|
141
|
+
}): Promise<AoMessageResult>;
|
|
142
|
+
getPrimaryNameRequests(params: PaginationParams<AoPrimaryNameRequest>): Promise<PaginationResult<AoPrimaryNameRequest>>;
|
|
143
|
+
getPrimaryName(params: {
|
|
144
|
+
address: WalletAddress;
|
|
145
|
+
} | {
|
|
146
|
+
name: string;
|
|
147
|
+
}): Promise<AoPrimaryName>;
|
|
148
|
+
getPrimaryNames(params: PaginationParams<AoPrimaryName>): Promise<PaginationResult<AoPrimaryName>>;
|
|
131
149
|
}
|
|
132
150
|
export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
133
151
|
protected process: AOProcess;
|
|
@@ -229,4 +247,7 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
229
247
|
type?: 'lease' | 'permabuy';
|
|
230
248
|
years?: number;
|
|
231
249
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
250
|
+
requestPrimaryName(params: {
|
|
251
|
+
name: string;
|
|
252
|
+
}): Promise<AoMessageResult>;
|
|
232
253
|
}
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -25,5 +25,5 @@ export declare const IO_TESTNET_PROCESS_ID = "agYcCFJtrMG6cqMuZfskIkFTGvUPddICmt
|
|
|
25
25
|
export declare const ANT_REGISTRY_ID = "i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc";
|
|
26
26
|
export declare const MIO_PER_IO = 1000000;
|
|
27
27
|
export declare const AOS_MODULE_ID = "cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk";
|
|
28
|
-
export declare const ANT_LUA_ID = "
|
|
28
|
+
export declare const ANT_LUA_ID = "AWO2a2lVfQnjPFThjE4Uuw4ZFAd9EsCHBEgDYkJA-kk";
|
|
29
29
|
export declare const DEFAULT_SCHEDULER_ID = "_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";
|
package/lib/types/types/ant.d.ts
CHANGED
|
@@ -41,7 +41,24 @@ export declare const AntRecordSchema: z.ZodObject<{
|
|
|
41
41
|
transactionId: string;
|
|
42
42
|
ttlSeconds: number;
|
|
43
43
|
}>;
|
|
44
|
+
export declare const AntEntrySchema: z.ZodIntersection<z.ZodObject<{
|
|
45
|
+
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
46
|
+
ttlSeconds: z.ZodNumber;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
transactionId: string;
|
|
49
|
+
ttlSeconds: number;
|
|
50
|
+
}, {
|
|
51
|
+
transactionId: string;
|
|
52
|
+
ttlSeconds: number;
|
|
53
|
+
}>, z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
name: string;
|
|
57
|
+
}, {
|
|
58
|
+
name: string;
|
|
59
|
+
}>>;
|
|
44
60
|
export type AoANTRecord = z.infer<typeof AntRecordSchema>;
|
|
61
|
+
export type AoANTRecordEntry = z.infer<typeof AntEntrySchema>;
|
|
45
62
|
export declare const AntRecordsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
46
63
|
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
47
64
|
ttlSeconds: z.ZodNumber;
|
|
@@ -52,6 +69,22 @@ export declare const AntRecordsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
52
69
|
transactionId: string;
|
|
53
70
|
ttlSeconds: number;
|
|
54
71
|
}>>;
|
|
72
|
+
export declare const AntEntriesSchema: z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
73
|
+
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
74
|
+
ttlSeconds: z.ZodNumber;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
transactionId: string;
|
|
77
|
+
ttlSeconds: number;
|
|
78
|
+
}, {
|
|
79
|
+
transactionId: string;
|
|
80
|
+
ttlSeconds: number;
|
|
81
|
+
}>, z.ZodObject<{
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
name: string;
|
|
85
|
+
}, {
|
|
86
|
+
name: string;
|
|
87
|
+
}>>, "many">;
|
|
55
88
|
export declare const AntControllersSchema: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
56
89
|
export declare const AntBalancesSchema: z.ZodRecord<z.ZodEffects<z.ZodString, string, string>, z.ZodNumber>;
|
|
57
90
|
export declare const AntStateSchema: z.ZodObject<{
|
|
@@ -76,9 +109,7 @@ export declare const AntStateSchema: z.ZodObject<{
|
|
|
76
109
|
Logo: z.ZodEffects<z.ZodString, string, string>;
|
|
77
110
|
TotalSupply: z.ZodNumber;
|
|
78
111
|
Initialized: z.ZodBoolean;
|
|
79
|
-
"Source-Code-TX-ID": z.ZodEffects<z.ZodString, string, string>;
|
|
80
112
|
}, "strip", z.ZodTypeAny, {
|
|
81
|
-
"Source-Code-TX-ID": string;
|
|
82
113
|
Name: string;
|
|
83
114
|
Ticker: string;
|
|
84
115
|
Description: string;
|
|
@@ -95,7 +126,6 @@ export declare const AntStateSchema: z.ZodObject<{
|
|
|
95
126
|
TotalSupply: number;
|
|
96
127
|
Initialized: boolean;
|
|
97
128
|
}, {
|
|
98
|
-
"Source-Code-TX-ID": string;
|
|
99
129
|
Name: string;
|
|
100
130
|
Ticker: string;
|
|
101
131
|
Description: string;
|
|
@@ -113,12 +143,16 @@ export declare const AntStateSchema: z.ZodObject<{
|
|
|
113
143
|
Initialized: boolean;
|
|
114
144
|
}>;
|
|
115
145
|
export type AoANTState = z.infer<typeof AntStateSchema>;
|
|
116
|
-
export declare const
|
|
146
|
+
export declare const AntReadHandlers: readonly ["balance", "balances", "totalSupply", "info", "controllers", "record", "records", "state"];
|
|
147
|
+
export type AoANTReadHandler = (typeof AntReadHandlers)[number];
|
|
148
|
+
export declare const AntWriteHandlers: readonly ["evolve", "_eval", "_default", "transfer", "addController", "removeController", "setRecord", "removeRecord", "setName", "setTicker", "setDescription", "setKeywords", "setLogo", "initializeState", "releaseName", "reassignName"];
|
|
149
|
+
export type AoANTWriteHandler = (typeof AntWriteHandlers)[number];
|
|
150
|
+
export declare const AntHandlerNames: ("balance" | "balances" | "totalSupply" | "info" | "controllers" | "record" | "records" | "state" | "evolve" | "_eval" | "_default" | "transfer" | "addController" | "removeController" | "setRecord" | "removeRecord" | "setName" | "setTicker" | "setDescription" | "setKeywords" | "setLogo" | "initializeState" | "releaseName" | "reassignName")[];
|
|
151
|
+
export type AoANTHandler = AoANTWriteHandler | AoANTReadHandler;
|
|
117
152
|
export declare const AntHandlersSchema: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
118
153
|
export declare const AntInfoSchema: z.ZodObject<{
|
|
119
154
|
Name: z.ZodString;
|
|
120
155
|
Owner: z.ZodEffects<z.ZodString, string, string>;
|
|
121
|
-
"Source-Code-TX-ID": z.ZodEffects<z.ZodString, string, string>;
|
|
122
156
|
Ticker: z.ZodString;
|
|
123
157
|
"Total-Supply": z.ZodEffects<z.ZodString, string, string>;
|
|
124
158
|
Description: z.ZodString;
|
|
@@ -128,7 +162,6 @@ export declare const AntInfoSchema: z.ZodObject<{
|
|
|
128
162
|
Handlers: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
129
163
|
HandlerNames: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
130
164
|
}, "strip", z.ZodTypeAny, {
|
|
131
|
-
"Source-Code-TX-ID": string;
|
|
132
165
|
Name: string;
|
|
133
166
|
Ticker: string;
|
|
134
167
|
Description: string;
|
|
@@ -140,7 +173,6 @@ export declare const AntInfoSchema: z.ZodObject<{
|
|
|
140
173
|
Handlers?: string[] | undefined;
|
|
141
174
|
HandlerNames?: string[] | undefined;
|
|
142
175
|
}, {
|
|
143
|
-
"Source-Code-TX-ID": string;
|
|
144
176
|
Name: string;
|
|
145
177
|
Ticker: string;
|
|
146
178
|
Description: string;
|
|
@@ -167,7 +199,7 @@ export interface AoANTRead {
|
|
|
167
199
|
getRecord({ undername }: {
|
|
168
200
|
undername: string;
|
|
169
201
|
}, opts?: AntReadOptions): Promise<AoANTRecord | undefined>;
|
|
170
|
-
getRecords(opts?: AntReadOptions): Promise<
|
|
202
|
+
getRecords(opts?: AntReadOptions): Promise<AoANTRecordEntry[]>;
|
|
171
203
|
getOwner(opts?: AntReadOptions): Promise<WalletAddress>;
|
|
172
204
|
getControllers(): Promise<WalletAddress[]>;
|
|
173
205
|
getTicker(opts?: AntReadOptions): Promise<string>;
|
|
@@ -176,6 +208,7 @@ export interface AoANTRead {
|
|
|
176
208
|
address: WalletAddress;
|
|
177
209
|
}, opts?: AntReadOptions): Promise<number>;
|
|
178
210
|
getBalances(opts?: AntReadOptions): Promise<Record<WalletAddress, number>>;
|
|
211
|
+
getHandlers(): Promise<AoANTHandler[]>;
|
|
179
212
|
}
|
|
180
213
|
export interface AoANTWrite extends AoANTRead {
|
|
181
214
|
transfer({ target }: {
|
|
@@ -207,6 +240,9 @@ export interface AoANTWrite extends AoANTRead {
|
|
|
207
240
|
setName({ name }: {
|
|
208
241
|
name: string;
|
|
209
242
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
243
|
+
setLogo({ txId }: {
|
|
244
|
+
txId: string;
|
|
245
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
210
246
|
releaseName({ name, ioProcessId }: {
|
|
211
247
|
name: string;
|
|
212
248
|
ioProcessId: string;
|
|
@@ -216,4 +252,13 @@ export interface AoANTWrite extends AoANTRead {
|
|
|
216
252
|
ioProcessId: string;
|
|
217
253
|
antProcessId: string;
|
|
218
254
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
255
|
+
approvePrimaryNameRequest({ name, address, ioProcessId, }: {
|
|
256
|
+
name: string;
|
|
257
|
+
address: WalletAddress;
|
|
258
|
+
ioProcessId: string;
|
|
259
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
260
|
+
removePrimaryNames({ names, ioProcessId }: {
|
|
261
|
+
names: string[];
|
|
262
|
+
ioProcessId: string;
|
|
263
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
219
264
|
}
|
|
@@ -44,6 +44,16 @@ export type WriteParameters<Input> = WithSigner<Required<ReadParameters<Input>>>
|
|
|
44
44
|
export type AoMessageResult = {
|
|
45
45
|
id: string;
|
|
46
46
|
};
|
|
47
|
+
export type AoPrimaryNameRequest = {
|
|
48
|
+
name: string;
|
|
49
|
+
startTimestamp: Timestamp;
|
|
50
|
+
endTimestamp: Timestamp;
|
|
51
|
+
};
|
|
52
|
+
export type AoPrimaryName = {
|
|
53
|
+
owner: WalletAddress;
|
|
54
|
+
name: string;
|
|
55
|
+
startTimestamp: Timestamp;
|
|
56
|
+
};
|
|
47
57
|
export type AtLeastOne<T, U = {
|
|
48
58
|
[K in keyof T]-?: Record<K, T[K]>;
|
|
49
59
|
}> = Partial<T> & U[keyof U];
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { AOProcess } from '../common/index.js';
|
|
17
|
-
import { AoMessageResult, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './index.js';
|
|
17
|
+
import { AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './index.js';
|
|
18
18
|
import { mIOToken } from './token.js';
|
|
19
19
|
export type PaginationParams<T = Record<string, never>> = {
|
|
20
20
|
cursor?: string;
|
|
@@ -46,19 +46,6 @@ export type AoRegistrationFees = Record<number, {
|
|
|
46
46
|
permabuy: number;
|
|
47
47
|
}>;
|
|
48
48
|
export type AoEpochIndex = number;
|
|
49
|
-
export interface AoIOState {
|
|
50
|
-
GatewayRegistry: Record<WalletAddress, AoGateway>;
|
|
51
|
-
Epochs: Record<AoEpochIndex, AoEpochData>;
|
|
52
|
-
NameRegistry: {
|
|
53
|
-
records: Record<string, AoArNSNameData>;
|
|
54
|
-
reserved: Record<string, AoArNSReservedNameData>;
|
|
55
|
-
};
|
|
56
|
-
Balances: Record<WalletAddress, number>;
|
|
57
|
-
Vaults: Record<WalletAddress, AoVaultData>;
|
|
58
|
-
Ticker: string;
|
|
59
|
-
Name: string;
|
|
60
|
-
Logo: string;
|
|
61
|
-
}
|
|
62
49
|
export type AoEpochObservationData = {
|
|
63
50
|
failureSummaries: Record<WalletAddress, WalletAddress[]>;
|
|
64
51
|
reports: Record<WalletAddress, TransactionId>;
|
|
@@ -92,6 +79,9 @@ export type AoArNSNameData = AoArNSPermabuyData | AoArNSLeaseData;
|
|
|
92
79
|
export type AoArNSNameDataWithName = AoArNSNameData & {
|
|
93
80
|
name: string;
|
|
94
81
|
};
|
|
82
|
+
export type AoArNSReservedNameDataWithName = AoArNSReservedNameData & {
|
|
83
|
+
name: string;
|
|
84
|
+
};
|
|
95
85
|
export type AoArNSBaseNameData = {
|
|
96
86
|
processId: ProcessId;
|
|
97
87
|
startTimestamp: number;
|
|
@@ -150,10 +140,8 @@ export type AoWalletVault = AoVaultData & {
|
|
|
150
140
|
};
|
|
151
141
|
export type AoGateway = {
|
|
152
142
|
settings: AoGatewaySettings;
|
|
153
|
-
delegates: AoGatewayDelegates;
|
|
154
143
|
stats: AoGatewayStats;
|
|
155
144
|
totalDelegatedStake: number;
|
|
156
|
-
vaults: Record<WalletAddress, AoVaultData>;
|
|
157
145
|
startTimestamp: Timestamp;
|
|
158
146
|
endTimestamp: Timestamp;
|
|
159
147
|
observerAddress: WalletAddress;
|
|
@@ -243,10 +231,19 @@ export type AoVaultDelegation = AoDelegationBase & AoVaultData & {
|
|
|
243
231
|
type: 'vault';
|
|
244
232
|
vaultId: TransactionId;
|
|
245
233
|
};
|
|
246
|
-
export type AoStakeDelegation =
|
|
234
|
+
export type AoStakeDelegation = AoDelegationBase & {
|
|
247
235
|
type: 'stake';
|
|
236
|
+
startTimestamp: Timestamp;
|
|
237
|
+
balance: number;
|
|
248
238
|
};
|
|
249
239
|
export type AoDelegation = AoStakeDelegation | AoVaultDelegation;
|
|
240
|
+
export type AoGatewayVault = {
|
|
241
|
+
cursorId: string;
|
|
242
|
+
vaultId: TransactionId;
|
|
243
|
+
balance: number;
|
|
244
|
+
endTimestamp: Timestamp;
|
|
245
|
+
startTimestamp: Timestamp;
|
|
246
|
+
};
|
|
250
247
|
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake' | 'observerAddress'> & Partial<AoGatewaySettings>;
|
|
251
248
|
export type AoUpdateGatewaySettingsParams = AtLeastOne<AoJoinNetworkParams>;
|
|
252
249
|
export interface AoIORead {
|
|
@@ -268,6 +265,15 @@ export interface AoIORead {
|
|
|
268
265
|
} & PaginationParams<AoGatewayDelegateWithAddress>): Promise<PaginationResult<AoGatewayDelegateWithAddress>>;
|
|
269
266
|
getGatewayDelegateAllowList(params?: PaginationParams<WalletAddress>): Promise<PaginationResult<WalletAddress>>;
|
|
270
267
|
getGateways(params?: PaginationParams<AoGatewayWithAddress>): Promise<PaginationResult<AoGatewayWithAddress>>;
|
|
268
|
+
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
269
|
+
address: WalletAddress;
|
|
270
|
+
}): Promise<PaginationResult<AoDelegation>>;
|
|
271
|
+
getAllowedDelegates(params: PaginationParams & {
|
|
272
|
+
address: WalletAddress;
|
|
273
|
+
}): Promise<PaginationResult<WalletAddress>>;
|
|
274
|
+
getGatewayVaults(params: PaginationParams<AoGatewayVault> & {
|
|
275
|
+
address: WalletAddress;
|
|
276
|
+
}): Promise<PaginationResult<AoGatewayVault>>;
|
|
271
277
|
getBalance(params: {
|
|
272
278
|
address: WalletAddress;
|
|
273
279
|
}): Promise<number>;
|
|
@@ -276,7 +282,7 @@ export interface AoIORead {
|
|
|
276
282
|
name: string;
|
|
277
283
|
}): Promise<AoArNSNameData | undefined>;
|
|
278
284
|
getArNSRecords(params?: PaginationParams<AoArNSNameDataWithName>): Promise<PaginationResult<AoArNSNameDataWithName>>;
|
|
279
|
-
getArNSReservedNames(): Promise<
|
|
285
|
+
getArNSReservedNames(params?: PaginationParams<AoArNSReservedNameDataWithName>): Promise<PaginationResult<AoArNSReservedNameDataWithName>>;
|
|
280
286
|
getArNSReservedName({ name, }: {
|
|
281
287
|
name: string;
|
|
282
288
|
}): Promise<AoArNSReservedNameData | undefined>;
|
|
@@ -311,6 +317,20 @@ export interface AoIORead {
|
|
|
311
317
|
address: WalletAddress;
|
|
312
318
|
vaultId: string;
|
|
313
319
|
}): Promise<AoVaultData>;
|
|
320
|
+
getPrimaryNameRequest(params: {
|
|
321
|
+
initiator: WalletAddress;
|
|
322
|
+
} | {
|
|
323
|
+
name: string;
|
|
324
|
+
}): Promise<AoMessageResult>;
|
|
325
|
+
getPrimaryNameRequests(params: PaginationParams<AoPrimaryNameRequest> & {
|
|
326
|
+
initiator?: WalletAddress;
|
|
327
|
+
}): Promise<PaginationResult<AoPrimaryNameRequest>>;
|
|
328
|
+
getPrimaryName(params: {
|
|
329
|
+
address: WalletAddress;
|
|
330
|
+
} | {
|
|
331
|
+
name: string;
|
|
332
|
+
}): Promise<AoPrimaryName>;
|
|
333
|
+
getPrimaryNames(params?: PaginationParams<AoPrimaryName>): Promise<PaginationResult<AoPrimaryName>>;
|
|
314
334
|
}
|
|
315
335
|
export interface AoIOWrite extends AoIORead {
|
|
316
336
|
transfer({ target, qty, }: {
|
|
@@ -371,6 +391,9 @@ export interface AoIOWrite extends AoIORead {
|
|
|
371
391
|
type?: 'lease' | 'permabuy';
|
|
372
392
|
years?: number;
|
|
373
393
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
394
|
+
requestPrimaryName(params: {
|
|
395
|
+
name: string;
|
|
396
|
+
}): Promise<AoMessageResult>;
|
|
374
397
|
}
|
|
375
398
|
export declare function isProcessConfiguration(config: object): config is {
|
|
376
399
|
process: AOProcess;
|
package/lib/types/utils/ao.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Arweave from 'arweave';
|
|
2
2
|
import { Logger } from '../common/index.js';
|
|
3
|
-
import { AoANTRecord } from '../types/ant.js';
|
|
3
|
+
import { AoANTRecord, AoANTRecordEntry } from '../types/ant.js';
|
|
4
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;
|
|
@@ -31,3 +31,8 @@ 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
|
+
/**
|
|
35
|
+
* @param records @type {AoANTRecordEntry[] | Record<string, AoANTRecord>} - the records returned by an ANT
|
|
36
|
+
* @returns @type {AoANTRecordEntry[]} - the alphabetically sorted records
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseAntRecords(records: AoANTRecordEntry[] | Record<string, AoANTRecord>): AoANTRecordEntry[];
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
17
|
import { BlockHeight, Timestamp } from '../types/common.js';
|
|
18
|
+
import { PaginationParams } from '../types/io.js';
|
|
18
19
|
export declare const validateArweaveId: (id: string) => boolean;
|
|
19
20
|
export declare function isBlockHeight(height: string | number): height is BlockHeight;
|
|
20
21
|
export declare const pruneTags: (tags: {
|
|
@@ -25,3 +26,7 @@ export declare const pruneTags: (tags: {
|
|
|
25
26
|
value: string;
|
|
26
27
|
}[];
|
|
27
28
|
export declare const getCurrentBlockUnixTimestampMs: (arweave: Arweave) => Promise<Timestamp>;
|
|
29
|
+
export declare const paginationParamsToTags: <T>(params?: PaginationParams<T>) => {
|
|
30
|
+
name: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}[];
|
package/lib/types/version.d.ts
CHANGED