@ar.io/sdk 2.6.0 → 2.7.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/bundles/web.bundle.min.js +65 -65
- package/lib/cjs/cli/cli.js +713 -0
- package/lib/cjs/cli/commands/gatewayWriteCommands.js +211 -0
- package/lib/cjs/cli/commands/readCommands.js +219 -0
- package/lib/cjs/cli/commands/transfer.js +26 -0
- package/lib/cjs/cli/options.js +336 -0
- package/lib/cjs/cli/types.js +2 -0
- package/lib/cjs/cli/utils.js +406 -0
- package/lib/cjs/common/io.js +2 -7
- package/lib/cjs/types/io.js +13 -1
- package/lib/cjs/utils/ao.js +32 -13
- package/lib/cjs/utils/base64.js +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +711 -0
- package/lib/esm/cli/commands/gatewayWriteCommands.js +194 -0
- package/lib/esm/cli/commands/readCommands.js +197 -0
- package/lib/esm/cli/commands/transfer.js +22 -0
- package/lib/esm/cli/options.js +333 -0
- package/lib/esm/cli/types.js +1 -0
- package/lib/esm/cli/utils.js +366 -0
- package/lib/esm/common/io.js +2 -7
- package/lib/esm/types/io.js +11 -0
- package/lib/esm/utils/ao.js +30 -12
- package/lib/esm/utils/base64.js +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/cli.d.ts +2 -0
- package/lib/types/cli/commands/gatewayWriteCommands.d.ts +38 -0
- package/lib/types/cli/commands/readCommands.d.ts +57 -0
- package/lib/types/cli/commands/transfer.d.ts +23 -0
- package/lib/types/cli/options.d.ts +326 -0
- package/lib/types/cli/types.d.ts +106 -0
- package/lib/types/cli/utils.d.ts +66 -0
- package/lib/types/common/io.d.ts +4 -7
- package/lib/types/types/io.d.ts +81 -60
- package/lib/types/utils/ao.d.ts +20 -10
- package/lib/types/version.d.ts +1 -1
- package/package.json +7 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { JWKInterface } from 'arweave/node/lib/wallet.js';
|
|
2
|
+
import { Command, OptionValues } from 'commander';
|
|
3
|
+
import { AoANTRead, AoANTWrite, AoIORead, AoIOWrite, AoRedelegateStakeParams, AoSigner, AoUpdateGatewaySettingsParams, ContractSigner, EpochInput, IOToken, Logger, PaginationParams, SpawnANTState, WriteOptions, mIOToken } from '../node/index.js';
|
|
4
|
+
import { ANTStateCLIOptions, AddressCLIOptions, EpochCLIOptions, GlobalCLIOptions, InitiatorCLIOptions, JsonSerializable, PaginationCLIOptions, ProcessIdCLIOptions, RedelegateStakeCLIOptions, TransferCLIOptions, UpdateGatewaySettingsCLIOptions, WalletCLIOptions, WriteActionCLIOptions } from './types.js';
|
|
5
|
+
export declare function stringifyJsonForCLIDisplay(json: JsonSerializable | unknown): string;
|
|
6
|
+
export declare function runCommand<O extends OptionValues>(command: Command, action: (options: O) => Promise<JsonSerializable>): Promise<void>;
|
|
7
|
+
export interface CommanderOption {
|
|
8
|
+
alias: string;
|
|
9
|
+
description: string;
|
|
10
|
+
default?: string | boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function makeCommand<O extends OptionValues = GlobalCLIOptions>({ description, name, options, action, }: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
action?: (options: O) => Promise<JsonSerializable>;
|
|
16
|
+
options?: CommanderOption[];
|
|
17
|
+
}): Command;
|
|
18
|
+
export declare function ioProcessIdFromOptions({ ioProcessId, dev, }: GlobalCLIOptions): string;
|
|
19
|
+
export declare function requiredJwkFromOptions(options: WalletCLIOptions): JWKInterface;
|
|
20
|
+
export declare function jwkToAddress(jwk: JWKInterface): string;
|
|
21
|
+
export declare function getLoggerFromOptions(options: GlobalCLIOptions): Logger;
|
|
22
|
+
export declare function readIOFromOptions(options: GlobalCLIOptions): AoIORead;
|
|
23
|
+
export declare function requiredContractSignerFromOptions(options: WalletCLIOptions): {
|
|
24
|
+
signer: ContractSigner;
|
|
25
|
+
signerAddress: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function requiredAoSignerFromOptions(options: WalletCLIOptions): AoSigner;
|
|
28
|
+
export declare function writeIOFromOptions(options: GlobalCLIOptions): {
|
|
29
|
+
io: AoIOWrite;
|
|
30
|
+
signerAddress: string;
|
|
31
|
+
};
|
|
32
|
+
export declare function formatIOWithCommas(value: IOToken): string;
|
|
33
|
+
/** helper to get address from --address option first, then check wallet options */
|
|
34
|
+
export declare function addressFromOptions<O extends AddressCLIOptions>(options: O): string | undefined;
|
|
35
|
+
export declare function requiredAddressFromOptions<O extends AddressCLIOptions>(options: O): string;
|
|
36
|
+
export declare function paginationParamsFromOptions<O extends PaginationCLIOptions>(options: O): PaginationParams & {
|
|
37
|
+
sortBy: any;
|
|
38
|
+
};
|
|
39
|
+
export declare function epochInputFromOptions(options: EpochCLIOptions): EpochInput;
|
|
40
|
+
export declare function requiredInitiatorFromOptions(options: InitiatorCLIOptions): string;
|
|
41
|
+
export declare function writeActionTagsFromOptions<O extends WriteActionCLIOptions>(options: O): WriteOptions;
|
|
42
|
+
export declare function gatewaySettingsFromOptions({ allowDelegatedStaking, autoStake, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, observerAddress, port, properties, allowedDelegates, }: UpdateGatewaySettingsCLIOptions): AoUpdateGatewaySettingsParams;
|
|
43
|
+
export declare function requiredTargetAndQuantityFromOptions(options: TransferCLIOptions): {
|
|
44
|
+
target: string;
|
|
45
|
+
ioQuantity: IOToken;
|
|
46
|
+
};
|
|
47
|
+
export declare function redelegateParamsFromOptions(options: RedelegateStakeCLIOptions): AoRedelegateStakeParams & {
|
|
48
|
+
stakeQty: mIOToken;
|
|
49
|
+
};
|
|
50
|
+
export declare function recordTypeFromOptions<O extends {
|
|
51
|
+
type?: string;
|
|
52
|
+
}>(options: O): 'lease' | 'permabuy';
|
|
53
|
+
export declare function requiredMIOFromOptions<O extends GlobalCLIOptions>(options: O, key: string): mIOToken;
|
|
54
|
+
export declare function assertEnoughBalance(io: AoIORead, address: string, ioQuantity: IOToken): Promise<void>;
|
|
55
|
+
export declare function confirmationPrompt(message: string): Promise<boolean>;
|
|
56
|
+
export declare function assertConfirmationPrompt<O extends {
|
|
57
|
+
skipConfirmation?: boolean;
|
|
58
|
+
}>(message: string, options: O): Promise<boolean>;
|
|
59
|
+
export declare function requiredProcessIdFromOptions<O extends ProcessIdCLIOptions>(o: O): string;
|
|
60
|
+
export declare function readANTFromOptions(options: ProcessIdCLIOptions): AoANTRead;
|
|
61
|
+
export declare function writeANTFromOptions(options: ProcessIdCLIOptions, signer?: ContractSigner): AoANTWrite;
|
|
62
|
+
export declare function requiredStringFromOptions<O extends GlobalCLIOptions>(options: O, key: string): string;
|
|
63
|
+
export declare function requiredStringArrayFromOptions<O extends GlobalCLIOptions>(options: O, key: string): string[];
|
|
64
|
+
export declare function positiveIntegerFromOptions<O extends GlobalCLIOptions>(options: O, key: string): number | undefined;
|
|
65
|
+
export declare function requiredPositiveIntegerFromOptions<O extends GlobalCLIOptions>(options: O, key: string): number;
|
|
66
|
+
export declare function getANTStateFromOptions(options: ANTStateCLIOptions): SpawnANTState;
|
package/lib/types/common/io.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
17
|
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoAuction, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AoRedelegationFeeInfo, 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, AoGatewayRegistrySettings, AoGatewayVault, AoIORead, AoIOWrite, AoRegistrationFees, AoVaultData, AoWalletVault, DemandFactorSettings, EpochInput } from '../types/io.js';
|
|
18
|
+
import { AoArNSNameData, AoArNSReservedNameDataWithName, AoAuctionPriceData, AoDelegation, AoEpochData, AoEpochSettings, AoGateway, AoGatewayDelegateWithAddress, AoGatewayRegistrySettings, AoGatewayVault, AoIORead, AoIOWrite, AoPaginatedAddressParams, AoRegistrationFees, AoVaultData, AoWalletVault, DemandFactorSettings, 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 {
|
|
@@ -76,9 +76,7 @@ export declare class IOReadable implements AoIORead {
|
|
|
76
76
|
[x: string]: any;
|
|
77
77
|
address: any;
|
|
78
78
|
}): Promise<PaginationResult<AoGatewayDelegateWithAddress>>;
|
|
79
|
-
getGatewayDelegateAllowList({ address, ...pageParams }:
|
|
80
|
-
address: WalletAddress;
|
|
81
|
-
} & PaginationParams<WalletAddress>): Promise<PaginationResult<WalletAddress>>;
|
|
79
|
+
getGatewayDelegateAllowList({ address, ...pageParams }: AoPaginatedAddressParams): Promise<PaginationResult<WalletAddress>>;
|
|
82
80
|
getGateways(pageParams?: PaginationParams<AoGatewayWithAddress>): Promise<PaginationResult<AoGatewayWithAddress>>;
|
|
83
81
|
getCurrentEpoch(): Promise<AoEpochData>;
|
|
84
82
|
getPrescribedObservers(epoch?: EpochInput): Promise<AoWeightedObserver[]>;
|
|
@@ -137,9 +135,7 @@ export declare class IOReadable implements AoIORead {
|
|
|
137
135
|
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
138
136
|
address: WalletAddress;
|
|
139
137
|
}): Promise<PaginationResult<AoDelegation>>;
|
|
140
|
-
getAllowedDelegates(params:
|
|
141
|
-
address: WalletAddress;
|
|
142
|
-
}): Promise<PaginationResult<WalletAddress>>;
|
|
138
|
+
getAllowedDelegates(params: AoPaginatedAddressParams): Promise<PaginationResult<WalletAddress>>;
|
|
143
139
|
getGatewayVaults(params: PaginationParams<AoGatewayVault> & {
|
|
144
140
|
address: WalletAddress;
|
|
145
141
|
}): Promise<PaginationResult<AoGatewayVault>>;
|
|
@@ -206,6 +202,7 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
206
202
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
207
203
|
decreaseOperatorStake(params: {
|
|
208
204
|
decreaseQty: number | mIOToken;
|
|
205
|
+
instant?: boolean;
|
|
209
206
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
210
207
|
saveObservations(params: {
|
|
211
208
|
reportTxId: TransactionId;
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export type PaginationParams<T = Record<string, never>> = {
|
|
|
24
24
|
};
|
|
25
25
|
export type PaginationResult<T> = {
|
|
26
26
|
items: T[];
|
|
27
|
-
nextCursor
|
|
27
|
+
nextCursor?: string;
|
|
28
28
|
totalItems: number;
|
|
29
|
-
sortBy?: keyof T;
|
|
29
|
+
sortBy?: T extends string ? string : keyof T;
|
|
30
30
|
sortOrder: 'asc' | 'desc';
|
|
31
31
|
hasMore: boolean;
|
|
32
32
|
};
|
|
@@ -131,7 +131,7 @@ export type AoGatewayService = {
|
|
|
131
131
|
};
|
|
132
132
|
export type AoGatewayServices = {
|
|
133
133
|
bundlers: AoGatewayService[];
|
|
134
|
-
}
|
|
134
|
+
};
|
|
135
135
|
export type AoGatewayDelegates = Record<WalletAddress, AoGatewayDelegate>;
|
|
136
136
|
export type AoGatewayDelegateAllowList = WalletAddress[];
|
|
137
137
|
export type AoWalletVault = AoVaultData & {
|
|
@@ -148,7 +148,7 @@ export type AoGateway = {
|
|
|
148
148
|
operatorStake: number;
|
|
149
149
|
status: 'joined' | 'leaving';
|
|
150
150
|
weights: AoGatewayWeights;
|
|
151
|
-
services
|
|
151
|
+
services?: AoGatewayServices;
|
|
152
152
|
};
|
|
153
153
|
export type AoGatewayStats = {
|
|
154
154
|
passedConsecutiveEpochs: number;
|
|
@@ -243,8 +243,68 @@ export type AoGatewayVault = {
|
|
|
243
243
|
endTimestamp: Timestamp;
|
|
244
244
|
startTimestamp: Timestamp;
|
|
245
245
|
};
|
|
246
|
-
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake'
|
|
247
|
-
|
|
246
|
+
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake'> & Partial<AoGatewaySettings> & {
|
|
247
|
+
observerAddress?: WalletAddress;
|
|
248
|
+
};
|
|
249
|
+
export type AoUpdateGatewaySettingsParams = AtLeastOne<Omit<AoJoinNetworkParams, 'operatorStake'>>;
|
|
250
|
+
export type AoArNSNameParams = {
|
|
251
|
+
name: string;
|
|
252
|
+
};
|
|
253
|
+
export type AoAddressParams = {
|
|
254
|
+
address: WalletAddress;
|
|
255
|
+
};
|
|
256
|
+
export type AoBalanceParams = AoAddressParams;
|
|
257
|
+
export type AoPaginatedAddressParams = PaginationParams & AoAddressParams;
|
|
258
|
+
export type AoDelegateStakeParams = {
|
|
259
|
+
target: WalletAddress;
|
|
260
|
+
stakeQty: number | mIOToken;
|
|
261
|
+
};
|
|
262
|
+
export type AoGetArNSRecordsParams = PaginationParams<AoArNSNameDataWithName>;
|
|
263
|
+
export type AoArNSAuctionPricesParams = {
|
|
264
|
+
name: string;
|
|
265
|
+
type: 'lease' | 'permabuy';
|
|
266
|
+
years?: number;
|
|
267
|
+
timestamp?: number;
|
|
268
|
+
intervalMs?: number;
|
|
269
|
+
};
|
|
270
|
+
export type AoRedelegateStakeParams = {
|
|
271
|
+
target: string;
|
|
272
|
+
source: string;
|
|
273
|
+
stakeQty: number | mIOToken;
|
|
274
|
+
vaultId?: string;
|
|
275
|
+
};
|
|
276
|
+
export declare const validIntents: string[];
|
|
277
|
+
export declare const intentsUsingYears: string[];
|
|
278
|
+
export type Intent = (typeof validIntents)[number];
|
|
279
|
+
export declare const isValidIntent: (intent: string) => intent is string;
|
|
280
|
+
export type AoTokenCostParams = {
|
|
281
|
+
intent: Intent;
|
|
282
|
+
type?: 'permabuy' | 'lease';
|
|
283
|
+
years?: number;
|
|
284
|
+
name: string;
|
|
285
|
+
quantity?: number;
|
|
286
|
+
};
|
|
287
|
+
export type AoGetVaultParams = {
|
|
288
|
+
address: WalletAddress;
|
|
289
|
+
vaultId: string;
|
|
290
|
+
};
|
|
291
|
+
export type AoBuyRecordParams = AoArNSNameParams & {
|
|
292
|
+
years?: number;
|
|
293
|
+
type: 'lease' | 'permabuy';
|
|
294
|
+
processId: string;
|
|
295
|
+
};
|
|
296
|
+
export type AoExtendLeaseParams = AoArNSNameParams & {
|
|
297
|
+
years: number;
|
|
298
|
+
};
|
|
299
|
+
export type AoIncreaseUndernameLimitParams = AoArNSNameParams & {
|
|
300
|
+
increaseCount: number;
|
|
301
|
+
};
|
|
302
|
+
export type AoSubmitAuctionBidParams = AoArNSNameParams & {
|
|
303
|
+
processId: string;
|
|
304
|
+
quantity?: number;
|
|
305
|
+
type?: 'lease' | 'permabuy';
|
|
306
|
+
years?: number;
|
|
307
|
+
};
|
|
248
308
|
export type AoGatewayRegistrySettings = {
|
|
249
309
|
delegates: {
|
|
250
310
|
minStake: number;
|
|
@@ -286,20 +346,14 @@ export interface AoIORead {
|
|
|
286
346
|
}>;
|
|
287
347
|
getTokenSupply(): Promise<AoTokenSupplyData>;
|
|
288
348
|
getEpochSettings(params?: EpochInput): Promise<AoEpochSettings>;
|
|
289
|
-
getGateway({ address
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
getGatewayDelegates({ address, ...pageParams }: {
|
|
293
|
-
address: WalletAddress;
|
|
294
|
-
} & PaginationParams<AoGatewayDelegateWithAddress>): Promise<PaginationResult<AoGatewayDelegateWithAddress>>;
|
|
295
|
-
getGatewayDelegateAllowList(params?: PaginationParams<WalletAddress>): Promise<PaginationResult<WalletAddress>>;
|
|
349
|
+
getGateway({ address }: AoAddressParams): Promise<AoGateway | undefined>;
|
|
350
|
+
getGatewayDelegates({ address, ...pageParams }: AoAddressParams & PaginationParams<AoGatewayDelegateWithAddress>): Promise<PaginationResult<AoGatewayDelegateWithAddress>>;
|
|
351
|
+
getGatewayDelegateAllowList(params: AoPaginatedAddressParams): Promise<PaginationResult<WalletAddress>>;
|
|
296
352
|
getGateways(params?: PaginationParams<AoGatewayWithAddress>): Promise<PaginationResult<AoGatewayWithAddress>>;
|
|
297
353
|
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
298
354
|
address: WalletAddress;
|
|
299
355
|
}): Promise<PaginationResult<AoDelegation>>;
|
|
300
|
-
getAllowedDelegates(params:
|
|
301
|
-
address: WalletAddress;
|
|
302
|
-
}): Promise<PaginationResult<WalletAddress>>;
|
|
356
|
+
getAllowedDelegates(params: AoPaginatedAddressParams): Promise<PaginationResult<WalletAddress>>;
|
|
303
357
|
getGatewayVaults(params: PaginationParams<AoGatewayVault> & {
|
|
304
358
|
address: WalletAddress;
|
|
305
359
|
}): Promise<PaginationResult<AoGatewayVault>>;
|
|
@@ -310,7 +364,7 @@ export interface AoIORead {
|
|
|
310
364
|
getArNSRecord({ name, }: {
|
|
311
365
|
name: string;
|
|
312
366
|
}): Promise<AoArNSNameData | undefined>;
|
|
313
|
-
getArNSRecords(params?:
|
|
367
|
+
getArNSRecords(params?: AoGetArNSRecordsParams): Promise<PaginationResult<AoArNSNameDataWithName>>;
|
|
314
368
|
getArNSReservedNames(params?: PaginationParams<AoArNSReservedNameDataWithName>): Promise<PaginationResult<AoArNSReservedNameDataWithName>>;
|
|
315
369
|
getArNSReservedName({ name, }: {
|
|
316
370
|
name: string;
|
|
@@ -319,34 +373,19 @@ export interface AoIORead {
|
|
|
319
373
|
getArNSAuction({ name }: {
|
|
320
374
|
name: string;
|
|
321
375
|
}): Promise<AoAuction | undefined>;
|
|
322
|
-
getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }:
|
|
323
|
-
|
|
324
|
-
type: 'lease' | 'permabuy';
|
|
325
|
-
years?: number;
|
|
326
|
-
timestamp?: number;
|
|
327
|
-
intervalMs?: number;
|
|
328
|
-
}): Promise<AoAuctionPriceData>;
|
|
329
|
-
getEpoch(epoch?: EpochInput): Promise<AoEpochData>;
|
|
376
|
+
getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }: AoArNSAuctionPricesParams): Promise<AoAuctionPriceData>;
|
|
377
|
+
getEpoch(epoch?: EpochInput): Promise<AoEpochData | undefined>;
|
|
330
378
|
getCurrentEpoch(): Promise<AoEpochData>;
|
|
331
379
|
getPrescribedObservers(epoch?: EpochInput): Promise<AoWeightedObserver[]>;
|
|
332
380
|
getPrescribedNames(epoch?: EpochInput): Promise<string[]>;
|
|
333
381
|
getObservations(epoch?: EpochInput): Promise<AoEpochObservationData>;
|
|
334
382
|
getDistributions(epoch?: EpochInput): Promise<AoEpochDistributionData>;
|
|
335
|
-
getTokenCost({ intent, type, years, name, quantity, }:
|
|
336
|
-
intent: 'Buy-Record' | 'Extend-Lease' | 'Increase-Undername-Limit' | 'Upgrade-Name' | 'Primary-Name-Request';
|
|
337
|
-
type?: 'permabuy' | 'lease';
|
|
338
|
-
years?: number;
|
|
339
|
-
name: string;
|
|
340
|
-
quantity?: number;
|
|
341
|
-
}): Promise<number>;
|
|
383
|
+
getTokenCost({ intent, type, years, name, quantity, }: AoTokenCostParams): Promise<number>;
|
|
342
384
|
getRegistrationFees(): Promise<AoRegistrationFees>;
|
|
343
385
|
getDemandFactor(): Promise<number>;
|
|
344
386
|
getDemandFactorSettings(): Promise<DemandFactorSettings>;
|
|
345
387
|
getVaults(params?: PaginationParams<AoWalletVault>): Promise<PaginationResult<AoWalletVault>>;
|
|
346
|
-
getVault({ address, vaultId, }:
|
|
347
|
-
address: WalletAddress;
|
|
348
|
-
vaultId: string;
|
|
349
|
-
}): Promise<AoVaultData>;
|
|
388
|
+
getVault({ address, vaultId, }: AoGetVaultParams): Promise<AoVaultData | undefined>;
|
|
350
389
|
getPrimaryNameRequest(params: {
|
|
351
390
|
initiator: WalletAddress;
|
|
352
391
|
}): Promise<AoPrimaryNameRequest>;
|
|
@@ -355,7 +394,7 @@ export interface AoIORead {
|
|
|
355
394
|
address: WalletAddress;
|
|
356
395
|
} | {
|
|
357
396
|
name: string;
|
|
358
|
-
}): Promise<AoPrimaryName>;
|
|
397
|
+
}): Promise<AoPrimaryName | undefined>;
|
|
359
398
|
getPrimaryNames(params?: PaginationParams<AoPrimaryName>): Promise<PaginationResult<AoPrimaryName>>;
|
|
360
399
|
getRedelegationFee(params: {
|
|
361
400
|
address: WalletAddress;
|
|
@@ -393,23 +432,10 @@ export interface AoIOWrite extends AoIORead {
|
|
|
393
432
|
reportTxId: TransactionId;
|
|
394
433
|
failedGateways: WalletAddress[];
|
|
395
434
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
396
|
-
buyRecord(params:
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
processId: string;
|
|
401
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
402
|
-
upgradeRecord(params: {
|
|
403
|
-
name: string;
|
|
404
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
405
|
-
extendLease(params: {
|
|
406
|
-
name: string;
|
|
407
|
-
years: number;
|
|
408
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
409
|
-
increaseUndernameLimit(params: {
|
|
410
|
-
name: string;
|
|
411
|
-
increaseCount: number;
|
|
412
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
435
|
+
buyRecord(params: AoBuyRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
436
|
+
upgradeRecord(params: AoArNSNameParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
437
|
+
extendLease(params: AoExtendLeaseParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
438
|
+
increaseUndernameLimit(params: AoIncreaseUndernameLimitParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
413
439
|
cancelWithdrawal(params: {
|
|
414
440
|
gatewayAddress?: WalletAddress;
|
|
415
441
|
vaultId: string;
|
|
@@ -424,12 +450,7 @@ export interface AoIOWrite extends AoIORead {
|
|
|
424
450
|
requestPrimaryName(params: {
|
|
425
451
|
name: string;
|
|
426
452
|
}): Promise<AoMessageResult>;
|
|
427
|
-
redelegateStake(params:
|
|
428
|
-
target: string;
|
|
429
|
-
source: string;
|
|
430
|
-
stakeQty: number | mIOToken;
|
|
431
|
-
vaultId?: string;
|
|
432
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
453
|
+
redelegateStake(params: AoRedelegateStakeParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
433
454
|
}
|
|
434
455
|
export declare function isProcessConfiguration(config: object): config is {
|
|
435
456
|
process: AOProcess;
|
package/lib/types/utils/ao.d.ts
CHANGED
|
@@ -2,25 +2,29 @@ import Arweave from 'arweave';
|
|
|
2
2
|
import { Logger } from '../common/index.js';
|
|
3
3
|
import { AoANTRecord } from '../types/ant.js';
|
|
4
4
|
import { AoClient, AoSigner, ContractSigner, WalletAddress } from '../types/index.js';
|
|
5
|
-
export
|
|
5
|
+
export type SpawnANTState = {
|
|
6
|
+
owner: WalletAddress;
|
|
7
|
+
controllers: WalletAddress[];
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
keywords: string[];
|
|
11
|
+
ticker: string;
|
|
12
|
+
records: Record<string, AoANTRecord>;
|
|
13
|
+
balances: Record<WalletAddress, number>;
|
|
14
|
+
};
|
|
15
|
+
export type SpawnANTParams = {
|
|
6
16
|
signer: AoSigner;
|
|
7
17
|
module?: string;
|
|
8
18
|
luaCodeTxId?: string;
|
|
9
19
|
ao?: AoClient;
|
|
10
20
|
scheduler?: string;
|
|
11
|
-
state?:
|
|
12
|
-
owner: WalletAddress;
|
|
13
|
-
controllers: WalletAddress[];
|
|
14
|
-
name: string;
|
|
15
|
-
ticker: string;
|
|
16
|
-
records: Record<string, AoANTRecord>;
|
|
17
|
-
balances: Record<WalletAddress, number>;
|
|
18
|
-
};
|
|
21
|
+
state?: SpawnANTState;
|
|
19
22
|
stateContractTxId?: string;
|
|
20
23
|
antRegistryId?: string;
|
|
21
24
|
logger?: Logger;
|
|
22
25
|
arweave?: Arweave;
|
|
23
|
-
}
|
|
26
|
+
};
|
|
27
|
+
export declare function spawnANT({ signer, module, luaCodeTxId, ao, scheduler, state, stateContractTxId, antRegistryId, logger, arweave, }: SpawnANTParams): Promise<string>;
|
|
24
28
|
export declare function evolveANT({ signer, processId, luaCodeTxId, ao, logger, arweave, }: {
|
|
25
29
|
signer: AoSigner;
|
|
26
30
|
processId: string;
|
|
@@ -31,3 +35,9 @@ export declare function evolveANT({ signer, processId, luaCodeTxId, ao, logger,
|
|
|
31
35
|
}): Promise<string>;
|
|
32
36
|
export declare function isAoSigner(value: unknown): value is AoSigner;
|
|
33
37
|
export declare function createAoSigner(signer: ContractSigner): AoSigner;
|
|
38
|
+
export declare const defaultTargetManifestId = "-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI";
|
|
39
|
+
export declare function initANTStateForAddress({ owner, targetId, ttlSeconds, keywords, controllers, description, ticker, name, }: Partial<SpawnANTState> & {
|
|
40
|
+
targetId?: string;
|
|
41
|
+
ttlSeconds?: number;
|
|
42
|
+
owner: WalletAddress;
|
|
43
|
+
}): SpawnANTState;
|
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.
|
|
3
|
+
"version": "2.7.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
"browser": "./bundles/web.bundle.min.js"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
+
"bin": {
|
|
59
|
+
"ar.io": "./lib/esm/cli/cli.js"
|
|
60
|
+
},
|
|
58
61
|
"scripts": {
|
|
59
62
|
"build:web": "node bundle.mjs",
|
|
60
63
|
"build:esm": "yarn tsc -p tsconfig.json",
|
|
@@ -89,6 +92,7 @@
|
|
|
89
92
|
"@semantic-release/npm": "^11.0.3",
|
|
90
93
|
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
|
91
94
|
"@types/node": "^20.12.12",
|
|
95
|
+
"@types/prompts": "^2.4.9",
|
|
92
96
|
"@types/sinon": "^10.0.15",
|
|
93
97
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
94
98
|
"@typescript-eslint/parser": "^6.4.0",
|
|
@@ -125,8 +129,10 @@
|
|
|
125
129
|
"arweave": "1.14.4",
|
|
126
130
|
"axios": "1.7.8",
|
|
127
131
|
"axios-retry": "^4.3.0",
|
|
132
|
+
"commander": "^12.1.0",
|
|
128
133
|
"eventemitter3": "^5.0.1",
|
|
129
134
|
"plimit-lit": "^3.0.1",
|
|
135
|
+
"prompts": "^2.4.2",
|
|
130
136
|
"winston": "^3.13.0",
|
|
131
137
|
"zod": "^3.23.8"
|
|
132
138
|
},
|