@ape.swap/bonds-sdk 3.0.23 → 3.0.25

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.
@@ -1,6 +1,7 @@
1
1
  import { icons } from '../../components/uikit-sdk/Svg/types';
2
2
  import { ChainId } from '@ape.swap/apeswap-lists';
3
3
  export declare const MAINNET_CHAINS: ChainId[];
4
+ export declare const TESTNET_CHAINS: ChainId[];
4
5
  export declare const NETWORK_ICONS: Partial<Record<number, icons>>;
5
6
  export declare const NETWORK_LABEL: Record<number, string>;
6
7
  export declare const BLOCK_EXPLORER: Record<number, string>;
package/dist/main.js CHANGED
@@ -17904,8 +17904,10 @@ var types = {};
17904
17904
  exports.defaultBillArtCollection =
17905
17905
  exports.BillArtCollection =
17906
17906
  exports.BillVersion =
17907
- exports.Wrappers =
17908
17907
  exports.Protocols =
17908
+ exports.ProtocolsWithWrapper =
17909
+ exports.Wrappers =
17910
+ exports.PriceApiProtocols =
17909
17911
  exports.ZapVersion =
17910
17912
  exports.IchiSupportedDex =
17911
17913
  exports.LiquidityDex =
@@ -17988,6 +17990,8 @@ var types = {};
17988
17990
  LiquidityDex['Synthswap'] = 'Synthswap';
17989
17991
  LiquidityDex['Aerodrome'] = 'Aerodrome';
17990
17992
  LiquidityDex['SmarDex'] = 'SmarDex';
17993
+ LiquidityDex['TrebleSwapV2'] = 'TrebleSwap V2';
17994
+ LiquidityDex['TrebleAlgebraIntegral'] = 'Treble Algebra Integral';
17991
17995
  //IOTA
17992
17996
  LiquidityDex['MagicSea'] = 'MagicSea';
17993
17997
  //ARBITRUM
@@ -18043,6 +18047,29 @@ var types = {};
18043
18047
  ZapVersion['SoulZap'] = 'SoulZap';
18044
18048
  ZapVersion['SoulZapApi'] = 'SoulZapApi';
18045
18049
  })((ZapVersion = exports.ZapVersion || (exports.ZapVersion = {})));
18050
+ //Price API Protocols
18051
+ var PriceApiProtocols
18052
+ ;(function (PriceApiProtocols) {
18053
+ PriceApiProtocols[(PriceApiProtocols['UniV2'] = 0)] = 'UniV2';
18054
+ PriceApiProtocols[(PriceApiProtocols['UniV3'] = 1)] = 'UniV3';
18055
+ PriceApiProtocols[(PriceApiProtocols['UniV4'] = 2)] = 'UniV4';
18056
+ PriceApiProtocols[(PriceApiProtocols['Algebra'] = 3)] = 'Algebra';
18057
+ PriceApiProtocols[(PriceApiProtocols['AlgebraIntegral'] = 4)] = 'AlgebraIntegral';
18058
+ PriceApiProtocols[(PriceApiProtocols['Solidly'] = 5)] = 'Solidly';
18059
+ PriceApiProtocols[(PriceApiProtocols['Curve'] = 6)] = 'Curve';
18060
+ })((PriceApiProtocols = exports.PriceApiProtocols || (exports.PriceApiProtocols = {})));
18061
+ (function (Wrappers) {
18062
+ Wrappers[(Wrappers['Gamma'] = 0)] = 'Gamma';
18063
+ Wrappers[(Wrappers['Ichi'] = 1)] = 'Ichi';
18064
+ Wrappers[(Wrappers['Steer'] = 2)] = 'Steer';
18065
+ })((exports.Wrappers || (exports.Wrappers = {})));
18066
+ exports.ProtocolsWithWrapper = [
18067
+ PriceApiProtocols.UniV3,
18068
+ PriceApiProtocols.UniV4,
18069
+ PriceApiProtocols.Algebra,
18070
+ PriceApiProtocols.AlgebraIntegral,
18071
+ ];
18072
+ //Protocols
18046
18073
  var Protocols
18047
18074
  ;(function (Protocols) {
18048
18075
  Protocols[(Protocols['Both'] = 1)] = 'Both';
@@ -18056,11 +18083,6 @@ var types = {};
18056
18083
  Protocols[(Protocols['Curve'] = 9)] = 'Curve';
18057
18084
  Protocols[(Protocols['AlgebraIntegral'] = 10)] = 'AlgebraIntegral';
18058
18085
  })((Protocols = exports.Protocols || (exports.Protocols = {})));
18059
- (function (Wrappers) {
18060
- Wrappers[(Wrappers['Gamma'] = 0)] = 'Gamma';
18061
- Wrappers[(Wrappers['Ichi'] = 1)] = 'Ichi';
18062
- Wrappers[(Wrappers['Steer'] = 2)] = 'Steer';
18063
- })((exports.Wrappers || (exports.Wrappers = {})));
18064
18086
  (function (BillVersion) {
18065
18087
  BillVersion['V1'] = 'V1';
18066
18088
  BillVersion['V2'] = 'V2';
@@ -18640,6 +18662,8 @@ var types = {};
18640
18662
  (_6[LiquidityDex.ShadowExchange] = {}),
18641
18663
  (_6[LiquidityDex.SwapX] = {}),
18642
18664
  (_6[LiquidityDex.SwapXAlgebraIntegral] = {}),
18665
+ (_6[LiquidityDex.TrebleSwapV2] = {}),
18666
+ (_6[LiquidityDex.TrebleAlgebraIntegral] = {}),
18643
18667
  _6);
18644
18668
 
18645
18669
  } (types));
@@ -18659,9 +18683,10 @@ const MAINNET_CHAINS = [
18659
18683
  types.ChainId.AVAX,
18660
18684
  types.ChainId.BLAST,
18661
18685
  types.ChainId.CROSSFI,
18662
- types.ChainId.MONAD_TESTNET,
18663
18686
  types.ChainId.SONIC,
18687
+ types.ChainId.MONAD_TESTNET,
18664
18688
  ];
18689
+ const TESTNET_CHAINS = [types.ChainId.MONAD_TESTNET];
18665
18690
  // Network Icons
18666
18691
  const NETWORK_ICONS = {
18667
18692
  [types.ChainId.BSC]: icons.BNB_TOKEN,
@@ -68651,233 +68676,6 @@ const zapInputTokens = {
68651
68676
  ],
68652
68677
  };
68653
68678
 
