@ape.swap/bonds-sdk 3.0.93 → 3.0.95

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 CHANGED
@@ -22499,7 +22499,7 @@ const SoulZapTokenManager = {
22499
22499
  [types.ChainId.AVAX]: '0xC4dE46cBE21400dabE2E7c66E04F43acE4b5b910',
22500
22500
  [types.ChainId.BLAST]: '0xde9Eb844AD9e8B067309205707e2fFaA6a049cc0',
22501
22501
  [types.ChainId.BERACHAIN]: '0xcFd581f15433899d093ca1ADfc3aC13c37DBfbe7',
22502
- [types.ChainId.SONIC]: '0x70005da62e17041977f7f99f91098b125ccde1a7',
22502
+ [types.ChainId.SONIC]: '0x173E473b314506324E10aD54978d25E1F54bCa48',
22503
22503
  };
22504
22504
  const ACF_TO_ABOND = '0xEce2b9C3704632Ce760271B0b84E3A4A698Ca962';
22505
22505
  const LENS_CONTRACT = {
@@ -58353,7 +58353,7 @@ const stagingUrls = {
58353
58353
  };
58354
58354
  const useSDKConfig = (config) => {
58355
58355
  const urls = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls;
58356
- const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.3' });
58356
+ const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], hotBondChains: [types.ChainId.BSC, types.ChainId.MATIC], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.3' });
58357
58357
  const { data } = useQuery({
58358
58358
  queryKey: [QUERY_KEYS.SDK_CONFIG],
58359
58359
  initialData,
@@ -78675,7 +78675,7 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
78675
78675
  height: '30px',
78676
78676
  mb: ['10px', '10px', '10px', '0px'],
78677
78677
  justifyContent: ['space-between', 'space-between', 'space-between', 'flex-end'],
78678
- }, children: [jsx$2(Flex, { sx: { display: ['flex', 'flex', 'flex', 'none'] }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) }), jsx$2(Flex, { sx: { cursor: 'pointer' }, children: onDismiss ? (jsxs(Fragment$1, { children: [showProjectInfoButton && jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation }), jsx$2(Flex, { sx: { mx: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) }), jsx$2(Flex, { onClick: handleClose, children: jsx$2(Svg, { icon: "close", color: "text" }) })] })) : (jsx$2(Flex, { sx: { py: '3px', mt: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }), jsxs(Flex, { sx: { width: '100%' }, children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: (_b = bondData.showcaseTokenName) !== null && _b !== void 0 ? _b : bondData.earnToken.symbol, size: 50, chain: bondData.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, jsx$2(ListTag, { text: (_c = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _c === void 0 ? void 0 : _c[0] })] }), jsxs(Flex, { className: "title-container price-container", sx: { flexDirection: 'column', pl: '20px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), SDKConfig.useTiers ? (jsxs(Flex, { sx: {
78678
+ }, children: [jsx$2(Flex, { sx: { display: ['flex', 'flex', 'flex', 'none'] }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) }), jsx$2(Flex, { sx: { cursor: 'pointer' }, children: onDismiss ? (jsxs(Fragment$1, { children: [showProjectInfoButton && jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation }), jsx$2(Flex, { sx: { mx: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) }), jsx$2(Flex, { onClick: handleClose, children: jsx$2(Svg, { icon: "close", color: "text" }) })] })) : (jsx$2(Flex, { sx: { py: '3px', mt: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }), jsxs(Flex, { sx: { width: '100%' }, children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: (_b = bondData.showcaseTokenName) !== null && _b !== void 0 ? _b : bondData.earnToken.symbol, size: 50, chain: bondData.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, jsx$2(ListTag, { text: (_c = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _c === void 0 ? void 0 : _c[0] })] }), jsxs(Flex, { className: "title-container price-container", sx: { flexDirection: 'column', pl: '20px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), SDKConfig.useTiers && bondData.billVersion === types.BillVersion.V4 ? (jsxs(Flex, { sx: {
78679
78679
  p: '3px 6px',
78680
78680
  border: '1px solid var(--theme-ui-colors-primaryButton)',
78681
78681
  borderRadius: 'normal',
@@ -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, _k, _l;
79281
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
79282
79282
  const SDKConfig = useSDKConfig();
79283
79283
  // Hooks
79284
79284
  const userChainId = useChainId();
@@ -79322,10 +79322,7 @@ 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 = ((_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);
79325
+ const zapEnabled = supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId);
79329
79326
  const exceedsMaxBuy = maxBuy(bondData).lt(getPayoutAmount(bondData, depositAmount, userPoints !== null && userPoints !== void 0 ? userPoints : '0'));
79330
79327
  const exceedsBalance = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0').lt(inputValue);
79331
79328
  // Loading State
@@ -79351,7 +79348,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
79351
79348
  });
79352
79349
  };
79353
79350
  // Approve & Purchase Functions
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);
79351
+ const [approvalState, approveCallback] = useApproval(inputValue, inputToken !== null && inputToken !== void 0 ? inputToken : null, (_h = (isZap ? SoulZapTokenManager === null || SoulZapTokenManager === void 0 ? void 0 : SoulZapTokenManager[bondData === null || bondData === void 0 ? void 0 : bondData.chainId] : (_g = bondData === null || bondData === void 0 ? void 0 : bondData.contractAddress) === null || _g === void 0 ? void 0 : _g[bondData.chainId])) !== null && _h !== void 0 ? _h : null, account !== null && account !== void 0 ? account : null, (_j = bondData === null || bondData === void 0 ? void 0 : bondData.chainId) !== null && _j !== void 0 ? _j : null);
79355
79352
  const handleApprove = () => __awaiter$9(void 0, void 0, void 0, function* () {
79356
79353
  return approveCallback().then(() => {
79357
79354
  track({
@@ -80196,8 +80193,8 @@ const BondRowsByChain = ({ bonds, hideTitles }) => {
80196
80193
  return acc;
80197
80194
  }, {});
80198
80195
  return (jsx$2(Flex$1, { className: "bondrowsbychain", children: validatedChains === null || validatedChains === void 0 ? void 0 : validatedChains.map((chain) => {
80199
- var _a;
80200
- return (jsx$2(BondRowsWithTitle, { chain: chain, bonds: (_a = groupedBonds[chain]) !== null && _a !== void 0 ? _a : [], showHotBonds: hideTitles ? false : SDKConfig.useHotBonds ? chain === types.ChainId.BSC || chain === types.ChainId.ARBITRUM : false }, chain));
80196
+ var _a, _b;
80197
+ return (jsx$2(BondRowsWithTitle, { chain: chain, bonds: (_a = groupedBonds[chain]) !== null && _a !== void 0 ? _a : [], showHotBonds: hideTitles ? false : SDKConfig.useHotBonds ? (_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.hotBondChains) === null || _b === void 0 ? void 0 : _b.includes(chain) : false }, chain));
80201
80198
  }) }));
80202
80199
  };
80203
80200
 
@@ -1,6 +1,7 @@
1
1
  export interface SDKPropsDTO {
2
2
  referenceId: string;
3
3
  chains: number[];
4
+ hotBondChains?: number[];
4
5
  useRainbowKit?: boolean;
5
6
  useHotBonds?: boolean;
6
7
  useTiers?: boolean;
@@ -14,6 +15,7 @@ export interface SDKPropsDTO {
14
15
  export interface SDKProps {
15
16
  referenceId: string;
16
17
  chains: number[];
18
+ hotBondChains: number[];
17
19
  useRainbowKit: boolean;
18
20
  useHotBonds: boolean;
19
21
  useTiers: boolean;
@@ -21,7 +23,7 @@ export interface SDKProps {
21
23
  showLowValueBonds: boolean;
22
24
  bondPartner?: string;
23
25
  urls: Record<URLKeys, string>;
24
- theme: any;
26
+ theme?: any;
25
27
  highestCompatibleVersion?: string;
26
28
  }
27
29
  export declare const useSDKConfig: (config?: SDKPropsDTO) => SDKProps;
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": "3.0.93",
6
+ "version": "3.0.95",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",