@ar.io/sdk 3.0.1-alpha.1 → 3.1.0-alpha.2
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 +76 -76
- package/lib/cjs/cli/cli.js +27 -71
- package/lib/cjs/cli/commands/arnsPurchaseCommands.js +167 -0
- package/lib/cjs/cli/commands/gatewayWriteCommands.js +8 -4
- package/lib/cjs/cli/commands/readCommands.js +17 -38
- package/lib/cjs/cli/commands/transfer.js +5 -1
- package/lib/cjs/cli/options.js +14 -7
- package/lib/cjs/cli/utils.js +59 -7
- package/lib/cjs/common/contracts/ao-process.js +7 -3
- package/lib/cjs/common/io.js +79 -23
- package/lib/cjs/types/io.js +6 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +30 -74
- package/lib/esm/cli/commands/arnsPurchaseCommands.js +159 -0
- package/lib/esm/cli/commands/gatewayWriteCommands.js +6 -2
- package/lib/esm/cli/commands/readCommands.js +16 -38
- package/lib/esm/cli/commands/transfer.js +6 -2
- package/lib/esm/cli/options.js +13 -6
- package/lib/esm/cli/utils.js +53 -5
- package/lib/esm/common/contracts/ao-process.js +7 -3
- package/lib/esm/common/io.js +79 -23
- package/lib/esm/types/io.js +4 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +22 -0
- package/lib/types/cli/commands/readCommands.d.ts +24 -2
- package/lib/types/cli/options.d.ts +5 -9
- package/lib/types/cli/types.d.ts +3 -5
- package/lib/types/cli/utils.d.ts +25 -4
- package/lib/types/common/contracts/ao-process.d.ts +2 -1
- package/lib/types/common/io.d.ts +7 -21
- package/lib/types/types/io.d.ts +39 -10
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/types/types/io.d.ts
CHANGED
|
@@ -252,30 +252,60 @@ export type AoRedelegateStakeParams = {
|
|
|
252
252
|
stakeQty: number | mARIOToken;
|
|
253
253
|
vaultId?: string;
|
|
254
254
|
};
|
|
255
|
-
export declare const validIntents:
|
|
256
|
-
export declare const intentsUsingYears:
|
|
255
|
+
export declare const validIntents: readonly ["Buy-Record", "Extend-Lease", "Increase-Undername-Limit", "Upgrade-Name", "Primary-Name-Request"];
|
|
256
|
+
export declare const intentsUsingYears: readonly ["Buy-Record", "Extend-Lease"];
|
|
257
257
|
export type Intent = (typeof validIntents)[number];
|
|
258
|
-
export declare const isValidIntent: (intent: string) => intent is
|
|
258
|
+
export declare const isValidIntent: (intent: string) => intent is "Buy-Record" | "Extend-Lease" | "Increase-Undername-Limit" | "Upgrade-Name" | "Primary-Name-Request";
|
|
259
259
|
export type AoTokenCostParams = {
|
|
260
260
|
intent: Intent;
|
|
261
261
|
type?: 'permabuy' | 'lease';
|
|
262
262
|
years?: number;
|
|
263
263
|
name: string;
|
|
264
264
|
quantity?: number;
|
|
265
|
+
fromAddress?: WalletAddress;
|
|
266
|
+
};
|
|
267
|
+
export declare const fundFromOptions: readonly ["balance", "stakes", "any"];
|
|
268
|
+
export type FundFrom = (typeof fundFromOptions)[number];
|
|
269
|
+
export declare const isValidFundFrom: (fundFrom: string) => fundFrom is "balance" | "stakes" | "any";
|
|
270
|
+
export type AoGetCostDetailsParams = AoTokenCostParams & {
|
|
271
|
+
fundFrom?: FundFrom;
|
|
272
|
+
};
|
|
273
|
+
export type AoFundingPlan = {
|
|
274
|
+
address: WalletAddress;
|
|
275
|
+
balance: number;
|
|
276
|
+
stakes: Record<WalletAddress, {
|
|
277
|
+
vaults: string[];
|
|
278
|
+
delegatedStake: number;
|
|
279
|
+
}>;
|
|
280
|
+
/** Any remaining shortfall will indicate an insufficient balance for the action */
|
|
281
|
+
shortfall: number;
|
|
282
|
+
};
|
|
283
|
+
export type CostDiscount = {
|
|
284
|
+
name: string;
|
|
285
|
+
discountTotal: number;
|
|
286
|
+
multiplier: number;
|
|
287
|
+
};
|
|
288
|
+
export type CostDetailsResult = {
|
|
289
|
+
tokenCost: number;
|
|
290
|
+
discounts: CostDiscount[];
|
|
291
|
+
fundingPlan?: AoFundingPlan;
|
|
265
292
|
};
|
|
266
293
|
export type AoGetVaultParams = {
|
|
267
294
|
address: WalletAddress;
|
|
268
295
|
vaultId: string;
|
|
269
296
|
};
|
|
270
|
-
export type
|
|
297
|
+
export type AoArNSPurchaseParams = AoArNSNameParams & {
|
|
298
|
+
fundFrom?: FundFrom;
|
|
299
|
+
};
|
|
300
|
+
export type AoBuyRecordParams = AoArNSPurchaseParams & {
|
|
271
301
|
years?: number;
|
|
272
302
|
type: 'lease' | 'permabuy';
|
|
273
303
|
processId: string;
|
|
274
304
|
};
|
|
275
|
-
export type AoExtendLeaseParams =
|
|
305
|
+
export type AoExtendLeaseParams = AoArNSPurchaseParams & {
|
|
276
306
|
years: number;
|
|
277
307
|
};
|
|
278
|
-
export type AoIncreaseUndernameLimitParams =
|
|
308
|
+
export type AoIncreaseUndernameLimitParams = AoArNSPurchaseParams & {
|
|
279
309
|
increaseCount: number;
|
|
280
310
|
};
|
|
281
311
|
export type AoGatewayRegistrySettings = {
|
|
@@ -353,6 +383,7 @@ export interface AoARIORead {
|
|
|
353
383
|
getObservations(epoch?: EpochInput): Promise<AoEpochObservationData>;
|
|
354
384
|
getDistributions(epoch?: EpochInput): Promise<AoEpochDistributionData>;
|
|
355
385
|
getTokenCost({ intent, type, years, name, quantity, }: AoTokenCostParams): Promise<number>;
|
|
386
|
+
getCostDetails({ intent, type, years, name, quantity, fundFrom, }: AoGetCostDetailsParams): Promise<CostDetailsResult>;
|
|
356
387
|
getRegistrationFees(): Promise<AoRegistrationFees>;
|
|
357
388
|
getDemandFactor(): Promise<number>;
|
|
358
389
|
getDemandFactorSettings(): Promise<DemandFactorSettings>;
|
|
@@ -406,16 +437,14 @@ export interface AoARIOWrite extends AoARIORead {
|
|
|
406
437
|
failedGateways: WalletAddress[];
|
|
407
438
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
408
439
|
buyRecord(params: AoBuyRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
409
|
-
upgradeRecord(params:
|
|
440
|
+
upgradeRecord(params: AoArNSPurchaseParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
410
441
|
extendLease(params: AoExtendLeaseParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
411
442
|
increaseUndernameLimit(params: AoIncreaseUndernameLimitParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
412
443
|
cancelWithdrawal(params: {
|
|
413
444
|
gatewayAddress?: WalletAddress;
|
|
414
445
|
vaultId: string;
|
|
415
446
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
416
|
-
requestPrimaryName(params:
|
|
417
|
-
name: string;
|
|
418
|
-
}): Promise<AoMessageResult>;
|
|
447
|
+
requestPrimaryName(params: AoArNSPurchaseParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
419
448
|
redelegateStake(params: AoRedelegateStakeParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
420
449
|
}
|
|
421
450
|
export declare function isProcessConfiguration(config: object): config is {
|
package/lib/types/version.d.ts
CHANGED