68654
- var ERC_20_ABI = [
68655
- {
68656
- constant: true,
68657
- inputs: [
68658
- ],
68659
- name: "name",
68660
- outputs: [
68661
- {
68662
- name: "",
68663
- type: "string"
68664
- }
68665
- ],
68666
- payable: false,
68667
- stateMutability: "view",
68668
- type: "function"
68669
- },
68670
- {
68671
- constant: false,
68672
- inputs: [
68673
- {
68674
- name: "_spender",
68675
- type: "address"
68676
- },
68677
- {
68678
- name: "_value",
68679
- type: "uint256"
68680
- }
68681
- ],
68682
- name: "approve",
68683
- outputs: [
68684
- {
68685
- name: "",
68686
- type: "bool"
68687
- }
68688
- ],
68689
- payable: false,
68690
- stateMutability: "nonpayable",
68691
- type: "function"
68692
- },
68693
- {
68694
- constant: true,
68695
- inputs: [
68696
- ],
68697
- name: "totalSupply",
68698
- outputs: [
68699
- {
68700
- name: "",
68701
- type: "uint256"
68702
- }
68703
- ],
68704
- payable: false,
68705
- stateMutability: "view",
68706
- type: "function"
68707
- },
68708
- {
68709
- constant: false,
68710
- inputs: [
68711
- {
68712
- name: "_from",
68713
- type: "address"
68714
- },
68715
- {
68716
- name: "_to",
68717
- type: "address"
68718
- },
68719
- {
68720
- name: "_value",
68721
- type: "uint256"
68722
- }
68723
- ],
68724
- name: "transferFrom",
68725
- outputs: [
68726
- {
68727
- name: "",
68728
- type: "bool"
68729
- }
68730
- ],
68731
- payable: false,
68732
- stateMutability: "nonpayable",
68733
- type: "function"
68734
- },
68735
- {
68736
- constant: true,
68737
- inputs: [
68738
- ],
68739
- name: "decimals",
68740
- outputs: [
68741
- {
68742
- name: "",
68743
- type: "uint8"
68744
- }
68745
- ],
68746
- payable: false,
68747
- stateMutability: "view",
68748
- type: "function"
68749
- },
68750
- {
68751
- constant: true,
68752
- inputs: [
68753
- {
68754
- name: "_owner",
68755
- type: "address"
68756
- }
68757
- ],
68758
- name: "balanceOf",
68759
- outputs: [
68760
- {
68761
- name: "balance",
68762
- type: "uint256"
68763
- }
68764
- ],
68765
- payable: false,
68766
- stateMutability: "view",
68767
- type: "function"
68768
- },
68769
- {
68770
- constant: true,
68771
- inputs: [
68772
- ],
68773
- name: "symbol",
68774
- outputs: [
68775
- {
68776
- name: "",
68777
- type: "string"
68778
- }
68779
- ],
68780
- payable: false,
68781
- stateMutability: "view",
68782
- type: "function"
68783
- },
68784
- {
68785
- constant: false,
68786
- inputs: [
68787
- {
68788
- name: "_to",
68789
- type: "address"
68790
- },
68791
- {
68792
- name: "_value",
68793
- type: "uint256"
68794
- }
68795
- ],
68796
- name: "transfer",
68797
- outputs: [
68798
- {
68799
- name: "",
68800
- type: "bool"
68801
- }
68802
- ],
68803
- payable: false,
68804
- stateMutability: "nonpayable",
68805
- type: "function"
68806
- },
68807
- {
68808
- constant: true,
68809
- inputs: [
68810
- {
68811
- name: "_owner",
68812
- type: "address"
68813
- },
68814
- {
68815
- name: "_spender",
68816
- type: "address"
68817
- }
68818
- ],
68819
- name: "allowance",
68820
- outputs: [
68821
- {
68822
- name: "",
68823
- type: "uint256"
68824
- }
68825
- ],
68826
- payable: false,
68827
- stateMutability: "view",
68828
- type: "function"
68829
- },
68830
- {
68831
- payable: true,
68832
- stateMutability: "payable",
68833
- type: "fallback"
68834
- },
68835
- {
68836
- anonymous: false,
68837
- inputs: [
68838
- {
68839
- indexed: true,
68840
- name: "owner",
68841
- type: "address"
68842
- },
68843
- {
68844
- indexed: true,
68845
- name: "spender",
68846
- type: "address"
68847
- },
68848
- {
68849
- indexed: false,
68850
- name: "value",
68851
- type: "uint256"
68852
- }
68853
- ],
68854
- name: "Approval",
68855
- type: "event"
68856
- },
68857
- {
68858
- anonymous: false,
68859
- inputs: [
68860
- {
68861
- indexed: true,
68862
- name: "from",
68863
- type: "address"
68864
- },
68865
- {
68866
- indexed: true,
68867
- name: "to",
68868
- type: "address"
68869
- },
68870
- {
68871
- indexed: false,
68872
- name: "value",
68873
- type: "uint256"
68874
- }
68875
- ],
68876
- name: "Transfer",
68877
- type: "event"
68878
- }
68879
- ];
68880
-
68881
68679
  var PRICE_GETTER_V3_ABI = [
68882
68680
  {
68883
68681
  anonymous: false,
@@ -69770,11 +69568,11 @@ const getTokenPrices = (apeswapListsURL, chains) => __awaiter$9(void 0, void 0,
69770
69568
  }
69771
69569
  });
69772
69570
  const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void 0, function* () {
69773
- const { parsedDexscreenerTokens, filterTokensToCall, arrayFilterTokens } = Object.keys(tokens).reduce((acc, key) => {
69571
+ const { externalTokens, filterTokensToCall, arrayFilterTokens } = Object.keys(tokens).reduce((acc, key) => {
69774
69572
  var _a, _b, _c, _d, _e, _f, _g;
69775
69573
  const token = tokens[key];
69776
69574
  if (((_a = token === null || token === void 0 ? void 0 : token.liquidityDex) === null || _a === void 0 ? void 0 : _a[chainId]) === types.LiquidityDex.External) {
69777
- acc.parsedDexscreenerTokens.push(Object.assign(Object.assign({}, token), { address: (_b = token.address[chainId]) !== null && _b !== void 0 ? _b : '', decimals: (_d = (_c = token === null || token === void 0 ? void 0 : token.decimals) === null || _c === void 0 ? void 0 : _c[chainId]) !== null && _d !== void 0 ? _d : 18, lpToken: (_e = token.lpToken) !== null && _e !== void 0 ? _e : false }));
69575
+ acc.externalTokens.push(Object.assign(Object.assign({}, token), { address: (_b = token.address[chainId]) !== null && _b !== void 0 ? _b : '', decimals: (_d = (_c = token === null || token === void 0 ? void 0 : token.decimals) === null || _c === void 0 ? void 0 : _c[chainId]) !== null && _d !== void 0 ? _d : 18, lpToken: (_e = token.lpToken) !== null && _e !== void 0 ? _e : false }));
69778
69576
  }
69779
69577
  else if ((token === null || token === void 0 ? void 0 : token.active) &&
69780
69578
  token.address[chainId] &&
@@ -69788,7 +69586,7 @@ const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void
69788
69586
  },
69789
69587
  // Accumulator
69790
69588
  {
69791
- parsedDexscreenerTokens: [],
69589
+ externalTokens: [],
69792
69590
  filterTokensToCall: {},
69793
69591
  arrayFilterTokens: [],
69794
69592
  });
@@ -69804,7 +69602,7 @@ const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void
69804
69602
  };
69805
69603
  });
69806
69604
  }
