@ar.io/sdk 3.10.0-alpha.6 → 3.10.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 +66 -125
- package/bundles/web.bundle.min.js +147 -126
- package/lib/cjs/cli/commands/antCommands.js +3 -4
- package/lib/cjs/cli/commands/arnsPurchaseCommands.js +5 -6
- package/lib/cjs/cli/commands/gatewayWriteCommands.js +11 -12
- package/lib/cjs/cli/commands/readCommands.js +21 -22
- package/lib/cjs/cli/commands/transfer.js +6 -7
- package/lib/cjs/cli/options.js +0 -12
- package/lib/cjs/cli/utils.js +52 -74
- package/lib/cjs/common/ant-versions.js +5 -5
- package/lib/cjs/common/faucet.js +2 -2
- package/lib/cjs/common/index.js +0 -2
- package/lib/cjs/common/io.js +5 -64
- package/lib/cjs/types/ant.js +2 -13
- package/lib/cjs/types/index.js +0 -1
- package/lib/cjs/types/io.js +5 -5
- package/lib/cjs/utils/ao.js +9 -14
- package/lib/cjs/utils/arweave.js +4 -4
- package/lib/cjs/utils/base64.js +4 -5
- package/lib/cjs/utils/json.js +1 -2
- package/lib/cjs/utils/schema.js +1 -2
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/web/index.js +1 -3
- package/lib/esm/cli/options.js +0 -12
- package/lib/esm/cli/utils.js +10 -31
- package/lib/esm/common/ant-versions.js +5 -5
- package/lib/esm/common/index.js +0 -2
- package/lib/esm/common/io.js +5 -64
- package/lib/esm/types/ant.js +0 -11
- package/lib/esm/types/index.js +0 -1
- package/lib/esm/types/io.js +1 -1
- package/lib/esm/utils/ao.js +0 -5
- package/lib/esm/version.js +1 -1
- package/lib/esm/web/index.js +1 -1
- package/lib/types/cli/commands/antCommands.d.ts +3 -3
- package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +1 -1
- package/lib/types/cli/commands/gatewayWriteCommands.d.ts +9 -9
- package/lib/types/cli/commands/readCommands.d.ts +3 -4
- package/lib/types/cli/commands/transfer.d.ts +3 -3
- package/lib/types/cli/options.d.ts +0 -9
- package/lib/types/cli/types.d.ts +0 -3
- package/lib/types/cli/utils.d.ts +0 -4
- package/lib/types/common/ant-versions.d.ts +6 -3
- package/lib/types/common/http.d.ts +0 -1
- package/lib/types/common/index.d.ts +0 -1
- package/lib/types/common/io.d.ts +9 -15
- package/lib/types/types/ant.d.ts +1 -53
- package/lib/types/types/common.d.ts +2 -8
- package/lib/types/types/index.d.ts +0 -1
- package/lib/types/types/io.d.ts +7 -9
- package/lib/types/types/token.d.ts +0 -2
- package/lib/types/utils/ao.d.ts +12 -1
- package/lib/types/utils/base64.d.ts +0 -2
- package/lib/types/version.d.ts +1 -1
- package/lib/types/web/index.d.ts +1 -1
- package/package.json +3 -5
- package/lib/cjs/common/turbo.js +0 -208
- package/lib/cjs/common/wayfinder/gateways.js +0 -75
- package/lib/cjs/common/wayfinder/index.js +0 -36
- package/lib/cjs/common/wayfinder/routers/fixed.js +0 -14
- package/lib/cjs/common/wayfinder/routers/fixed.test.js +0 -14
- package/lib/cjs/common/wayfinder/routers/priority.js +0 -38
- package/lib/cjs/common/wayfinder/routers/priority.test.js +0 -155
- package/lib/cjs/common/wayfinder/routers/random.js +0 -23
- package/lib/cjs/common/wayfinder/routers/random.test.js +0 -104
- package/lib/cjs/common/wayfinder/routers/simple-cache.js +0 -25
- package/lib/cjs/common/wayfinder/routers/simple-cache.test.js +0 -41
- package/lib/cjs/common/wayfinder/wayfinder.js +0 -194
- package/lib/cjs/common/wayfinder/wayfinder.test.js +0 -254
- package/lib/cjs/types/wayfinder.js +0 -2
- package/lib/cjs/utils/url.js +0 -28
- package/lib/cjs/utils/url.test.js +0 -24
- package/lib/esm/common/turbo.js +0 -200
- package/lib/esm/common/wayfinder/gateways.js +0 -69
- package/lib/esm/common/wayfinder/index.js +0 -20
- package/lib/esm/common/wayfinder/routers/fixed.js +0 -10
- package/lib/esm/common/wayfinder/routers/fixed.test.js +0 -12
- package/lib/esm/common/wayfinder/routers/priority.js +0 -34
- package/lib/esm/common/wayfinder/routers/priority.test.js +0 -153
- package/lib/esm/common/wayfinder/routers/random.js +0 -19
- package/lib/esm/common/wayfinder/routers/random.test.js +0 -102
- package/lib/esm/common/wayfinder/routers/simple-cache.js +0 -21
- package/lib/esm/common/wayfinder/routers/simple-cache.test.js +0 -39
- package/lib/esm/common/wayfinder/wayfinder.js +0 -187
- package/lib/esm/common/wayfinder/wayfinder.test.js +0 -249
- package/lib/esm/types/wayfinder.js +0 -1
- package/lib/esm/utils/url.js +0 -24
- package/lib/esm/utils/url.test.js +0 -19
- package/lib/types/common/turbo.d.ts +0 -62
- package/lib/types/common/wayfinder/gateways.d.ts +0 -44
- package/lib/types/common/wayfinder/index.d.ts +0 -19
- package/lib/types/common/wayfinder/routers/fixed.d.ts +0 -25
- package/lib/types/common/wayfinder/routers/fixed.test.d.ts +0 -1
- package/lib/types/common/wayfinder/routers/priority.d.ts +0 -34
- package/lib/types/common/wayfinder/routers/priority.test.d.ts +0 -1
- package/lib/types/common/wayfinder/routers/random.d.ts +0 -28
- package/lib/types/common/wayfinder/routers/random.test.d.ts +0 -1
- package/lib/types/common/wayfinder/routers/simple-cache.d.ts +0 -29
- package/lib/types/common/wayfinder/routers/simple-cache.test.d.ts +0 -1
- package/lib/types/common/wayfinder/wayfinder.d.ts +0 -106
- package/lib/types/common/wayfinder/wayfinder.test.d.ts +0 -1
- package/lib/types/types/wayfinder.d.ts +0 -20
- package/lib/types/utils/url.d.ts +0 -19
- package/lib/types/utils/url.test.d.ts +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setAntRecordCLICommand = setAntRecordCLICommand;
|
|
4
|
+
exports.setAntBaseNameCLICommand = setAntBaseNameCLICommand;
|
|
5
|
+
exports.setAntUndernameCLICommand = setAntUndernameCLICommand;
|
|
4
6
|
const utils_js_1 = require("../utils.js");
|
|
5
7
|
/** @deprecated -- use set-ant-base-name and set-ant-undername */
|
|
6
8
|
async function setAntRecordCLICommand(o) {
|
|
@@ -17,7 +19,6 @@ async function setAntRecordCLICommand(o) {
|
|
|
17
19
|
ttlSeconds,
|
|
18
20
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
19
21
|
}
|
|
20
|
-
exports.setAntRecordCLICommand = setAntRecordCLICommand;
|
|
21
22
|
async function setAntBaseNameCLICommand(o) {
|
|
22
23
|
const ttlSeconds = +(o.ttlSeconds ?? utils_js_1.defaultTtlSecondsCLI);
|
|
23
24
|
const transactionId = (0, utils_js_1.requiredStringFromOptions)(o, 'transactionId');
|
|
@@ -30,7 +31,6 @@ async function setAntBaseNameCLICommand(o) {
|
|
|
30
31
|
ttlSeconds,
|
|
31
32
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
32
33
|
}
|
|
33
|
-
exports.setAntBaseNameCLICommand = setAntBaseNameCLICommand;
|
|
34
34
|
async function setAntUndernameCLICommand(o) {
|
|
35
35
|
const ttlSeconds = +(o.ttlSeconds ?? utils_js_1.defaultTtlSecondsCLI);
|
|
36
36
|
const undername = (0, utils_js_1.requiredStringFromOptions)(o, 'undername');
|
|
@@ -45,4 +45,3 @@ async function setAntUndernameCLICommand(o) {
|
|
|
45
45
|
ttlSeconds,
|
|
46
46
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
47
47
|
}
|
|
48
|
-
exports.setAntUndernameCLICommand = setAntUndernameCLICommand;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buyRecordCLICommand = buyRecordCLICommand;
|
|
4
|
+
exports.upgradeRecordCLICommand = upgradeRecordCLICommand;
|
|
5
|
+
exports.extendLeaseCLICommand = extendLeaseCLICommand;
|
|
6
|
+
exports.increaseUndernameLimitCLICommand = increaseUndernameLimitCLICommand;
|
|
7
|
+
exports.requestPrimaryNameCLICommand = requestPrimaryNameCLICommand;
|
|
4
8
|
const utils_js_1 = require("../utils.js");
|
|
5
9
|
async function buyRecordCLICommand(o) {
|
|
6
10
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(o);
|
|
@@ -42,7 +46,6 @@ async function buyRecordCLICommand(o) {
|
|
|
42
46
|
fundFrom: (0, utils_js_1.fundFromFromOptions)(o),
|
|
43
47
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
44
48
|
}
|
|
45
|
-
exports.buyRecordCLICommand = buyRecordCLICommand;
|
|
46
49
|
async function upgradeRecordCLICommand(o) {
|
|
47
50
|
const name = (0, utils_js_1.requiredStringFromOptions)(o, 'name');
|
|
48
51
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(o);
|
|
@@ -74,7 +77,6 @@ async function upgradeRecordCLICommand(o) {
|
|
|
74
77
|
fundFrom,
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
|
-
exports.upgradeRecordCLICommand = upgradeRecordCLICommand;
|
|
78
80
|
async function extendLeaseCLICommand(o) {
|
|
79
81
|
const name = (0, utils_js_1.requiredStringFromOptions)(o, 'name');
|
|
80
82
|
const years = (0, utils_js_1.requiredPositiveIntegerFromOptions)(o, 'years');
|
|
@@ -108,7 +110,6 @@ async function extendLeaseCLICommand(o) {
|
|
|
108
110
|
years,
|
|
109
111
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
110
112
|
}
|
|
111
|
-
exports.extendLeaseCLICommand = extendLeaseCLICommand;
|
|
112
113
|
async function increaseUndernameLimitCLICommand(o) {
|
|
113
114
|
const name = (0, utils_js_1.requiredStringFromOptions)(o, 'name');
|
|
114
115
|
const increaseCount = (0, utils_js_1.requiredPositiveIntegerFromOptions)(o, 'increaseCount');
|
|
@@ -139,7 +140,6 @@ async function increaseUndernameLimitCLICommand(o) {
|
|
|
139
140
|
increaseCount,
|
|
140
141
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
141
142
|
}
|
|
142
|
-
exports.increaseUndernameLimitCLICommand = increaseUndernameLimitCLICommand;
|
|
143
143
|
async function requestPrimaryNameCLICommand(o) {
|
|
144
144
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(o);
|
|
145
145
|
const fundFrom = (0, utils_js_1.fundFromFromOptions)(o);
|
|
@@ -164,4 +164,3 @@ async function requestPrimaryNameCLICommand(o) {
|
|
|
164
164
|
fundFrom,
|
|
165
165
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
166
166
|
}
|
|
167
|
-
exports.requestPrimaryNameCLICommand = requestPrimaryNameCLICommand;
|
|
@@ -3,7 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.joinNetwork = joinNetwork;
|
|
7
|
+
exports.updateGatewaySettings = updateGatewaySettings;
|
|
8
|
+
exports.leaveNetwork = leaveNetwork;
|
|
9
|
+
exports.saveObservations = saveObservations;
|
|
10
|
+
exports.increaseOperatorStake = increaseOperatorStake;
|
|
11
|
+
exports.decreaseOperatorStake = decreaseOperatorStake;
|
|
12
|
+
exports.instantWithdrawal = instantWithdrawal;
|
|
13
|
+
exports.cancelWithdrawal = cancelWithdrawal;
|
|
14
|
+
exports.delegateStake = delegateStake;
|
|
15
|
+
exports.decreaseDelegateStake = decreaseDelegateStake;
|
|
16
|
+
exports.redelegateStake = redelegateStake;
|
|
7
17
|
/**
|
|
8
18
|
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
9
19
|
*
|
|
@@ -55,7 +65,6 @@ async function joinNetwork(options) {
|
|
|
55
65
|
};
|
|
56
66
|
return output;
|
|
57
67
|
}
|
|
58
|
-
exports.joinNetwork = joinNetwork;
|
|
59
68
|
async function updateGatewaySettings(options) {
|
|
60
69
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(options);
|
|
61
70
|
const gatewaySettings = (0, utils_js_1.gatewaySettingsFromOptions)(options);
|
|
@@ -72,7 +81,6 @@ async function updateGatewaySettings(options) {
|
|
|
72
81
|
};
|
|
73
82
|
return output;
|
|
74
83
|
}
|
|
75
|
-
exports.updateGatewaySettings = updateGatewaySettings;
|
|
76
84
|
async function leaveNetwork(options) {
|
|
77
85
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(options);
|
|
78
86
|
if (!options.skipConfirmation) {
|
|
@@ -84,7 +92,6 @@ async function leaveNetwork(options) {
|
|
|
84
92
|
}
|
|
85
93
|
return (0, utils_js_1.writeARIOFromOptions)(options).ario.leaveNetwork((0, utils_js_1.customTagsFromOptions)(options));
|
|
86
94
|
}
|
|
87
|
-
exports.leaveNetwork = leaveNetwork;
|
|
88
95
|
async function saveObservations(o) {
|
|
89
96
|
const failedGateways = (0, utils_js_1.requiredStringArrayFromOptions)(o, 'failedGateways');
|
|
90
97
|
const reportTxId = (0, utils_js_1.requiredStringFromOptions)(o, 'transactionId');
|
|
@@ -94,7 +101,6 @@ async function saveObservations(o) {
|
|
|
94
101
|
reportTxId: (0, utils_js_1.requiredStringFromOptions)(o, 'transactionId'),
|
|
95
102
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
96
103
|
}
|
|
97
|
-
exports.saveObservations = saveObservations;
|
|
98
104
|
async function increaseOperatorStake(o) {
|
|
99
105
|
const increaseQty = (0, utils_js_1.requiredMARIOFromOptions)(o, 'operatorStake');
|
|
100
106
|
await (0, utils_js_1.assertConfirmationPrompt)(`You are about to increase your operator stake by ${(0, utils_js_1.formatARIOWithCommas)(increaseQty.toARIO())} ARIO\nAre you sure?`, o);
|
|
@@ -103,7 +109,6 @@ async function increaseOperatorStake(o) {
|
|
|
103
109
|
}),
|
|
104
110
|
(0, utils_js_1.customTagsFromOptions)(o));
|
|
105
111
|
}
|
|
106
|
-
exports.increaseOperatorStake = increaseOperatorStake;
|
|
107
112
|
async function decreaseOperatorStake(o) {
|
|
108
113
|
const decreaseQty = (0, utils_js_1.requiredMARIOFromOptions)(o, 'operatorStake');
|
|
109
114
|
// TODO: Can assert stake is sufficient for action, and new target stake meets contract minimum
|
|
@@ -112,7 +117,6 @@ async function decreaseOperatorStake(o) {
|
|
|
112
117
|
decreaseQty,
|
|
113
118
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
114
119
|
}
|
|
115
|
-
exports.decreaseOperatorStake = decreaseOperatorStake;
|
|
116
120
|
async function instantWithdrawal(o) {
|
|
117
121
|
const vaultId = (0, utils_js_1.requiredStringFromOptions)(o, 'vaultId');
|
|
118
122
|
const gatewayAddress = (0, utils_js_1.requiredAddressFromOptions)(o);
|
|
@@ -122,7 +126,6 @@ async function instantWithdrawal(o) {
|
|
|
122
126
|
gatewayAddress,
|
|
123
127
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
124
128
|
}
|
|
125
|
-
exports.instantWithdrawal = instantWithdrawal;
|
|
126
129
|
async function cancelWithdrawal(o) {
|
|
127
130
|
const vaultId = (0, utils_js_1.requiredStringFromOptions)(o, 'vaultId');
|
|
128
131
|
const gatewayAddress = (0, utils_js_1.requiredAddressFromOptions)(o);
|
|
@@ -132,7 +135,6 @@ async function cancelWithdrawal(o) {
|
|
|
132
135
|
gatewayAddress,
|
|
133
136
|
}, (0, utils_js_1.customTagsFromOptions)(o));
|
|
134
137
|
}
|
|
135
|
-
exports.cancelWithdrawal = cancelWithdrawal;
|
|
136
138
|
async function delegateStake(options) {
|
|
137
139
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(options);
|
|
138
140
|
const { target, arioQuantity } = (0, utils_js_1.requiredTargetAndQuantityFromOptions)(options);
|
|
@@ -171,7 +173,6 @@ async function delegateStake(options) {
|
|
|
171
173
|
};
|
|
172
174
|
return output;
|
|
173
175
|
}
|
|
174
|
-
exports.delegateStake = delegateStake;
|
|
175
176
|
async function decreaseDelegateStake(options) {
|
|
176
177
|
const ario = (0, utils_js_1.writeARIOFromOptions)(options).ario;
|
|
177
178
|
const { target, arioQuantity } = (0, utils_js_1.requiredTargetAndQuantityFromOptions)(options);
|
|
@@ -192,7 +193,6 @@ async function decreaseDelegateStake(options) {
|
|
|
192
193
|
};
|
|
193
194
|
return output;
|
|
194
195
|
}
|
|
195
|
-
exports.decreaseDelegateStake = decreaseDelegateStake;
|
|
196
196
|
async function redelegateStake(options) {
|
|
197
197
|
const ario = (0, utils_js_1.writeARIOFromOptions)(options).ario;
|
|
198
198
|
const params = (0, utils_js_1.redelegateParamsFromOptions)(options);
|
|
@@ -209,4 +209,3 @@ async function redelegateStake(options) {
|
|
|
209
209
|
};
|
|
210
210
|
return output;
|
|
211
211
|
}
|
|
212
|
-
exports.redelegateStake = redelegateStake;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getGateway = getGateway;
|
|
4
|
+
exports.listGateways = listGateways;
|
|
5
|
+
exports.listAllDelegatesCLICommand = listAllDelegatesCLICommand;
|
|
6
|
+
exports.getGatewayDelegates = getGatewayDelegates;
|
|
7
|
+
exports.getDelegations = getDelegations;
|
|
8
|
+
exports.getAllowedDelegates = getAllowedDelegates;
|
|
9
|
+
exports.getArNSRecord = getArNSRecord;
|
|
10
|
+
exports.listArNSRecords = listArNSRecords;
|
|
11
|
+
exports.getArNSReservedName = getArNSReservedName;
|
|
12
|
+
exports.listArNSReservedNames = listArNSReservedNames;
|
|
13
|
+
exports.getArNSReturnedName = getArNSReturnedName;
|
|
14
|
+
exports.listArNSReturnedNames = listArNSReturnedNames;
|
|
15
|
+
exports.getEpoch = getEpoch;
|
|
16
|
+
exports.getPrescribedObservers = getPrescribedObservers;
|
|
17
|
+
exports.getPrescribedNames = getPrescribedNames;
|
|
18
|
+
exports.getTokenCost = getTokenCost;
|
|
19
|
+
exports.getCostDetails = getCostDetails;
|
|
20
|
+
exports.getPrimaryName = getPrimaryName;
|
|
21
|
+
exports.getGatewayVaults = getGatewayVaults;
|
|
22
|
+
exports.getAllGatewayVaults = getAllGatewayVaults;
|
|
23
|
+
exports.getVault = getVault;
|
|
4
24
|
const token_js_1 = require("../../types/token.js");
|
|
5
25
|
const utils_js_1 = require("../utils.js");
|
|
6
26
|
async function getGateway(o) {
|
|
@@ -10,17 +30,14 @@ async function getGateway(o) {
|
|
|
10
30
|
});
|
|
11
31
|
return gateway ?? { message: `No gateway found for address ${address}` };
|
|
12
32
|
}
|
|
13
|
-
exports.getGateway = getGateway;
|
|
14
33
|
async function listGateways(o) {
|
|
15
34
|
const gateways = await (0, utils_js_1.readARIOFromOptions)(o).getGateways((0, utils_js_1.paginationParamsFromOptions)(o));
|
|
16
35
|
return gateways.items.length ? gateways : { message: 'No gateways found' };
|
|
17
36
|
}
|
|
18
|
-
exports.listGateways = listGateways;
|
|
19
37
|
async function listAllDelegatesCLICommand(o) {
|
|
20
38
|
const delegates = await (0, utils_js_1.readARIOFromOptions)(o).getAllDelegates((0, utils_js_1.paginationParamsFromOptions)(o));
|
|
21
39
|
return delegates.items.length ? delegates : { message: 'No delegates found' };
|
|
22
40
|
}
|
|
23
|
-
exports.listAllDelegatesCLICommand = listAllDelegatesCLICommand;
|
|
24
41
|
async function getGatewayDelegates(o) {
|
|
25
42
|
const address = (0, utils_js_1.requiredAddressFromOptions)(o);
|
|
26
43
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getGatewayDelegates({
|
|
@@ -33,7 +50,6 @@ async function getGatewayDelegates(o) {
|
|
|
33
50
|
message: `No delegates found for gateway ${address}`,
|
|
34
51
|
};
|
|
35
52
|
}
|
|
36
|
-
exports.getGatewayDelegates = getGatewayDelegates;
|
|
37
53
|
async function getDelegations(o) {
|
|
38
54
|
const address = (0, utils_js_1.requiredAddressFromOptions)(o);
|
|
39
55
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getDelegations({
|
|
@@ -46,7 +62,6 @@ async function getDelegations(o) {
|
|
|
46
62
|
message: `No delegations found for address ${address}`,
|
|
47
63
|
};
|
|
48
64
|
}
|
|
49
|
-
exports.getDelegations = getDelegations;
|
|
50
65
|
async function getAllowedDelegates(o) {
|
|
51
66
|
const address = (0, utils_js_1.requiredAddressFromOptions)(o);
|
|
52
67
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getAllowedDelegates({
|
|
@@ -59,63 +74,53 @@ async function getAllowedDelegates(o) {
|
|
|
59
74
|
message: `No allow list found for gateway delegate ${address}`,
|
|
60
75
|
};
|
|
61
76
|
}
|
|
62
|
-
exports.getAllowedDelegates = getAllowedDelegates;
|
|
63
77
|
async function getArNSRecord(o) {
|
|
64
78
|
const name = (0, utils_js_1.requiredStringFromOptions)(o, 'name');
|
|
65
79
|
return ((await (0, utils_js_1.readARIOFromOptions)(o).getArNSRecord({
|
|
66
80
|
name,
|
|
67
81
|
})) ?? { message: `No record found for name ${name}` });
|
|
68
82
|
}
|
|
69
|
-
exports.getArNSRecord = getArNSRecord;
|
|
70
83
|
async function listArNSRecords(o) {
|
|
71
84
|
const records = await (0, utils_js_1.readARIOFromOptions)(o).getArNSRecords((0, utils_js_1.paginationParamsFromOptions)(o));
|
|
72
85
|
return records.items.length ? records : { message: 'No records found' };
|
|
73
86
|
}
|
|
74
|
-
exports.listArNSRecords = listArNSRecords;
|
|
75
87
|
async function getArNSReservedName(o) {
|
|
76
88
|
const name = (0, utils_js_1.requiredStringFromOptions)(o, 'name');
|
|
77
89
|
return ((await (0, utils_js_1.readARIOFromOptions)(o).getArNSReservedName({
|
|
78
90
|
name,
|
|
79
91
|
})) ?? { message: `No reserved name found for name ${name}` });
|
|
80
92
|
}
|
|
81
|
-
exports.getArNSReservedName = getArNSReservedName;
|
|
82
93
|
async function listArNSReservedNames(o) {
|
|
83
94
|
const reservedNames = await (0, utils_js_1.readARIOFromOptions)(o).getArNSReservedNames((0, utils_js_1.paginationParamsFromOptions)(o));
|
|
84
95
|
return reservedNames.items.length
|
|
85
96
|
? reservedNames
|
|
86
97
|
: { message: 'No reserved names found' };
|
|
87
98
|
}
|
|
88
|
-
exports.listArNSReservedNames = listArNSReservedNames;
|
|
89
99
|
async function getArNSReturnedName(o) {
|
|
90
100
|
const name = (0, utils_js_1.requiredStringFromOptions)(o, 'name');
|
|
91
101
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getArNSReturnedName({ name });
|
|
92
102
|
return result ?? { message: `No returned name found for name ${name}` };
|
|
93
103
|
}
|
|
94
|
-
exports.getArNSReturnedName = getArNSReturnedName;
|
|
95
104
|
async function listArNSReturnedNames(o) {
|
|
96
105
|
const returnedNames = await (0, utils_js_1.readARIOFromOptions)(o).getArNSReturnedNames((0, utils_js_1.paginationParamsFromOptions)(o));
|
|
97
106
|
return returnedNames.items.length
|
|
98
107
|
? returnedNames
|
|
99
108
|
: { message: 'No returned names found' };
|
|
100
109
|
}
|
|
101
|
-
exports.listArNSReturnedNames = listArNSReturnedNames;
|
|
102
110
|
async function getEpoch(o) {
|
|
103
111
|
const epoch = await (0, utils_js_1.readARIOFromOptions)(o).getEpoch((0, utils_js_1.epochInputFromOptions)(o));
|
|
104
112
|
return epoch ?? { message: `No epoch found for provided input` };
|
|
105
113
|
}
|
|
106
|
-
exports.getEpoch = getEpoch;
|
|
107
114
|
async function getPrescribedObservers(o) {
|
|
108
115
|
const epoch = (0, utils_js_1.epochInputFromOptions)(o);
|
|
109
116
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getPrescribedObservers(epoch);
|
|
110
117
|
return (result ?? { message: `No prescribed observers found for epoch ${epoch}` });
|
|
111
118
|
}
|
|
112
|
-
exports.getPrescribedObservers = getPrescribedObservers;
|
|
113
119
|
async function getPrescribedNames(o) {
|
|
114
120
|
const epoch = (0, utils_js_1.epochInputFromOptions)(o);
|
|
115
121
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getPrescribedNames((0, utils_js_1.epochInputFromOptions)(o));
|
|
116
122
|
return result ?? { message: `No prescribed names found for epoch ${epoch}` };
|
|
117
123
|
}
|
|
118
|
-
exports.getPrescribedNames = getPrescribedNames;
|
|
119
124
|
async function getTokenCost(o) {
|
|
120
125
|
const tokenCost = await (0, utils_js_1.readARIOFromOptions)(o).getTokenCost((0, utils_js_1.getTokenCostParamsFromOptions)(o));
|
|
121
126
|
const output = {
|
|
@@ -124,7 +129,6 @@ async function getTokenCost(o) {
|
|
|
124
129
|
};
|
|
125
130
|
return output;
|
|
126
131
|
}
|
|
127
|
-
exports.getTokenCost = getTokenCost;
|
|
128
132
|
async function getCostDetails(o) {
|
|
129
133
|
const costDetails = await (0, utils_js_1.readARIOFromOptions)(o).getCostDetails({
|
|
130
134
|
...(0, utils_js_1.getTokenCostParamsFromOptions)(o),
|
|
@@ -138,7 +142,6 @@ async function getCostDetails(o) {
|
|
|
138
142
|
};
|
|
139
143
|
return output;
|
|
140
144
|
}
|
|
141
|
-
exports.getCostDetails = getCostDetails;
|
|
142
145
|
async function getPrimaryName(o) {
|
|
143
146
|
const address = (0, utils_js_1.addressFromOptions)(o);
|
|
144
147
|
const name = o.name;
|
|
@@ -155,7 +158,6 @@ async function getPrimaryName(o) {
|
|
|
155
158
|
message: `No primary name found`,
|
|
156
159
|
});
|
|
157
160
|
}
|
|
158
|
-
exports.getPrimaryName = getPrimaryName;
|
|
159
161
|
async function getGatewayVaults(o) {
|
|
160
162
|
const address = (0, utils_js_1.requiredAddressFromOptions)(o);
|
|
161
163
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getGatewayVaults({
|
|
@@ -168,7 +170,6 @@ async function getGatewayVaults(o) {
|
|
|
168
170
|
message: `No vaults found for gateway ${address}`,
|
|
169
171
|
};
|
|
170
172
|
}
|
|
171
|
-
exports.getGatewayVaults = getGatewayVaults;
|
|
172
173
|
async function getAllGatewayVaults(o) {
|
|
173
174
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getAllGatewayVaults((0, utils_js_1.paginationParamsFromOptions)(o));
|
|
174
175
|
return result.items?.length
|
|
@@ -177,7 +178,6 @@ async function getAllGatewayVaults(o) {
|
|
|
177
178
|
message: `No vaults found`,
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
|
-
exports.getAllGatewayVaults = getAllGatewayVaults;
|
|
181
181
|
async function getVault(o) {
|
|
182
182
|
return (0, utils_js_1.readARIOFromOptions)(o)
|
|
183
183
|
.getVault({
|
|
@@ -188,4 +188,3 @@ async function getVault(o) {
|
|
|
188
188
|
message: `No vault found for provided address and vault ID`,
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
exports.getVault = getVault;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transferCLICommand = transferCLICommand;
|
|
4
|
+
exports.vaultedTransferCLICommand = vaultedTransferCLICommand;
|
|
5
|
+
exports.revokeVaultCLICommand = revokeVaultCLICommand;
|
|
6
|
+
exports.createVaultCLICommand = createVaultCLICommand;
|
|
7
|
+
exports.extendVaultCLICommand = extendVaultCLICommand;
|
|
8
|
+
exports.increaseVaultCLICommand = increaseVaultCLICommand;
|
|
4
9
|
const token_js_1 = require("../../types/token.js");
|
|
5
10
|
const utils_js_1 = require("../utils.js");
|
|
6
11
|
async function transferCLICommand(options) {
|
|
@@ -28,7 +33,6 @@ async function transferCLICommand(options) {
|
|
|
28
33
|
};
|
|
29
34
|
return output;
|
|
30
35
|
}
|
|
31
|
-
exports.transferCLICommand = transferCLICommand;
|
|
32
36
|
async function vaultedTransferCLICommand(o) {
|
|
33
37
|
const mARIOQuantity = (0, utils_js_1.requiredMARIOFromOptions)(o, 'quantity');
|
|
34
38
|
const recipient = (0, utils_js_1.requiredStringFromOptions)(o, 'recipient');
|
|
@@ -59,7 +63,6 @@ async function vaultedTransferCLICommand(o) {
|
|
|
59
63
|
};
|
|
60
64
|
return output;
|
|
61
65
|
}
|
|
62
|
-
exports.vaultedTransferCLICommand = vaultedTransferCLICommand;
|
|
63
66
|
async function revokeVaultCLICommand(o) {
|
|
64
67
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(o);
|
|
65
68
|
const vaultId = (0, utils_js_1.requiredStringFromOptions)(o, 'vaultId');
|
|
@@ -82,7 +85,6 @@ async function revokeVaultCLICommand(o) {
|
|
|
82
85
|
};
|
|
83
86
|
return output;
|
|
84
87
|
}
|
|
85
|
-
exports.revokeVaultCLICommand = revokeVaultCLICommand;
|
|
86
88
|
async function createVaultCLICommand(o) {
|
|
87
89
|
const mARIOQuantity = (0, utils_js_1.requiredMARIOFromOptions)(o, 'quantity');
|
|
88
90
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(o);
|
|
@@ -110,7 +112,6 @@ async function createVaultCLICommand(o) {
|
|
|
110
112
|
};
|
|
111
113
|
return output;
|
|
112
114
|
}
|
|
113
|
-
exports.createVaultCLICommand = createVaultCLICommand;
|
|
114
115
|
async function extendVaultCLICommand(o) {
|
|
115
116
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(o);
|
|
116
117
|
const vaultId = (0, utils_js_1.requiredStringFromOptions)(o, 'vaultId');
|
|
@@ -134,7 +135,6 @@ async function extendVaultCLICommand(o) {
|
|
|
134
135
|
};
|
|
135
136
|
return output;
|
|
136
137
|
}
|
|
137
|
-
exports.extendVaultCLICommand = extendVaultCLICommand;
|
|
138
138
|
async function increaseVaultCLICommand(o) {
|
|
139
139
|
const mARIOQuantity = (0, utils_js_1.requiredMARIOFromOptions)(o, 'quantity');
|
|
140
140
|
const { ario, signerAddress } = (0, utils_js_1.writeARIOFromOptions)(o);
|
|
@@ -157,4 +157,3 @@ async function increaseVaultCLICommand(o) {
|
|
|
157
157
|
};
|
|
158
158
|
return output;
|
|
159
159
|
}
|
|
160
|
-
exports.increaseVaultCLICommand = increaseVaultCLICommand;
|
package/lib/cjs/cli/options.js
CHANGED
|
@@ -52,10 +52,6 @@ exports.optionMap = {
|
|
|
52
52
|
alias: '--cu-url <cuUrl>',
|
|
53
53
|
description: 'The URL for a custom compute unit',
|
|
54
54
|
},
|
|
55
|
-
paymentUrl: {
|
|
56
|
-
alias: '--payment-url <paymentUrl>',
|
|
57
|
-
description: 'The URL for a custom turbo payment service',
|
|
58
|
-
},
|
|
59
55
|
processId: {
|
|
60
56
|
alias: '--process-id <processId>',
|
|
61
57
|
description: 'The process ID to interact with',
|
|
@@ -276,15 +272,9 @@ exports.optionMap = {
|
|
|
276
272
|
alias: '--logo <logo>',
|
|
277
273
|
description: 'The ANT logo',
|
|
278
274
|
},
|
|
279
|
-
token: {
|
|
280
|
-
alias: '-t, --token <type>',
|
|
281
|
-
description: 'Crypto token type for wallet or action',
|
|
282
|
-
default: 'arweave',
|
|
283
|
-
},
|
|
284
275
|
};
|
|
285
276
|
exports.walletOptions = [
|
|
286
277
|
exports.optionMap.walletFile,
|
|
287
|
-
exports.optionMap.token,
|
|
288
278
|
// optionMap.mnemonic,
|
|
289
279
|
exports.optionMap.privateKey,
|
|
290
280
|
];
|
|
@@ -302,7 +292,6 @@ exports.arnsPurchaseOptions = [
|
|
|
302
292
|
...exports.writeActionOptions,
|
|
303
293
|
exports.optionMap.name,
|
|
304
294
|
exports.optionMap.fundFrom,
|
|
305
|
-
exports.optionMap.paymentUrl,
|
|
306
295
|
];
|
|
307
296
|
exports.epochOptions = [exports.optionMap.epochIndex, exports.optionMap.timestamp];
|
|
308
297
|
exports.addressAndVaultIdOptions = [exports.optionMap.address, exports.optionMap.vaultId];
|
|
@@ -326,7 +315,6 @@ exports.tokenCostOptions = [
|
|
|
326
315
|
exports.optionMap.quantity,
|
|
327
316
|
exports.optionMap.address,
|
|
328
317
|
exports.optionMap.fundFrom,
|
|
329
|
-
exports.optionMap.paymentUrl,
|
|
330
318
|
];
|
|
331
319
|
exports.transferOptions = [
|
|
332
320
|
...exports.writeActionOptions,
|