@ape.swap/bonds-sdk 4.7.0-test.3 → 5.0.0

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.
@@ -4,4 +4,5 @@ export declare const MAINNET_CHAINS: ChainId[];
4
4
  export declare const TESTNET_CHAINS: ChainId[];
5
5
  export declare const NETWORK_ICONS: Partial<Record<number, icons>>;
6
6
  export declare const NETWORK_LABEL: Record<number, string>;
7
+ export declare const SHORT_NETWORK_LABEL: Record<number, string>;
7
8
  export declare const BLOCK_EXPLORER: Record<number, string>;
package/dist/main.js CHANGED
@@ -49460,6 +49460,28 @@ const NETWORK_LABEL = {
49460
49460
  [main.ChainId.MEGAETH_TESTNET]: 'MegaETH Testnet',
49461
49461
  [main.ChainId.HYPEREVM]: 'HyperEVM',
49462
49462
  };
49463
+ const SHORT_NETWORK_LABEL = {
49464
+ [main.ChainId.BSC]: 'BNB',
49465
+ [main.ChainId.MATIC]: 'Pol',
49466
+ [main.ChainId.MAINNET]: 'Eth',
49467
+ [main.ChainId.TLOS]: 'Telo',
49468
+ [main.ChainId.ARBITRUM]: 'Arb',
49469
+ [main.ChainId.LINEA]: 'Line',
49470
+ [main.ChainId.LIGHTLINK]: 'Ligh',
49471
+ [main.ChainId.IOTA]: 'Iota',
49472
+ [main.ChainId.BASE]: 'Base',
49473
+ [main.ChainId.GRAPHLINQ]: 'Grap',
49474
+ [main.ChainId.AVAX]: 'Avax',
49475
+ [main.ChainId.BLAST]: 'Bla',
49476
+ [main.ChainId.CROSSFI]: 'Cro',
49477
+ [main.ChainId.MONAD]: 'Mona',
49478
+ [main.ChainId.SONIC]: 'Son',
49479
+ [main.ChainId.BERACHAIN]: 'Bera',
49480
+ [main.ChainId.SOL]: 'Sol',
49481
+ [main.ChainId.KATANA]: 'Kat',
49482
+ [main.ChainId.UNICHAIN]: 'Unic',
49483
+ [main.ChainId.HYPEREVM]: 'Hyp',
49484
+ };
49463
49485
  // Network block explorers
49464
49486
  const BLOCK_EXPLORER = {
49465
49487
  [main.ChainId.MAINNET]: 'https://etherscan.io',
@@ -64304,15 +64326,7 @@ const Estimations = ({ depositAmount, bondData, youSpendString, isZap, fetchingZ
64304
64326
  background: '#9960C5',
64305
64327
  opacity: 0.2,
64306
64328
  borderRadius: 'normal',
64307
- } }), jsxs(Flex, { className: "row-container premium", sx: { zIndex: 1 }, children: [jsx$2("img", { src: `https://ape.bond/images/launch/${tierName === null || tierName === void 0 ? void 0 : tierName.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { color: 'success', mr: '3px', fontWeight: 700 }, children: `+${(_b = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _b !== void 0 ? _b : 0}%` }), "Boost:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Boost }), 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" }) }) }), userTier !== main.LaunchBondTiers.Mythical && (jsx$2(Flex, { sx: {
64308
- ml: '5px',
64309
- color: 'primaryButton',
64310
- fontWeight: 500,
64311
- cursor: 'pointer',
64312
- ':hover': { textDecoration: 'underline' },
64313
- }, onClick: () => {
64314
- window.open('https://ape.bond/true-yield', '_blank');
64315
- }, children: 'Upgrade your Tier >' }))] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val premium-positive`, children: ["$ ", formatNumberSI(boostAmount)] }))] })), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You Get (over ", getTimePeriods(bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm, true).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumberSI(estimatedOutputAmount, 4), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatNumberSI(estimatedOutputUSD, 2)] }))] })] }));
64329
+ } }), jsxs(Flex, { className: "row-container premium", sx: { zIndex: 1 }, children: [jsx$2("img", { src: `https://ape.bond/images/launch/${tierName === null || tierName === void 0 ? void 0 : tierName.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { color: 'success', mr: '3px', fontWeight: 700 }, children: `+${(_b = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _b !== void 0 ? _b : 0}%` }), "Boost:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Boost }), 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 premium-positive`, children: ["$ ", formatNumberSI(boostAmount)] }))] })), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You Get (over ", getTimePeriods(bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm, true).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumberSI(estimatedOutputAmount, 4), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatNumberSI(estimatedOutputUSD, 2)] }))] })] }));
64316
64330
  };
