@ar.io/sdk 3.24.0 → 4.0.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 +682 -600
- package/lib/esm/cli/cli.js +188 -152
- package/lib/esm/cli/commands/antCommands.js +23 -58
- package/lib/esm/cli/commands/arnsPurchaseCommands.js +48 -30
- package/lib/esm/cli/commands/escrowCommands.js +221 -0
- package/lib/esm/cli/commands/gatewayWriteCommands.js +142 -23
- package/lib/esm/cli/commands/pruneCommands.js +150 -0
- package/lib/esm/cli/commands/readCommands.js +22 -3
- package/lib/esm/cli/commands/transfer.js +6 -6
- package/lib/esm/cli/options.js +124 -58
- package/lib/esm/cli/utils.js +280 -174
- package/lib/esm/common/ant-registry.js +17 -143
- package/lib/esm/common/ant.js +44 -1167
- package/lib/esm/common/faucet.js +11 -6
- package/lib/esm/common/index.js +0 -4
- package/lib/esm/common/io.js +25 -1412
- package/lib/esm/constants.js +13 -19
- package/lib/esm/solana/ant-readable.js +724 -0
- package/lib/esm/solana/ant-registry-readable.js +133 -0
- package/lib/esm/solana/ant-registry-writeable.js +472 -0
- package/lib/esm/solana/ant-writeable.js +384 -0
- package/lib/esm/solana/ata.js +70 -0
- package/lib/esm/solana/canonical-message.js +128 -0
- package/lib/esm/solana/clusters.js +111 -0
- package/lib/esm/solana/constants.js +146 -0
- package/lib/esm/solana/delegation-math.js +112 -0
- package/lib/esm/solana/deserialize.js +711 -0
- package/lib/esm/solana/escrow.js +839 -0
- package/lib/{cjs/utils/json.js → esm/solana/events.js} +15 -10
- package/lib/esm/solana/funding-plan.js +699 -0
- package/lib/esm/solana/index.js +126 -0
- package/lib/esm/solana/instruction.js +39 -0
- package/lib/esm/solana/io-readable.js +2182 -0
- package/lib/esm/solana/io-writeable.js +3196 -0
- package/lib/esm/solana/json-rpc.js +90 -0
- package/lib/esm/solana/metadata.js +81 -0
- package/lib/esm/solana/mpl-core.js +192 -0
- package/lib/esm/solana/pda.js +332 -0
- package/lib/esm/solana/predict-prescribed-observers.js +110 -0
- package/lib/esm/solana/retry.js +117 -0
- package/lib/esm/solana/rpc-circuit-breaker.js +258 -0
- package/lib/esm/solana/send.js +372 -0
- package/lib/esm/solana/spawn-ant.js +224 -0
- package/lib/esm/solana/types.js +1 -0
- package/lib/esm/types/ant.js +27 -15
- package/lib/esm/types/io.js +8 -11
- package/lib/esm/utils/ant.js +0 -63
- package/lib/esm/utils/index.js +0 -3
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/antCommands.d.ts +5 -13
- package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +33 -7
- package/lib/types/cli/commands/escrowCommands.d.ts +68 -0
- package/lib/types/cli/commands/gatewayWriteCommands.d.ts +12 -11
- package/lib/types/cli/commands/pruneCommands.d.ts +31 -0
- package/lib/types/cli/commands/readCommands.d.ts +27 -22
- package/lib/types/cli/commands/transfer.d.ts +9 -9
- package/lib/types/cli/options.d.ts +76 -21
- package/lib/types/cli/types.d.ts +11 -13
- package/lib/types/cli/utils.d.ts +71 -31
- package/lib/types/common/ant-registry.d.ts +49 -47
- package/lib/types/common/ant.d.ts +54 -539
- package/lib/types/common/faucet.d.ts +20 -8
- package/lib/types/common/index.d.ts +0 -3
- package/lib/types/common/io.d.ts +51 -263
- package/lib/types/constants.d.ts +11 -18
- package/lib/types/solana/ant-readable.d.ts +180 -0
- package/lib/types/solana/ant-registry-readable.d.ts +105 -0
- package/lib/types/solana/ant-registry-writeable.d.ts +249 -0
- package/lib/types/solana/ant-writeable.d.ts +177 -0
- package/lib/types/solana/ata.d.ts +44 -0
- package/lib/types/solana/canonical-message.d.ts +121 -0
- package/lib/types/solana/clusters.d.ts +109 -0
- package/lib/types/solana/constants.d.ts +119 -0
- package/lib/types/solana/delegation-math.d.ts +45 -0
- package/lib/types/solana/deserialize.d.ts +262 -0
- package/lib/types/solana/escrow.d.ts +480 -0
- package/lib/types/solana/events.d.ts +38 -0
- package/lib/types/solana/funding-plan.d.ts +225 -0
- package/lib/types/solana/index.d.ts +87 -0
- package/lib/types/solana/instruction.d.ts +39 -0
- package/lib/types/solana/io-readable.d.ts +499 -0
- package/lib/types/solana/io-writeable.d.ts +893 -0
- package/lib/types/solana/json-rpc.d.ts +47 -0
- package/lib/types/solana/metadata.d.ts +84 -0
- package/lib/types/solana/mpl-core.d.ts +120 -0
- package/lib/types/solana/pda.d.ts +95 -0
- package/lib/types/solana/predict-prescribed-observers.d.ts +28 -0
- package/lib/types/solana/retry.d.ts +62 -0
- package/lib/types/solana/rpc-circuit-breaker.d.ts +78 -0
- package/lib/types/solana/send.d.ts +94 -0
- package/lib/types/solana/spawn-ant.d.ts +145 -0
- package/lib/types/solana/types.d.ts +82 -0
- package/lib/types/types/ant-registry.d.ts +43 -4
- package/lib/types/types/ant.d.ts +114 -96
- package/lib/types/types/common.d.ts +18 -74
- package/lib/types/types/faucet.d.ts +2 -2
- package/lib/types/types/io.d.ts +244 -158
- package/lib/types/types/token.d.ts +0 -12
- package/lib/types/utils/ant.d.ts +1 -12
- package/lib/types/utils/index.d.ts +0 -3
- package/lib/types/version.d.ts +1 -1
- package/package.json +36 -33
- package/lib/cjs/cli/cli.js +0 -822
- package/lib/cjs/cli/commands/antCommands.js +0 -113
- package/lib/cjs/cli/commands/arnsPurchaseCommands.js +0 -212
- package/lib/cjs/cli/commands/gatewayWriteCommands.js +0 -210
- package/lib/cjs/cli/commands/readCommands.js +0 -215
- package/lib/cjs/cli/commands/transfer.js +0 -159
- package/lib/cjs/cli/options.js +0 -470
- package/lib/cjs/cli/types.js +0 -2
- package/lib/cjs/cli/utils.js +0 -639
- package/lib/cjs/common/ant-registry.js +0 -155
- package/lib/cjs/common/ant-versions.js +0 -93
- package/lib/cjs/common/ant.js +0 -1182
- package/lib/cjs/common/arweave.js +0 -27
- package/lib/cjs/common/contracts/ao-process.js +0 -224
- package/lib/cjs/common/error.js +0 -64
- package/lib/cjs/common/faucet.js +0 -150
- package/lib/cjs/common/hyperbeam/hb.js +0 -173
- package/lib/cjs/common/index.js +0 -42
- package/lib/cjs/common/io.js +0 -1423
- package/lib/cjs/common/logger.js +0 -83
- package/lib/cjs/common/loggers/winston.js +0 -68
- package/lib/cjs/common/marketplace.js +0 -731
- package/lib/cjs/common/turbo.js +0 -223
- package/lib/cjs/constants.js +0 -41
- package/lib/cjs/node/index.js +0 -39
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/types/ant-registry.js +0 -2
- package/lib/cjs/types/ant.js +0 -168
- package/lib/cjs/types/common.js +0 -2
- package/lib/cjs/types/faucet.js +0 -2
- package/lib/cjs/types/index.js +0 -37
- package/lib/cjs/types/io.js +0 -51
- package/lib/cjs/types/token.js +0 -116
- package/lib/cjs/utils/ant.js +0 -108
- package/lib/cjs/utils/ao.js +0 -432
- package/lib/cjs/utils/arweave.js +0 -285
- package/lib/cjs/utils/base64.js +0 -62
- package/lib/cjs/utils/hash.js +0 -56
- package/lib/cjs/utils/index.js +0 -38
- package/lib/cjs/utils/processes.js +0 -173
- package/lib/cjs/utils/random.js +0 -30
- package/lib/cjs/utils/schema.js +0 -15
- package/lib/cjs/utils/url.js +0 -37
- package/lib/cjs/version.js +0 -20
- package/lib/cjs/web/index.js +0 -41
- package/lib/esm/common/ant-versions.js +0 -87
- package/lib/esm/common/arweave.js +0 -21
- package/lib/esm/common/contracts/ao-process.js +0 -220
- package/lib/esm/common/hyperbeam/hb.js +0 -169
- package/lib/esm/common/marketplace.js +0 -724
- package/lib/esm/common/turbo.js +0 -215
- package/lib/esm/node/index.js +0 -20
- package/lib/esm/utils/ao.js +0 -420
- package/lib/esm/utils/arweave.js +0 -271
- package/lib/esm/utils/processes.js +0 -167
- package/lib/esm/web/index.js +0 -20
- package/lib/types/common/ant-versions.d.ts +0 -39
- package/lib/types/common/arweave.d.ts +0 -17
- package/lib/types/common/contracts/ao-process.d.ts +0 -47
- package/lib/types/common/hyperbeam/hb.d.ts +0 -88
- package/lib/types/common/marketplace.d.ts +0 -568
- package/lib/types/common/turbo.d.ts +0 -61
- package/lib/types/node/index.d.ts +0 -20
- package/lib/types/utils/ao.d.ts +0 -80
- package/lib/types/utils/arweave.d.ts +0 -79
- package/lib/types/utils/processes.d.ts +0 -39
- package/lib/types/web/index.d.ts +0 -20
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { WriteActionCLIOptions } from '../types.js';
|
|
2
|
+
type PruneOptions = WriteActionCLIOptions & {
|
|
3
|
+
name?: string;
|
|
4
|
+
max?: string;
|
|
5
|
+
gateway?: string;
|
|
6
|
+
delegator?: string;
|
|
7
|
+
observer?: string;
|
|
8
|
+
initiator?: string;
|
|
9
|
+
owner?: string;
|
|
10
|
+
withdrawalId?: string;
|
|
11
|
+
vaultId?: string;
|
|
12
|
+
epochIndex?: string;
|
|
13
|
+
arnsRecords?: string[];
|
|
14
|
+
returnedNames?: string[];
|
|
15
|
+
};
|
|
16
|
+
export declare function pruneExpiredNamesCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult | {
|
|
17
|
+
message: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function pruneNameToReturnedCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
20
|
+
export declare function pruneReturnedNamesCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult | {
|
|
21
|
+
message: string;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function pruneExpiredReservationCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
24
|
+
export declare function pruneGatewayCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
25
|
+
export declare function finalizeGoneCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
26
|
+
export declare function closeObservationCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
27
|
+
export declare function closeEmptyDelegationCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
28
|
+
export declare function closeDrainedWithdrawalCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
29
|
+
export declare function releaseVaultCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
30
|
+
export declare function closeExpiredRequestCLICommand(o: PruneOptions): Promise<import("../../types/common.js").MessageResult>;
|
|
31
|
+
export {};
|
|
@@ -13,66 +13,71 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { ArNSNameDataWithName, Delegation, GatewayDelegateWithAddress, GatewayVault, GetCostDetailsParams, UserWithdrawal } from '../../types/io.js';
|
|
17
17
|
import { AddressAndNameCLIOptions, AddressAndVaultIdCLIOptions, AddressCLIOptions, CLIOptionsFromAoParams, EpochCLIOptions, GetTokenCostCLIOptions, GlobalCLIOptions, NameCLIOptions, PaginationAddressCLIOptions, PaginationCLIOptions } from '../types.js';
|
|
18
|
-
export declare function getGateway(o: AddressCLIOptions): Promise<import("../../types/io.js").
|
|
19
|
-
export declare function listGateways(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").
|
|
18
|
+
export declare function getGateway(o: AddressCLIOptions): Promise<import("../../types/io.js").Gateway>;
|
|
19
|
+
export declare function listGateways(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").GatewayWithAddress> | {
|
|
20
20
|
message: string;
|
|
21
21
|
}>;
|
|
22
|
-
export declare function listAllDelegatesCLICommand(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").
|
|
22
|
+
export declare function listAllDelegatesCLICommand(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").AllDelegates> | {
|
|
23
23
|
message: string;
|
|
24
24
|
}>;
|
|
25
|
-
export declare function getGatewayDelegates(o: AddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<
|
|
25
|
+
export declare function getGatewayDelegates(o: AddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<GatewayDelegateWithAddress> | {
|
|
26
26
|
message: string;
|
|
27
27
|
}>;
|
|
28
|
-
export declare function getDelegations(o: PaginationAddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<
|
|
28
|
+
export declare function getDelegations(o: PaginationAddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<Delegation> | {
|
|
29
29
|
message: string;
|
|
30
30
|
}>;
|
|
31
31
|
export declare function getAllowedDelegates(o: PaginationAddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<string> | {
|
|
32
32
|
message: string;
|
|
33
33
|
}>;
|
|
34
|
-
export declare function getArNSRecord(o: NameCLIOptions): Promise<import("../../types/io.js").
|
|
35
|
-
export declare function listArNSRecords(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<
|
|
34
|
+
export declare function getArNSRecord(o: NameCLIOptions): Promise<import("../../types/io.js").ArNSNameData>;
|
|
35
|
+
export declare function listArNSRecords(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<ArNSNameDataWithName> | {
|
|
36
36
|
message: string;
|
|
37
37
|
}>;
|
|
38
|
-
export declare function listArNSRecordsForAddress(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<
|
|
38
|
+
export declare function listArNSRecordsForAddress(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<ArNSNameDataWithName> | {
|
|
39
39
|
message: string;
|
|
40
40
|
}>;
|
|
41
|
-
export declare function getArNSReservedName(o: NameCLIOptions): Promise<import("../../types/io.js").
|
|
42
|
-
export declare function listArNSReservedNames(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").
|
|
41
|
+
export declare function getArNSReservedName(o: NameCLIOptions): Promise<import("../../types/io.js").ArNSReservedNameData>;
|
|
42
|
+
export declare function listArNSReservedNames(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").ArNSReservedNameDataWithName> | {
|
|
43
43
|
message: string;
|
|
44
44
|
}>;
|
|
45
|
-
export declare function getArNSReturnedName(o: NameCLIOptions): Promise<import("../../types/io.js").
|
|
46
|
-
export declare function listArNSReturnedNames(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").
|
|
45
|
+
export declare function getArNSReturnedName(o: NameCLIOptions): Promise<import("../../types/io.js").ReturnedName>;
|
|
46
|
+
export declare function listArNSReturnedNames(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").ReturnedName> | {
|
|
47
47
|
message: string;
|
|
48
48
|
}>;
|
|
49
|
-
export declare function getEpoch(o: EpochCLIOptions): Promise<import("../../types/io.js").
|
|
50
|
-
export declare function getPrescribedObservers(o: EpochCLIOptions): Promise<import("../../types/io.js").
|
|
49
|
+
export declare function getEpoch(o: EpochCLIOptions): Promise<import("../../types/io.js").EpochData<import("../../types/io.js").EpochDistributionData>>;
|
|
50
|
+
export declare function getPrescribedObservers(o: EpochCLIOptions): Promise<import("../../types/io.js").WeightedObserver[]>;
|
|
51
51
|
export declare function getPrescribedNames(o: EpochCLIOptions): Promise<string[]>;
|
|
52
52
|
export declare function getTokenCost(o: GetTokenCostCLIOptions): Promise<{
|
|
53
53
|
mARIOTokenCost: number;
|
|
54
54
|
message: string;
|
|
55
55
|
}>;
|
|
56
|
-
export declare function getCostDetails(o: GlobalCLIOptions & CLIOptionsFromAoParams<
|
|
56
|
+
export declare function getCostDetails(o: GlobalCLIOptions & CLIOptionsFromAoParams<GetCostDetailsParams>): Promise<{
|
|
57
57
|
message: string;
|
|
58
58
|
tokenCost: number;
|
|
59
59
|
discounts: import("../../types/io.js").CostDiscount[];
|
|
60
|
-
returnedNameDetails?: import("../../types/io.js").
|
|
60
|
+
returnedNameDetails?: import("../../types/io.js").ReturnedName & {
|
|
61
61
|
basePrice: number;
|
|
62
62
|
};
|
|
63
|
-
fundingPlan?: import("../../types/io.js").
|
|
63
|
+
fundingPlan?: import("../../types/io.js").FundingPlan;
|
|
64
64
|
wincQty?: string;
|
|
65
65
|
}>;
|
|
66
|
-
export declare function getPrimaryName(o: AddressAndNameCLIOptions): Promise<import("../../types/common.js").
|
|
67
|
-
export declare function getGatewayVaults(o: PaginationAddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<
|
|
66
|
+
export declare function getPrimaryName(o: AddressAndNameCLIOptions): Promise<import("../../types/common.js").PrimaryName>;
|
|
67
|
+
export declare function getGatewayVaults(o: PaginationAddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<GatewayVault> | {
|
|
68
68
|
message: string;
|
|
69
69
|
}>;
|
|
70
|
-
export declare function getAllGatewayVaults(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").
|
|
70
|
+
export declare function getAllGatewayVaults(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").AllGatewayVaults> | {
|
|
71
71
|
message: string;
|
|
72
72
|
}>;
|
|
73
|
-
export declare function
|
|
73
|
+
export declare function getWithdrawals(o: PaginationAddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<UserWithdrawal> | {
|
|
74
|
+
message: string;
|
|
75
|
+
}>;
|
|
76
|
+
export declare function getVault(o: AddressAndVaultIdCLIOptions): Promise<import("../../types/io.js").VaultData>;
|
|
74
77
|
export declare function resolveArNSName(o: NameCLIOptions): Promise<import("../../types/io.js").ArNSNameResolutionData>;
|
|
75
78
|
export declare function listAntsForAddress(o: AddressCLIOptions): Promise<{
|
|
76
79
|
Owned: string[];
|
|
77
80
|
Controlled: string[];
|
|
81
|
+
} | {
|
|
82
|
+
message: string;
|
|
78
83
|
}>;
|
|
@@ -13,28 +13,28 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { CreateVaultParams, ExtendVaultParams, IncreaseVaultParams, RevokeVaultParams, VaultedTransferParams } from '../../types/io.js';
|
|
17
17
|
import { CLIWriteOptionsFromAoParams, JsonSerializable, TransferCLIOptions } from '../types.js';
|
|
18
18
|
export declare function transferCLICommand(options: TransferCLIOptions): Promise<{
|
|
19
19
|
senderAddress: string;
|
|
20
|
-
transferResult: import("../../types/common.js").
|
|
20
|
+
transferResult: import("../../types/common.js").MessageResult<Record<string, string | number | boolean | null>>;
|
|
21
21
|
message: string;
|
|
22
22
|
} | {
|
|
23
23
|
message: string;
|
|
24
24
|
}>;
|
|
25
|
-
export declare function vaultedTransferCLICommand(o: CLIWriteOptionsFromAoParams<
|
|
26
|
-
export declare function revokeVaultCLICommand(o: CLIWriteOptionsFromAoParams<
|
|
27
|
-
export declare function createVaultCLICommand(o: CLIWriteOptionsFromAoParams<
|
|
28
|
-
export declare function extendVaultCLICommand(o: CLIWriteOptionsFromAoParams<
|
|
25
|
+
export declare function vaultedTransferCLICommand(o: CLIWriteOptionsFromAoParams<VaultedTransferParams>): Promise<JsonSerializable>;
|
|
26
|
+
export declare function revokeVaultCLICommand(o: CLIWriteOptionsFromAoParams<RevokeVaultParams>): Promise<JsonSerializable>;
|
|
27
|
+
export declare function createVaultCLICommand(o: CLIWriteOptionsFromAoParams<CreateVaultParams>): Promise<JsonSerializable>;
|
|
28
|
+
export declare function extendVaultCLICommand(o: CLIWriteOptionsFromAoParams<ExtendVaultParams>): Promise<{
|
|
29
29
|
senderAddress: string;
|
|
30
|
-
transferResult: import("../../types/common.js").
|
|
30
|
+
transferResult: import("../../types/common.js").MessageResult<Record<string, string | number | boolean | null>>;
|
|
31
31
|
message: string;
|
|
32
32
|
} | {
|
|
33
33
|
message: string;
|
|
34
34
|
}>;
|
|
35
|
-
export declare function increaseVaultCLICommand(o: CLIWriteOptionsFromAoParams<
|
|
35
|
+
export declare function increaseVaultCLICommand(o: CLIWriteOptionsFromAoParams<IncreaseVaultParams>): Promise<{
|
|
36
36
|
senderAddress: string;
|
|
37
|
-
transferResult: import("../../types/common.js").
|
|
37
|
+
transferResult: import("../../types/common.js").MessageResult<Record<string, string | number | boolean | null>>;
|
|
38
38
|
message: string;
|
|
39
39
|
} | {
|
|
40
40
|
message: string;
|
|
@@ -27,33 +27,59 @@ export declare const optionMap: {
|
|
|
27
27
|
description: string;
|
|
28
28
|
type: string;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
rpcUrl: {
|
|
31
31
|
alias: string;
|
|
32
32
|
description: string;
|
|
33
|
-
type: string;
|
|
34
33
|
};
|
|
35
|
-
|
|
34
|
+
antProgramId: {
|
|
35
|
+
alias: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
coreProgramId: {
|
|
39
|
+
alias: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
garProgramId: {
|
|
43
|
+
alias: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
arnsProgramId: {
|
|
47
|
+
alias: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
escrowProgramId: {
|
|
51
|
+
alias: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
ant: {
|
|
55
|
+
alias: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
recipientArweave: {
|
|
59
|
+
alias: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
recipientEthereum: {
|
|
36
63
|
alias: string;
|
|
37
64
|
description: string;
|
|
38
|
-
type: string;
|
|
39
65
|
};
|
|
40
|
-
|
|
66
|
+
newRecipientArweave: {
|
|
41
67
|
alias: string;
|
|
42
68
|
description: string;
|
|
43
69
|
};
|
|
44
|
-
|
|
70
|
+
newRecipientEthereum: {
|
|
45
71
|
alias: string;
|
|
46
72
|
description: string;
|
|
47
73
|
};
|
|
48
|
-
|
|
74
|
+
signatureFile: {
|
|
49
75
|
alias: string;
|
|
50
76
|
description: string;
|
|
51
77
|
};
|
|
52
|
-
|
|
78
|
+
saltLen: {
|
|
53
79
|
alias: string;
|
|
54
80
|
description: string;
|
|
55
81
|
};
|
|
56
|
-
|
|
82
|
+
claimant: {
|
|
57
83
|
alias: string;
|
|
58
84
|
description: string;
|
|
59
85
|
};
|
|
@@ -133,10 +159,6 @@ export declare const optionMap: {
|
|
|
133
159
|
description: string;
|
|
134
160
|
type: string;
|
|
135
161
|
};
|
|
136
|
-
services: {
|
|
137
|
-
alias: string;
|
|
138
|
-
description: string;
|
|
139
|
-
};
|
|
140
162
|
skipConfirmation: {
|
|
141
163
|
alias: string;
|
|
142
164
|
description: string;
|
|
@@ -234,6 +256,10 @@ export declare const optionMap: {
|
|
|
234
256
|
alias: string;
|
|
235
257
|
description: string;
|
|
236
258
|
};
|
|
259
|
+
targetProtocol: {
|
|
260
|
+
alias: string;
|
|
261
|
+
description: string;
|
|
262
|
+
};
|
|
237
263
|
ttlSeconds: {
|
|
238
264
|
alias: string;
|
|
239
265
|
description: string;
|
|
@@ -273,12 +299,24 @@ export declare const optionMap: {
|
|
|
273
299
|
alias: string;
|
|
274
300
|
description: string;
|
|
275
301
|
};
|
|
276
|
-
|
|
302
|
+
gatewayAddress: {
|
|
303
|
+
alias: string;
|
|
304
|
+
description: string;
|
|
305
|
+
};
|
|
306
|
+
fundAsOperator: {
|
|
277
307
|
alias: string;
|
|
278
308
|
description: string;
|
|
279
309
|
type: string;
|
|
280
310
|
};
|
|
281
|
-
|
|
311
|
+
withdrawalId: {
|
|
312
|
+
alias: string;
|
|
313
|
+
description: string;
|
|
314
|
+
};
|
|
315
|
+
fundingPlanJson: {
|
|
316
|
+
alias: string;
|
|
317
|
+
description: string;
|
|
318
|
+
};
|
|
319
|
+
revokable: {
|
|
282
320
|
alias: string;
|
|
283
321
|
description: string;
|
|
284
322
|
type: string;
|
|
@@ -299,7 +337,7 @@ export declare const optionMap: {
|
|
|
299
337
|
alias: string;
|
|
300
338
|
description: string;
|
|
301
339
|
};
|
|
302
|
-
|
|
340
|
+
metadataUri: {
|
|
303
341
|
alias: string;
|
|
304
342
|
description: string;
|
|
305
343
|
};
|
|
@@ -317,7 +355,28 @@ export declare const optionMap: {
|
|
|
317
355
|
alias: string;
|
|
318
356
|
description: string;
|
|
319
357
|
};
|
|
320
|
-
|
|
358
|
+
gateway: {
|
|
359
|
+
alias: string;
|
|
360
|
+
description: string;
|
|
361
|
+
};
|
|
362
|
+
delegator: {
|
|
363
|
+
alias: string;
|
|
364
|
+
description: string;
|
|
365
|
+
};
|
|
366
|
+
observer: {
|
|
367
|
+
alias: string;
|
|
368
|
+
description: string;
|
|
369
|
+
};
|
|
370
|
+
max: {
|
|
371
|
+
alias: string;
|
|
372
|
+
description: string;
|
|
373
|
+
};
|
|
374
|
+
arnsRecords: {
|
|
375
|
+
alias: string;
|
|
376
|
+
description: string;
|
|
377
|
+
type: string;
|
|
378
|
+
};
|
|
379
|
+
returnedNames: {
|
|
321
380
|
alias: string;
|
|
322
381
|
description: string;
|
|
323
382
|
type: string;
|
|
@@ -416,10 +475,6 @@ export declare const setAntUndernameOptions: {
|
|
|
416
475
|
alias: string;
|
|
417
476
|
description: string;
|
|
418
477
|
}[];
|
|
419
|
-
export declare const upgradeAntOptions: {
|
|
420
|
-
alias: string;
|
|
421
|
-
description: string;
|
|
422
|
-
}[];
|
|
423
478
|
export declare const transferRecordOwnershipOptions: {
|
|
424
479
|
alias: string;
|
|
425
480
|
description: string;
|
package/lib/types/cli/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { AddressParams, ArNSNameParams, GetVaultParams, JoinNetworkParams, PaginationParams, TokenCostParams } from '../types/io.js';
|
|
17
17
|
export type SupportedCLITokenType = 'ethereum' | 'arweave';
|
|
18
18
|
export type WalletCLIOptions = {
|
|
19
19
|
walletFile?: string;
|
|
@@ -21,15 +21,13 @@ export type WalletCLIOptions = {
|
|
|
21
21
|
privateKey?: string;
|
|
22
22
|
};
|
|
23
23
|
export type GlobalCLIOptions = WalletCLIOptions & {
|
|
24
|
-
devnet: boolean;
|
|
25
|
-
testnet: boolean;
|
|
26
24
|
mainnet: boolean;
|
|
27
25
|
debug: boolean;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
rpcUrl?: string;
|
|
27
|
+
antProgramId?: string;
|
|
28
|
+
coreProgramId?: string;
|
|
29
|
+
garProgramId?: string;
|
|
30
|
+
arnsProgramId?: string;
|
|
33
31
|
};
|
|
34
32
|
export type WriteActionCLIOptions = GlobalCLIOptions & {
|
|
35
33
|
tags?: string[];
|
|
@@ -60,7 +58,7 @@ export type CLIWriteOptionsFromAoAntParams<T> = CLIWriteOptionsFromAoParams<T &
|
|
|
60
58
|
processId: string;
|
|
61
59
|
}>;
|
|
62
60
|
export type PaginationCLIOptions = GlobalCLIOptions & CLIOptionsFromAoParams<PaginationParams>;
|
|
63
|
-
export type AddressCLIOptions = GlobalCLIOptions & CLIOptionsFromAoParams<
|
|
61
|
+
export type AddressCLIOptions = GlobalCLIOptions & CLIOptionsFromAoParams<AddressParams>;
|
|
64
62
|
export type ProcessIdCLIOptions = GlobalCLIOptions & {
|
|
65
63
|
processId?: string;
|
|
66
64
|
};
|
|
@@ -75,17 +73,17 @@ export type EpochCLIOptions = GlobalCLIOptions & CLIOptionsFromAoParams<{
|
|
|
75
73
|
epochIndex: number;
|
|
76
74
|
timestamp: number;
|
|
77
75
|
}>;
|
|
78
|
-
export type GetTokenCostCLIOptions = GlobalCLIOptions & CLIOptionsFromAoParams<
|
|
76
|
+
export type GetTokenCostCLIOptions = GlobalCLIOptions & CLIOptionsFromAoParams<TokenCostParams>;
|
|
79
77
|
export type PaginationAddressCLIOptions = AddressCLIOptions & PaginationCLIOptions;
|
|
80
|
-
export type NameCLIOptions = GlobalCLIOptions & CLIOptionsFromAoParams<
|
|
78
|
+
export type NameCLIOptions = GlobalCLIOptions & CLIOptionsFromAoParams<ArNSNameParams>;
|
|
81
79
|
export type NameWriteCLIOptions = WriteActionCLIOptions & NameCLIOptions;
|
|
82
|
-
export type AddressAndVaultIdCLIOptions = CLIOptionsFromAoParams<
|
|
80
|
+
export type AddressAndVaultIdCLIOptions = CLIOptionsFromAoParams<GetVaultParams> & GlobalCLIOptions;
|
|
83
81
|
export type AddressAndVaultIdCLIWriteOptions = WriteActionCLIOptions & AddressAndVaultIdCLIOptions;
|
|
84
82
|
export type TransferCLIOptions = WriteActionCLIOptions & {
|
|
85
83
|
quantity?: string;
|
|
86
84
|
target?: string;
|
|
87
85
|
};
|
|
88
|
-
export type JoinNetworkCLIOptions = WriteActionCLIOptions & CLIOptionsFromAoParams<
|
|
86
|
+
export type JoinNetworkCLIOptions = WriteActionCLIOptions & CLIOptionsFromAoParams<JoinNetworkParams>;
|
|
89
87
|
export type UpdateGatewaySettingsCLIOptions = Omit<JoinNetworkCLIOptions, 'operatorStake'>;
|
|
90
88
|
export type DelegateStakeCLIOptions = TransferCLIOptions;
|
|
91
89
|
export type RedelegateStakeCLIOptions = TransferCLIOptions & {
|
package/lib/types/cli/utils.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { JWKInterface } from 'arweave/node/lib/wallet.js';
|
|
2
1
|
import { Command, OptionValues } from 'commander';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Logger } from '../common/logger.js';
|
|
3
|
+
import type { ANTRegistryRead } from '../types/ant-registry.js';
|
|
4
|
+
import type { ANTRead, ANTWrite } from '../types/ant.js';
|
|
5
|
+
import type { WriteOptions } from '../types/common.js';
|
|
6
|
+
import type { ARIORead, ARIOWrite, EpochInput, FundFrom, GetCostDetailsParams, PaginationParams, RedelegateStakeParams, UpdateGatewaySettingsParams } from '../types/io.js';
|
|
7
|
+
import { ARIOToken, mARIOToken } from '../types/token.js';
|
|
8
|
+
import { ANTStateCLIOptions, AddressCLIOptions, EpochCLIOptions, GetTokenCostCLIOptions, GlobalCLIOptions, InitiatorCLIOptions, JsonSerializable, PaginationCLIOptions, ProcessIdCLIOptions, RedelegateStakeCLIOptions, TransferCLIOptions, UpdateGatewaySettingsCLIOptions, WriteActionCLIOptions } from './types.js';
|
|
5
9
|
export declare const defaultTtlSecondsCLI = 3600;
|
|
6
10
|
export declare function stringifyJsonForCLIDisplay(json: JsonSerializable | unknown): string;
|
|
7
11
|
export declare function runCommand<O extends OptionValues>(command: Command, action: (options: O) => Promise<JsonSerializable>): Promise<void>;
|
|
@@ -17,42 +21,42 @@ export declare function makeCommand<O extends OptionValues = GlobalCLIOptions>({
|
|
|
17
21
|
action?: (options: O) => Promise<JsonSerializable>;
|
|
18
22
|
options?: CommanderOption[];
|
|
19
23
|
}): Command;
|
|
20
|
-
export declare function arioProcessIdFromOptions({ arioProcessId, devnet, testnet, }: GlobalCLIOptions): string;
|
|
21
|
-
export declare function antRegistryIdFromOptions({ antRegistryProcessId, testnet, }: GlobalCLIOptions): string;
|
|
22
|
-
export declare function requiredJwkFromOptions(options: WalletCLIOptions): JWKInterface;
|
|
23
|
-
export declare function jwkToAddress(jwk: JWKInterface): string;
|
|
24
24
|
export declare function getLoggerFromOptions(options: GlobalCLIOptions): Logger;
|
|
25
|
-
export declare function readARIOFromOptions(options: GlobalCLIOptions):
|
|
26
|
-
export declare function readANTRegistryFromOptions(options: ProcessIdCLIOptions):
|
|
27
|
-
export declare function
|
|
28
|
-
|
|
25
|
+
export declare function readARIOFromOptions(options: GlobalCLIOptions): ARIORead;
|
|
26
|
+
export declare function readANTRegistryFromOptions(options: ProcessIdCLIOptions): Promise<ANTRegistryRead>;
|
|
27
|
+
export declare function writeARIOFromOptions(options: GlobalCLIOptions): Promise<{
|
|
28
|
+
ario: ARIOWrite;
|
|
29
29
|
signerAddress: string;
|
|
30
|
-
}
|
|
31
|
-
export declare function requiredContractSignerFromOptions(options: WalletCLIOptions): {
|
|
32
|
-
signer: ContractSigner;
|
|
33
|
-
signerAddress: string;
|
|
34
|
-
};
|
|
35
|
-
export declare function requiredAoSignerFromOptions(options: WalletCLIOptions): AoSigner;
|
|
36
|
-
export declare function writeARIOFromOptions(options: GlobalCLIOptions): {
|
|
37
|
-
ario: AoARIOWrite;
|
|
38
|
-
signerAddress: string;
|
|
39
|
-
};
|
|
30
|
+
}>;
|
|
40
31
|
export declare function formatARIOWithCommas(value: ARIOToken): string;
|
|
41
32
|
export declare function formatMARIOToARIOWithCommas(value: mARIOToken): string;
|
|
42
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Resolve the wallet address from CLI options. Priority order:
|
|
35
|
+
* 1. `--address <addr>` — used verbatim.
|
|
36
|
+
* 2. `--wallet-file <path-to-keypair.json>` — derive the Solana pubkey
|
|
37
|
+
* from the keypair file (last 32 bytes of the 64-byte secret-key
|
|
38
|
+
* array are the public key; base58-encode them).
|
|
39
|
+
* 3. `--private-key <base58-secret>` — base58-decode the secret, take
|
|
40
|
+
* the trailing 32 bytes as the pubkey. Matches the keypair-file
|
|
41
|
+
* path; kept aligned with `loadSolanaSignerFromOptions` so cost
|
|
42
|
+
* / funding lookups work even when the user authenticates with
|
|
43
|
+
* only a private key.
|
|
44
|
+
*
|
|
45
|
+
* Returns `undefined` when none of those is set. Use
|
|
46
|
+
* `requiredAddressFromOptions` for callers that must have an address.
|
|
47
|
+
*/
|
|
43
48
|
export declare function addressFromOptions<O extends AddressCLIOptions>(options: O): string | undefined;
|
|
44
49
|
export declare function requiredAddressFromOptions<O extends AddressCLIOptions>(options: O): string;
|
|
45
50
|
export declare function paginationParamsFromOptions<O extends PaginationCLIOptions, R>(options: O): PaginationParams<R>;
|
|
46
51
|
export declare function epochInputFromOptions(options: EpochCLIOptions): EpochInput;
|
|
47
52
|
export declare function requiredInitiatorFromOptions(options: InitiatorCLIOptions): string;
|
|
48
53
|
export declare function customTagsFromOptions<O extends WriteActionCLIOptions>(options: O): WriteOptions;
|
|
49
|
-
export declare function
|
|
50
|
-
export declare function gatewaySettingsFromOptions(options: UpdateGatewaySettingsCLIOptions): AoUpdateGatewaySettingsParams;
|
|
54
|
+
export declare function gatewaySettingsFromOptions(options: UpdateGatewaySettingsCLIOptions): UpdateGatewaySettingsParams;
|
|
51
55
|
export declare function requiredTargetAndQuantityFromOptions(options: TransferCLIOptions): {
|
|
52
56
|
target: string;
|
|
53
57
|
arioQuantity: ARIOToken;
|
|
54
58
|
};
|
|
55
|
-
export declare function redelegateParamsFromOptions(options: RedelegateStakeCLIOptions):
|
|
59
|
+
export declare function redelegateParamsFromOptions(options: RedelegateStakeCLIOptions): RedelegateStakeParams & {
|
|
56
60
|
stakeQty: mARIOToken;
|
|
57
61
|
};
|
|
58
62
|
export declare function recordTypeFromOptions<O extends {
|
|
@@ -60,12 +64,12 @@ export declare function recordTypeFromOptions<O extends {
|
|
|
60
64
|
}>(options: O): 'lease' | 'permabuy';
|
|
61
65
|
export declare function requiredMARIOFromOptions<O extends GlobalCLIOptions>(options: O, key: string): mARIOToken;
|
|
62
66
|
export declare function assertEnoughBalanceForArNSPurchase({ ario, address, costDetailsParams, }: {
|
|
63
|
-
ario:
|
|
67
|
+
ario: ARIORead;
|
|
64
68
|
address: string;
|
|
65
|
-
costDetailsParams:
|
|
69
|
+
costDetailsParams: GetCostDetailsParams;
|
|
66
70
|
}): Promise<void>;
|
|
67
71
|
export declare function assertEnoughMARIOBalance({ address, ario, mARIOQuantity, }: {
|
|
68
|
-
ario:
|
|
72
|
+
ario: ARIORead;
|
|
69
73
|
address: string;
|
|
70
74
|
mARIOQuantity: mARIOToken | number;
|
|
71
75
|
}): Promise<void>;
|
|
@@ -74,15 +78,27 @@ export declare function assertConfirmationPrompt<O extends {
|
|
|
74
78
|
skipConfirmation?: boolean;
|
|
75
79
|
}>(message: string, options: O): Promise<boolean>;
|
|
76
80
|
export declare function requiredProcessIdFromOptions<O extends ProcessIdCLIOptions>(o: O): string;
|
|
77
|
-
export declare function readANTFromOptions(options: ProcessIdCLIOptions):
|
|
78
|
-
export declare function writeANTFromOptions(options: ProcessIdCLIOptions
|
|
81
|
+
export declare function readANTFromOptions(options: ProcessIdCLIOptions): Promise<ANTRead>;
|
|
82
|
+
export declare function writeANTFromOptions(options: ProcessIdCLIOptions): Promise<ANTWrite>;
|
|
79
83
|
export declare function booleanFromOptions<O extends GlobalCLIOptions>(options: O, key: string): boolean;
|
|
80
84
|
export declare function requiredStringFromOptions<O extends GlobalCLIOptions>(options: O, key: string): string;
|
|
81
85
|
export declare function stringArrayFromOptions<O extends GlobalCLIOptions>(options: O, key: string): string[] | undefined;
|
|
82
86
|
export declare function requiredStringArrayFromOptions<O extends GlobalCLIOptions>(options: O, key: string): string[];
|
|
83
87
|
export declare function positiveIntegerFromOptions<O extends GlobalCLIOptions>(options: O, key: string): number | undefined;
|
|
84
88
|
export declare function requiredPositiveIntegerFromOptions<O extends GlobalCLIOptions>(options: O, key: string): number;
|
|
85
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Spawn a fresh ANT on Solana from CLI options.
|
|
91
|
+
*
|
|
92
|
+
* Resolves the signer the same way `writeARIOFromOptions` does (KeyPairSigner
|
|
93
|
+
* from `--wallet-file` or `--private-key`), then bundles MPL Core `CreateV1` +
|
|
94
|
+
* `ario_ant::initialize` into a single transaction. The signer's address
|
|
95
|
+
* becomes the ANT owner on chain — no separate `--address` is required.
|
|
96
|
+
*
|
|
97
|
+
* Maps the user-facing options (`--name`, `--ticker`, `--description`,
|
|
98
|
+
* `--keywords`, `--logo`, `--target` for the @ record tx id) onto the Solana
|
|
99
|
+
* `InitializeAntParams` payload.
|
|
100
|
+
*/
|
|
101
|
+
export declare function spawnSolanaANTFromOptions(options: ANTStateCLIOptions): Promise<import('../solana/spawn-ant.js').SpawnSolanaANTResult>;
|
|
86
102
|
export declare function getTokenCostParamsFromOptions(o: GetTokenCostCLIOptions): {
|
|
87
103
|
type: "lease" | "permabuy";
|
|
88
104
|
quantity: number | undefined;
|
|
@@ -97,6 +113,30 @@ export declare function fundFromFromOptions<O extends {
|
|
|
97
113
|
export declare function referrerFromOptions<O extends {
|
|
98
114
|
referrer?: string;
|
|
99
115
|
}>(o: O): string | undefined;
|
|
116
|
+
/** Parse `--withdrawal-id` from CLI options into a bigint. */
|
|
117
|
+
export declare function withdrawalIdFromOptions<O extends {
|
|
118
|
+
withdrawalId?: string;
|
|
119
|
+
}>(o: O): bigint | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Parse `--funding-plan-json` into a `FundingSourceSpec[]`. Validates each
|
|
122
|
+
* entry's `kind` against the on-chain enum and parses `amount` as a bigint.
|
|
123
|
+
* Each Delegation/OperatorStake entry MAY carry a `gateway` field (base58
|
|
124
|
+
* Solana address) — required when the plan spans multiple gateways.
|
|
125
|
+
*
|
|
126
|
+
* Format examples:
|
|
127
|
+
* '[{"kind":"balance","amount":"100"},{"kind":"withdrawal","amount":"500"}]'
|
|
128
|
+
* '[{"kind":"delegation","amount":"100","gateway":"Gw1..."},{"kind":"delegation","amount":"50","gateway":"Gw2..."}]'
|
|
129
|
+
*
|
|
130
|
+
* Returns undefined when the flag isn't set; throws Error on malformed JSON
|
|
131
|
+
* or unknown kinds.
|
|
132
|
+
*/
|
|
133
|
+
export declare function fundingPlanFromOptions<O extends {
|
|
134
|
+
fundingPlanJson?: string;
|
|
135
|
+
}>(o: O): {
|
|
136
|
+
kind: string;
|
|
137
|
+
amount: bigint;
|
|
138
|
+
gateway?: string;
|
|
139
|
+
}[] | undefined;
|
|
100
140
|
export declare function assertLockLengthInRange(lockLengthMs: number, assertMin?: boolean): void;
|
|
101
141
|
export declare function antRecordMetadataFromOptions<O extends {
|
|
102
142
|
owner?: string;
|