@ar.io/sdk 3.0.1-alpha.1 → 3.1.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 +38 -0
- package/bundles/web.bundle.min.js +64 -64
- package/lib/cjs/cli/cli.js +8 -2
- package/lib/cjs/cli/commands/readCommands.js +22 -22
- package/lib/cjs/cli/options.js +6 -0
- package/lib/cjs/cli/utils.js +21 -1
- package/lib/cjs/common/contracts/ao-process.js +7 -3
- package/lib/cjs/common/io.js +47 -1
- package/lib/cjs/types/io.js +6 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/cli.js +9 -3
- package/lib/esm/cli/commands/readCommands.js +21 -22
- package/lib/esm/cli/options.js +6 -0
- package/lib/esm/cli/utils.js +20 -1
- package/lib/esm/common/contracts/ao-process.js +7 -3
- package/lib/esm/common/io.js +47 -1
- package/lib/esm/types/io.js +4 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/readCommands.d.ts +24 -2
- package/lib/types/cli/options.d.ts +4 -0
- package/lib/types/cli/utils.d.ts +9 -1
- package/lib/types/common/contracts/ao-process.d.ts +2 -1
- package/lib/types/common/io.d.ts +2 -1
- package/lib/types/types/io.d.ts +31 -3
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/types/types/io.d.ts
CHANGED
|
@@ -252,16 +252,43 @@ 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;
|
|
@@ -353,6 +380,7 @@ export interface AoARIORead {
|
|
|
353
380
|
getObservations(epoch?: EpochInput): Promise<AoEpochObservationData>;
|
|
354
381
|
getDistributions(epoch?: EpochInput): Promise<AoEpochDistributionData>;
|
|
355
382
|
getTokenCost({ intent, type, years, name, quantity, }: AoTokenCostParams): Promise<number>;
|
|
383
|
+
getCostDetails({ intent, type, years, name, quantity, fundFrom, }: AoGetCostDetailsParams): Promise<CostDetailsResult>;
|
|
356
384
|
getRegistrationFees(): Promise<AoRegistrationFees>;
|
|
357
385
|
getDemandFactor(): Promise<number>;
|
|
358
386
|
getDemandFactorSettings(): Promise<DemandFactorSettings>;
|
package/lib/types/version.d.ts
CHANGED