@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
package/lib/cjs/cli/cli.js
DELETED
|
@@ -1,822 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
// eslint-disable-next-line header/header -- This is a CLI file
|
|
20
|
-
const commander_1 = require("commander");
|
|
21
|
-
const index_js_1 = require("../node/index.js");
|
|
22
|
-
const token_js_1 = require("../types/token.js");
|
|
23
|
-
const version_js_1 = require("../version.js");
|
|
24
|
-
const antCommands_js_1 = require("./commands/antCommands.js");
|
|
25
|
-
const arnsPurchaseCommands_js_1 = require("./commands/arnsPurchaseCommands.js");
|
|
26
|
-
const gatewayWriteCommands_js_1 = require("./commands/gatewayWriteCommands.js");
|
|
27
|
-
const readCommands_js_1 = require("./commands/readCommands.js");
|
|
28
|
-
const transfer_js_1 = require("./commands/transfer.js");
|
|
29
|
-
const options_js_1 = require("./options.js");
|
|
30
|
-
const utils_js_1 = require("./utils.js");
|
|
31
|
-
(0, utils_js_1.applyOptions)(commander_1.program
|
|
32
|
-
.name('ar.io')
|
|
33
|
-
.version(version_js_1.version)
|
|
34
|
-
.description('AR.IO Network CLI')
|
|
35
|
-
.helpCommand(true), options_js_1.globalOptions);
|
|
36
|
-
// # Getters
|
|
37
|
-
(0, utils_js_1.makeCommand)({
|
|
38
|
-
name: 'info',
|
|
39
|
-
description: 'Get network info',
|
|
40
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options).getInfo(),
|
|
41
|
-
});
|
|
42
|
-
(0, utils_js_1.makeCommand)({
|
|
43
|
-
name: 'token-supply',
|
|
44
|
-
description: 'Get the total token supply',
|
|
45
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options).getTokenSupply(),
|
|
46
|
-
});
|
|
47
|
-
(0, utils_js_1.makeCommand)({
|
|
48
|
-
name: 'balance',
|
|
49
|
-
description: 'Get the balance of an address',
|
|
50
|
-
options: [options_js_1.optionMap.address],
|
|
51
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options)
|
|
52
|
-
.getBalance({ address: (0, utils_js_1.requiredAddressFromOptions)(options) })
|
|
53
|
-
.then((result) => ({
|
|
54
|
-
address: (0, utils_js_1.requiredAddressFromOptions)(options),
|
|
55
|
-
mARIOBalance: result,
|
|
56
|
-
message: `Provided address current has a balance of ${(0, utils_js_1.formatARIOWithCommas)(new token_js_1.mARIOToken(result).toARIO())} ARIO`,
|
|
57
|
-
})),
|
|
58
|
-
});
|
|
59
|
-
(0, utils_js_1.makeCommand)({
|
|
60
|
-
name: 'get-registration-fees',
|
|
61
|
-
description: 'Get registration fees',
|
|
62
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options).getRegistrationFees(),
|
|
63
|
-
});
|
|
64
|
-
(0, utils_js_1.makeCommand)({
|
|
65
|
-
name: 'get-demand-factor',
|
|
66
|
-
description: 'Get demand factor',
|
|
67
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options).getDemandFactor(),
|
|
68
|
-
});
|
|
69
|
-
(0, utils_js_1.makeCommand)({
|
|
70
|
-
name: 'get-demand-factor-settings',
|
|
71
|
-
description: 'Get current settings for demand factor',
|
|
72
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options).getDemandFactorSettings(),
|
|
73
|
-
});
|
|
74
|
-
(0, utils_js_1.makeCommand)({
|
|
75
|
-
name: 'get-epoch-settings',
|
|
76
|
-
description: 'Get current settings for epochs',
|
|
77
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options).getEpochSettings(),
|
|
78
|
-
});
|
|
79
|
-
(0, utils_js_1.makeCommand)({
|
|
80
|
-
name: 'get-gateway',
|
|
81
|
-
description: 'Get the gateway of an address',
|
|
82
|
-
options: [options_js_1.optionMap.address],
|
|
83
|
-
action: readCommands_js_1.getGateway,
|
|
84
|
-
});
|
|
85
|
-
(0, utils_js_1.makeCommand)({
|
|
86
|
-
name: 'get-gateway-delegates',
|
|
87
|
-
description: 'Get the delegates of a gateway',
|
|
88
|
-
options: options_js_1.paginationAddressOptions,
|
|
89
|
-
action: readCommands_js_1.getGatewayDelegates,
|
|
90
|
-
});
|
|
91
|
-
(0, utils_js_1.makeCommand)({
|
|
92
|
-
name: 'get-gateway-vaults',
|
|
93
|
-
description: 'Get the vaults of a gateway',
|
|
94
|
-
options: options_js_1.paginationAddressOptions,
|
|
95
|
-
action: readCommands_js_1.getGatewayVaults,
|
|
96
|
-
});
|
|
97
|
-
(0, utils_js_1.makeCommand)({
|
|
98
|
-
name: 'get-delegations',
|
|
99
|
-
description: 'Get all stake delegated to gateways from this address',
|
|
100
|
-
options: [options_js_1.optionMap.address],
|
|
101
|
-
action: readCommands_js_1.getDelegations,
|
|
102
|
-
});
|
|
103
|
-
(0, utils_js_1.makeCommand)({
|
|
104
|
-
name: 'get-allowed-delegates',
|
|
105
|
-
description: 'Get the allow list of a gateway delegate',
|
|
106
|
-
options: options_js_1.paginationAddressOptions,
|
|
107
|
-
action: readCommands_js_1.getAllowedDelegates,
|
|
108
|
-
});
|
|
109
|
-
(0, utils_js_1.makeCommand)({
|
|
110
|
-
name: 'get-arns-record',
|
|
111
|
-
description: 'Get an ArNS record by name',
|
|
112
|
-
options: [options_js_1.optionMap.name],
|
|
113
|
-
action: readCommands_js_1.getArNSRecord,
|
|
114
|
-
});
|
|
115
|
-
(0, utils_js_1.makeCommand)({
|
|
116
|
-
name: 'get-arns-reserved-name',
|
|
117
|
-
description: 'Get a reserved ArNS name',
|
|
118
|
-
options: [options_js_1.optionMap.name],
|
|
119
|
-
action: readCommands_js_1.getArNSReservedName,
|
|
120
|
-
});
|
|
121
|
-
(0, utils_js_1.makeCommand)({
|
|
122
|
-
name: 'get-arns-returned-name',
|
|
123
|
-
description: 'Get an ArNS returned name by name',
|
|
124
|
-
options: [options_js_1.optionMap.name],
|
|
125
|
-
action: readCommands_js_1.getArNSReturnedName,
|
|
126
|
-
});
|
|
127
|
-
(0, utils_js_1.makeCommand)({
|
|
128
|
-
name: 'get-epoch',
|
|
129
|
-
description: 'Get epoch data',
|
|
130
|
-
options: options_js_1.epochOptions,
|
|
131
|
-
action: readCommands_js_1.getEpoch,
|
|
132
|
-
});
|
|
133
|
-
(0, utils_js_1.makeCommand)({
|
|
134
|
-
name: 'get-current-epoch',
|
|
135
|
-
description: 'Get current epoch data',
|
|
136
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options).getCurrentEpoch(),
|
|
137
|
-
});
|
|
138
|
-
(0, utils_js_1.makeCommand)({
|
|
139
|
-
name: 'get-prescribed-observers',
|
|
140
|
-
description: 'Get prescribed observers for an epoch',
|
|
141
|
-
options: options_js_1.epochOptions,
|
|
142
|
-
action: readCommands_js_1.getPrescribedObservers,
|
|
143
|
-
});
|
|
144
|
-
(0, utils_js_1.makeCommand)({
|
|
145
|
-
name: 'get-prescribed-names',
|
|
146
|
-
description: 'Get prescribed names for an epoch',
|
|
147
|
-
options: options_js_1.epochOptions,
|
|
148
|
-
action: readCommands_js_1.getPrescribedNames,
|
|
149
|
-
});
|
|
150
|
-
(0, utils_js_1.makeCommand)({
|
|
151
|
-
name: 'get-observations',
|
|
152
|
-
description: 'Get observations for an epoch',
|
|
153
|
-
options: options_js_1.epochOptions,
|
|
154
|
-
action: (o) => (0, utils_js_1.readARIOFromOptions)(o)
|
|
155
|
-
.getObservations((0, utils_js_1.epochInputFromOptions)(o))
|
|
156
|
-
.then((result) => result ?? { message: 'No observations found for epoch' }),
|
|
157
|
-
});
|
|
158
|
-
(0, utils_js_1.makeCommand)({
|
|
159
|
-
name: 'get-distributions',
|
|
160
|
-
description: 'Get distributions for an epoch',
|
|
161
|
-
options: options_js_1.epochOptions,
|
|
162
|
-
action: (o) => (0, utils_js_1.readARIOFromOptions)(o)
|
|
163
|
-
.getDistributions((0, utils_js_1.epochInputFromOptions)(o))
|
|
164
|
-
.then((result) => result ?? { message: 'No distributions found for epoch' }),
|
|
165
|
-
});
|
|
166
|
-
(0, utils_js_1.makeCommand)({
|
|
167
|
-
name: 'get-eligible-rewards',
|
|
168
|
-
description: 'Get eligible rewards for an epoch',
|
|
169
|
-
options: [...options_js_1.epochOptions, ...options_js_1.paginationOptions],
|
|
170
|
-
action: (o) => (0, utils_js_1.readARIOFromOptions)(o)
|
|
171
|
-
.getEligibleEpochRewards((0, utils_js_1.epochInputFromOptions)(o), (0, utils_js_1.paginationParamsFromOptions)(o))
|
|
172
|
-
.then((result) => result ?? { message: 'No eligible distributions found for epoch' }),
|
|
173
|
-
});
|
|
174
|
-
(0, utils_js_1.makeCommand)({
|
|
175
|
-
name: 'get-token-cost',
|
|
176
|
-
description: 'Get token cost for an intended action',
|
|
177
|
-
options: options_js_1.tokenCostOptions,
|
|
178
|
-
action: readCommands_js_1.getTokenCost,
|
|
179
|
-
});
|
|
180
|
-
(0, utils_js_1.makeCommand)({
|
|
181
|
-
name: 'get-cost-details',
|
|
182
|
-
description: 'Get expanded cost details for an intended action',
|
|
183
|
-
options: options_js_1.tokenCostOptions,
|
|
184
|
-
action: readCommands_js_1.getCostDetails,
|
|
185
|
-
});
|
|
186
|
-
(0, utils_js_1.makeCommand)({
|
|
187
|
-
name: 'get-primary-name',
|
|
188
|
-
description: 'Get primary name',
|
|
189
|
-
options: [options_js_1.optionMap.address, options_js_1.optionMap.name],
|
|
190
|
-
action: readCommands_js_1.getPrimaryName,
|
|
191
|
-
});
|
|
192
|
-
(0, utils_js_1.makeCommand)({
|
|
193
|
-
name: 'get-primary-name-request',
|
|
194
|
-
description: 'Get primary name request',
|
|
195
|
-
options: [options_js_1.optionMap.initiator],
|
|
196
|
-
action: (o) => (0, utils_js_1.readARIOFromOptions)(o)
|
|
197
|
-
.getPrimaryNameRequest({
|
|
198
|
-
initiator: (0, utils_js_1.requiredStringFromOptions)(o, 'initiator'),
|
|
199
|
-
})
|
|
200
|
-
.then((result) => result ?? {
|
|
201
|
-
message: `No primary name request found`,
|
|
202
|
-
}),
|
|
203
|
-
});
|
|
204
|
-
(0, utils_js_1.makeCommand)({
|
|
205
|
-
name: 'get-redelegation-fee',
|
|
206
|
-
description: 'Get redelegation fee',
|
|
207
|
-
options: [options_js_1.optionMap.address],
|
|
208
|
-
action: (options) => (0, utils_js_1.readARIOFromOptions)(options).getRedelegationFee({
|
|
209
|
-
address: (0, utils_js_1.requiredAddressFromOptions)(options),
|
|
210
|
-
}),
|
|
211
|
-
});
|
|
212
|
-
(0, utils_js_1.makeCommand)({
|
|
213
|
-
name: 'get-vault',
|
|
214
|
-
description: 'Get the vault of provided address and vault ID',
|
|
215
|
-
options: options_js_1.getVaultOptions,
|
|
216
|
-
action: readCommands_js_1.getVault,
|
|
217
|
-
});
|
|
218
|
-
// # ArNS Resolution
|
|
219
|
-
(0, utils_js_1.makeCommand)({
|
|
220
|
-
name: 'resolve-arns-name',
|
|
221
|
-
description: 'Resolve an ArNS name',
|
|
222
|
-
options: [options_js_1.optionMap.name],
|
|
223
|
-
action: readCommands_js_1.resolveArNSName,
|
|
224
|
-
});
|
|
225
|
-
// # Paginated handlers
|
|
226
|
-
(0, utils_js_1.makeCommand)({
|
|
227
|
-
name: 'list-gateways',
|
|
228
|
-
description: 'List the gateways of the network',
|
|
229
|
-
options: options_js_1.paginationOptions,
|
|
230
|
-
action: readCommands_js_1.listGateways,
|
|
231
|
-
});
|
|
232
|
-
(0, utils_js_1.makeCommand)({
|
|
233
|
-
name: 'list-all-delegates',
|
|
234
|
-
description: 'List all paginated delegates from all gateways',
|
|
235
|
-
options: options_js_1.paginationOptions,
|
|
236
|
-
action: readCommands_js_1.listAllDelegatesCLICommand,
|
|
237
|
-
});
|
|
238
|
-
(0, utils_js_1.makeCommand)({
|
|
239
|
-
name: 'list-arns-records',
|
|
240
|
-
description: 'List all ArNS records',
|
|
241
|
-
options: options_js_1.paginationOptions,
|
|
242
|
-
action: readCommands_js_1.listArNSRecords,
|
|
243
|
-
});
|
|
244
|
-
(0, utils_js_1.makeCommand)({
|
|
245
|
-
name: 'list-arns-names-for-address',
|
|
246
|
-
description: 'List all ArNS names for an address',
|
|
247
|
-
options: [
|
|
248
|
-
...options_js_1.paginationOptions,
|
|
249
|
-
options_js_1.optionMap.address,
|
|
250
|
-
options_js_1.optionMap.antRegistryProcessId,
|
|
251
|
-
],
|
|
252
|
-
action: readCommands_js_1.listArNSRecordsForAddress,
|
|
253
|
-
});
|
|
254
|
-
(0, utils_js_1.makeCommand)({
|
|
255
|
-
name: 'list-arns-reserved-names',
|
|
256
|
-
description: 'Get all reserved ArNS names',
|
|
257
|
-
options: options_js_1.paginationOptions,
|
|
258
|
-
action: readCommands_js_1.listArNSReservedNames,
|
|
259
|
-
});
|
|
260
|
-
(0, utils_js_1.makeCommand)({
|
|
261
|
-
name: 'list-arns-returned-names',
|
|
262
|
-
description: 'Get all ArNS recently returned names',
|
|
263
|
-
options: options_js_1.paginationOptions,
|
|
264
|
-
action: readCommands_js_1.listArNSReturnedNames,
|
|
265
|
-
});
|
|
266
|
-
(0, utils_js_1.makeCommand)({
|
|
267
|
-
name: 'list-vaults',
|
|
268
|
-
description: 'Get all wallet vaults',
|
|
269
|
-
options: options_js_1.paginationOptions,
|
|
270
|
-
action: (o) => (0, utils_js_1.readARIOFromOptions)(o)
|
|
271
|
-
.getVaults((0, utils_js_1.paginationParamsFromOptions)(o))
|
|
272
|
-
.then((result) => result.items.length ? result : { message: 'No vaults found' }),
|
|
273
|
-
});
|
|
274
|
-
(0, utils_js_1.makeCommand)({
|
|
275
|
-
name: 'list-primary-name-requests',
|
|
276
|
-
description: 'Get primary name requests',
|
|
277
|
-
options: options_js_1.paginationOptions,
|
|
278
|
-
action: (o) => (0, utils_js_1.readARIOFromOptions)(o)
|
|
279
|
-
.getPrimaryNameRequests((0, utils_js_1.paginationParamsFromOptions)(o))
|
|
280
|
-
.then((result) => result.items.length ? result : { message: 'No requests found' }),
|
|
281
|
-
});
|
|
282
|
-
(0, utils_js_1.makeCommand)({
|
|
283
|
-
name: 'list-primary-names',
|
|
284
|
-
description: 'Get primary names',
|
|
285
|
-
options: options_js_1.paginationOptions,
|
|
286
|
-
action: (o) => (0, utils_js_1.readARIOFromOptions)(o)
|
|
287
|
-
.getPrimaryNames((0, utils_js_1.paginationParamsFromOptions)(o))
|
|
288
|
-
.then((result) => result.items.length ? result : { message: 'No names found' }),
|
|
289
|
-
});
|
|
290
|
-
(0, utils_js_1.makeCommand)({
|
|
291
|
-
name: 'list-balances',
|
|
292
|
-
description: 'List all balances',
|
|
293
|
-
options: options_js_1.paginationOptions,
|
|
294
|
-
action: (o) => (0, utils_js_1.readARIOFromOptions)(o)
|
|
295
|
-
.getBalances((0, utils_js_1.paginationParamsFromOptions)(o))
|
|
296
|
-
.then((result) => result.items.length ? result : { message: 'No balances found' }),
|
|
297
|
-
});
|
|
298
|
-
(0, utils_js_1.makeCommand)({
|
|
299
|
-
name: 'list-all-gateway-vaults',
|
|
300
|
-
description: 'List vaults from all gateways',
|
|
301
|
-
options: options_js_1.paginationAddressOptions,
|
|
302
|
-
action: readCommands_js_1.getAllGatewayVaults,
|
|
303
|
-
});
|
|
304
|
-
// # Actions
|
|
305
|
-
(0, utils_js_1.makeCommand)({
|
|
306
|
-
name: 'transfer',
|
|
307
|
-
description: 'Transfer ARIO to another address',
|
|
308
|
-
options: options_js_1.transferOptions,
|
|
309
|
-
action: transfer_js_1.transferCLICommand,
|
|
310
|
-
});
|
|
311
|
-
(0, utils_js_1.makeCommand)({
|
|
312
|
-
name: 'vaulted-transfer',
|
|
313
|
-
description: 'Transfer ARIO to another address into a locked vault',
|
|
314
|
-
options: options_js_1.vaultedTransferOptions,
|
|
315
|
-
action: transfer_js_1.vaultedTransferCLICommand,
|
|
316
|
-
});
|
|
317
|
-
(0, utils_js_1.makeCommand)({
|
|
318
|
-
name: 'revoke-vault',
|
|
319
|
-
description: 'Revoke a vaulted transfer as the controller',
|
|
320
|
-
options: [...options_js_1.writeActionOptions, options_js_1.optionMap.vaultId, options_js_1.optionMap.recipient],
|
|
321
|
-
action: transfer_js_1.revokeVaultCLICommand,
|
|
322
|
-
});
|
|
323
|
-
(0, utils_js_1.makeCommand)({
|
|
324
|
-
name: 'create-vault',
|
|
325
|
-
description: 'Create a locked vault with balance from the sender',
|
|
326
|
-
options: [...options_js_1.writeActionOptions, options_js_1.optionMap.lockLengthMs, options_js_1.optionMap.quantity],
|
|
327
|
-
action: transfer_js_1.createVaultCLICommand,
|
|
328
|
-
});
|
|
329
|
-
(0, utils_js_1.makeCommand)({
|
|
330
|
-
name: 'extend-vault',
|
|
331
|
-
description: 'Extend the lock length of a vault as the recipient',
|
|
332
|
-
options: [...options_js_1.writeActionOptions, options_js_1.optionMap.vaultId, options_js_1.optionMap.extendLengthMs],
|
|
333
|
-
action: transfer_js_1.extendVaultCLICommand,
|
|
334
|
-
});
|
|
335
|
-
(0, utils_js_1.makeCommand)({
|
|
336
|
-
name: 'increase-vault',
|
|
337
|
-
description: 'Increase the balance of a locked vault as the recipient',
|
|
338
|
-
options: [...options_js_1.writeActionOptions, options_js_1.optionMap.vaultId, options_js_1.optionMap.quantity],
|
|
339
|
-
action: transfer_js_1.increaseVaultCLICommand,
|
|
340
|
-
});
|
|
341
|
-
(0, utils_js_1.makeCommand)({
|
|
342
|
-
name: 'join-network',
|
|
343
|
-
description: 'Join a gateway to the AR.IO network',
|
|
344
|
-
options: options_js_1.joinNetworkOptions,
|
|
345
|
-
action: gatewayWriteCommands_js_1.joinNetwork,
|
|
346
|
-
});
|
|
347
|
-
(0, utils_js_1.makeCommand)({
|
|
348
|
-
name: 'leave-network',
|
|
349
|
-
description: 'Leave a gateway from the AR.IO network',
|
|
350
|
-
action: gatewayWriteCommands_js_1.leaveNetwork,
|
|
351
|
-
});
|
|
352
|
-
(0, utils_js_1.makeCommand)({
|
|
353
|
-
name: 'update-gateway-settings',
|
|
354
|
-
description: 'Update AR.IO gateway settings',
|
|
355
|
-
options: options_js_1.updateGatewaySettingsOptions,
|
|
356
|
-
action: gatewayWriteCommands_js_1.updateGatewaySettings,
|
|
357
|
-
});
|
|
358
|
-
(0, utils_js_1.makeCommand)({
|
|
359
|
-
name: 'save-observations',
|
|
360
|
-
description: 'Save observations',
|
|
361
|
-
options: [
|
|
362
|
-
options_js_1.optionMap.failedGateways,
|
|
363
|
-
options_js_1.optionMap.transactionId,
|
|
364
|
-
...options_js_1.writeActionOptions,
|
|
365
|
-
],
|
|
366
|
-
action: gatewayWriteCommands_js_1.saveObservations,
|
|
367
|
-
});
|
|
368
|
-
(0, utils_js_1.makeCommand)({
|
|
369
|
-
name: 'increase-operator-stake',
|
|
370
|
-
description: 'Increase operator stake',
|
|
371
|
-
options: options_js_1.operatorStakeOptions,
|
|
372
|
-
action: gatewayWriteCommands_js_1.increaseOperatorStake,
|
|
373
|
-
});
|
|
374
|
-
(0, utils_js_1.makeCommand)({
|
|
375
|
-
name: 'decrease-operator-stake',
|
|
376
|
-
description: 'Decrease operator stake',
|
|
377
|
-
options: options_js_1.operatorStakeOptions,
|
|
378
|
-
action: gatewayWriteCommands_js_1.decreaseOperatorStake,
|
|
379
|
-
});
|
|
380
|
-
(0, utils_js_1.makeCommand)({
|
|
381
|
-
name: 'instant-withdrawal',
|
|
382
|
-
description: 'Instantly withdraw stake from an existing gateway withdrawal vault',
|
|
383
|
-
options: options_js_1.addressAndVaultIdOptions,
|
|
384
|
-
action: gatewayWriteCommands_js_1.instantWithdrawal,
|
|
385
|
-
});
|
|
386
|
-
(0, utils_js_1.makeCommand)({
|
|
387
|
-
name: 'cancel-withdrawal',
|
|
388
|
-
description: 'Cancel a pending gateway withdrawal vault',
|
|
389
|
-
options: options_js_1.addressAndVaultIdOptions,
|
|
390
|
-
action: gatewayWriteCommands_js_1.cancelWithdrawal,
|
|
391
|
-
});
|
|
392
|
-
(0, utils_js_1.makeCommand)({
|
|
393
|
-
name: 'delegate-stake',
|
|
394
|
-
description: 'Delegate stake to a gateway',
|
|
395
|
-
options: options_js_1.delegateStakeOptions,
|
|
396
|
-
action: gatewayWriteCommands_js_1.delegateStake,
|
|
397
|
-
});
|
|
398
|
-
(0, utils_js_1.makeCommand)({
|
|
399
|
-
name: 'decrease-delegate-stake',
|
|
400
|
-
description: 'Decrease delegated stake',
|
|
401
|
-
options: options_js_1.decreaseDelegateStakeOptions,
|
|
402
|
-
action: gatewayWriteCommands_js_1.decreaseDelegateStake,
|
|
403
|
-
});
|
|
404
|
-
(0, utils_js_1.makeCommand)({
|
|
405
|
-
name: 'redelegate-stake',
|
|
406
|
-
description: 'Redelegate stake to another gateway',
|
|
407
|
-
options: options_js_1.redelegateStakeOptions,
|
|
408
|
-
action: gatewayWriteCommands_js_1.redelegateStake,
|
|
409
|
-
});
|
|
410
|
-
(0, utils_js_1.makeCommand)({
|
|
411
|
-
name: 'buy-record',
|
|
412
|
-
description: 'Buy a record',
|
|
413
|
-
options: options_js_1.buyRecordOptions,
|
|
414
|
-
action: arnsPurchaseCommands_js_1.buyRecordCLICommand,
|
|
415
|
-
});
|
|
416
|
-
// TODO alias buy-record with buy-name
|
|
417
|
-
(0, utils_js_1.makeCommand)({
|
|
418
|
-
name: 'upgrade-record',
|
|
419
|
-
description: 'Upgrade the lease of a record to a permabuy',
|
|
420
|
-
options: options_js_1.arnsPurchaseOptions,
|
|
421
|
-
action: arnsPurchaseCommands_js_1.upgradeRecordCLICommand,
|
|
422
|
-
});
|
|
423
|
-
(0, utils_js_1.makeCommand)({
|
|
424
|
-
name: 'extend-lease',
|
|
425
|
-
description: 'Extend the lease of a record',
|
|
426
|
-
options: [...options_js_1.arnsPurchaseOptions, options_js_1.optionMap.years],
|
|
427
|
-
action: arnsPurchaseCommands_js_1.extendLeaseCLICommand,
|
|
428
|
-
});
|
|
429
|
-
(0, utils_js_1.makeCommand)({
|
|
430
|
-
name: 'increase-undername-limit',
|
|
431
|
-
description: 'Increase the limit of a name',
|
|
432
|
-
options: [...options_js_1.arnsPurchaseOptions, options_js_1.optionMap.increaseCount],
|
|
433
|
-
action: arnsPurchaseCommands_js_1.increaseUndernameLimitCLICommand,
|
|
434
|
-
});
|
|
435
|
-
(0, utils_js_1.makeCommand)({
|
|
436
|
-
name: 'request-primary-name',
|
|
437
|
-
description: 'Request a primary name',
|
|
438
|
-
options: options_js_1.arnsPurchaseOptions,
|
|
439
|
-
action: arnsPurchaseCommands_js_1.requestPrimaryNameCLICommand,
|
|
440
|
-
});
|
|
441
|
-
(0, utils_js_1.makeCommand)({
|
|
442
|
-
name: 'set-primary-name',
|
|
443
|
-
description: 'Set an ArNS name you own as your primary name',
|
|
444
|
-
options: options_js_1.arnsPurchaseOptions,
|
|
445
|
-
action: arnsPurchaseCommands_js_1.setPrimaryNameCLICommand,
|
|
446
|
-
});
|
|
447
|
-
// # ANT Registry
|
|
448
|
-
(0, utils_js_1.makeCommand)({
|
|
449
|
-
name: 'get-ants-for-address',
|
|
450
|
-
description: 'Get the list of ANTs owned by an address according to the ANT registry',
|
|
451
|
-
options: [options_js_1.optionMap.address, options_js_1.optionMap.antRegistryProcessId],
|
|
452
|
-
action: readCommands_js_1.listAntsForAddress,
|
|
453
|
-
});
|
|
454
|
-
// # ANTS
|
|
455
|
-
// # Getters
|
|
456
|
-
(0, utils_js_1.makeCommand)({
|
|
457
|
-
name: 'get-ant-state',
|
|
458
|
-
description: 'Get the state of an ANT process',
|
|
459
|
-
options: [options_js_1.optionMap.processId],
|
|
460
|
-
action: async (options) => {
|
|
461
|
-
return (0, utils_js_1.readANTFromOptions)(options).getState();
|
|
462
|
-
},
|
|
463
|
-
});
|
|
464
|
-
(0, utils_js_1.makeCommand)({
|
|
465
|
-
name: 'get-ant-info',
|
|
466
|
-
description: 'Get the info of an ANT process',
|
|
467
|
-
options: [options_js_1.optionMap.processId],
|
|
468
|
-
action: async (options) => {
|
|
469
|
-
return (0, utils_js_1.readANTFromOptions)(options).getInfo();
|
|
470
|
-
},
|
|
471
|
-
});
|
|
472
|
-
(0, utils_js_1.makeCommand)({
|
|
473
|
-
name: 'get-ant-record',
|
|
474
|
-
description: 'Get a record of an ANT process',
|
|
475
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.undername],
|
|
476
|
-
action: async (options) => {
|
|
477
|
-
return ((await (0, utils_js_1.readANTFromOptions)(options).getRecord({
|
|
478
|
-
undername: (0, utils_js_1.requiredStringFromOptions)(options, 'undername'),
|
|
479
|
-
})) ?? { message: 'No record found' });
|
|
480
|
-
},
|
|
481
|
-
});
|
|
482
|
-
(0, utils_js_1.makeCommand)({
|
|
483
|
-
name: 'get-ant-owner',
|
|
484
|
-
description: 'Get the owner of an ANT process',
|
|
485
|
-
options: [options_js_1.optionMap.processId],
|
|
486
|
-
action: async (options) => {
|
|
487
|
-
return (0, utils_js_1.readANTFromOptions)(options).getOwner();
|
|
488
|
-
},
|
|
489
|
-
});
|
|
490
|
-
(0, utils_js_1.makeCommand)({
|
|
491
|
-
name: 'get-ant-name',
|
|
492
|
-
description: 'Get the name of an ANT process',
|
|
493
|
-
options: [options_js_1.optionMap.processId],
|
|
494
|
-
action: async (options) => {
|
|
495
|
-
return (0, utils_js_1.readANTFromOptions)(options).getName();
|
|
496
|
-
},
|
|
497
|
-
});
|
|
498
|
-
(0, utils_js_1.makeCommand)({
|
|
499
|
-
name: 'get-ant-ticker',
|
|
500
|
-
description: 'Get the ticker of an ANT process',
|
|
501
|
-
options: [options_js_1.optionMap.processId],
|
|
502
|
-
action: async (options) => {
|
|
503
|
-
return (0, utils_js_1.readANTFromOptions)(options).getTicker();
|
|
504
|
-
},
|
|
505
|
-
});
|
|
506
|
-
(0, utils_js_1.makeCommand)({
|
|
507
|
-
name: 'get-ant-logo',
|
|
508
|
-
description: 'Get the logo of an ANT process',
|
|
509
|
-
options: [options_js_1.optionMap.processId],
|
|
510
|
-
action: async (options) => {
|
|
511
|
-
return (0, utils_js_1.readANTFromOptions)(options).getLogo();
|
|
512
|
-
},
|
|
513
|
-
});
|
|
514
|
-
(0, utils_js_1.makeCommand)({
|
|
515
|
-
name: 'get-ant-balance',
|
|
516
|
-
description: 'Get the balance of an ANT process',
|
|
517
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.address],
|
|
518
|
-
action: async (options) => {
|
|
519
|
-
return (0, utils_js_1.readANTFromOptions)(options).getBalance({
|
|
520
|
-
address: (0, utils_js_1.requiredAddressFromOptions)(options),
|
|
521
|
-
});
|
|
522
|
-
},
|
|
523
|
-
});
|
|
524
|
-
// # Spawn
|
|
525
|
-
(0, utils_js_1.makeCommand)({
|
|
526
|
-
name: 'spawn-ant',
|
|
527
|
-
description: 'Spawn an ANT process',
|
|
528
|
-
options: options_js_1.antStateOptions,
|
|
529
|
-
action: async (options) => {
|
|
530
|
-
const state = (0, utils_js_1.getANTStateFromOptions)(options);
|
|
531
|
-
const antProcessId = await (0, index_js_1.spawnANT)({
|
|
532
|
-
state,
|
|
533
|
-
signer: (0, utils_js_1.requiredAoSignerFromOptions)(options),
|
|
534
|
-
logger: (0, utils_js_1.getLoggerFromOptions)(options),
|
|
535
|
-
...(options.module !== undefined ? { module: options.module } : {}),
|
|
536
|
-
});
|
|
537
|
-
return {
|
|
538
|
-
processId: antProcessId,
|
|
539
|
-
state,
|
|
540
|
-
message: `Spawned ANT process with process ID ${antProcessId}`,
|
|
541
|
-
};
|
|
542
|
-
},
|
|
543
|
-
});
|
|
544
|
-
// # ANT Paginated Handlers
|
|
545
|
-
(0, utils_js_1.makeCommand)({
|
|
546
|
-
name: 'list-ant-records',
|
|
547
|
-
description: 'Get the records of an ANT process',
|
|
548
|
-
options: [options_js_1.optionMap.processId],
|
|
549
|
-
action: async (options) => {
|
|
550
|
-
return (0, utils_js_1.readANTFromOptions)(options).getRecords();
|
|
551
|
-
},
|
|
552
|
-
});
|
|
553
|
-
(0, utils_js_1.makeCommand)({
|
|
554
|
-
name: 'list-ant-controllers',
|
|
555
|
-
description: 'List the controllers of an ANT process',
|
|
556
|
-
options: [options_js_1.optionMap.processId],
|
|
557
|
-
action: async (options) => {
|
|
558
|
-
return (0, utils_js_1.readANTFromOptions)(options).getControllers();
|
|
559
|
-
},
|
|
560
|
-
});
|
|
561
|
-
(0, utils_js_1.makeCommand)({
|
|
562
|
-
name: 'list-ant-balances',
|
|
563
|
-
description: 'Get the balances of an ANT process',
|
|
564
|
-
options: [options_js_1.optionMap.processId],
|
|
565
|
-
action: async (options) => {
|
|
566
|
-
return (0, utils_js_1.readANTFromOptions)(options).getBalances();
|
|
567
|
-
},
|
|
568
|
-
});
|
|
569
|
-
// # Actions
|
|
570
|
-
(0, utils_js_1.makeCommand)({
|
|
571
|
-
name: 'transfer-ant-ownership',
|
|
572
|
-
description: 'Transfer ownership of an ANT process',
|
|
573
|
-
options: [
|
|
574
|
-
options_js_1.optionMap.processId,
|
|
575
|
-
options_js_1.optionMap.target,
|
|
576
|
-
options_js_1.optionMap.removeControllers,
|
|
577
|
-
...options_js_1.writeActionOptions,
|
|
578
|
-
],
|
|
579
|
-
action: async (options) => {
|
|
580
|
-
const target = (0, utils_js_1.requiredStringFromOptions)(options, 'target');
|
|
581
|
-
const removeControllers = options.removeControllers !== undefined
|
|
582
|
-
? options.removeControllers
|
|
583
|
-
: true;
|
|
584
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to transfer ANT ownership to ${target}${removeControllers ? ' (controllers will be removed)' : ' (controllers will be retained)'}?`, options);
|
|
585
|
-
return (0, utils_js_1.writeANTFromOptions)(options).transfer({
|
|
586
|
-
target,
|
|
587
|
-
removeControllers,
|
|
588
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
589
|
-
},
|
|
590
|
-
});
|
|
591
|
-
(0, utils_js_1.makeCommand)({
|
|
592
|
-
name: 'add-ant-controller',
|
|
593
|
-
description: 'Add a controller to an ANT process',
|
|
594
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.controller, ...options_js_1.writeActionOptions],
|
|
595
|
-
action: async (options) => {
|
|
596
|
-
const controller = (0, utils_js_1.requiredStringFromOptions)(options, 'controller');
|
|
597
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to add ${controller} as a controller?`, options);
|
|
598
|
-
return (0, utils_js_1.writeANTFromOptions)(options).addController({
|
|
599
|
-
controller: (0, utils_js_1.requiredStringFromOptions)(options, 'controller'),
|
|
600
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
601
|
-
},
|
|
602
|
-
});
|
|
603
|
-
(0, utils_js_1.makeCommand)({
|
|
604
|
-
name: 'remove-ant-controller',
|
|
605
|
-
description: 'Remove a controller from an ANT process',
|
|
606
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.controller, ...options_js_1.writeActionOptions],
|
|
607
|
-
action: async (options) => {
|
|
608
|
-
return (0, utils_js_1.writeANTFromOptions)(options).removeController({
|
|
609
|
-
controller: (0, utils_js_1.requiredStringFromOptions)(options, 'controller'),
|
|
610
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
611
|
-
},
|
|
612
|
-
});
|
|
613
|
-
(0, utils_js_1.makeCommand)({
|
|
614
|
-
name: 'remove-ant-record',
|
|
615
|
-
description: 'Remove a record from an ANT process',
|
|
616
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.undername, ...options_js_1.writeActionOptions],
|
|
617
|
-
action: async (options) => {
|
|
618
|
-
const undername = (0, utils_js_1.requiredStringFromOptions)(options, 'undername');
|
|
619
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to remove the record with undername ${undername}?`, options);
|
|
620
|
-
return (0, utils_js_1.writeANTFromOptions)(options).removeRecord({
|
|
621
|
-
undername,
|
|
622
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
623
|
-
},
|
|
624
|
-
});
|
|
625
|
-
(0, utils_js_1.makeCommand)({
|
|
626
|
-
name: 'set-ant-record',
|
|
627
|
-
description: 'Set a record of an ANT process. Deprecated: use set-ant-base-name and set-ant-undername',
|
|
628
|
-
options: options_js_1.setAntUndernameOptions,
|
|
629
|
-
action: antCommands_js_1.setAntRecordCLICommand,
|
|
630
|
-
});
|
|
631
|
-
(0, utils_js_1.makeCommand)({
|
|
632
|
-
name: 'set-ant-base-name',
|
|
633
|
-
description: 'Set the base name of an ANT process',
|
|
634
|
-
options: options_js_1.setAntBaseNameOptions,
|
|
635
|
-
action: antCommands_js_1.setAntBaseNameCLICommand,
|
|
636
|
-
});
|
|
637
|
-
(0, utils_js_1.makeCommand)({
|
|
638
|
-
name: 'set-ant-undername',
|
|
639
|
-
description: 'Set an undername of an ANT process',
|
|
640
|
-
options: options_js_1.setAntUndernameOptions,
|
|
641
|
-
action: antCommands_js_1.setAntUndernameCLICommand,
|
|
642
|
-
});
|
|
643
|
-
(0, utils_js_1.makeCommand)({
|
|
644
|
-
name: 'transfer-record',
|
|
645
|
-
description: 'Transfer ownership of a specific record (undername) to another address',
|
|
646
|
-
options: options_js_1.transferRecordOwnershipOptions,
|
|
647
|
-
action: antCommands_js_1.transferRecordOwnershipCLICommand,
|
|
648
|
-
});
|
|
649
|
-
(0, utils_js_1.makeCommand)({
|
|
650
|
-
name: 'upgrade-ant',
|
|
651
|
-
description: 'Upgrade an ANT by forking it to the latest version and reassigning names',
|
|
652
|
-
options: options_js_1.upgradeAntOptions,
|
|
653
|
-
action: antCommands_js_1.upgradeAntCLICommand,
|
|
654
|
-
});
|
|
655
|
-
(0, utils_js_1.makeCommand)({
|
|
656
|
-
name: 'set-ant-ticker',
|
|
657
|
-
description: 'Set the ticker of an ANT process',
|
|
658
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.ticker, ...options_js_1.writeActionOptions],
|
|
659
|
-
action: async (options) => {
|
|
660
|
-
const ticker = (0, utils_js_1.requiredStringFromOptions)(options, 'ticker');
|
|
661
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to set the ticker to ${ticker}?`, options);
|
|
662
|
-
return (0, utils_js_1.writeANTFromOptions)(options).setTicker({
|
|
663
|
-
ticker,
|
|
664
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
665
|
-
},
|
|
666
|
-
});
|
|
667
|
-
(0, utils_js_1.makeCommand)({
|
|
668
|
-
name: 'set-ant-name',
|
|
669
|
-
description: 'Set the name of an ANT process',
|
|
670
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.name, ...options_js_1.writeActionOptions],
|
|
671
|
-
action: async (options) => {
|
|
672
|
-
const name = (0, utils_js_1.requiredStringFromOptions)(options, 'name');
|
|
673
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to set the name to ${(0, utils_js_1.requiredStringFromOptions)(options, 'name')}?`, options);
|
|
674
|
-
return (0, utils_js_1.writeANTFromOptions)(options).setName({
|
|
675
|
-
name,
|
|
676
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
677
|
-
},
|
|
678
|
-
});
|
|
679
|
-
(0, utils_js_1.makeCommand)({
|
|
680
|
-
name: 'set-ant-description',
|
|
681
|
-
description: 'Set the description of an ANT process',
|
|
682
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.description, ...options_js_1.writeActionOptions],
|
|
683
|
-
action: async (options) => {
|
|
684
|
-
const description = (0, utils_js_1.requiredStringFromOptions)(options, 'description');
|
|
685
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to set the ANT description to ${description}?`, options);
|
|
686
|
-
return (0, utils_js_1.writeANTFromOptions)(options).setDescription({
|
|
687
|
-
description,
|
|
688
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
689
|
-
},
|
|
690
|
-
});
|
|
691
|
-
(0, utils_js_1.makeCommand)({
|
|
692
|
-
name: 'set-ant-keywords',
|
|
693
|
-
description: 'Set the keywords of an ANT process',
|
|
694
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.keywords, ...options_js_1.writeActionOptions],
|
|
695
|
-
action: async (options) => {
|
|
696
|
-
const keywords = (0, utils_js_1.requiredStringArrayFromOptions)(options, 'keywords');
|
|
697
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to set the ANT keywords to ${keywords}?`, options);
|
|
698
|
-
return (0, utils_js_1.writeANTFromOptions)(options).setKeywords({
|
|
699
|
-
keywords,
|
|
700
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
701
|
-
},
|
|
702
|
-
});
|
|
703
|
-
(0, utils_js_1.makeCommand)({
|
|
704
|
-
name: 'set-ant-logo',
|
|
705
|
-
description: 'Set the logo of an ANT process',
|
|
706
|
-
options: [
|
|
707
|
-
options_js_1.optionMap.processId,
|
|
708
|
-
options_js_1.optionMap.transactionId,
|
|
709
|
-
...options_js_1.writeActionOptions,
|
|
710
|
-
],
|
|
711
|
-
action: async (options) => {
|
|
712
|
-
const txId = (0, utils_js_1.requiredStringFromOptions)(options, 'transactionId');
|
|
713
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to set the ANT logo to target Arweave TxID ${txId}?`, options);
|
|
714
|
-
return (0, utils_js_1.writeANTFromOptions)(options).setLogo({
|
|
715
|
-
txId,
|
|
716
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
717
|
-
},
|
|
718
|
-
});
|
|
719
|
-
// # ARIO Actions
|
|
720
|
-
(0, utils_js_1.makeCommand)({
|
|
721
|
-
name: 'release-name',
|
|
722
|
-
description: 'Release the name of an ANT process',
|
|
723
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.name, ...options_js_1.writeActionOptions],
|
|
724
|
-
action: async (options) => {
|
|
725
|
-
const name = (0, utils_js_1.requiredStringFromOptions)(options, 'name');
|
|
726
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to release the name ${name} back to the protocol?`, options);
|
|
727
|
-
return (0, utils_js_1.writeANTFromOptions)(options).releaseName({
|
|
728
|
-
name,
|
|
729
|
-
arioProcessId: (0, utils_js_1.arioProcessIdFromOptions)(options),
|
|
730
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
731
|
-
},
|
|
732
|
-
});
|
|
733
|
-
(0, utils_js_1.makeCommand)({
|
|
734
|
-
name: 'reassign-name',
|
|
735
|
-
description: 'Reassign the name of an ANT process to another ANT process',
|
|
736
|
-
options: [
|
|
737
|
-
options_js_1.optionMap.processId,
|
|
738
|
-
options_js_1.optionMap.name,
|
|
739
|
-
options_js_1.optionMap.target,
|
|
740
|
-
...options_js_1.writeActionOptions,
|
|
741
|
-
],
|
|
742
|
-
action: async (options) => {
|
|
743
|
-
const targetProcess = (0, utils_js_1.requiredStringFromOptions)(options, 'target');
|
|
744
|
-
const name = (0, utils_js_1.requiredStringFromOptions)(options, 'name');
|
|
745
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to reassign the name ${name} to ANT process ${targetProcess}?`, options);
|
|
746
|
-
return (0, utils_js_1.writeANTFromOptions)(options).reassignName({
|
|
747
|
-
name,
|
|
748
|
-
arioProcessId: (0, utils_js_1.arioProcessIdFromOptions)(options),
|
|
749
|
-
antProcessId: targetProcess,
|
|
750
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
751
|
-
},
|
|
752
|
-
});
|
|
753
|
-
(0, utils_js_1.makeCommand)({
|
|
754
|
-
name: 'approve-primary-name-request',
|
|
755
|
-
description: 'Approve a primary name request',
|
|
756
|
-
options: [
|
|
757
|
-
options_js_1.optionMap.processId,
|
|
758
|
-
options_js_1.optionMap.name,
|
|
759
|
-
options_js_1.optionMap.address,
|
|
760
|
-
...options_js_1.writeActionOptions,
|
|
761
|
-
],
|
|
762
|
-
action: async (options) => {
|
|
763
|
-
const address = (0, utils_js_1.requiredAddressFromOptions)(options);
|
|
764
|
-
const name = (0, utils_js_1.requiredStringFromOptions)(options, 'name');
|
|
765
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to approve the primary name request ${name} to ${address}?`, options);
|
|
766
|
-
return (0, utils_js_1.writeANTFromOptions)(options).approvePrimaryNameRequest({
|
|
767
|
-
name,
|
|
768
|
-
address,
|
|
769
|
-
arioProcessId: (0, utils_js_1.arioProcessIdFromOptions)(options),
|
|
770
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
771
|
-
},
|
|
772
|
-
});
|
|
773
|
-
(0, utils_js_1.makeCommand)({
|
|
774
|
-
name: 'remove-primary-names',
|
|
775
|
-
description: 'Remove primary names',
|
|
776
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.names, ...options_js_1.writeActionOptions],
|
|
777
|
-
action: async (options) => {
|
|
778
|
-
const names = (0, utils_js_1.requiredStringArrayFromOptions)(options, 'names');
|
|
779
|
-
await (0, utils_js_1.assertConfirmationPrompt)(`Are you sure you want to remove the primary names ${names}?`, options);
|
|
780
|
-
return (0, utils_js_1.writeANTFromOptions)(options).removePrimaryNames({
|
|
781
|
-
names,
|
|
782
|
-
arioProcessId: (0, utils_js_1.arioProcessIdFromOptions)(options),
|
|
783
|
-
}, (0, utils_js_1.customTagsFromOptions)(options));
|
|
784
|
-
},
|
|
785
|
-
});
|
|
786
|
-
// # Utilities
|
|
787
|
-
(0, utils_js_1.makeCommand)({
|
|
788
|
-
name: 'write-action',
|
|
789
|
-
description: 'Send a write action to an AO Process',
|
|
790
|
-
options: [...options_js_1.writeActionOptions, options_js_1.optionMap.processId],
|
|
791
|
-
action: async (options) => {
|
|
792
|
-
const process = new index_js_1.AOProcess({
|
|
793
|
-
processId: (0, utils_js_1.requiredProcessIdFromOptions)(options),
|
|
794
|
-
logger: (0, utils_js_1.getLoggerFromOptions)(options),
|
|
795
|
-
});
|
|
796
|
-
return process.send({
|
|
797
|
-
tags: (0, utils_js_1.customTagsFromOptions)(options).tags ?? [],
|
|
798
|
-
signer: (0, utils_js_1.requiredAoSignerFromOptions)(options),
|
|
799
|
-
});
|
|
800
|
-
},
|
|
801
|
-
});
|
|
802
|
-
(0, utils_js_1.makeCommand)({
|
|
803
|
-
name: 'read-action',
|
|
804
|
-
description: 'Send a dry-run read action to an AO Process',
|
|
805
|
-
options: [options_js_1.optionMap.processId, options_js_1.optionMap.tags],
|
|
806
|
-
action: async (options) => {
|
|
807
|
-
const process = new index_js_1.AOProcess({
|
|
808
|
-
processId: (0, utils_js_1.requiredProcessIdFromOptions)(options),
|
|
809
|
-
logger: (0, utils_js_1.getLoggerFromOptions)(options),
|
|
810
|
-
});
|
|
811
|
-
return process.read({
|
|
812
|
-
tags: (0, utils_js_1.customTagsFromOptions)(options).tags ?? [],
|
|
813
|
-
});
|
|
814
|
-
},
|
|
815
|
-
});
|
|
816
|
-
// Normalize separators so includes() works on Windows (argv uses backslashes).
|
|
817
|
-
const argvScript = process.argv[1].replace(/\\/g, '/');
|
|
818
|
-
if (argvScript.includes('bin/ar.io') || // Running from global .bin
|
|
819
|
-
argvScript.includes('cli/cli') // Running from source
|
|
820
|
-
) {
|
|
821
|
-
commander_1.program.parse(process.argv);
|
|
822
|
-
}
|