@ar.io/sdk 2.7.0-alpha.6 → 3.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 +155 -239
- package/bundles/web.bundle.min.js +74 -74
- package/lib/cjs/cli/cli.js +32 -38
- package/lib/cjs/cli/commands/gatewayWriteCommands.js +39 -39
- package/lib/cjs/cli/commands/readCommands.js +28 -45
- package/lib/cjs/cli/commands/transfer.js +7 -7
- package/lib/cjs/cli/options.js +4 -11
- package/lib/cjs/cli/utils.js +22 -22
- package/lib/cjs/common/ant.js +18 -14
- package/lib/cjs/common/io.js +15 -68
- package/lib/cjs/constants.js +5 -5
- package/lib/cjs/types/token.js +14 -14
- package/lib/cjs/utils/processes.js +4 -4
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +36 -42
- package/lib/esm/cli/commands/gatewayWriteCommands.js +41 -41
- package/lib/esm/cli/commands/readCommands.js +27 -43
- package/lib/esm/cli/commands/transfer.js +8 -8
- package/lib/esm/cli/options.js +3 -10
- package/lib/esm/cli/utils.js +18 -18
- package/lib/esm/common/ant.js +18 -14
- package/lib/esm/common/io.js +12 -65
- package/lib/esm/constants.js +4 -4
- package/lib/esm/types/token.js +12 -12
- package/lib/esm/utils/processes.js +6 -6
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/readCommands.d.ts +3 -4
- package/lib/types/cli/options.d.ts +1 -5
- package/lib/types/cli/types.d.ts +2 -4
- package/lib/types/cli/utils.d.ts +10 -10
- package/lib/types/common/ant.d.ts +14 -14
- package/lib/types/common/io.d.ts +20 -45
- package/lib/types/constants.d.ts +4 -4
- package/lib/types/types/ant.d.ts +8 -8
- package/lib/types/types/io.d.ts +14 -49
- package/lib/types/types/token.d.ts +8 -8
- package/lib/types/utils/processes.d.ts +4 -4
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/types/cli/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JWKInterface } from 'arweave/node/lib/wallet.js';
|
|
2
2
|
import { Command, OptionValues } from 'commander';
|
|
3
|
-
import { AoANTRead, AoANTWrite,
|
|
3
|
+
import { ARIOToken, AoANTRead, AoANTWrite, AoARIORead, AoARIOWrite, AoRedelegateStakeParams, AoSigner, AoUpdateGatewaySettingsParams, ContractSigner, EpochInput, Logger, PaginationParams, SpawnANTState, WriteOptions, mARIOToken } from '../node/index.js';
|
|
4
4
|
import { ANTStateCLIOptions, AddressCLIOptions, EpochCLIOptions, GlobalCLIOptions, InitiatorCLIOptions, JsonSerializable, PaginationCLIOptions, ProcessIdCLIOptions, RedelegateStakeCLIOptions, TransferCLIOptions, UpdateGatewaySettingsCLIOptions, WalletCLIOptions, WriteActionCLIOptions } from './types.js';
|
|
5
5
|
export declare function stringifyJsonForCLIDisplay(json: JsonSerializable | unknown): string;
|
|
6
6
|
export declare function runCommand<O extends OptionValues>(command: Command, action: (options: O) => Promise<JsonSerializable>): Promise<void>;
|
|
@@ -16,21 +16,21 @@ export declare function makeCommand<O extends OptionValues = GlobalCLIOptions>({
|
|
|
16
16
|
action?: (options: O) => Promise<JsonSerializable>;
|
|
17
17
|
options?: CommanderOption[];
|
|
18
18
|
}): Command;
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function arioProcessIdFromOptions({ arioProcessId, dev, }: GlobalCLIOptions): string;
|
|
20
20
|
export declare function requiredJwkFromOptions(options: WalletCLIOptions): JWKInterface;
|
|
21
21
|
export declare function jwkToAddress(jwk: JWKInterface): string;
|
|
22
22
|
export declare function getLoggerFromOptions(options: GlobalCLIOptions): Logger;
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function readARIOFromOptions(options: GlobalCLIOptions): AoARIORead;
|
|
24
24
|
export declare function requiredContractSignerFromOptions(options: WalletCLIOptions): {
|
|
25
25
|
signer: ContractSigner;
|
|
26
26
|
signerAddress: string;
|
|
27
27
|
};
|
|
28
28
|
export declare function requiredAoSignerFromOptions(options: WalletCLIOptions): AoSigner;
|
|
29
|
-
export declare function
|
|
30
|
-
|
|
29
|
+
export declare function writeARIOFromOptions(options: GlobalCLIOptions): {
|
|
30
|
+
ario: AoARIOWrite;
|
|
31
31
|
signerAddress: string;
|
|
32
32
|
};
|
|
33
|
-
export declare function
|
|
33
|
+
export declare function formatARIOWithCommas(value: ARIOToken): string;
|
|
34
34
|
/** helper to get address from --address option first, then check wallet options */
|
|
35
35
|
export declare function addressFromOptions<O extends AddressCLIOptions>(options: O): string | undefined;
|
|
36
36
|
export declare function requiredAddressFromOptions<O extends AddressCLIOptions>(options: O): string;
|
|
@@ -43,16 +43,16 @@ export declare function writeActionTagsFromOptions<O extends WriteActionCLIOptio
|
|
|
43
43
|
export declare function gatewaySettingsFromOptions({ allowDelegatedStaking, autoStake, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, observerAddress, port, properties, allowedDelegates, }: UpdateGatewaySettingsCLIOptions): AoUpdateGatewaySettingsParams;
|
|
44
44
|
export declare function requiredTargetAndQuantityFromOptions(options: TransferCLIOptions): {
|
|
45
45
|
target: string;
|
|
46
|
-
|
|
46
|
+
arioQuantity: ARIOToken;
|
|
47
47
|
};
|
|
48
48
|
export declare function redelegateParamsFromOptions(options: RedelegateStakeCLIOptions): AoRedelegateStakeParams & {
|
|
49
|
-
stakeQty:
|
|
49
|
+
stakeQty: mARIOToken;
|
|
50
50
|
};
|
|
51
51
|
export declare function recordTypeFromOptions<O extends {
|
|
52
52
|
type?: string;
|
|
53
53
|
}>(options: O): 'lease' | 'permabuy';
|
|
54
|
-
export declare function requiredMIOFromOptions<O extends GlobalCLIOptions>(options: O, key: string):
|
|
55
|
-
export declare function assertEnoughBalance(io:
|
|
54
|
+
export declare function requiredMIOFromOptions<O extends GlobalCLIOptions>(options: O, key: string): mARIOToken;
|
|
55
|
+
export declare function assertEnoughBalance(io: AoARIORead, address: string, ioQuantity: ARIOToken): Promise<void>;
|
|
56
56
|
export declare function confirmationPrompt(message: string): Promise<boolean>;
|
|
57
57
|
export declare function assertConfirmationPrompt<O extends {
|
|
58
58
|
skipConfirmation?: boolean;
|
|
@@ -227,44 +227,44 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
227
227
|
txId: string;
|
|
228
228
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
229
229
|
/**
|
|
230
|
-
* @param name @type {string} The name you want to release. The name will be put up for
|
|
231
|
-
* @param
|
|
230
|
+
* @param name @type {string} The name you want to release. The name will be put up for as a recently returned name on the ARIO contract. 50% of the winning bid will be distributed to the ANT owner at the time of purchase. If no purchase in the recently returned name period (14 epochs), the name will be released and can be reregistered by anyone.
|
|
231
|
+
* @param arioProcessId @type {string} The processId of the ARIO contract. This is where the ANT will send the message to release the name.
|
|
232
232
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
233
233
|
* @example
|
|
234
234
|
* ```ts
|
|
235
|
-
* ant.releaseName({ name: "ardrive",
|
|
235
|
+
* ant.releaseName({ name: "ardrive", arioProcessId: AR_TESTNET_PROCESS_ID });
|
|
236
236
|
* ```
|
|
237
237
|
*/
|
|
238
|
-
releaseName({ name,
|
|
238
|
+
releaseName({ name, arioProcessId }: {
|
|
239
239
|
name: string;
|
|
240
|
-
|
|
240
|
+
arioProcessId: string;
|
|
241
241
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
242
242
|
/**
|
|
243
|
-
* Sends a message to the
|
|
243
|
+
* Sends a message to the ARIO contract to reassign the name to a new ANT. This can only be done by the current owner of the ANT.
|
|
244
244
|
* @param name @type {string} The name you want to reassign.
|
|
245
|
-
* @param
|
|
245
|
+
* @param arioProcessId @type {string} The processId of the ARIO contract.
|
|
246
246
|
* @param antProcessId @type {string} The processId of the ANT contract.
|
|
247
247
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
248
248
|
* @example
|
|
249
249
|
* ```ts
|
|
250
|
-
* ant.reassignName({ name: "ardrive",
|
|
250
|
+
* ant.reassignName({ name: "ardrive", arioProcessId: ARIO_TESTNET_PROCESS_ID, antProcessId: NEW_ANT_PROCESS_ID });
|
|
251
251
|
* ```
|
|
252
252
|
*/
|
|
253
|
-
reassignName({ name,
|
|
253
|
+
reassignName({ name, arioProcessId, antProcessId, }: {
|
|
254
254
|
name: string;
|
|
255
|
-
|
|
255
|
+
arioProcessId: string;
|
|
256
256
|
antProcessId: string;
|
|
257
257
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
258
258
|
/**
|
|
259
259
|
* Approves a primary name request for a given name or address.
|
|
260
260
|
*/
|
|
261
|
-
approvePrimaryNameRequest({ name, address,
|
|
261
|
+
approvePrimaryNameRequest({ name, address, arioProcessId, }: {
|
|
262
262
|
name: string;
|
|
263
263
|
address: WalletAddress;
|
|
264
|
-
|
|
264
|
+
arioProcessId: string;
|
|
265
265
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
266
|
-
removePrimaryNames({ names,
|
|
266
|
+
removePrimaryNames({ names, arioProcessId }: {
|
|
267
267
|
names: string[];
|
|
268
|
-
|
|
268
|
+
arioProcessId: string;
|
|
269
269
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
270
270
|
}
|
package/lib/types/common/io.d.ts
CHANGED
|
@@ -14,30 +14,30 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
|
-
import { AoArNSNameDataWithName, AoArNSReservedNameData,
|
|
18
|
-
import { AoArNSNameData, AoArNSReservedNameDataWithName,
|
|
19
|
-
import {
|
|
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, AoArNSReservedNameDataWithName, AoDelegation, AoEpochData, AoEpochSettings, AoGateway, AoGatewayDelegateWithAddress, AoGatewayRegistrySettings, AoGatewayVault, AoPaginatedAddressParams, AoRegistrationFees, AoVaultData, AoWalletVault, DemandFactorSettings, EpochInput } from '../types/io.js';
|
|
19
|
+
import { mARIOToken } from '../types/token.js';
|
|
20
20
|
import { AOProcess } from './contracts/ao-process.js';
|
|
21
|
-
export declare class
|
|
22
|
-
static init():
|
|
21
|
+
export declare class ARIO {
|
|
22
|
+
static init(): AoARIORead;
|
|
23
23
|
static init({ process }: {
|
|
24
24
|
process: AOProcess;
|
|
25
|
-
}):
|
|
25
|
+
}): AoARIORead;
|
|
26
26
|
static init({ process, signer, }: WithSigner<{
|
|
27
27
|
process: AOProcess;
|
|
28
|
-
}>):
|
|
28
|
+
}>): AoARIOWrite;
|
|
29
29
|
static init({ processId, signer, }: WithSigner<{
|
|
30
30
|
processId: string;
|
|
31
|
-
}>):
|
|
31
|
+
}>): AoARIOWrite;
|
|
32
32
|
static init({ processId, signer, }: {
|
|
33
33
|
signer?: ContractSigner | undefined;
|
|
34
34
|
processId: string;
|
|
35
35
|
}): any;
|
|
36
36
|
static init({ processId }: {
|
|
37
37
|
processId: string;
|
|
38
|
-
}):
|
|
38
|
+
}): AoARIORead;
|
|
39
39
|
}
|
|
40
|
-
export declare class
|
|
40
|
+
export declare class ARIOReadable implements AoARIORead {
|
|
41
41
|
protected process: AOProcess;
|
|
42
42
|
private arweave;
|
|
43
43
|
constructor(config?: ProcessConfiguration, arweave?: Arweave);
|
|
@@ -110,28 +110,10 @@ export declare class IOReadable implements AoIORead {
|
|
|
110
110
|
getRegistrationFees(): Promise<AoRegistrationFees>;
|
|
111
111
|
getDemandFactor(): Promise<number>;
|
|
112
112
|
getDemandFactorSettings(): Promise<DemandFactorSettings>;
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
getArNSReturnedNames(params?: PaginationParams<AoReturnedName>): Promise<PaginationResult<AoReturnedName>>;
|
|
114
|
+
getArNSReturnedName({ name, }: {
|
|
115
115
|
name: string;
|
|
116
|
-
}): Promise<
|
|
117
|
-
/**
|
|
118
|
-
* Get auction prices for a given auction at the provided intervals
|
|
119
|
-
*
|
|
120
|
-
* @param {Object} params - The parameters for fetching auction prices
|
|
121
|
-
* @param {string} params.name - The name of the auction
|
|
122
|
-
* @param {('permabuy'|'lease')} [params.type='lease'] - The type of purchase
|
|
123
|
-
* @param {number} [params.years=1] - The number of years for lease (only applicable if type is 'lease')
|
|
124
|
-
* @param {number} [params.timestamp=Date.now()] - The timestamp to fetch prices for
|
|
125
|
-
* @param {number} [params.intervalMs=900000] - The interval in milliseconds between price points (default is 15 minutes)
|
|
126
|
-
* @returns {Promise<AoAuctionPriceData>} The auction price data
|
|
127
|
-
*/
|
|
128
|
-
getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }: {
|
|
129
|
-
name: string;
|
|
130
|
-
type?: 'permabuy' | 'lease';
|
|
131
|
-
years?: number;
|
|
132
|
-
timestamp?: number;
|
|
133
|
-
intervalMs?: number;
|
|
134
|
-
}): Promise<AoAuctionPriceData>;
|
|
116
|
+
}): Promise<AoReturnedName | undefined>;
|
|
135
117
|
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
136
118
|
address: WalletAddress;
|
|
137
119
|
}): Promise<PaginationResult<AoDelegation>>;
|
|
@@ -161,7 +143,7 @@ export declare class IOReadable implements AoIORead {
|
|
|
161
143
|
}): Promise<AoRedelegationFeeInfo>;
|
|
162
144
|
getGatewayRegistrySettings(): Promise<AoGatewayRegistrySettings>;
|
|
163
145
|
}
|
|
164
|
-
export declare class
|
|
146
|
+
export declare class ARIOWriteable extends ARIOReadable implements AoARIOWrite {
|
|
165
147
|
protected process: AOProcess;
|
|
166
148
|
private signer;
|
|
167
149
|
constructor({ signer, ...config }: WithSigner<{
|
|
@@ -171,18 +153,18 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
171
153
|
}>);
|
|
172
154
|
transfer({ target, qty, }: {
|
|
173
155
|
target: string;
|
|
174
|
-
qty: number |
|
|
156
|
+
qty: number | mARIOToken;
|
|
175
157
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
176
158
|
joinNetwork({ operatorStake, allowDelegatedStaking, allowedDelegates, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: AoJoinNetworkParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
177
159
|
leaveNetwork(options?: WriteOptions): Promise<AoMessageResult>;
|
|
178
160
|
updateGatewaySettings({ allowDelegatedStaking, allowedDelegates, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: AoUpdateGatewaySettingsParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
179
161
|
delegateStake(params: {
|
|
180
162
|
target: string;
|
|
181
|
-
stakeQty: number |
|
|
163
|
+
stakeQty: number | mARIOToken;
|
|
182
164
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
183
165
|
decreaseDelegateStake(params: {
|
|
184
166
|
target: string;
|
|
185
|
-
decreaseQty: number |
|
|
167
|
+
decreaseQty: number | mARIOToken;
|
|
186
168
|
instant?: boolean;
|
|
187
169
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
188
170
|
/**
|
|
@@ -198,10 +180,10 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
198
180
|
vaultId: string;
|
|
199
181
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
200
182
|
increaseOperatorStake(params: {
|
|
201
|
-
increaseQty: number |
|
|
183
|
+
increaseQty: number | mARIOToken;
|
|
202
184
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
203
185
|
decreaseOperatorStake(params: {
|
|
204
|
-
decreaseQty: number |
|
|
186
|
+
decreaseQty: number | mARIOToken;
|
|
205
187
|
instant?: boolean;
|
|
206
188
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
207
189
|
saveObservations(params: {
|
|
@@ -255,13 +237,6 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
255
237
|
gatewayAddress?: WalletAddress;
|
|
256
238
|
vaultId: string;
|
|
257
239
|
}, options?: WriteOptions | undefined): Promise<AoMessageResult>;
|
|
258
|
-
submitAuctionBid(params: {
|
|
259
|
-
name: string;
|
|
260
|
-
processId: string;
|
|
261
|
-
quantity?: number;
|
|
262
|
-
type?: 'lease' | 'permabuy';
|
|
263
|
-
years?: number;
|
|
264
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
265
240
|
requestPrimaryName(params: {
|
|
266
241
|
name: string;
|
|
267
242
|
}): Promise<AoMessageResult>;
|
|
@@ -279,7 +254,7 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
|
|
|
279
254
|
redelegateStake(params: {
|
|
280
255
|
target: string;
|
|
281
256
|
source: string;
|
|
282
|
-
stakeQty: number |
|
|
257
|
+
stakeQty: number | mARIOToken;
|
|
283
258
|
vaultId?: string;
|
|
284
259
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
285
260
|
}
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ export declare const FQDN_REGEX: RegExp;
|
|
|
19
19
|
export declare const SORT_KEY_REGEX: RegExp;
|
|
20
20
|
export declare const ARNS_TESTNET_REGISTRY_TX: string;
|
|
21
21
|
export declare const ARNS_DEVNET_REGISTRY_TX = "_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8";
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
22
|
+
export declare const ARIO_DEVNET_PROCESS_ID = "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc";
|
|
23
|
+
export declare const arioDevnetProcessId = "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc";
|
|
24
|
+
export declare const ARIO_TESTNET_PROCESS_ID = "agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA";
|
|
25
25
|
export declare const ANT_REGISTRY_ID = "i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc";
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const MARIO_PER_ARIO = 1000000;
|
|
27
27
|
export declare const AOS_MODULE_ID = "cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk";
|
|
28
28
|
export declare const ANT_LUA_ID = "16_FyX-V2QU0RPSh1GIaEETSaUjNb0oVjCFpVbAfQq4";
|
|
29
29
|
export declare const DEFAULT_SCHEDULER_ID = "_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";
|
package/lib/types/types/ant.d.ts
CHANGED
|
@@ -210,22 +210,22 @@ export interface AoANTWrite extends AoANTRead {
|
|
|
210
210
|
setLogo({ txId }: {
|
|
211
211
|
txId: string;
|
|
212
212
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
213
|
-
releaseName({ name,
|
|
213
|
+
releaseName({ name, arioProcessId }: {
|
|
214
214
|
name: string;
|
|
215
|
-
|
|
215
|
+
arioProcessId: string;
|
|
216
216
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
217
|
-
reassignName({ name,
|
|
217
|
+
reassignName({ name, arioProcessId, antProcessId, }: {
|
|
218
218
|
name: string;
|
|
219
|
-
|
|
219
|
+
arioProcessId: string;
|
|
220
220
|
antProcessId: string;
|
|
221
221
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
222
|
-
approvePrimaryNameRequest({ name, address,
|
|
222
|
+
approvePrimaryNameRequest({ name, address, arioProcessId, }: {
|
|
223
223
|
name: string;
|
|
224
224
|
address: WalletAddress;
|
|
225
|
-
|
|
225
|
+
arioProcessId: string;
|
|
226
226
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
227
|
-
removePrimaryNames({ names,
|
|
227
|
+
removePrimaryNames({ names, arioProcessId }: {
|
|
228
228
|
names: string[];
|
|
229
|
-
|
|
229
|
+
arioProcessId: string;
|
|
230
230
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
231
231
|
}
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { AOProcess } from '../common/index.js';
|
|
17
17
|
import { AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AoRedelegationFeeInfo, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './index.js';
|
|
18
|
-
import {
|
|
18
|
+
import { mARIOToken } from './token.js';
|
|
19
19
|
export type PaginationParams<T = Record<string, never>> = {
|
|
20
20
|
cursor?: string;
|
|
21
21
|
limit?: number;
|
|
@@ -200,26 +200,12 @@ export type AoBalanceWithAddress = {
|
|
|
200
200
|
address: WalletAddress;
|
|
201
201
|
balance: number;
|
|
202
202
|
};
|
|
203
|
-
export type
|
|
204
|
-
durationMs: number;
|
|
205
|
-
decayRate: number;
|
|
206
|
-
scalingExponent: number;
|
|
207
|
-
startPriceMultiplier: number;
|
|
208
|
-
};
|
|
209
|
-
export type AoAuction = {
|
|
203
|
+
export type AoReturnedName = {
|
|
210
204
|
name: string;
|
|
211
205
|
startTimestamp: Timestamp;
|
|
212
206
|
endTimestamp: Timestamp;
|
|
213
207
|
initiator: string;
|
|
214
|
-
|
|
215
|
-
demandFactor: number;
|
|
216
|
-
settings: AoAuctionSettings;
|
|
217
|
-
};
|
|
218
|
-
export type AoAuctionPriceData = {
|
|
219
|
-
type: 'lease' | 'permabuy';
|
|
220
|
-
years?: number;
|
|
221
|
-
prices: Record<string, number>;
|
|
222
|
-
currentPrice: number;
|
|
208
|
+
premiumMultiplier: number;
|
|
223
209
|
};
|
|
224
210
|
export type AoDelegationBase = {
|
|
225
211
|
type: 'stake' | 'vault';
|
|
@@ -257,20 +243,13 @@ export type AoBalanceParams = AoAddressParams;
|
|
|
257
243
|
export type AoPaginatedAddressParams = PaginationParams & AoAddressParams;
|
|
258
244
|
export type AoDelegateStakeParams = {
|
|
259
245
|
target: WalletAddress;
|
|
260
|
-
stakeQty: number |
|
|
246
|
+
stakeQty: number | mARIOToken;
|
|
261
247
|
};
|
|
262
248
|
export type AoGetArNSRecordsParams = PaginationParams<AoArNSNameDataWithName>;
|
|
263
|
-
export type AoArNSAuctionPricesParams = {
|
|
264
|
-
name: string;
|
|
265
|
-
type: 'lease' | 'permabuy';
|
|
266
|
-
years?: number;
|
|
267
|
-
timestamp?: number;
|
|
268
|
-
intervalMs?: number;
|
|
269
|
-
};
|
|
270
249
|
export type AoRedelegateStakeParams = {
|
|
271
250
|
target: string;
|
|
272
251
|
source: string;
|
|
273
|
-
stakeQty: number |
|
|
252
|
+
stakeQty: number | mARIOToken;
|
|
274
253
|
vaultId?: string;
|
|
275
254
|
};
|
|
276
255
|
export declare const validIntents: string[];
|
|
@@ -299,12 +278,6 @@ export type AoExtendLeaseParams = AoArNSNameParams & {
|
|
|
299
278
|
export type AoIncreaseUndernameLimitParams = AoArNSNameParams & {
|
|
300
279
|
increaseCount: number;
|
|
301
280
|
};
|
|
302
|
-
export type AoSubmitAuctionBidParams = AoArNSNameParams & {
|
|
303
|
-
processId: string;
|
|
304
|
-
quantity?: number;
|
|
305
|
-
type?: 'lease' | 'permabuy';
|
|
306
|
-
years?: number;
|
|
307
|
-
};
|
|
308
281
|
export type AoGatewayRegistrySettings = {
|
|
309
282
|
delegates: {
|
|
310
283
|
minStake: number;
|
|
@@ -335,7 +308,7 @@ export type DemandFactorSettings = {
|
|
|
335
308
|
stepDownThreshold: number;
|
|
336
309
|
criteria: string;
|
|
337
310
|
};
|
|
338
|
-
export interface
|
|
311
|
+
export interface AoARIORead {
|
|
339
312
|
getInfo(): Promise<{
|
|
340
313
|
Ticker: string;
|
|
341
314
|
Name: string;
|
|
@@ -369,11 +342,10 @@ export interface AoIORead {
|
|
|
369
342
|
getArNSReservedName({ name, }: {
|
|
370
343
|
name: string;
|
|
371
344
|
}): Promise<AoArNSReservedNameData | undefined>;
|
|
372
|
-
|
|
373
|
-
|
|
345
|
+
getArNSReturnedNames(params?: PaginationParams<AoReturnedName>): Promise<PaginationResult<AoReturnedName>>;
|
|
346
|
+
getArNSReturnedName({ name, }: {
|
|
374
347
|
name: string;
|
|
375
|
-
}): Promise<
|
|
376
|
-
getArNSAuctionPrices({ name, type, years, timestamp, intervalMs, }: AoArNSAuctionPricesParams): Promise<AoAuctionPriceData>;
|
|
348
|
+
}): Promise<AoReturnedName | undefined>;
|
|
377
349
|
getEpoch(epoch?: EpochInput): Promise<AoEpochData | undefined>;
|
|
378
350
|
getCurrentEpoch(): Promise<AoEpochData>;
|
|
379
351
|
getPrescribedObservers(epoch?: EpochInput): Promise<AoWeightedObserver[]>;
|
|
@@ -401,7 +373,7 @@ export interface AoIORead {
|
|
|
401
373
|
}): Promise<AoRedelegationFeeInfo>;
|
|
402
374
|
getGatewayRegistrySettings(): Promise<AoGatewayRegistrySettings>;
|
|
403
375
|
}
|
|
404
|
-
export interface
|
|
376
|
+
export interface AoARIOWrite extends AoARIORead {
|
|
405
377
|
transfer({ target, qty, }: {
|
|
406
378
|
target: WalletAddress;
|
|
407
379
|
qty: number;
|
|
@@ -410,19 +382,19 @@ export interface AoIOWrite extends AoIORead {
|
|
|
410
382
|
leaveNetwork(options?: WriteOptions): Promise<AoMessageResult>;
|
|
411
383
|
updateGatewaySettings(params: AoUpdateGatewaySettingsParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
412
384
|
increaseOperatorStake(params: {
|
|
413
|
-
increaseQty: number |
|
|
385
|
+
increaseQty: number | mARIOToken;
|
|
414
386
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
415
387
|
decreaseOperatorStake(params: {
|
|
416
|
-
decreaseQty: number |
|
|
388
|
+
decreaseQty: number | mARIOToken;
|
|
417
389
|
instant?: boolean;
|
|
418
390
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
419
391
|
delegateStake(params: {
|
|
420
392
|
target: WalletAddress;
|
|
421
|
-
stakeQty: number |
|
|
393
|
+
stakeQty: number | mARIOToken;
|
|
422
394
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
423
395
|
decreaseDelegateStake(params: {
|
|
424
396
|
target: WalletAddress;
|
|
425
|
-
decreaseQty: number |
|
|
397
|
+
decreaseQty: number | mARIOToken;
|
|
426
398
|
instant?: boolean;
|
|
427
399
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
428
400
|
instantWithdrawal(params: {
|
|
@@ -441,13 +413,6 @@ export interface AoIOWrite extends AoIORead {
|
|
|
441
413
|
gatewayAddress?: WalletAddress;
|
|
442
414
|
vaultId: string;
|
|
443
415
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
444
|
-
submitAuctionBid(params: {
|
|
445
|
-
name: string;
|
|
446
|
-
processId: string;
|
|
447
|
-
quantity?: number;
|
|
448
|
-
type?: 'lease' | 'permabuy';
|
|
449
|
-
years?: number;
|
|
450
|
-
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
451
416
|
requestPrimaryName(params: {
|
|
452
417
|
name: string;
|
|
453
418
|
}): Promise<AoMessageResult>;
|
|
@@ -17,20 +17,20 @@ declare class PositiveFiniteInteger implements Equatable<PositiveFiniteInteger>
|
|
|
17
17
|
toJSON(): number;
|
|
18
18
|
equals(other: PositiveFiniteInteger): boolean;
|
|
19
19
|
}
|
|
20
|
-
export declare class
|
|
20
|
+
export declare class ARIOToken {
|
|
21
21
|
protected value: number;
|
|
22
22
|
constructor(value: number);
|
|
23
23
|
valueOf(): number;
|
|
24
|
-
|
|
24
|
+
toMARIO(): mARIOToken;
|
|
25
25
|
toString(): string;
|
|
26
26
|
}
|
|
27
|
-
export declare class
|
|
27
|
+
export declare class mARIOToken extends PositiveFiniteInteger {
|
|
28
28
|
constructor(value: number);
|
|
29
|
-
multiply(multiplier:
|
|
30
|
-
divide(divisor:
|
|
31
|
-
plus(addend:
|
|
32
|
-
minus(subtractHend:
|
|
33
|
-
|
|
29
|
+
multiply(multiplier: mARIOToken | number): mARIOToken;
|
|
30
|
+
divide(divisor: mARIOToken | number): mARIOToken;
|
|
31
|
+
plus(addend: mARIOToken): mARIOToken;
|
|
32
|
+
minus(subtractHend: mARIOToken): mARIOToken;
|
|
33
|
+
toARIO(): ARIOToken;
|
|
34
34
|
}
|
|
35
35
|
export type AoSigner = (args: {
|
|
36
36
|
data: string | Buffer;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { EventEmitter } from 'eventemitter3';
|
|
17
17
|
import { ILogger } from '../common/logger.js';
|
|
18
18
|
import { AoANTRegistryRead } from '../types/ant-registry.js';
|
|
19
|
-
import {
|
|
19
|
+
import { AoARIORead, AoArNSNameData, ProcessId, WalletAddress } from '../types/index.js';
|
|
20
20
|
/**
|
|
21
21
|
* @beta This API is in beta and may change in the future.
|
|
22
22
|
*/
|
|
@@ -25,13 +25,13 @@ export declare const getANTProcessesOwnedByWallet: ({ address, registry, }: {
|
|
|
25
25
|
registry?: AoANTRegistryRead;
|
|
26
26
|
}) => Promise<ProcessId[]>;
|
|
27
27
|
export declare class ArNSEventEmitter extends EventEmitter {
|
|
28
|
-
protected contract:
|
|
28
|
+
protected contract: AoARIORead;
|
|
29
29
|
private timeoutMs;
|
|
30
30
|
private throttle;
|
|
31
31
|
private logger;
|
|
32
32
|
private strict;
|
|
33
33
|
constructor({ contract, timeoutMs, concurrency, logger, strict, }?: {
|
|
34
|
-
contract?:
|
|
34
|
+
contract?: AoARIORead;
|
|
35
35
|
timeoutMs?: number;
|
|
36
36
|
concurrency?: number;
|
|
37
37
|
logger?: ILogger;
|
|
@@ -44,7 +44,7 @@ export declare class ArNSEventEmitter extends EventEmitter {
|
|
|
44
44
|
}): Promise<void>;
|
|
45
45
|
}
|
|
46
46
|
export declare const fetchAllArNSRecords: ({ contract, emitter, logger, pageSize, }: {
|
|
47
|
-
contract?:
|
|
47
|
+
contract?: AoARIORead;
|
|
48
48
|
emitter?: EventEmitter;
|
|
49
49
|
logger?: ILogger;
|
|
50
50
|
pageSize?: number;
|
package/lib/types/version.d.ts
CHANGED