64317
64331
 
64318
64332
  const ProjectDescription = ({ description, isProjectView }) => {
@@ -65080,29 +65094,29 @@ const BuyComponent = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond,
65080
65094
  mt: '10px',
65081
65095
  borderRadius: 'normal',
65082
65096
  p: '2px 10px',
65083
- }, children: jsx$2(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 }) }) })), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (jsx$2(Flex, { className: "button-container get", children: jsx$2(Button, { className: "action-button", onClick: () => (LifiSupported.includes(bondChain) ? onOpenLifiModal() : openExternal()), variant: "secondary", fullWidth: true, sx: { fontSize: ['14px', '14px', '14px', '16px'], height: '100%' }, children: LifiSupported.includes(bondChain)
65084
- ? `Swap & Bridge`
65085
- : `Get ${getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, bondData === null || bondData === void 0 ? void 0 : bondData.chainId)}` }) })), 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 ||
65086
- (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
65087
- !account ||
65088
- !inputValue ||
65089
- parseFloat(inputValue) === 0 ||
65090
- fetchingZapQuote ||
65091
- zapError ||
65092
- exceedsRealMaxBuy ||
65093
- exceedsBalance ||
65094
- (isZap && !zapData) ||
65095
- SDKConfig.blockSales, onClick: handleOpenModal, sx: { fontSize: ['14px', '14px', '14px', '16px'] }, children: SDKConfig.blockSales
65096
- ? 'Complete KYC to Buy'
65097
- : exceedsRealMaxBuy
65098
- ? 'Exceeds Max Buy. Reduce amount'
65099
- : exceedsBalance
65100
- ? 'Exceeds balance'
65101
- : zapError
65102
- ? 'something went wrong'
65103
- : !inputValue || parseFloat(inputValue) === 0
65104
- ? 'Insert amount'
65105
- : `buy` })) })] })] }) })) : (jsx$2(Fragment$1, {}));
65097
+ }, children: jsx$2(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 }) }) })), jsx$2(Flex, { className: "modaltable-container button-container", children: jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : (jsxs(Flex, { sx: { width: '100%', gap: '10px', flexDirection: ['column', 'column', 'column', 'row'] }, children: [jsx$2(Button, { variant: "secondary", onClick: () => (LifiSupported.includes(bondChain) ? onOpenLifiModal() : openExternal()), sx: { width: ['100%', '100%', '100%', '35%'], fontSize: ['14px', '14px', '14px', '16px'] }, children: LifiSupported.includes(bondChain)
65098
+ ? `Bridge to ${SHORT_NETWORK_LABEL[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]}`
65099
+ : `Get ${getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, bondData === null || bondData === void 0 ? void 0 : bondData.chainId)}` }), isUserRestricted ? (jsx$2(Button, { className: "action-button", disabled: true, children: "INSUFFICIENT TIER" })) : (jsx$2(Button, { className: "action-button", load: load || fetchingZapQuote, disabled: load ||
65100
+ (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
65101
+ !account ||
65102
+ !inputValue ||
65103
+ parseFloat(inputValue) === 0 ||
65104
+ fetchingZapQuote ||
65105
+ zapError ||
65106
+ exceedsRealMaxBuy ||
65107
+ exceedsBalance ||
65108
+ (isZap && !zapData) ||
65109
+ SDKConfig.blockSales, onClick: handleOpenModal, sx: { fontSize: ['14px', '14px', '14px', '16px'] }, children: SDKConfig.blockSales
65110
+ ? 'Complete KYC to Buy'
65111
+ : exceedsRealMaxBuy
65112
+ ? 'Exceeds Max Buy. Reduce amount'
65113
+ : exceedsBalance
65114
+ ? 'Exceeds balance'
65115
+ : zapError
65116
+ ? 'something went wrong'
65117
+ : !inputValue || parseFloat(inputValue) === 0
65118
+ ? 'Insert amount'
65119
+ : `buy` })), ' '] })) }) })] }) })) : (jsx$2(Fragment$1, {}));
65106
65120
  };
