@ar.io/sdk 3.3.0-alpha.13 → 3.3.0-alpha.14
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 +38 -0
- package/bundles/web.bundle.min.js +26 -26
- package/lib/cjs/cli/cli.js +6 -0
- package/lib/cjs/cli/commands/readCommands.js +10 -1
- package/lib/cjs/common/io.js +8 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +7 -1
- package/lib/esm/cli/commands/readCommands.js +8 -0
- package/lib/esm/common/io.js +8 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/readCommands.d.ts +3 -0
- package/lib/types/common/io.d.ts +2 -1
- package/lib/types/types/io.d.ts +11 -8
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/cli/cli.js
CHANGED
|
@@ -258,6 +258,12 @@ const utils_js_1 = require("./utils.js");
|
|
|
258
258
|
options: options_js_1.paginationAddressOptions,
|
|
259
259
|
action: readCommands_js_1.getGatewayVaults,
|
|
260
260
|
});
|
|
261
|
+
(0, utils_js_1.makeCommand)({
|
|
262
|
+
name: 'list-all-gateway-vaults',
|
|
263
|
+
description: 'List vaults from all gateways',
|
|
264
|
+
options: options_js_1.paginationAddressOptions,
|
|
265
|
+
action: readCommands_js_1.getAllGatewayVaults,
|
|
266
|
+
});
|
|
261
267
|
(0, utils_js_1.makeCommand)({
|
|
262
268
|
name: 'transfer',
|
|
263
269
|
description: 'Transfer ARIO to another address',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getVault = exports.getGatewayVaults = exports.getPrimaryName = exports.getCostDetails = exports.getTokenCost = exports.getPrescribedNames = exports.getPrescribedObservers = exports.getEpoch = exports.listArNSReturnedNames = exports.getArNSReturnedName = exports.listArNSReservedNames = exports.getArNSReservedName = exports.listArNSRecords = exports.getArNSRecord = exports.getAllowedDelegates = exports.getDelegations = exports.getGatewayDelegates = exports.listAllDelegatesCLICommand = exports.listGateways = exports.getGateway = void 0;
|
|
3
|
+
exports.getVault = exports.getAllGatewayVaults = exports.getGatewayVaults = exports.getPrimaryName = exports.getCostDetails = exports.getTokenCost = exports.getPrescribedNames = exports.getPrescribedObservers = exports.getEpoch = exports.listArNSReturnedNames = exports.getArNSReturnedName = exports.listArNSReservedNames = exports.getArNSReservedName = exports.listArNSRecords = exports.getArNSRecord = exports.getAllowedDelegates = exports.getDelegations = exports.getGatewayDelegates = exports.listAllDelegatesCLICommand = exports.listGateways = exports.getGateway = void 0;
|
|
4
4
|
const token_js_1 = require("../../types/token.js");
|
|
5
5
|
const utils_js_1 = require("../utils.js");
|
|
6
6
|
async function getGateway(o) {
|
|
@@ -173,6 +173,15 @@ async function getGatewayVaults(o) {
|
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
exports.getGatewayVaults = getGatewayVaults;
|
|
176
|
+
async function getAllGatewayVaults(o) {
|
|
177
|
+
const result = await (0, utils_js_1.readARIOFromOptions)(o).getAllGatewayVaults((0, utils_js_1.paginationParamsFromOptions)(o));
|
|
178
|
+
return result.items?.length
|
|
179
|
+
? result
|
|
180
|
+
: {
|
|
181
|
+
message: `No vaults found`,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
exports.getAllGatewayVaults = getAllGatewayVaults;
|
|
176
185
|
async function getVault(o) {
|
|
177
186
|
return (0, utils_js_1.readARIOFromOptions)(o)
|
|
178
187
|
.getVault({
|
package/lib/cjs/common/io.js
CHANGED
|
@@ -449,6 +449,14 @@ class ARIOReadable {
|
|
|
449
449
|
],
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
|
+
async getAllGatewayVaults(params) {
|
|
453
|
+
return this.process.read({
|
|
454
|
+
tags: [
|
|
455
|
+
{ name: 'Action', value: 'All-Gateway-Vaults' },
|
|
456
|
+
...(0, arweave_js_1.paginationParamsToTags)(params),
|
|
457
|
+
],
|
|
458
|
+
});
|
|
459
|
+
}
|
|
452
460
|
}
|
|
453
461
|
exports.ARIOReadable = ARIOReadable;
|
|
454
462
|
class ARIOWriteable extends ARIOReadable {
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/cli/cli.js
CHANGED
|
@@ -21,7 +21,7 @@ import { mARIOToken } from '../types/token.js';
|
|
|
21
21
|
import { version } from '../version.js';
|
|
22
22
|
import { buyRecordCLICommand, extendLeaseCLICommand, increaseUndernameLimitCLICommand, requestPrimaryNameCLICommand, upgradeRecordCLICommand, } from './commands/arnsPurchaseCommands.js';
|
|
23
23
|
import { cancelWithdrawal, decreaseDelegateStake, decreaseOperatorStake, delegateStake, increaseOperatorStake, instantWithdrawal, joinNetwork, leaveNetwork, redelegateStake, saveObservations, updateGatewaySettings, } from './commands/gatewayWriteCommands.js';
|
|
24
|
-
import { getAllowedDelegates, getArNSRecord, getArNSReservedName, getArNSReturnedName, getCostDetails, getDelegations, getEpoch, getGateway, getGatewayDelegates, getGatewayVaults, getPrescribedNames, getPrescribedObservers, getPrimaryName, getTokenCost, getVault, listAllDelegatesCLICommand, listArNSRecords, listArNSReservedNames, listArNSReturnedNames, listGateways, } from './commands/readCommands.js';
|
|
24
|
+
import { getAllGatewayVaults, getAllowedDelegates, getArNSRecord, getArNSReservedName, getArNSReturnedName, getCostDetails, getDelegations, getEpoch, getGateway, getGatewayDelegates, getGatewayVaults, getPrescribedNames, getPrescribedObservers, getPrimaryName, getTokenCost, getVault, listAllDelegatesCLICommand, listArNSRecords, listArNSReservedNames, listArNSReturnedNames, listGateways, } from './commands/readCommands.js';
|
|
25
25
|
import { transfer } from './commands/transfer.js';
|
|
26
26
|
import { addressAndVaultIdOptions, antStateOptions, arnsPurchaseOptions, buyRecordOptions, decreaseDelegateStakeOptions, delegateStakeOptions, epochOptions, getVaultOptions, globalOptions, joinNetworkOptions, operatorStakeOptions, optionMap, paginationAddressOptions, paginationOptions, redelegateStakeOptions, tokenCostOptions, transferOptions, updateGatewaySettingsOptions, writeActionOptions, } from './options.js';
|
|
27
27
|
import { applyOptions, arioProcessIdFromOptions, assertConfirmationPrompt, epochInputFromOptions, formatARIOWithCommas, getANTStateFromOptions, getLoggerFromOptions, makeCommand, paginationParamsFromOptions, readANTFromOptions, readARIOFromOptions, requiredAddressFromOptions, requiredAoSignerFromOptions, requiredProcessIdFromOptions, requiredStringArrayFromOptions, requiredStringFromOptions, writeANTFromOptions, writeActionTagsFromOptions, } from './utils.js';
|
|
@@ -256,6 +256,12 @@ makeCommand({
|
|
|
256
256
|
options: paginationAddressOptions,
|
|
257
257
|
action: getGatewayVaults,
|
|
258
258
|
});
|
|
259
|
+
makeCommand({
|
|
260
|
+
name: 'list-all-gateway-vaults',
|
|
261
|
+
description: 'List vaults from all gateways',
|
|
262
|
+
options: paginationAddressOptions,
|
|
263
|
+
action: getAllGatewayVaults,
|
|
264
|
+
});
|
|
259
265
|
makeCommand({
|
|
260
266
|
name: 'transfer',
|
|
261
267
|
description: 'Transfer ARIO to another address',
|
|
@@ -151,6 +151,14 @@ export async function getGatewayVaults(o) {
|
|
|
151
151
|
message: `No vaults found for gateway ${address}`,
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
+
export async function getAllGatewayVaults(o) {
|
|
155
|
+
const result = await readARIOFromOptions(o).getAllGatewayVaults(paginationParamsFromOptions(o));
|
|
156
|
+
return result.items?.length
|
|
157
|
+
? result
|
|
158
|
+
: {
|
|
159
|
+
message: `No vaults found`,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
154
162
|
export async function getVault(o) {
|
|
155
163
|
return readARIOFromOptions(o)
|
|
156
164
|
.getVault({
|
package/lib/esm/common/io.js
CHANGED
|
@@ -445,6 +445,14 @@ export class ARIOReadable {
|
|
|
445
445
|
],
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
|
+
async getAllGatewayVaults(params) {
|
|
449
|
+
return this.process.read({
|
|
450
|
+
tags: [
|
|
451
|
+
{ name: 'Action', value: 'All-Gateway-Vaults' },
|
|
452
|
+
...paginationParamsToTags(params),
|
|
453
|
+
],
|
|
454
|
+
});
|
|
455
|
+
}
|
|
448
456
|
}
|
|
449
457
|
export class ARIOWriteable extends ARIOReadable {
|
|
450
458
|
signer;
|
package/lib/esm/version.js
CHANGED
|
@@ -79,6 +79,9 @@ export declare function getPrimaryName(o: AddressAndNameCLIOptions): Promise<imp
|
|
|
79
79
|
export declare function getGatewayVaults(o: PaginationAddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<AoGatewayVault> | {
|
|
80
80
|
message: string;
|
|
81
81
|
}>;
|
|
82
|
+
export declare function getAllGatewayVaults(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").AoAllGatewayVaults> | {
|
|
83
|
+
message: string;
|
|
84
|
+
}>;
|
|
82
85
|
export declare function getVault(o: AddressAndVaultIdCLIOptions): Promise<import("../../types/io.js").AoVaultData | {
|
|
83
86
|
message: string;
|
|
84
87
|
}>;
|
package/lib/types/common/io.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
17
|
import { AoArNSNameDataWithName, AoArNSReservedNameData, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AoRedelegationFeeInfo, AoReturnedName, AoTokenSupplyData, AoUpdateGatewaySettingsParams, AoWeightedObserver, OptionalArweave, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types/index.js';
|
|
18
|
-
import { AoARIORead, AoARIOWrite, AoAllDelegates, AoArNSNameData, AoArNSPurchaseParams, AoArNSReservedNameDataWithName, AoBuyRecordParams, AoDelegation, AoEpochData, AoEpochSettings, AoExtendLeaseParams, AoGateway, AoGatewayDelegateWithAddress, AoGatewayRegistrySettings, AoGatewayVault, AoGetCostDetailsParams, AoIncreaseUndernameLimitParams, AoPaginatedAddressParams, AoRegistrationFees, AoVaultData, AoWalletVault, CostDetailsResult, DemandFactorSettings, EpochInput } from '../types/io.js';
|
|
18
|
+
import { AoARIORead, AoARIOWrite, AoAllDelegates, AoAllGatewayVaults, AoArNSNameData, AoArNSPurchaseParams, AoArNSReservedNameDataWithName, AoBuyRecordParams, AoDelegation, AoEpochData, AoEpochSettings, AoExtendLeaseParams, AoGateway, AoGatewayDelegateWithAddress, AoGatewayRegistrySettings, AoGatewayVault, AoGetCostDetailsParams, AoIncreaseUndernameLimitParams, AoPaginatedAddressParams, AoRegistrationFees, AoVaultData, AoWalletVault, CostDetailsResult, DemandFactorSettings, EpochInput } from '../types/io.js';
|
|
19
19
|
import { mARIOToken } from '../types/token.js';
|
|
20
20
|
import { AOProcess } from './contracts/ao-process.js';
|
|
21
21
|
type ARIOConfigNoSigner = OptionalArweave<ProcessConfiguration>;
|
|
@@ -137,6 +137,7 @@ export declare class ARIOReadable implements AoARIORead {
|
|
|
137
137
|
}): Promise<AoRedelegationFeeInfo>;
|
|
138
138
|
getGatewayRegistrySettings(): Promise<AoGatewayRegistrySettings>;
|
|
139
139
|
getAllDelegates(params?: PaginationParams<AoAllDelegates>): Promise<PaginationResult<AoAllDelegates>>;
|
|
140
|
+
getAllGatewayVaults(params?: PaginationParams<AoAllGatewayVaults>): Promise<PaginationResult<AoAllGatewayVaults>>;
|
|
140
141
|
}
|
|
141
142
|
export declare class ARIOWriteable extends ARIOReadable implements AoARIOWrite {
|
|
142
143
|
protected process: AOProcess;
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -197,6 +197,11 @@ export type AoGatewayDelegate = {
|
|
|
197
197
|
export type AoGatewayDelegateWithAddress = AoGatewayDelegate & {
|
|
198
198
|
address: WalletAddress;
|
|
199
199
|
};
|
|
200
|
+
export type AoAllDelegates = AoGatewayDelegateWithAddress & {
|
|
201
|
+
gatewayAddress: WalletAddress;
|
|
202
|
+
vaultedStake: number;
|
|
203
|
+
cursorId: string;
|
|
204
|
+
};
|
|
200
205
|
export type AoGatewaySettings = {
|
|
201
206
|
allowDelegatedStaking: boolean | 'allowlist';
|
|
202
207
|
delegateRewardShareRatio: number;
|
|
@@ -236,6 +241,7 @@ export type AoStakeDelegation = AoDelegationBase & {
|
|
|
236
241
|
balance: number;
|
|
237
242
|
};
|
|
238
243
|
export type AoDelegation = AoStakeDelegation | AoVaultDelegation;
|
|
244
|
+
/** Operator stake being withdrawn from a given gateway */
|
|
239
245
|
export type AoGatewayVault = {
|
|
240
246
|
cursorId: string;
|
|
241
247
|
vaultId: TransactionId;
|
|
@@ -243,6 +249,10 @@ export type AoGatewayVault = {
|
|
|
243
249
|
endTimestamp: Timestamp;
|
|
244
250
|
startTimestamp: Timestamp;
|
|
245
251
|
};
|
|
252
|
+
/** Operator stake being withdrawn from all gateway gateways */
|
|
253
|
+
export type AoAllGatewayVaults = AoGatewayVault & {
|
|
254
|
+
gatewayAddress: WalletAddress;
|
|
255
|
+
};
|
|
246
256
|
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake'> & Partial<AoGatewaySettings> & {
|
|
247
257
|
observerAddress?: WalletAddress;
|
|
248
258
|
};
|
|
@@ -422,15 +432,8 @@ export interface AoARIORead {
|
|
|
422
432
|
}): Promise<AoRedelegationFeeInfo>;
|
|
423
433
|
getGatewayRegistrySettings(): Promise<AoGatewayRegistrySettings>;
|
|
424
434
|
getAllDelegates(params?: PaginationParams<AoAllDelegates>): Promise<PaginationResult<AoAllDelegates>>;
|
|
435
|
+
getAllGatewayVaults(params?: PaginationParams<AoAllGatewayVaults>): Promise<PaginationResult<AoAllGatewayVaults>>;
|
|
425
436
|
}
|
|
426
|
-
export type AoAllDelegates = {
|
|
427
|
-
address: WalletAddress;
|
|
428
|
-
gatewayAddress: WalletAddress;
|
|
429
|
-
delegatedStake: number;
|
|
430
|
-
startTimestamp: Timestamp;
|
|
431
|
-
vaultedStake: number;
|
|
432
|
-
cursorId: string;
|
|
433
|
-
};
|
|
434
437
|
export interface AoARIOWrite extends AoARIORead {
|
|
435
438
|
transfer({ target, qty, }: {
|
|
436
439
|
target: WalletAddress;
|
package/lib/types/version.d.ts
CHANGED