@ar.io/sdk 3.3.0-alpha.2 → 3.3.0-alpha.4
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 +46 -0
- package/bundles/web.bundle.min.js +64 -64
- package/lib/cjs/cli/cli.js +6 -0
- package/lib/cjs/cli/commands/readCommands.js +6 -1
- package/lib/cjs/common/io.js +8 -0
- package/lib/cjs/constants.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +7 -1
- package/lib/esm/cli/commands/readCommands.js +4 -0
- package/lib/esm/common/io.js +8 -0
- package/lib/esm/constants.js +2 -2
- 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/constants.d.ts +2 -2
- package/lib/types/types/io.d.ts +9 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/cli/cli.js
CHANGED
|
@@ -64,6 +64,12 @@ const utils_js_1 = require("./utils.js");
|
|
|
64
64
|
options: options_js_1.paginationOptions,
|
|
65
65
|
action: readCommands_js_1.listGateways,
|
|
66
66
|
});
|
|
67
|
+
(0, utils_js_1.makeCommand)({
|
|
68
|
+
name: 'list-all-delegates',
|
|
69
|
+
description: 'List all paginated delegates from all gateways',
|
|
70
|
+
options: options_js_1.paginationOptions,
|
|
71
|
+
action: readCommands_js_1.listAllDelegatesCLICommand,
|
|
72
|
+
});
|
|
67
73
|
(0, utils_js_1.makeCommand)({
|
|
68
74
|
name: 'get-gateway-delegates',
|
|
69
75
|
description: 'Get the delegates of a gateway',
|
|
@@ -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.listGateways = exports.getGateway = void 0;
|
|
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;
|
|
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) {
|
|
@@ -16,6 +16,11 @@ async function listGateways(o) {
|
|
|
16
16
|
return gateways.items.length ? gateways : { message: 'No gateways found' };
|
|
17
17
|
}
|
|
18
18
|
exports.listGateways = listGateways;
|
|
19
|
+
async function listAllDelegatesCLICommand(o) {
|
|
20
|
+
const delegates = await (0, utils_js_1.readARIOFromOptions)(o).getAllDelegates((0, utils_js_1.paginationParamsFromOptions)(o));
|
|
21
|
+
return delegates.items.length ? delegates : { message: 'No delegates found' };
|
|
22
|
+
}
|
|
23
|
+
exports.listAllDelegatesCLICommand = listAllDelegatesCLICommand;
|
|
19
24
|
async function getGatewayDelegates(o) {
|
|
20
25
|
const address = (0, utils_js_1.requiredAddressFromOptions)(o);
|
|
21
26
|
const result = await (0, utils_js_1.readARIOFromOptions)(o).getGatewayDelegates({
|
package/lib/cjs/common/io.js
CHANGED
|
@@ -448,6 +448,14 @@ class ARIOReadable {
|
|
|
448
448
|
tags: [{ name: 'Action', value: 'Gateway-Registry-Settings' }],
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
|
+
async getAllDelegates(params) {
|
|
452
|
+
return this.process.read({
|
|
453
|
+
tags: [
|
|
454
|
+
{ name: 'Action', value: 'All-Paginated-Delegates' },
|
|
455
|
+
...(0, arweave_js_1.paginationParamsToTags)(params),
|
|
456
|
+
],
|
|
457
|
+
});
|
|
458
|
+
}
|
|
451
459
|
}
|
|
452
460
|
exports.ARIOReadable = ARIOReadable;
|
|
453
461
|
class ARIOWriteable extends ARIOReadable {
|
package/lib/cjs/constants.js
CHANGED
|
@@ -29,6 +29,6 @@ exports.arioDevnetProcessId = exports.ARIO_DEVNET_PROCESS_ID;
|
|
|
29
29
|
exports.ARIO_TESTNET_PROCESS_ID = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA';
|
|
30
30
|
exports.ANT_REGISTRY_ID = 'i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc';
|
|
31
31
|
exports.MARIO_PER_ARIO = 1_000_000;
|
|
32
|
-
exports.AOS_MODULE_ID = '
|
|
33
|
-
exports.ANT_LUA_ID = '
|
|
32
|
+
exports.AOS_MODULE_ID = 'EHu5-WHKqYTAMHbMAxXtJ3i8C4pYzRjknpzFM6fnIRw';
|
|
33
|
+
exports.ANT_LUA_ID = 'k9tQkbnFYZOGp6ist1yFuaqk_wOkzM5KUSNDtWzCLtg';
|
|
34
34
|
exports.DEFAULT_SCHEDULER_ID = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA';
|
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, listArNSRecords, listArNSReservedNames, listArNSReturnedNames, listGateways, } from './commands/readCommands.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';
|
|
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, requiredStringArrayFromOptions, requiredStringFromOptions, writeANTFromOptions, writeActionTagsFromOptions, } from './utils.js';
|
|
@@ -62,6 +62,12 @@ makeCommand({
|
|
|
62
62
|
options: paginationOptions,
|
|
63
63
|
action: listGateways,
|
|
64
64
|
});
|
|
65
|
+
makeCommand({
|
|
66
|
+
name: 'list-all-delegates',
|
|
67
|
+
description: 'List all paginated delegates from all gateways',
|
|
68
|
+
options: paginationOptions,
|
|
69
|
+
action: listAllDelegatesCLICommand,
|
|
70
|
+
});
|
|
65
71
|
makeCommand({
|
|
66
72
|
name: 'get-gateway-delegates',
|
|
67
73
|
description: 'Get the delegates of a gateway',
|
|
@@ -11,6 +11,10 @@ export async function listGateways(o) {
|
|
|
11
11
|
const gateways = await readARIOFromOptions(o).getGateways(paginationParamsFromOptions(o));
|
|
12
12
|
return gateways.items.length ? gateways : { message: 'No gateways found' };
|
|
13
13
|
}
|
|
14
|
+
export async function listAllDelegatesCLICommand(o) {
|
|
15
|
+
const delegates = await readARIOFromOptions(o).getAllDelegates(paginationParamsFromOptions(o));
|
|
16
|
+
return delegates.items.length ? delegates : { message: 'No delegates found' };
|
|
17
|
+
}
|
|
14
18
|
export async function getGatewayDelegates(o) {
|
|
15
19
|
const address = requiredAddressFromOptions(o);
|
|
16
20
|
const result = await readARIOFromOptions(o).getGatewayDelegates({
|
package/lib/esm/common/io.js
CHANGED
|
@@ -444,6 +444,14 @@ export class ARIOReadable {
|
|
|
444
444
|
tags: [{ name: 'Action', value: 'Gateway-Registry-Settings' }],
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
|
+
async getAllDelegates(params) {
|
|
448
|
+
return this.process.read({
|
|
449
|
+
tags: [
|
|
450
|
+
{ name: 'Action', value: 'All-Paginated-Delegates' },
|
|
451
|
+
...paginationParamsToTags(params),
|
|
452
|
+
],
|
|
453
|
+
});
|
|
454
|
+
}
|
|
447
455
|
}
|
|
448
456
|
export class ARIOWriteable extends ARIOReadable {
|
|
449
457
|
signer;
|
package/lib/esm/constants.js
CHANGED
|
@@ -26,6 +26,6 @@ export const arioDevnetProcessId = ARIO_DEVNET_PROCESS_ID;
|
|
|
26
26
|
export const ARIO_TESTNET_PROCESS_ID = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA';
|
|
27
27
|
export const ANT_REGISTRY_ID = 'i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc';
|
|
28
28
|
export const MARIO_PER_ARIO = 1_000_000;
|
|
29
|
-
export const AOS_MODULE_ID = '
|
|
30
|
-
export const ANT_LUA_ID = '
|
|
29
|
+
export const AOS_MODULE_ID = 'EHu5-WHKqYTAMHbMAxXtJ3i8C4pYzRjknpzFM6fnIRw';
|
|
30
|
+
export const ANT_LUA_ID = 'k9tQkbnFYZOGp6ist1yFuaqk_wOkzM5KUSNDtWzCLtg';
|
|
31
31
|
export const DEFAULT_SCHEDULER_ID = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA';
|
package/lib/esm/version.js
CHANGED
|
@@ -21,6 +21,9 @@ export declare function getGateway(o: AddressCLIOptions): Promise<import("../../
|
|
|
21
21
|
export declare function listGateways(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").AoGatewayWithAddress> | {
|
|
22
22
|
message: string;
|
|
23
23
|
}>;
|
|
24
|
+
export declare function listAllDelegatesCLICommand(o: PaginationCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").AoAllDelegates> | {
|
|
25
|
+
message: string;
|
|
26
|
+
}>;
|
|
24
27
|
export declare function getGatewayDelegates(o: AddressCLIOptions): Promise<import("../../types/io.js").PaginationResult<import("../../types/io.js").AoGatewayDelegateWithAddress> | {
|
|
25
28
|
message: string;
|
|
26
29
|
}>;
|
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, ContractSigner, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types/index.js';
|
|
18
|
-
import { AoARIORead, AoARIOWrite, 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, 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
|
export declare class ARIO {
|
|
@@ -150,6 +150,7 @@ export declare class ARIOReadable implements AoARIORead {
|
|
|
150
150
|
address: WalletAddress;
|
|
151
151
|
}): Promise<AoRedelegationFeeInfo>;
|
|
152
152
|
getGatewayRegistrySettings(): Promise<AoGatewayRegistrySettings>;
|
|
153
|
+
getAllDelegates(params?: PaginationParams<AoAllDelegates>): Promise<PaginationResult<AoAllDelegates>>;
|
|
153
154
|
}
|
|
154
155
|
export declare class ARIOWriteable extends ARIOReadable implements AoARIOWrite {
|
|
155
156
|
protected process: AOProcess;
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -24,6 +24,6 @@ export declare const arioDevnetProcessId = "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6
|
|
|
24
24
|
export declare const ARIO_TESTNET_PROCESS_ID = "agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA";
|
|
25
25
|
export declare const ANT_REGISTRY_ID = "i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc";
|
|
26
26
|
export declare const MARIO_PER_ARIO = 1000000;
|
|
27
|
-
export declare const AOS_MODULE_ID = "
|
|
28
|
-
export declare const ANT_LUA_ID = "
|
|
27
|
+
export declare const AOS_MODULE_ID = "EHu5-WHKqYTAMHbMAxXtJ3i8C4pYzRjknpzFM6fnIRw";
|
|
28
|
+
export declare const ANT_LUA_ID = "k9tQkbnFYZOGp6ist1yFuaqk_wOkzM5KUSNDtWzCLtg";
|
|
29
29
|
export declare const DEFAULT_SCHEDULER_ID = "_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -412,7 +412,16 @@ export interface AoARIORead {
|
|
|
412
412
|
address: WalletAddress;
|
|
413
413
|
}): Promise<AoRedelegationFeeInfo>;
|
|
414
414
|
getGatewayRegistrySettings(): Promise<AoGatewayRegistrySettings>;
|
|
415
|
+
getAllDelegates(params?: PaginationParams<AoAllDelegates>): Promise<PaginationResult<AoAllDelegates>>;
|
|
415
416
|
}
|
|
417
|
+
export type AoAllDelegates = {
|
|
418
|
+
address: WalletAddress;
|
|
419
|
+
gatewayAddress: WalletAddress;
|
|
420
|
+
delegatedStake: number;
|
|
421
|
+
startTimestamp: Timestamp;
|
|
422
|
+
vaultedStake: number;
|
|
423
|
+
cursorId: string;
|
|
424
|
+
};
|
|
416
425
|
export interface AoARIOWrite extends AoARIORead {
|
|
417
426
|
transfer({ target, qty, }: {
|
|
418
427
|
target: WalletAddress;
|
package/lib/types/version.d.ts
CHANGED