69807
- const dexScreenerResults = yield getBatchTokenPriceWithDexscreener({ chainId, tokens: parsedDexscreenerTokens });
69605
+ const externalResults = yield getBatchTokensExternal({ chainId, tokens: externalTokens });
69808
69606
  const tokenResults = yield getTokenPricesV3FromPriceGetter(filterTokensToCall, chainId);
69809
69607
  const parsedTokenResults = arrayFilterTokens.map((token, i) => {
69810
69608
  var _a, _b, _c;
@@ -69817,143 +69615,35 @@ const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void
69817
69615
  chainId,
69818
69616
  };
69819
69617
  });
69820
- return [...parsedTokenResults, ...dexScreenerResults];
69618
+ return [...parsedTokenResults, ...externalResults];
69821
69619
  });
69822
- const getBatchTokenPriceWithDexscreener = (params) => __awaiter$9(void 0, void 0, void 0, function* () {
69620
+ const getBatchTokensExternal = (params) => __awaiter$9(void 0, void 0, void 0, function* () {
69823
69621
  const { chainId, tokens } = params;
69824
- // as I'm reutilizing the same array, I need to clone it to avoid changing the original array
69825
- const tokensCopy = lodashExports.cloneDeep(tokens);
69826
69622
  try {
69827
- const baseURL = 'https://api.dexscreener.com/latest/dex';
69828
- const totalSupplies = [];
69829
- const chains = [];
69830
- let chainName = getDexScreenerChainName(chainId);
69831
- const calls = tokensCopy.map((token) => __awaiter$9(void 0, void 0, void 0, function* () {
69832
- const { symbol, lpToken, totalSupply, decimals } = token;
69833
- if (['USDT', 'USDC'].includes(symbol)) {
69834
- chains.push('injective');
69835
- return {
69836
- pairs: [
69837
- {
69838
- chainId: chainName,
69839
- baseToken: {
69840
- address: token.address,
69841
- },
69842
- liquidity: {
69843
- usd: 1,
69844
- },
69845
- priceUsd: 1,
69846
- },
69847
- ],
69848
- };
69849
- }
69850
- if (symbol.toLowerCase() === 'inj' || symbol.toLowerCase() === 'winj') {
69851
- token.address = 'inj';
69852
- }
69853
- if (token.symbol.toUpperCase() === 'WGLQ') {
69854
- token.address = '0x9f9c8ec3534c3ce16f928381372bfbfbfb9f4d24';
69855
- chainName = 'ethereum';
69856
- }
69857
- if (token.symbol.toUpperCase() === 'ETH' && chainId === types.ChainId.GRAPHLINQ) {
69858
- token.address = '0x2170Ed0880ac9A755fd29B2688956BD959F933F8';
69859
- chainName = 'bsc';
69860
- }
69861
- if (!chainName) {
69862
- console.log(`Chain ${chainId} is not supported by dexscreener.`);
69863
- return null;
69864
- }
69865
- else {
69866
- chains.push(chainName);
69867
- }
69868
- let endpoint;
69869
- if (lpToken) {
69870
- if (!totalSupply) {
69871
- const calls = [
69872
- {
69873
- address: token.address,
69874
- name: 'totalSupply',
69875
- },
69876
- ];
69877
- const supply = getBalanceNumber((yield multicall(chainId, ERC_20_ABI, calls))[0], decimals);
69878
- totalSupplies.push(supply);
69879
- }
69880
- else {
69881
- totalSupplies.push(totalSupply);
69882
- }
69883
- endpoint = `pairs/${chainName}`;
69884
- }
69885
- else {
69886
- endpoint = `tokens`;
69887
- }
69888
- const url = `${baseURL}/${endpoint}/${token.address}`;
69889
- try {
69890
- const response = yield axios.get(url);
69891
- return response.data;
69892
- }
69893
- catch (error) {
69894
- console.log(`Failed to fetch data for token ${token.address}: ${error}`);
69895
- return null;
69896
- }
69897
- }));
69898
- const result = yield Promise.all(calls);
69899
- return result.map((response, index) => {
69623
+ const baseURL = 'https://price-api.ape.bond/prices';
69624
+ const tokensToCall = tokens.map((token) => token.address);
69625
+ if (tokensToCall.length === 0)
69626
+ return [];
69627
+ const response = yield axios.post(`${baseURL}`, {
69628
+ rpcUrl: 'string',
69629
+ tokens: tokensToCall,
69630
+ chain: chainId,
69631
+ });
69632
+ return response.data.map((token) => {
69900
69633
  var _a;
69901
- if (!response || !response.pairs) {
69902
- return Object.assign(Object.assign({}, tokensCopy === null || tokensCopy === void 0 ? void 0 : tokensCopy[index]), { price: undefined, chainId });
69903
- }
69904
- const supply = totalSupplies[index];
69905
- const token = tokensCopy[index];
69906
- let price;
69907
- try {
69908
- if (token.lpToken) {
69909
- const liquidity = response.pair.liquidity.usd;
69910
- price = liquidity / supply;
69911
- }
69912
- else {
69913
- const pairs = response.pairs;
69914
- price = (_a = pairs
69915
- .filter((pair) => pair.chainId === chains[index] && pair.baseToken.address.toLowerCase() === token.address.toLowerCase())
69916
- .sort((a, b) => { var _a, _b; return ((_a = b === null || b === void 0 ? void 0 : b.liquidity) === null || _a === void 0 ? void 0 : _a.usd) - ((_b = a === null || a === void 0 ? void 0 : a.liquidity) === null || _b === void 0 ? void 0 : _b.usd); })[0]) === null || _a === void 0 ? void 0 : _a.priceUsd;
69917
- }
69918
- }
69919
- catch (_b) {
69920
- price = undefined;
69921
- }
69922
- let originalAddress = token.address;
69923
- if (token.address === 'inj') {
69924
- originalAddress = '0x4569348D39cc38F4d6a1180573Df73B7b03251d9';
69925
- }
69926
- if (token.address === '0x2170Ed0880ac9A755fd29B2688956BD959F933F8' && chainId === types.ChainId.GRAPHLINQ) {
69927
- originalAddress = '0xbeED106D0f2e6950BFa1Eec74E1253CA0a643442';
69928
- chainName = 'ethereum';
69929
- }
69930
- if (token.address === '0x9f9c8ec3534c3ce16f928381372bfbfbfb9f4d24') {
69931
- originalAddress = '0xEB567ec41738c2bAb2599A1070FC5B727721b3B6';
69932
- }
69933
- return Object.assign(Object.assign({}, tokensCopy === null || tokensCopy === void 0 ? void 0 : tokensCopy[index]), { address: originalAddress, chainId, price: parseFloat(price !== null && price !== void 0 ? price : '0') });
69634
+ return {
69635
+ symbol: token.symbol,
69636
+ address: token.tokenAddress,
69637
+ price: parseFloat(token.price),
69638
+ decimals: (_a = tokens.find((t) => t.address.toLowerCase() === token.tokenAddress.toLowerCase())) === null || _a === void 0 ? void 0 : _a.decimals,
69639
+ chainId,
69640
+ };
69934
69641
  });
69935
69642
  }
69936
69643
  catch (_a) {
69937
- console.log(`Failed to get price from dexscreener for chain ${chainId}.`);
69938
- return tokensCopy.map((token) => {
69939
- return Object.assign(Object.assign({}, token), { chainId, price: undefined });
69940
- });
69644
+ console.log(`Failed to get price from api for chain ${chainId}.`);
69941
69645
  }
69942
69646
  });
69943
- const getDexScreenerChainName = (chainId) => {
69944
- const chainsName = {
69945
- [types.ChainId.MAINNET]: 'ethereum',
69946
- [types.ChainId.TLOS]: 'telos',
69947
- [types.ChainId.BSC]: 'bsc',
69948
- [types.ChainId.MATIC]: 'polygon',
69949
- [types.ChainId.ARBITRUM]: 'arbitrum',
69950
- [types.ChainId.INEVM]: 'injective',
69951
- [types.ChainId.LINEA]: 'linea',
69952
- [types.ChainId.GRAPHLINQ]: 'ethereum',
69953
- };
69954
- //@ts-ignore
69955
- return chainsName[chainId];
69956
- };
69957
69647
  function getTokenPricesV3FromPriceGetter(tokensToCall, chain) {
69958
69648
  return __awaiter$9(this, void 0, void 0, function* () {
69959
69649
  const calls = [];
@@ -71536,15 +71226,30 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
71536
71226
  // Hooks
71537
71227
  const SDKConfig = useSDKConfig();
71538
71228
  const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
71229
+ const mainnetChains = chains.filter((item) => !TESTNET_CHAINS.includes(item));
71230
+ const testnetChains = chains.filter((item) => TESTNET_CHAINS.includes(item));
71539
71231
  // State
71540
71232
  const [isOpen, setIsOpen] = useState(false);
71541
71233
  // Handlers
71542
71234
  const handleCheckbox = (newChain) => {
71543
- const prevChainFilterOptions = chainFilterOption;
71235
+ const prevChainFilterOptions = chainFilterOption.map(String);
71544
71236
  let newChainFilterOption;
71545
71237
  if (newChain === 'All Chains') {
71546
71238
  newChainFilterOption = ['All Chains'];
71547
71239
  }
71240
+ else if (newChain === 'All Testnet') {
71241
+ if (prevChainFilterOptions.includes('All Testnet')) {
71242
+ newChainFilterOption = prevChainFilterOptions.filter((option) => ![...testnetChains.map((t) => t.toString()), 'All Testnet'].includes(option));
71243
+ }
71244
+ else {
71245
+ newChainFilterOption = [
71246
+ ...prevChainFilterOptions.filter((option) => option !== 'All Chains'),
71247
+ ...testnetChains.map((t) => t.toString()),
71248
+ 'All Testnet',
71249
+ ];
71250
+ }
71251
+ newChainFilterOption = newChainFilterOption.length === 0 ? ['All Chains'] : newChainFilterOption;
71252
+ }
71548
71253
  else {
71549
71254
  if (prevChainFilterOptions.includes(newChain)) {
71550
71255
  const filteredChains = prevChainFilterOptions.filter((option) => option !== newChain);
@@ -71552,8 +71257,8 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
71552
71257
  }
71553
71258
  else {
71554
71259
  const newArray = [...prevChainFilterOptions.filter((option) => option !== 'All Chains'), newChain];
71555
- const allChainsArePresent = MAINNET_CHAINS.every((chain) => newArray.includes(chain.toString()));
71556
- newChainFilterOption = allChainsArePresent ? ['All Chains'] : newArray;
71260
+ const allMainnetsSelected = MAINNET_CHAINS.every((chain) => newArray.includes(chain.toString()));
71261
+ newChainFilterOption = allMainnetsSelected ? ['All Chains'] : newArray;
71557
71262
  }
71558
71263
  }
71559
71264
  setChainFilterOption(newChainFilterOption);
@@ -71576,7 +71281,7 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
71576
71281
  alignItems: 'center',
71577
71282
  width: '100%',
71578
71283
  justifyContent: 'space-between',
71579
- }, onClick: () => setIsOpen(!isOpen), className: "dropdown", children: [jsx$2(Text, { sx: { lineHeight: '22px', fontSize: '14px', fontWeight: 400, px: '10px' }, children: chainFilterOption.includes('All Chains') ? 'All Chains' : `Chains (${chainFilterOption.length})` }), jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] }), isOpen && (jsx$2(Flex, { sx: {
71284
+ }, onClick: () => setIsOpen(!isOpen), className: "dropdown", children: [jsx$2(Text, { sx: { lineHeight: '22px', fontSize: '14px', fontWeight: 400, px: '10px' }, children: chainFilterOption.includes('All Chains') ? 'All Chains' : `Chains (${chainFilterOption.length})` }), jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] }), isOpen && (jsxs(Flex, { sx: {
71580
71285
  flexDirection: ['column', 'column', 'column'],
71581
71286
  position: 'absolute',
71582
71287
  top: '45px',
@@ -71587,15 +71292,25 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
71587
71292
  borderRadius: 'normal',
71588
71293
  background: 'white2',
71589
71294
  zIndex: 1001,
71590
- }, children: ['All Chains', ...chains].map((chainId) => {
71591
- return (jsx$2(Flex, { sx: {
71592
- borderRadius: 'normal',
71593
- p: '5px 15px',
71594
- minHeight: '40px',
71595
- cursor: 'pointer',
71596
- '&:hover': { bg: 'white3' },
71597
- }, onClick: () => handleCheckbox(chainId.toString()), children: jsxs(Flex, { sx: { width: '100%', alignItems: 'center', fontSize: '14px' }, children: [jsx$2(Checkbox, { checked: chainFilterOption.includes(chainId.toString()) }), chainId === 'All Chains' ? (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px' }, children: jsx$2(Svg, { icon: "AllChains", width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: "All Chains" })] })) : (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px', borderRadius: '50px', overflow: 'hidden' }, children: jsx$2(Svg, { icon: NETWORK_ICONS[chainId], width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: NETWORK_LABEL[chainId] })] }))] }) }, chainId));
71598
- }) }))] }));
71295
+ }, children: [['All Chains', ...mainnetChains].map((chainId) => {
71296
+ return (jsx$2(Flex, { sx: {
71297
+ borderRadius: 'normal',
71298
+ p: '5px 15px',
71299
+ minHeight: '40px',
71300
+ cursor: 'pointer',
71301
+ '&:hover': { bg: 'white3' },
71302
+ }, onClick: () => handleCheckbox(chainId.toString()), children: jsxs(Flex, { sx: { width: '100%', alignItems: 'center', fontSize: '14px' }, children: [jsx$2(Checkbox, { checked: chainFilterOption.includes(chainId.toString()) }), chainId === 'All Chains' ? (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px' }, children: jsx$2(Svg, { icon: "AllChains", width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: "All Chains" })] })) : (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px', borderRadius: '50px', overflow: 'hidden' }, children: jsx$2(Svg, { icon: NETWORK_ICONS[chainId], width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: NETWORK_LABEL[chainId] })] }))] }) }, chainId));
71303
+ }), testnetChains.length > 0 &&
71304
+ ['All Testnet', ...testnetChains].map((chainId) => {
71305
+ return (jsx$2(Flex, { sx: {
71306
+ borderRadius: 'normal',
71307
+ p: '5px 15px',
71308
+ minHeight: '40px',
71309
+ cursor: 'pointer',
71310
+ '&:hover': { bg: 'white3' },
71311
+ pl: chainId !== 'All Testnet' ? '35px' : '15px',
71312
+ }, onClick: () => handleCheckbox(chainId.toString()), children: jsxs(Flex, { sx: { width: '100%', alignItems: 'center', fontSize: '14px' }, children: [jsx$2(Checkbox, { checked: chainFilterOption.includes(chainId.toString()) }), chainId === 'All Testnet' ? (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px' }, children: jsx$2(Svg, { icon: "AllChains", width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: "All Testnet" })] })) : (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px', borderRadius: '50px', overflow: 'hidden' }, children: jsx$2(Svg, { icon: NETWORK_ICONS[chainId], width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: NETWORK_LABEL[chainId] })] }))] }) }, chainId));
71313
+ })] }))] }));
71599
71314
  };