65107
65121
 
65108
65122
  var __defProp = Object.defineProperty;
@@ -66553,7 +66567,7 @@ const BuyComponentSolana = ({ onDismiss, bondAddress, bondChain, isProjectView,
66553
66567
  }
66554
66568
  };
66555
66569
  // Modals
66556
- const [onOpenLifiModal] = useModal(jsx$2(LifiModal, { bondChain: 1151111081099710, principalToken: (_g = (_f = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _f === void 0 ? void 0 : _f.address) === null || _g === void 0 ? void 0 : _g[bondData === null || bondData === void 0 ? void 0 : bondData.chainId] }));
66570
+ const [onOpenLifiModal] = useModal(jsx$2(LifiModal, { bondChain: 1151111081099710, principalToken: (_g = (_f = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _f === void 0 ? void 0 : _f.address) === null || _g === void 0 ? void 0 : _g[bondData === null || bondData === void 0 ? void 0 : bondData.chainId] }), true, false, 'LifiModal');
66557
66571
  const [openNoBonusModal] = useModal(jsx$2(NoBonusModal, { onAcknowledge: handleBothPurchases, showcaseTokenName: bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName }), true, true, 'NoBonusModal');
66558
66572
  // Effects
66559
66573
  const [hasChecked, setHasChecked] = useState(false);
@@ -66573,7 +66587,7 @@ const BuyComponentSolana = ({ onDismiss, bondAddress, bondChain, isProjectView,
66573
66587
  mt: '10px',
66574
66588
  borderRadius: 'normal',
66575
66589
  p: '2px 10px',
66576
- }, 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) === main.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" }) }))] }) })), jsx$2(Flex, { className: "modaltable-container button-container", children: jsx$2(Flex, { className: "button-container buy", children: !accountSolana ? (jsx$2(ConnectSolanaWallet, {})) : (jsxs(Flex, { sx: { width: '100%', gap: '10px', flexDirection: ['column', 'column', 'column', 'row'] }, children: [jsx$2(Button, { variant: "secondary", onClick: () => onOpenLifiModal(), sx: { width: ['100%', '100%', '100%', '35%'], fontSize: ['14px', '14px', '14px', '16px'] }, children: "swap & bridge" }), jsx$2(Button, { className: "action-button", load: load, disabled: load ||
66590
+ }, 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) === main.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" }) }))] }) })), jsx$2(Flex, { className: "modaltable-container button-container", children: jsx$2(Flex, { className: "button-container buy", children: !accountSolana ? (jsx$2(ConnectSolanaWallet, {})) : (jsxs(Flex, { sx: { width: '100%', gap: '10px', flexDirection: ['column', 'column', 'column', 'row'] }, children: [jsx$2(Button, { variant: "secondary", onClick: () => onOpenLifiModal(), sx: { width: ['100%', '100%', '100%', '35%'], fontSize: ['14px', '14px', '14px', '16px'] }, children: "bridge to sol" }), jsx$2(Button, { className: "action-button", load: load, disabled: load ||
66577
66591
  (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
66578
66592
  !accountSolana ||
66579
66593
  !inputValue ||
package/dist/styles.css CHANGED
@@ -453,18 +453,6 @@
453
453
  justify-content: space-between;
454
454
  }
455
455
 
456
- .button-container.get {
457
- justify-content: center;
458
- align-items: center;
459
- cursor: pointer;
460
- width: 45%;
461
- min-width: 110px;
462
- }
463
- .button-container.get .action-button {
464
- margin-right: 10px;
465
- padding: 9px 5px;
466
- }
467
-
468
456
  .button-container.buy {
469
457
  justify-content: center;
470
458
  align-items: center;
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.7.0-test.3",
6
+ "version": "5.0.0",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",