@ar.io/sdk 2.4.0 → 2.5.0-alpha.10
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 +266 -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 -77
- 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 -78
- 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 +50 -17
- 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, 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>;
|
|
@@ -125,6 +125,24 @@ export declare class IOReadable implements AoIORead {
|
|
|
125
125
|
timestamp?: number;
|
|
126
126
|
intervalMs?: number;
|
|
127
127
|
}): Promise<AoAuctionPriceData>;
|
|
128
|
+
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
129
|
+
address: WalletAddress;
|
|
130
|
+
}): Promise<PaginationResult<AoDelegation>>;
|
|
131
|
+
getGatewayVaults(params: PaginationParams<AoGatewayVault> & {
|
|
132
|
+
address: WalletAddress;
|
|
133
|
+
}): Promise<PaginationResult<AoGatewayVault>>;
|
|
134
|
+
getPrimaryNameRequest(params: {
|
|
135
|
+
initiator: WalletAddress;
|
|
136
|
+
} | {
|
|
137
|
+
name: string;
|
|
138
|
+
}): Promise<AoMessageResult>;
|
|
139
|
+
getPrimaryNameRequests(params: PaginationParams<AoPrimaryNameRequest>): Promise<PaginationResult<AoPrimaryNameRequest>>;
|
|
140
|
+
getPrimaryName(params: {
|
|
141
|
+
address: WalletAddress;
|
|
142
|
+
} | {
|
|
143
|
+
name: string;
|
|
144
|
+
}): Promise<AoPrimaryName>;
|
|
145
|
+
getPrimaryNames(params: PaginationParams<AoPrimaryName>): Promise<PaginationResult<AoPrimaryName>>;
|
|
128
146
|
}
|
|
129
147
|
export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
130
148
|
protected process: AOProcess;
|
|
@@ -226,4 +244,7 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
226
244
|
type?: 'lease' | 'permabuy';
|
|
227
245
|
years?: number;
|
|
228
246
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
247
|
+
requestPrimaryName(params: {
|
|
248
|
+
name: string;
|
|
249
|
+
}): Promise<AoMessageResult>;
|
|
229
250
|
}
|
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;
|
|
@@ -234,6 +222,28 @@ export type AoAuctionPriceData = {
|
|
|
234
222
|
prices: Record<string, number>;
|
|
235
223
|
currentPrice: number;
|
|
236
224
|
};
|
|
225
|
+
export type AoDelegationBase = {
|
|
226
|
+
type: 'stake' | 'vault';
|
|
227
|
+
gatewayAddress: WalletAddress;
|
|
228
|
+
delegationId: string;
|
|
229
|
+
};
|
|
230
|
+
export type AoVaultDelegation = AoDelegationBase & AoVaultData & {
|
|
231
|
+
type: 'vault';
|
|
232
|
+
vaultId: TransactionId;
|
|
233
|
+
};
|
|
234
|
+
export type AoStakeDelegation = AoDelegationBase & {
|
|
235
|
+
type: 'stake';
|
|
236
|
+
startTimestamp: Timestamp;
|
|
237
|
+
balance: number;
|
|
238
|
+
};
|
|
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
|
+
};
|
|
237
247
|
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake' | 'observerAddress'> & Partial<AoGatewaySettings>;
|
|
238
248
|
export type AoUpdateGatewaySettingsParams = AtLeastOne<AoJoinNetworkParams>;
|
|
239
249
|
export interface AoIORead {
|
|
@@ -255,6 +265,12 @@ export interface AoIORead {
|
|
|
255
265
|
} & PaginationParams<AoGatewayDelegateWithAddress>): Promise<PaginationResult<AoGatewayDelegateWithAddress>>;
|
|
256
266
|
getGatewayDelegateAllowList(params?: PaginationParams<WalletAddress>): Promise<PaginationResult<WalletAddress>>;
|
|
257
267
|
getGateways(params?: PaginationParams<AoGatewayWithAddress>): Promise<PaginationResult<AoGatewayWithAddress>>;
|
|
268
|
+
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
269
|
+
address: WalletAddress;
|
|
270
|
+
}): Promise<PaginationResult<AoDelegation>>;
|
|
271
|
+
getGatewayVaults(params: PaginationParams<AoGatewayVault> & {
|
|
272
|
+
address: WalletAddress;
|
|
273
|
+
}): Promise<PaginationResult<AoGatewayVault>>;
|
|
258
274
|
getBalance(params: {
|
|
259
275
|
address: WalletAddress;
|
|
260
276
|
}): Promise<number>;
|
|
@@ -263,7 +279,7 @@ export interface AoIORead {
|
|
|
263
279
|
name: string;
|
|
264
280
|
}): Promise<AoArNSNameData | undefined>;
|
|
265
281
|
getArNSRecords(params?: PaginationParams<AoArNSNameDataWithName>): Promise<PaginationResult<AoArNSNameDataWithName>>;
|
|
266
|
-
getArNSReservedNames(): Promise<
|
|
282
|
+
getArNSReservedNames(params?: PaginationParams<AoArNSReservedNameDataWithName>): Promise<PaginationResult<AoArNSReservedNameDataWithName>>;
|
|
267
283
|
getArNSReservedName({ name, }: {
|
|
268
284
|
name: string;
|
|
269
285
|
}): Promise<AoArNSReservedNameData | undefined>;
|
|
@@ -298,6 +314,20 @@ export interface AoIORead {
|
|
|
298
314
|
address: WalletAddress;
|
|
299
315
|
vaultId: string;
|
|
300
316
|
}): Promise<AoVaultData>;
|
|
317
|
+
getPrimaryNameRequest(params: {
|
|
318
|
+
initiator: WalletAddress;
|
|
319
|
+
} | {
|
|
320
|
+
name: string;
|
|
321
|
+
}): Promise<AoMessageResult>;
|
|
322
|
+
getPrimaryNameRequests(params: PaginationParams<AoPrimaryNameRequest> & {
|
|
323
|
+
initiator?: WalletAddress;
|
|
324
|
+
}): Promise<PaginationResult<AoPrimaryNameRequest>>;
|
|
325
|
+
getPrimaryName(params: {
|
|
326
|
+
address: WalletAddress;
|
|
327
|
+
} | {
|
|
328
|
+
name: string;
|
|
329
|
+
}): Promise<AoPrimaryName>;
|
|
330
|
+
getPrimaryNames(params?: PaginationParams<AoPrimaryName>): Promise<PaginationResult<AoPrimaryName>>;
|
|
301
331
|
}
|
|
302
332
|
export interface AoIOWrite extends AoIORead {
|
|
303
333
|
transfer({ target, qty, }: {
|
|
@@ -358,6 +388,9 @@ export interface AoIOWrite extends AoIORead {
|
|
|
358
388
|
type?: 'lease' | 'permabuy';
|
|
359
389
|
years?: number;
|
|
360
390
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
391
|
+
requestPrimaryName(params: {
|
|
392
|
+
name: string;
|
|
393
|
+
}): Promise<AoMessageResult>;
|
|
361
394
|
}
|
|
362
395
|
export declare function isProcessConfiguration(config: object): config is {
|
|
363
396
|
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