@ape.swap/bonds-sdk 3.0.92 → 3.0.93
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 +8 -5
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -79278,7 +79278,7 @@ const TransactionModal = ({ onDismiss, txChain, approvalState, approveCallback,
|
|
|
79278
79278
|
};
|
|
79279
79279
|
|
|
79280
79280
|
const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isProjectView }) => {
|
|
79281
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
79281
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
79282
79282
|
const SDKConfig = useSDKConfig();
|
|
79283
79283
|
// Hooks
|
|
79284
79284
|
const userChainId = useChainId();
|
|
@@ -79322,7 +79322,10 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
79322
79322
|
$${formatUSDNumber((parseFloat(inputValue) * (inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0)).toString())}`;
|
|
79323
79323
|
// Validations
|
|
79324
79324
|
const isGoldRush = ((_f = bondData === null || bondData === void 0 ? void 0 : bondData.billArt) === null || _f === void 0 ? void 0 : _f.collection) === types.BillArtCollection.GoldenTicket_Collection1;
|
|
79325
|
-
const zapEnabled =
|
|
79325
|
+
const zapEnabled = ((_h = (_g = bondData === null || bondData === void 0 ? void 0 : bondData.contractAddress) === null || _g === void 0 ? void 0 : _g[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) === null || _h === void 0 ? void 0 : _h.toLowerCase()) ===
|
|
79326
|
+
'0x355ff1Ae557F4D620e1e1e5fac98a8dE03D5e9bC'.toLowerCase()
|
|
79327
|
+
? false
|
|
79328
|
+
: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId);
|
|
79326
79329
|
const exceedsMaxBuy = maxBuy(bondData).lt(getPayoutAmount(bondData, depositAmount, userPoints !== null && userPoints !== void 0 ? userPoints : '0'));
|
|
79327
79330
|
const exceedsBalance = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0').lt(inputValue);
|
|
79328
79331
|
// Loading State
|
|
@@ -79348,7 +79351,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
79348
79351
|
});
|
|
79349
79352
|
};
|
|
79350
79353
|
// Approve & Purchase Functions
|
|
79351
|
-
const [approvalState, approveCallback] = useApproval(inputValue, inputToken !== null && inputToken !== void 0 ? inputToken : null, (
|
|
79354
|
+
const [approvalState, approveCallback] = useApproval(inputValue, inputToken !== null && inputToken !== void 0 ? inputToken : null, (_k = (isZap ? SoulZapTokenManager === null || SoulZapTokenManager === void 0 ? void 0 : SoulZapTokenManager[bondData === null || bondData === void 0 ? void 0 : bondData.chainId] : (_j = bondData === null || bondData === void 0 ? void 0 : bondData.contractAddress) === null || _j === void 0 ? void 0 : _j[bondData.chainId])) !== null && _k !== void 0 ? _k : null, account !== null && account !== void 0 ? account : null, (_l = bondData === null || bondData === void 0 ? void 0 : bondData.chainId) !== null && _l !== void 0 ? _l : null);
|
|
79352
79355
|
const handleApprove = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
79353
79356
|
return approveCallback().then(() => {
|
|
79354
79357
|
track({
|
|
@@ -79551,11 +79554,11 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
79551
79554
|
mt: '10px',
|
|
79552
79555
|
borderRadius: 'normal',
|
|
79553
79556
|
p: '2px 10px',
|
|
79554
|
-
}, children: jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400, display: 'flex', alignItems: 'center', gap: '10px' }, children: [jsx$2(SafeHTMLComponent, { html: bondData === null || bondData === void 0 ? void 0 : bondData.warningCard }), (bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === types.ChainId.SONIC && (bondData === null || bondData === void 0 ? void 0 : bondData.earnToken.symbol.toLowerCase()) === 'moon' && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Open the 'cog' icon menu in the top right and set the Slippage Tolerance to 5% or more." }), width: "315px", placement: "topRight", transformTip: "translate(9%, -10%)", children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) }))] }) })), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (jsx$2(Flex, { className: "button-container get", children: jsx$2(Button, { className: "action-button", onClick: () => bondData.billVersion === types.BillVersion.V4 && SDKConfig.useTiers
|
|
79557
|
+
}, children: jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400, display: 'flex', alignItems: 'center', gap: '10px' }, children: [jsx$2(SafeHTMLComponent, { html: bondData === null || bondData === void 0 ? void 0 : bondData.warningCard }), (bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === types.ChainId.SONIC && (bondData === null || bondData === void 0 ? void 0 : bondData.earnToken.symbol.toLowerCase()) === 'moon' && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Open the 'cog' icon menu in the top right and set the Slippage Tolerance to 5% or more." }), width: "315px", placement: "topRight", transformTip: "translate(9%, -10%)", children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) }))] }) })), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (jsx$2(Flex, { className: "button-container get", children: jsx$2(Button, { className: "action-button", onClick: () => bondData.billVersion === types.BillVersion.V4 && SDKConfig.useTiers && zapEnabled
|
|
79555
79558
|
? window.open('http://ape.bond/tier-staking', '_blank')
|
|
79556
79559
|
: zapEnabled
|
|
79557
79560
|
? handleOpenZapModal()
|
|
79558
|
-
: openExternal(), variant: "secondary", fullWidth: true, children: bondData.billVersion === types.BillVersion.V4 && SDKConfig.useTiers
|
|
79561
|
+
: openExternal(), variant: "secondary", fullWidth: true, children: bondData.billVersion === types.BillVersion.V4 && SDKConfig.useTiers && zapEnabled
|
|
79559
79562
|
? `Get ${!isMobile ? 'your' : ''} Tier`
|
|
79560
79563
|
: `Get ${getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)}` }) })), jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : isUserRestricted ? (jsx$2(Button, { className: "action-button", disabled: true, children: "INSUFFICIENT TIER" })) : (jsx$2(Button, { className: "action-button", load: load || fetchingZapQuote, disabled: load ||
|
|
79561
79564
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|