@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.
@@ -252,16 +252,43 @@ export type AoRedelegateStakeParams = {
252
252
  stakeQty: number | mARIOToken;
253
253
  vaultId?: string;
254
254
  };
255
- export declare const validIntents: string[];
256
- export declare const intentsUsingYears: string[];
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 string;
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>;
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "3.0.0";
16
+ export declare const version = "3.0.1-alpha.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "3.0.1-alpha.1",
3
+ "version": "3.1.0-alpha.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"