@ape.swap/bonds-sdk 4.0.0-test.31 → 4.0.0-test.33
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/dist/main.js +5 -11
- package/dist/state/tiers/useTierPoints.d.ts +0 -10
- package/dist/utils/numbers.d.ts +0 -4
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -63244,6 +63244,7 @@ const PUBLIC_RPC_URLS = {
|
|
|
63244
63244
|
[types$1.ChainId.ARBITRUM]: ['https://arb1.arbitrum.io/rpc'],
|
|
63245
63245
|
[types$1.ChainId.BSC_TESTNET]: ['https://data-seed-prebsc-2-s3.binance.org:8545/'],
|
|
63246
63246
|
[types$1.ChainId.MATIC]: [
|
|
63247
|
+
'https://polygon.drpc.org',
|
|
63247
63248
|
'https://polygon-mainnet.public.blastapi.io/',
|
|
63248
63249
|
'https://polygon-rpc.com/',
|
|
63249
63250
|
'https://rpc-mainnet.matic.network',
|
|
@@ -63422,16 +63423,6 @@ function reportError(_a) {
|
|
|
63422
63423
|
});
|
|
63423
63424
|
}
|
|
63424
63425
|
|
|
63425
|
-
/**
|
|
63426
|
-
* @deprecated This map is deprecated. Boost values are now being retrieved from the Realtime API.
|
|
63427
|
-
*/
|
|
63428
|
-
({
|
|
63429
|
-
[types$1.LaunchBondTiers.Bronze]: '+1%',
|
|
63430
|
-
[types$1.LaunchBondTiers.Silver]: '+2%',
|
|
63431
|
-
[types$1.LaunchBondTiers.Gold]: '+3%',
|
|
63432
|
-
[types$1.LaunchBondTiers.Diamond]: '+4%',
|
|
63433
|
-
[types$1.LaunchBondTiers.Legend]: '+5%',
|
|
63434
|
-
});
|
|
63435
63426
|
const TIERS_COLORS = {
|
|
63436
63427
|
[types$1.LaunchBondTiers.Bronze]: 'linear-gradient(90deg, #473129 0%, #33231D 100%)',
|
|
63437
63428
|
[types$1.LaunchBondTiers.Silver]: 'linear-gradient(90deg, #3A3A3C 0%, #2C2C2F 100%)',
|
|
@@ -77274,6 +77265,7 @@ const YourSolanaBondsModal = ({ onDismiss, userBill }) => {
|
|
|
77274
77265
|
var _a, _b, _c, _d, _e, _f;
|
|
77275
77266
|
return getBalanceNumber(new BigNumber$1((_a = userBill === null || userBill === void 0 ? void 0 : userBill.payout) !== null && _a !== void 0 ? _a : 0), (_f = (_d = (_c = (_b = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _b === void 0 ? void 0 : _b.earnToken) === null || _c === void 0 ? void 0 : _c.decimals) === null || _d === void 0 ? void 0 : _d[(_e = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _e === void 0 ? void 0 : _e.chainId]) !== null && _f !== void 0 ? _f : 18);
|
|
77276
77267
|
};
|
|
77268
|
+
console.log(totalPending(userBill));
|
|
77277
77269
|
const claimable = (userBill) => {
|
|
77278
77270
|
var _a, _b, _c, _d, _e, _f;
|
|
77279
77271
|
return getBalanceNumber(new BigNumber$1((_a = userBill === null || userBill === void 0 ? void 0 : userBill.pendingRewards) !== null && _a !== void 0 ? _a : '0'), (_f = (_d = (_c = (_b = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _b === void 0 ? void 0 : _b.earnToken) === null || _c === void 0 ? void 0 : _c.decimals) === null || _d === void 0 ? void 0 : _d[(_e = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _e === void 0 ? void 0 : _e.chainId]) !== null && _f !== void 0 ? _f : 18);
|
|
@@ -82925,7 +82917,8 @@ function calculateTrueBondPrice(bondPricing, bondTerm, currentTimestamp, princip
|
|
|
82925
82917
|
const price = numerator.dividedBy(principalDecimalsMultiplier).dividedBy(e18);
|
|
82926
82918
|
// Apply minimum debt floor
|
|
82927
82919
|
const priceToUse = price.lt(minimumDebt) ? minimumDebt : price;
|
|
82928
|
-
const
|
|
82920
|
+
const feeToUse = feeInPrincipal * 2; // HOTFIX!!!!!!!
|
|
82921
|
+
const reverseFee = new BigNumber$1(feeToUse / 100 / (1 - feeToUse / 100));
|
|
82929
82922
|
return new BigNumber$1(priceToUse).plus(new BigNumber$1(priceToUse).times(reverseFee)).toFixed(0);
|
|
82930
82923
|
}
|
|
82931
82924
|
catch (error) {
|
|
@@ -85509,6 +85502,7 @@ const Estimations = ({ depositAmount, bondData, youSpendString, isZap, fetchingZ
|
|
|
85509
85502
|
const estimatedOutputUSD = estimatedOutputAmount * parseFloat((_b = bondData === null || bondData === void 0 ? void 0 : bondData.payoutTokenPrice) !== null && _b !== void 0 ? _b : '0');
|
|
85510
85503
|
const noTierAmount = getRawBonus$1(bondData, depositAmount, '0');
|
|
85511
85504
|
const boostAmount = parseFloat(bonusString) - parseFloat(noTierAmount);
|
|
85505
|
+
console.log(estimatedOutputAmount);
|
|
85512
85506
|
return (jsxs(Flex, { className: "modaltable-container text-container", children: [jsxs(Flex, { className: "text-container row", children: [jsx$2(Flex, { className: "row-container spend", children: "You Spend:" }), jsx$2(Flex, { className: "row-container spend-val", children: youSpendString })] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Bonus:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val ${getBonusColor(bonusString)}`, children: ["$ ", formatNumberSI(bonusString)] }))] }), (trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.points) !== '0' && userTier !== undefined && userPoints && SDKConfig.useTiers && (jsxs(Flex, { className: "text-container row", sx: {
|
|
85513
85507
|
border: '1px solid var(--theme-ui-colors-primaryButton)',
|
|
85514
85508
|
borderRadius: 'normal',
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated This map is deprecated. Boost values are now being retrieved from the Realtime API.
|
|
4
|
-
*/
|
|
5
|
-
export declare const boostMap: {
|
|
6
|
-
0: string;
|
|
7
|
-
1: string;
|
|
8
|
-
2: string;
|
|
9
|
-
3: string;
|
|
10
|
-
4: string;
|
|
11
|
-
};
|
|
12
2
|
export declare const TIERS_COLORS: {
|
|
13
3
|
0: string;
|
|
14
4
|
1: string;
|
package/dist/utils/numbers.d.ts
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
1
|
export declare const isNumber: (s: string) => boolean;
|
|
2
|
-
export declare const floorFormatter: (n: number) => string;
|
|
3
|
-
export declare const volumeFormatter: (n: number) => string;
|
|
4
|
-
export declare const quantityFormatter: (n: number) => string;
|
|
5
|
-
export declare const roundWholePercentage: (n: number) => string;
|