71600
71315
 
71601
71316
  const BondFilters = ({ setChainFilterOption, chainFilterOption, filterOptions, filterOption, setFilterOption, onHandleQueryChange, }) => {
@@ -74685,6 +74400,233 @@ function isAddress(value) {
74685
74400
  }
74686
74401
  }
74687
74402
 
74403
+ var ERC_20_ABI = [
74404
+ {
74405
+ constant: true,
74406
+ inputs: [
74407
+ ],
74408
+ name: "name",
74409
+ outputs: [
74410
+ {
74411
+ name: "",
74412
+ type: "string"
74413
+ }
74414
+ ],
74415
+ payable: false,
74416
+ stateMutability: "view",
74417
+ type: "function"
74418
+ },
74419
+ {
74420
+ constant: false,
74421
+ inputs: [
74422
+ {
74423
+ name: "_spender",
74424
+ type: "address"
74425
+ },
74426
+ {
74427
+ name: "_value",
74428
+ type: "uint256"
74429
+ }
74430
+ ],
74431
+ name: "approve",
74432
+ outputs: [
74433
+ {
74434
+ name: "",
74435
+ type: "bool"
74436
+ }
74437
+ ],
74438
+ payable: false,
74439
+ stateMutability: "nonpayable",
74440
+ type: "function"
74441
+ },
74442
+ {
74443
+ constant: true,
74444
+ inputs: [
74445
+ ],
74446
+ name: "totalSupply",
74447
+ outputs: [
74448
+ {
74449
+ name: "",
74450
+ type: "uint256"
74451
+ }
74452
+ ],
74453
+ payable: false,
74454
+ stateMutability: "view",
74455
+ type: "function"
74456
+ },
74457
+ {
74458
+ constant: false,
74459
+ inputs: [
74460
+ {
74461
+ name: "_from",
74462
+ type: "address"
74463
+ },
74464
+ {
74465
+ name: "_to",
74466
+ type: "address"
74467
+ },
74468
+ {
74469
+ name: "_value",
74470
+ type: "uint256"
74471
+ }
74472
+ ],
74473
+ name: "transferFrom",
74474
+ outputs: [
74475
+ {
74476
+ name: "",
74477
+ type: "bool"
74478
+ }
74479
+ ],
74480
+ payable: false,
74481
+ stateMutability: "nonpayable",
74482
+ type: "function"
74483
+ },
74484
+ {
74485
+ constant: true,
74486
+ inputs: [
74487
+ ],
74488
+ name: "decimals",
74489
+ outputs: [
74490
+ {
74491
+ name: "",
74492
+ type: "uint8"
74493
+ }
74494
+ ],
74495
+ payable: false,
74496
+ stateMutability: "view",
74497
+ type: "function"
74498
+ },
74499
+ {
74500
+ constant: true,
74501
+ inputs: [
74502
+ {
74503
+ name: "_owner",
74504
+ type: "address"
74505
+ }
74506
+ ],
74507
+ name: "balanceOf",
74508
+ outputs: [
74509
+ {
74510
+ name: "balance",
74511
+ type: "uint256"
74512
+ }
74513
+ ],
74514
+ payable: false,
74515
+ stateMutability: "view",
74516
+ type: "function"
74517
+ },
74518
+ {
74519
+ constant: true,
74520
+ inputs: [
74521
+ ],
74522
+ name: "symbol",
74523
+ outputs: [
74524
+ {
74525
+ name: "",
74526
+ type: "string"
74527
+ }
74528
+ ],
74529
+ payable: false,
74530
+ stateMutability: "view",
74531
+ type: "function"
74532
+ },
74533
+ {
74534
+ constant: false,
74535
+ inputs: [
74536
+ {
74537
+ name: "_to",
74538
+ type: "address"
74539
+ },
74540
+ {
74541
+ name: "_value",
74542
+ type: "uint256"
74543
+ }
74544
+ ],
74545
+ name: "transfer",
74546
+ outputs: [
74547
+ {
74548
+ name: "",
74549
+ type: "bool"
74550
+ }
74551
+ ],
74552
+ payable: false,
74553
+ stateMutability: "nonpayable",
74554
+ type: "function"
74555
+ },
74556
+ {
74557
+ constant: true,
74558
+ inputs: [
74559
+ {
74560
+ name: "_owner",
74561
+ type: "address"
74562
+ },
74563
+ {
74564
+ name: "_spender",
74565
+ type: "address"
74566
+ }
74567
+ ],
74568
+ name: "allowance",
74569
+ outputs: [
74570
+ {
74571
+ name: "",
74572
+ type: "uint256"
74573
+ }
74574
+ ],
74575
+ payable: false,
74576
+ stateMutability: "view",
74577
+ type: "function"
74578
+ },
74579
+ {
74580
+ payable: true,
74581
+ stateMutability: "payable",
74582
+ type: "fallback"
74583
+ },
74584
+ {
74585
+ anonymous: false,
74586
+ inputs: [
74587
+ {
74588
+ indexed: true,
74589
+ name: "owner",
74590
+ type: "address"
74591
+ },
74592
+ {
74593
+ indexed: true,
74594
+ name: "spender",
74595
+ type: "address"
74596
+ },
74597
+ {
74598
+ indexed: false,
74599
+ name: "value",
74600
+ type: "uint256"
74601
+ }
74602
+ ],
74603
+ name: "Approval",
74604
+ type: "event"
74605
+ },
74606
+ {
74607
+ anonymous: false,
74608
+ inputs: [
74609
+ {
74610
+ indexed: true,
74611
+ name: "from",
74612
+ type: "address"
74613
+ },
74614
+ {
74615
+ indexed: true,
74616
+ name: "to",
74617
+ type: "address"
74618
+ },
74619
+ {
74620
+ indexed: false,
74621
+ name: "value",
74622
+ type: "uint256"
74623
+ }
74624
+ ],
74625
+ name: "Transfer",
74626
+ type: "event"
74627
+ }
74628
+ ];
74629
+
74688
74630
  function useCurrencyBalance(currency, account, chainId) {
74689
74631
  return useQuery({
74690
74632
  queryKey: [
@@ -76759,6 +76701,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76759
76701
  const inputToken = useTokenFromZapList(inputTokenString, bondData === null || bondData === void 0 ? void 0 : bondData.chainId, bondData === null || bondData === void 0 ? void 0 : bondData.lpToken);
76760
76702
  const isZap = (inputTokenString === null || inputTokenString === void 0 ? void 0 : inputTokenString.toLowerCase()) !== ((_e = (_d = (_c = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _c === void 0 ? void 0 : _c.address) === null || _d === void 0 ? void 0 : _d[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) === null || _e === void 0 ? void 0 : _e.toLowerCase());
76761
76703
  const [fetchingZapQuote, zapData, zapDepositAmount, zapError, zapTrueBondPrice] = useSoulZapBondQuote(inputValue, inputToken, bondData, account, tierProofSig);
76704
+ const rateChanged = parseFloat(zapTrueBondPrice !== null && zapTrueBondPrice !== void 0 ? zapTrueBondPrice : '0') > parseFloat(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0');
76762
76705
  const inputTokenPrice = useCurrencyPrice(inputToken !== null && inputToken !== void 0 ? inputToken : null, bondChain);
76763
76706
  const { data: inputCurrencyBalance } = useCurrencyBalance(inputToken !== null && inputToken !== void 0 ? inputToken : null, account !== null && account !== void 0 ? account : null, (_f = bondData === null || bondData === void 0 ? void 0 : bondData.chainId) !== null && _f !== void 0 ? _f : null);
76764
76707
  // Estimations
@@ -76775,8 +76718,6 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76775
76718
  setInputValue('');
76776
76719
  setInputTokenString(newInputToken);
76777
76720
  }, []);
76778
- // Modals
76779
- const [onOpenZapModal] = useModal(jsx$2(ZapModal, { outputToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, account: account, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId }), true, true, 'zapModal');
76780
76721
  const handleOpenZapModal = () => {
76781
76722
  var _a;
76782
76723
  onOpenZapModal();
@@ -76803,6 +76744,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76803
76744
  });
76804
76745
  });
76805
76746
  };
76747
+ // This is the regular buy bond interaction (a.k.a. write method called "deposit" in smartcontract)
76806
76748
  const handleBuyCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
76807
76749
  var _a, _b, _c, _d, _e, _f, _g;
76808
76750
  const billAddress = bondData === null || bondData === void 0 ? void 0 : bondData.billAddress;
@@ -76817,7 +76759,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76817
76759
  },
