@ape.swap/bonds-sdk 4.5.3 → 4.5.4-test.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.
@@ -17,12 +17,28 @@ export declare const getVestingTermsString: (bond?: BondsData | BillsConfig) =>
17
17
  export declare const getVestingTermsTooltipString: (bond?: BondsData | BillsConfig) => string | undefined;
18
18
  export declare const discountEarnTokenPrice: (bond: BondsData, useTiers?: boolean) => string;
19
19
  export declare const discountEarnTokenPriceForUser: (bond: BondsData, useTiers?: boolean, userTier?: LaunchBondTiers) => string;
20
- export declare const maxBuy: (bond?: BondsData, allowLowValueBonds?: boolean) => BigNumber;
20
+ export declare const SAFETY_THRESHOLD = 5;
21
+ export declare const getSafetyAvailable: (bond?: BondsData, allowLowValueBonds?: boolean) => BigNumber;
22
+ export declare const getSafetyPurchaseLimit: (bond?: BondsData, allowLowValueBonds?: boolean) => BigNumber;
23
+ export declare const getMaxBuy: (bond?: BondsData, allowLowValueBonds?: boolean) => BigNumber;
21
24
  export declare function formatNumber(input: string): string;
22
25
  export declare function formatUSDNumber(input: string): string;
23
26
  export declare const youSpendUSD: (bond: BondsData, inputValue: string) => string;
24
- export declare const getPayoutAmount: (bond?: BondsData, inputValue?: string, userPoints?: string) => number;
25
- export declare const youGetUSD: (bond: BondsData, inputValue: string, userPoints: string) => string;
27
+ export declare const getPayoutAmount: (bond?: BondsData, inputValue?: string, userPoints?: string | null) => number;
28
+ export declare const youGetUSD: (bond?: BondsData, inputValue?: string, userPoints?: string) => number;
29
+ export declare const getRawPayoutAmount: (bond?: BondsData, inputValue?: string, userPoints?: string | null) => number;
26
30
  export declare const getRawBonus: (bond?: BondsData, inputValue?: string, userPoints?: string) => string;
27
31
  export declare const getFeeAmount: (bond?: BondsData, inputValue?: string, userPoints?: string) => number;
28
32
  export declare const getBonusColor: (premiumString: string) => string;
33
+ /**
34
+ * Calculates the principal token amount needed to receive a target payout amount.
35
+ * This is the reverse of getRawPayoutAmount function (does NOT include fees).
36
+ *
37
+ * @param bond - The bond data
38
+ * @param targetPayoutAmount - The desired payout amount in payout tokens
39
+ * @param userPoints - User's tier points
40
+ * @returns The principal token amount needed, or '0' if calculation cannot be performed
41
+ */
42
+ export declare const getPrincipalAmount: (bond?: BondsData, targetPayoutAmount?: number | string, userPoints?: string | null) => BigNumber;
43
+ export declare const getRemainingTokensString: (bond: BondsData, allowLowValueBonds?: boolean) => string;
44
+ export declare const remainingPercentage: (bond: BondsData) => number;
@@ -1,3 +1,3 @@
1
1
  export declare const localeFormat: (number: number, precision?: number) => string;
2
- export declare const formatNumberSI: (num?: number | string, digits?: number) => string;
2
+ export declare const formatNumberSI: (num?: number | string | BigNumber, digits?: number) => string;
3
3
  export declare const formatUSDNumber: (input: string | number) => string;
@@ -10,7 +10,7 @@ export interface TimeLeft {
10
10
  minutes: number;
11
11
  seconds: number;
12
12
  }
13
- export declare const getTimePeriods: (seconds: number, days?: boolean) => TimeLeft;
13
+ export declare const getTimePeriods: (seconds?: number, days?: boolean) => TimeLeft;
14
14
  /**
15
15
  * formatTimeLeft receives a number in seconds and returns a human-understandable string
16
16
  *
@@ -3,12 +3,9 @@ import { SortOptions } from './Bonds';
3
3
  import { BillsConfig } from '@ape.swap/apeswap-lists';
4
4
  export declare const isBondSoldOut: (bill: BondsData, showLowValueBonds?: boolean) => boolean;
5
5
  export declare const sortBonds: (sortConfig?: SortOptions, bonds?: BondsData[]) => BondsData[];
6
- export declare const vestingTime: (vestingTerm?: number) => import("../../utils/getTimePeriods").TimeLeft;
7
- export declare const remainingPercentage: (bond: BondsData) => number;
8
6
  export declare const getDiscountColor: (discount?: number) => string;
9
7
  export declare const calculateARR: (bond: BondsData | BillsConfig, useTiers: boolean) => string;
10
8
  export declare const isBondSupported: (SDKVersion: string, bondVersion: string) => boolean;
11
- export declare const getRemainingTokensString: (bond: BondsData | BillsConfig) => string;
12
9
  /**
13
10
  * Finds the highest TrueBondPrices element where userPoints is higher than points in the array.
14
11
  * @param userPoints - The user's points as a string representing a BigNumber.
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BondsData } from '../../../../types/bonds';
3
- declare const BondCards: ({ bondData }: {
3
+ declare const BondCards: ({ bondData, isDoingMaxBuy }: {
4
4
  bondData: BondsData;
5
+ isDoingMaxBuy?: boolean;
5
6
  }) => React.JSX.Element;
6
7
  export default BondCards;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "4.5.3",
6
+ "version": "4.5.4-test.1",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",