76818
76760
  });
76819
76761
  try {
76820
- const maxPrice = new BigNumber$1(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0').times(102).div(100).toFixed(0);
76762
+ const maxPrice = new BigNumber$1(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0').times(102).div(100).toFixed(0); // multiply it by 1.02
76821
76763
  const rawAmount = adjustDecimals(inputValue);
76822
76764
  const amount = new BigNumber$1(rawAmount).times(new BigNumber$1(10).pow(decimals !== null && decimals !== void 0 ? decimals : 18)).toString();
76823
76765
  const shouldUseSig = (bondData === null || bondData === void 0 ? void 0 : bondData.billVersion) === types.BillVersion.V4 && SDKConfig.useTiers;
@@ -76854,6 +76796,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76854
76796
  addToastError(error.shortMessage);
76855
76797
  }
76856
76798
  });
76799
+ // ignore this for SOL migration
76857
76800
  const handleZapCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
76858
76801
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
76859
76802
  if (zapData && ((_a = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _a === void 0 ? void 0 : _a.to) && ((_b = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _b === void 0 ? void 0 : _b.data)) {
@@ -76911,23 +76854,15 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76911
76854
  }
76912
76855
  }
76913
76856
  });
76914
- const [openGeofencingModal] = useModal(jsx$2(RestrictedRegionModal, {}));
76915
- const blockedBondsForAE = [
76916
- '0x0719CCaF2f07f59b23DB7d80E3d2791A0836bdfD'.toLowerCase(),
76917
- '0xBc48794a04777E7170bD5633E8b728f8a0945971'.toLowerCase(),
76918
- '0x94A283756B70c2A77bc58Ae0E2615Caf14310186'.toLowerCase(),
76919
- '0x6639D4acAe77967c253C75cBfEd7C612682E2704'.toLowerCase(),
76920
- ];
76921
- const rateChanged = parseFloat(zapTrueBondPrice !== null && zapTrueBondPrice !== void 0 ? zapTrueBondPrice : '0') > parseFloat(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0');
76922
- const [openNewRateModal] = useModal(jsx$2(NewRateModal, { bond: bondData, zapTrueBondPrice: zapTrueBondPrice, depositAmount: depositAmount, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError, handleZap: () => handleZapCallback().finally(() => setLoadingTx(false)) }), true, false);
76923
76857
  const handleBothPurchases = () => {
76924
76858
  var _a, _b;
76925
76859
  if ((geoData === null || geoData === void 0 ? void 0 : geoData.countryCode) === 'AE' && blockedBondsForAE.includes((_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '')) {
76926
- openGeofencingModal();
76860
+ openGeofencingModal(); // ignore this for SOL migration
76927
76861
  }
76928
76862
  else {
76929
76863
  setLoadingTx(true);
76930
76864
  if (isZap) {
76865
+ // ignore this for SOL migration
76931
76866
  if (rateChanged) {
76932
76867
  openNewRateModal();
76933
76868
  }
@@ -76940,7 +76875,6 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76940
76875
  }
76941
76876
  }
76942
76877
  };
76943
- const [openNoBonusModal] = useModal(jsx$2(NoBonusModal, { onAcknowledge: handleBothPurchases, showcaseTokenName: bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName }), true, true, 'NoBonusModal');
76944
76878
  const handleOpenModal = () => {
76945
76879
  var _a;
76946
76880
  const bonus = (_a = trueBondPriceData === null || trueBondPriceData === void 0 ? void 0 : trueBondPriceData.bonusWithFee) !== null && _a !== void 0 ? _a : 0;
@@ -76952,16 +76886,25 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76952
76886
  }
76953
76887
  };
76954
76888
  const openExternal = () => {
76955
- if ((bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === types.ChainId.LIGHTLINK) {
76956
- window.open('https://app.elektrik.network/#/swap', '_blank');
76957
- }
76958
- if ((bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === types.ChainId.GRAPHLINQ) {
76959
- window.open('https://hub.graphlinq.io/swap', '_blank');
76889
+ var _a, _b;
76890
+ if ((_a = bondData.lpToken.getLpUrl) === null || _a === void 0 ? void 0 : _a[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) {
76891
+ window.open((_b = bondData.lpToken.getLpUrl) === null || _b === void 0 ? void 0 : _b[bondData === null || bondData === void 0 ? void 0 : bondData.chainId], '_blank');
76960
76892
  }
76961
76893
  else {
76962
76894
  window.open(`https://ape.bond/swap?outputcurrency=${bondData === null || bondData === void 0 ? void 0 : bondData.lpToken.address[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]}&outputChain=${bondData === null || bondData === void 0 ? void 0 : bondData.chainId}`, '_blank');
76963
76895
  }
76964
76896
  };
76897
+ // Modals
76898
+ const [onOpenZapModal] = useModal(jsx$2(ZapModal, { outputToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, account: account, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId }), true, true, 'zapModal');
76899
+ const [openNewRateModal] = useModal(jsx$2(NewRateModal, { bond: bondData, zapTrueBondPrice: zapTrueBondPrice, depositAmount: depositAmount, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError, handleZap: () => handleZapCallback().finally(() => setLoadingTx(false)) }), true, false);
76900
+ const [openNoBonusModal] = useModal(jsx$2(NoBonusModal, { onAcknowledge: handleBothPurchases, showcaseTokenName: bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName }), true, true, 'NoBonusModal');
76901
+ const [openGeofencingModal] = useModal(jsx$2(RestrictedRegionModal, {}));
76902
+ const blockedBondsForAE = [
76903
+ '0x0719CCaF2f07f59b23DB7d80E3d2791A0836bdfD'.toLowerCase(),
76904
+ '0xBc48794a04777E7170bD5633E8b728f8a0945971'.toLowerCase(),
76905
+ '0x94A283756B70c2A77bc58Ae0E2615Caf14310186'.toLowerCase(),
76906
+ '0x6639D4acAe77967c253C75cBfEd7C612682E2704'.toLowerCase(),
76907
+ ];
76965
76908
  // Effects
76966
76909
  const [hasChecked, setHasChecked] = useState(false);
76967
76910
  useEffect(() => {
@@ -76977,7 +76920,13 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
76977
76920
  console.log('change to native');
76978
76921
  }
76979
76922
  }, [inputCurrencyBalance]);
76980
- return bondData ? (jsxs(Flex, { className: `modal-content ${isGoldRush ? 'gold-rush' : ''}`, children: [jsx$2("div", { className: "gold-ribbon" }), jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), jsx$2(ProjectDescription, { description: bondData.shortDescription, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, inputDisabled: isUserRestricted }), SDKConfig.useTiers && jsx$2(GetUpToComponent, { bond: bondData, depositAmount: depositAmount }), 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
76923
+ return bondData ? (jsxs(Flex, { className: `modal-content ${isGoldRush ? 'gold-rush' : ''}`, children: [jsx$2("div", { className: "gold-ribbon" }), jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), jsx$2(ProjectDescription, { description: bondData.shortDescription, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, inputDisabled: isUserRestricted }), SDKConfig.useTiers && jsx$2(GetUpToComponent, { bond: bondData, depositAmount: depositAmount }), (bondData === null || bondData === void 0 ? void 0 : bondData.warningCard) && (jsx$2(Flex, { sx: {
76924
+ width: '100%',
76925
+ background: '#DE62F366',
76926
+ justifyContent: 'center',
76927
+ mt: '15px',
76928
+ borderRadius: 'normal',
76929
+ }, children: jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, p: '2px 10px' }, children: 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: () => bondData.billVersion === types.BillVersion.V4 && SDKConfig.useTiers
76981
76930
  ? window.open('http://ape.bond/tier-staking', '_blank')
76982
76931
  : supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId)
76983
76932
  ? handleOpenZapModal()
@@ -77081,6 +77030,8 @@ const CheckUrl = () => {
77081
77030
  };
77082
77031
 
77083
77032
  const ChainTitle = ({ chain, pt, hideTitles, isOpen, }) => {
77033
+ var _a;
77034
+ const isMobile = useIsMobile();
77084
77035
  return (jsxs(Flex, { className: "chaintitle", sx: {
77085
77036
  pt,
77086
77037
  pb: '10px',
@@ -77092,7 +77043,7 @@ const ChainTitle = ({ chain, pt, hideTitles, isOpen, }) => {
77092
77043
  display: hideTitles ? 'none' : 'flex',
77093
77044
  width: '300px',
77094
77045
  alignItems: 'center',
77095
- }, children: [NETWORK_LABEL[chain], " Bonds", jsx$2(Flex, { sx: { ml: '7px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }), NETWORK_LABEL[chain].includes('Testnet') && (jsxs(Flex, { sx: { ml: '15px' }, children: [jsx$2(Text, { sx: { fontSize: '12px', color: '#DE62F3', fontWeight: 700, mr: '7px' }, children: "TESTNET" }), jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Bear in mind this is a testnet and funds are not real" }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) })] }))] }));
77046
+ }, children: [NETWORK_LABEL[chain], " Bonds", jsx$2(Flex, { sx: { ml: '7px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }), ((_a = NETWORK_LABEL[chain]) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('testnet')) && (jsxs(Flex, { sx: { ml: '15px' }, children: [jsx$2(Text, { sx: { fontSize: '12px', color: '#DE62F3', fontWeight: 700, mr: '7px' }, children: "TESTNET" }), jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Testnet Bonds let you experiment with fake tokens for free on upcoming chains still in development." }), width: isMobile ? '272px' : '280px', placement: isMobile ? 'bottomRight' : 'bottomLeft', transformTip: isMobile ? 'translate(10%, -5%)' : 'translate(-5%, -5%)', children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) })] }))] }));
77096
77047
  };
77097
77048
 
77098
77049
  const ProgressBar = ({ value, color = 'text' }) => {
@@ -77295,6 +77246,31 @@ const HotBondCards = () => {
77295
77246
  }) })] })] }));
77296
77247
  };
77297
77248
 
77249
+ const BANNER_INFO = {
77250
+ [types.ChainId.MONAD_TESTNET]: {
77251
+ title: 'Test and Play on Monad Testnet',
77252
+ subtitle: 'Explore Monad for free, earn points and qualify for potential airdrops.',
77253
+ buttons: [
77254
+ { label: 'GET MON TOKENS', href: 'https://testnet.monad.xyz' },
77255
+ ],
77256
+ background: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner_jpkg38.png',
77257
+ backgroundMobile: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner-mobile_y6xveu.png',
77258
+ logo: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/monad-logo_lkstid.png',
77259
+ },
77260
+ };
77261
+ const BannerTestnet = ({ chainId }) => {
77262
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77263
+ return (jsxs("div", { className: "banner-container", sx: {
77264
+ backgroundImage: [
77265
+ `url(${(_a = BANNER_INFO[chainId]) === null || _a === void 0 ? void 0 : _a.backgroundMobile})`,
77266
+ `url(${(_b = BANNER_INFO[chainId]) === null || _b === void 0 ? void 0 : _b.backgroundMobile})`,
77267
+ `url(${(_c = BANNER_INFO[chainId]) === null || _c === void 0 ? void 0 : _c.backgroundMobile})`,
77268
+ `url(${(_d = BANNER_INFO[chainId]) === null || _d === void 0 ? void 0 : _d.background})`,
77269
+ `url(${(_e = BANNER_INFO[chainId]) === null || _e === void 0 ? void 0 : _e.background})`,
77270
+ ],
77271
+ }, children: [jsxs("div", { className: "banner-logos", children: [jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/apebond-logo_vzt4dl.png", alt: "apebond-white-logo", style: { width: '100px' } }), jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/x-icono_va7sdu.png", alt: "x-white-logo" }), jsx$2("img", { src: `${(_f = BANNER_INFO[chainId]) === null || _f === void 0 ? void 0 : _f.logo}`, alt: "partner-logo" })] }), jsx$2("div", { className: "banner-title", children: (_g = BANNER_INFO[chainId]) === null || _g === void 0 ? void 0 : _g.title }), jsx$2("div", { className: "banner-subtitle", children: (_h = BANNER_INFO[chainId]) === null || _h === void 0 ? void 0 : _h.subtitle }), jsx$2("div", { className: "banner-actions", children: (_j = BANNER_INFO[chainId]) === null || _j === void 0 ? void 0 : _j.buttons.map((button, index) => (jsx$2(Button, { className: "action-button", onClick: () => window.open(button.href, '_blank'), children: button.label }, `banner-button-${index}`))) })] }, `banner-container-${chainId}`));
77272
+ };
77273
+
77298
77274
  const BondRowsWithTitle = ({ chain, bonds, hideTitles, showHotBonds }) => {
77299
77275
  const billsFilteredByChain = bonds.filter((bill) => bill.chainId === chain);
77300
77276
  const key = chain;
@@ -77304,7 +77280,7 @@ const BondRowsWithTitle = ({ chain, bonds, hideTitles, showHotBonds }) => {
77304
77280
  overflow: 'hidden',
77305
77281
  width: '100%',
77306
77282
  marginTop: '0px',
77307
- }, className: "bonds-card-container", children: [billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map((bond, index) => {
77283
+ }, className: "bonds-card-container", children: [TESTNET_CHAINS.includes(chain) && jsx$2(BannerTestnet, { chainId: chain }), billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map((bond, index) => {
77308
77284
  var _a, _b;
77309
77285
  return (jsx$2(BondRow
77310
77286
  //@ts-ignore
package/dist/styles.css CHANGED
@@ -1906,3 +1906,78 @@ span.flex-inline {
1906
1906
  font-size: 12px;
1907
1907
  font-weight: 400;
1908
1908
  }
1909
+
1910
+ .banner-container {
1911
+ width: 100%;
1912
+ min-height: 160px;
1913
+ border-radius: 8px;
1914
+ display: flex;
1915
+ flex-direction: column;
1916
+ align-items: center;
1917
+ justify-content: center;
1918
+ margin-bottom: 10px;
1919
+ gap: 5px;
1920
+ background-size: cover;
1921
+ background-repeat: no-repeat;
1922
+ padding: 20px;
1923
+ }
1924
+ .banner-container .banner-logos {
1925
+ display: flex;
1926
+ align-items: center;
1927
+ justify-content: center;
1928
+ gap: 10px;
1929
+ }
1930
+ .banner-container .banner-title {
1931
+ font-weight: 700;
1932
+ font-size: 25.26px;
1933
+ line-height: 30.26px;
1934
+ letter-spacing: 0%;
1935
+ text-align: center;
1936
+ vertical-align: middle;
1937
+ background: linear-gradient(180deg, #FFFFFF 50%, #666666 100%);
1938
+ background-clip: text;
1939
+ -webkit-background-clip: text;
1940
+ -webkit-text-fill-color: transparent;
1941
+ }
1942
+ .banner-container .banner-subtitle {
1943
+ font-weight: 400;
1944
+ font-size: 14.26px;
1945
+ line-height: 30.26px;
1946
+ letter-spacing: 0%;
1947
+ text-align: center;
1948
+ vertical-align: middle;
1949
+ background: linear-gradient(180deg, #FFFFFF 50%, #666666 100%);
1950
+ background-clip: text;
1951
+ -webkit-background-clip: text;
1952
+ -webkit-text-fill-color: transparent;
1953
+ }
1954
+ .banner-container .banner-actions {
1955
+ display: flex;
1956
+ align-items: center;
1957
+ justify-content: center;
1958
+ gap: 10px;
1959
+ }
1960
+ .banner-container .banner-actions .action-button {
1961
+ height: 35px;
1962
+ font-size: 12px;
1963
+ font-weight: 700;
1964
+ }
1965
+
1966
+ @media (max-width: 575px) {
1967
+ .banner-container .banner-title {
1968
+ width: 50%;
1969
+ font-size: 18px;
1970
+ line-height: 21px;
1971
+ }
1972
+ .banner-container .banner-subtitle {
1973
+ width: 55%;
1974
+ font-size: 12px;
1975
+ line-height: 14px;
1976
+ margin-bottom: 10px;
1977
+ }
1978
+ }
1979
+ @media (min-width: 800px) and (max-width: 1000px) {
1980
+ .banner-container {
1981
+ background-position: bottom center;
1982
+ }
1983
+ }
@@ -39,4 +39,5 @@ export interface BondsData {
39
39
  billArt: {
40
40
  collection: string;
41
41
  };
42
+ warningCard?: string;
42
43
  }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface BannerTestnetProps {
3
+ chainId: number;
4
+ }
5
+ declare const BannerTestnet: React.FC<BannerTestnetProps>;
6
+ export default BannerTestnet;
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.23",
6
+ "version": "3.0.25",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",
@@ -57,7 +57,7 @@
57
57
  "yalc": "^1.0.0-pre.53"
58
58
  },
59
59
  "dependencies": {
60
- "@ape.swap/apeswap-lists": "4.2.3",
60
+ "@ape.swap/apeswap-lists": "4.2.5",
61
61
  "@emotion/react": "11.11.4",
62
62
  "bignumber.js": "^9.1.2",
63
63
  "chart.js": "4.2.0",