@ape.swap/bonds-sdk 2.1.0 → 2.1.1-test.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.
package/dist/main.js CHANGED
@@ -71189,18 +71189,20 @@ function useUserBonds() {
71189
71189
  // First fetch the full list of bonds
71190
71190
  const { data: bondList } = useBondsList();
71191
71191
  const { address } = useAccount();
71192
+ const SDKConfig = useSDKConfig();
71193
+ const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
71192
71194
  // Once the full list is fetched, fetch user's purchased bonds
71193
71195
  return useQuery({
71194
71196
  queryKey: [QUERY_KEYS.USER_BONDS, address],
71195
- queryFn: () => getUserBonds(address, bondList),
71197
+ queryFn: () => getUserBonds(address, bondList, chains),
71196
71198
  refetchOnWindowFocus: false,
71197
71199
  refetchInterval: 60000,
71198
71200
  enabled: !!bondList && !!address,
71199
71201
  });
71200
71202
  }
71201
- const getUserBonds = (account, bondList) => __awaiter$9(void 0, void 0, void 0, function* () {
71203
+ const getUserBonds = (account, bondList, chains) => __awaiter$9(void 0, void 0, void 0, function* () {
71202
71204
  try {
71203
- const results = yield Promise.allSettled(MAINNET_CHAINS.map((chain) => fetchUserOwnedBillsDataAsync(chain, account, bondList)));
71205
+ const results = yield Promise.allSettled(chains.map((chain) => fetchUserOwnedBillsDataAsync(chain, account, bondList)));
71204
71206
  // Filter out only fulfilled promises
71205
71207
  const fulfilledResults = results
71206
71208
  .filter((result) => result.status === 'fulfilled')
@@ -71321,7 +71323,12 @@ const MenuSelect = (_a) => {
71321
71323
  };
71322
71324
 
71323
71325
  const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
71326
+ // Hooks
71327
+ const SDKConfig = useSDKConfig();
71328
+ const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
71329
+ // State
71324
71330
  const [isOpen, setIsOpen] = useState(false);
71331
+ // Handlers
71325
71332
  const handleCheckbox = (newChain) => {
71326
71333
  const prevChainFilterOptions = chainFilterOption;
71327
71334
  let newChainFilterOption;
@@ -71365,12 +71372,12 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
71365
71372
  top: '45px',
71366
71373
  right: '0px',
71367
71374
  width: '200px',
71368
- height: ['300px', '300px', '350px'],
71375
+ maxHeight: ['300px', '300px', '350px'],
71369
71376
  overflowY: 'scroll',
71370
71377
  borderRadius: 'normal',
71371
71378
  background: 'white2',
71372
71379
  zIndex: 1001,
71373
- }, children: ['All Chains', ...MAINNET_CHAINS].map((chainId) => {
71380
+ }, children: ['All Chains', ...chains].map((chainId) => {
71374
71381
  return (jsx$2(Flex, { sx: {
71375
71382
  borderRadius: 'normal',
71376
71383
  p: '5px 15px',
@@ -71513,6 +71520,8 @@ const YourBonds = () => {
71513
71520
 
71514
71521
  // This basically returns the 2 tags with the higher active bond count
71515
71522
  const useTopTags = (initialBondList) => {
71523
+ const SDKConfig = useSDKConfig();
71524
+ const chains = SDKConfig.chains;
71516
71525
  const bonds = initialBondList;
71517
71526
  const countTagsInBonds = (bonds) => {
71518
71527
  const tagCount = {};
@@ -71531,34 +71540,29 @@ const useTopTags = (initialBondList) => {
71531
71540
  });
71532
71541
  return tagCount;
71533
71542
  };
71534
- const activeBonds = bonds === null || bonds === void 0 ? void 0 : bonds.filter((bond) => !bond.soldOut);
71543
+ const activeBonds = bonds === null || bonds === void 0 ? void 0 : bonds.filter((bond) => !bond.soldOut && (chains === null || chains === void 0 ? void 0 : chains.includes(bond.chainId)));
71535
71544
  const countedTags = countTagsInBonds(activeBonds);
71536
71545
  const sortedTagsArray = Object.entries(countedTags).sort((a, b) => b[1] - a[1]);
71537
71546
  return sortedTagsArray.slice(0, 2).map((tagCountArray) => tagCountArray[0]);
71538
71547
  };
71539
71548
 
71540
71549
  const isBondSoldOut = (bill) => {
71541
- var _a;
71542
- const { tokensRemaining, discount, payoutTokenPrice } = bill;
71543
- if (bill.soldOut)
71544
- return true;
71545
- if (bill.inactive)
71546
- return true;
71547
- if (!tokensRemaining)
71548
- return false;
71549
- const thresholdToHide = new BigNumber$1(100).div(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : 0);
71550
- if (discount && discount > 50) {
71551
- // If discount is over 50% it will be hidden
71552
- // console.log('Soldout contract:', billAddress)
71553
- return true;
71554
- }
71555
- if (((_a = new BigNumber$1(tokensRemaining)) === null || _a === void 0 ? void 0 : _a.lte(thresholdToHide)) || discount === 100) {
71556
- // If there's less than 100 usd bond will be hidden
71557
- // console.log('Soldout contract: ', billAddress)
71558
- return true;
71559
- }
71560
- else
71561
- return false;
71550
+ return false;
71551
+ // const { tokensRemaining, discount, payoutTokenPrice } = bill
71552
+ // if (bill.soldOut) return true
71553
+ // if (bill.inactive) return true
71554
+ // if (!tokensRemaining) return false
71555
+ // const thresholdToHide = new BigNumber(100).div(payoutTokenPrice ?? 0)
71556
+ // if (discount && discount > 50) {
71557
+ // // If discount is over 50% it will be hidden
71558
+ // // console.log('Soldout contract:', billAddress)
71559
+ // return true
71560
+ // }
71561
+ // if (new BigNumber(tokensRemaining)?.lte(thresholdToHide) || discount === 100) {
71562
+ // // If there's less than 100 usd bond will be hidden
71563
+ // // console.log('Soldout contract: ', billAddress)
71564
+ // return true
71565
+ // } else return false
71562
71566
  };
71563
71567
  const sortBonds = (sortConfig, bonds) => {
71564
71568
  const bondsToSort = bonds !== null && bonds !== void 0 ? bonds : [];
@@ -72256,6 +72260,7 @@ const TokenSelectorModal = ({ bondPrincipalToken, bondEarnToken, handleCurrencyS
72256
72260
 
72257
72261
  const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, }) => {
72258
72262
  var _a, _b;
72263
+ const { address: account } = useAccount();
72259
72264
  const tokenBalanceString = tokenBalance ? new BigNumber$1(tokenBalance).toPrecision(5) : 'loading';
72260
72265
  const splited = typeof selectedToken !== 'string' ? (_a = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.symbol) === null || _a === void 0 ? void 0 : _a.split('-') : undefined;
72261
72266
  const handleInputChange = (event) => {
@@ -72278,7 +72283,7 @@ const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId,
72278
72283
  : v.currentTarget.value.slice(0, v.currentTarget.value.length - 1);
72279
72284
  } }) }), jsxs(Flex$1, { className: "input-container token", onClick: () => (enableZap ? onTokenSelectorModal() : null), sx: { cursor: enableZap ? 'pointer' : 'default' }, children: [jsxs(Flex$1, { children: [jsx$2(Flex$1, { className: "input-container bondicon", children: lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 28, chain: chainId })) : (jsx$2(TokenImage, { symbol: getSymbol(selectedToken, chainId), size: 28, chain: chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: getSymbol(selectedToken, chainId) })] }), enableZap && (jsx$2(Flex$1, { sx: { mr: '8px' }, children: jsx$2(Svg, { icon: "caret" }) }))] })] }), jsxs(Flex$1, { className: "input-container balancerow", children: [jsx$2(Flex$1, { children: selectedTokenPrice && typedValue
72280
72285
  ? `$${formatUSDNumber((selectedTokenPrice * parseFloat(typedValue)).toFixed(2))}`
72281
- : '' }), jsxs(Flex$1, { children: [jsxs(Flex$1, { className: "balancerow text", children: ["Balance: ", tokenBalanceString] }), jsxs(Flex$1, { className: "balancerow max", children: [tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant !== 'alt' && (jsx$2(Fragment$1, { children: jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" }) })), tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant === 'alt' && (jsxs(Flex$1, { children: [jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 4).toString()), children: "25%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 2).toString()), children: "50%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) * 0.75).toString()), children: "75%" }), jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" })] }))] })] })] })] }));
72286
+ : '' }), jsxs(Flex$1, { children: [account && jsxs(Flex$1, { className: "balancerow text", children: ["Balance: ", tokenBalanceString] }), jsxs(Flex$1, { className: "balancerow max", children: [tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant !== 'alt' && (jsx$2(Fragment$1, { children: jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" }) })), tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant === 'alt' && (jsxs(Flex$1, { children: [jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 4).toString()), children: "25%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 2).toString()), children: "50%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) * 0.75).toString()), children: "75%" }), jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" })] }))] })] })] })] }));
72282
72287
  };
72283
72288
 
72284
72289
  var NetworkNames;
@@ -72459,6 +72464,708 @@ const useSoulZapTokenQuote = (typedValue, inputCurrency, outputToken, chainId, a
72459
72464
  return [isLoading, response, estimateOutput, zapError];
72460
72465
  };
72461
72466
 
72467
+ var USDT_ETH_ABI = [
72468
+ {
72469
+ constant: true,
72470
+ inputs: [
72471
+ ],
72472
+ name: "name",
72473
+ outputs: [
72474
+ {
72475
+ name: "",
72476
+ type: "string"
72477
+ }
72478
+ ],
72479
+ payable: false,
72480
+ stateMutability: "view",
72481
+ type: "function"
72482
+ },
72483
+ {
72484
+ constant: false,
72485
+ inputs: [
72486
+ {
72487
+ name: "_upgradedAddress",
72488
+ type: "address"
72489
+ }
72490
+ ],
72491
+ name: "deprecate",
72492
+ outputs: [
72493
+ ],
72494
+ payable: false,
72495
+ stateMutability: "nonpayable",
72496
+ type: "function"
72497
+ },
72498
+ {
72499
+ constant: false,
72500
+ inputs: [
72501
+ {
72502
+ name: "_spender",
72503
+ type: "address"
72504
+ },
72505
+ {
72506
+ name: "_value",
72507
+ type: "uint256"
72508
+ }
72509
+ ],
72510
+ name: "approve",
72511
+ outputs: [
72512
+ ],
72513
+ payable: false,
72514
+ stateMutability: "nonpayable",
72515
+ type: "function"
72516
+ },
72517
+ {
72518
+ constant: true,
72519
+ inputs: [
72520
+ ],
72521
+ name: "deprecated",
72522
+ outputs: [
72523
+ {
72524
+ name: "",
72525
+ type: "bool"
72526
+ }
72527
+ ],
72528
+ payable: false,
72529
+ stateMutability: "view",
72530
+ type: "function"
72531
+ },
72532
+ {
72533
+ constant: false,
72534
+ inputs: [
72535
+ {
72536
+ name: "_evilUser",
72537
+ type: "address"
72538
+ }
72539
+ ],
72540
+ name: "addBlackList",
72541
+ outputs: [
72542
+ ],
72543
+ payable: false,
72544
+ stateMutability: "nonpayable",
72545
+ type: "function"
72546
+ },
72547
+ {
72548
+ constant: true,
72549
+ inputs: [
72550
+ ],
72551
+ name: "totalSupply",
72552
+ outputs: [
72553
+ {
72554
+ name: "",
72555
+ type: "uint256"
72556
+ }
72557
+ ],
72558
+ payable: false,
72559
+ stateMutability: "view",
72560
+ type: "function"
72561
+ },
72562
+ {
72563
+ constant: false,
72564
+ inputs: [
72565
+ {
72566
+ name: "_from",
72567
+ type: "address"
72568
+ },
72569
+ {
72570
+ name: "_to",
72571
+ type: "address"
72572
+ },
72573
+ {
72574
+ name: "_value",
72575
+ type: "uint256"
72576
+ }
72577
+ ],
72578
+ name: "transferFrom",
72579
+ outputs: [
72580
+ ],
72581
+ payable: false,
72582
+ stateMutability: "nonpayable",
72583
+ type: "function"
72584
+ },
72585
+ {
72586
+ constant: true,
72587
+ inputs: [
72588
+ ],
72589
+ name: "upgradedAddress",
72590
+ outputs: [
72591
+ {
72592
+ name: "",
72593
+ type: "address"
72594
+ }
72595
+ ],
72596
+ payable: false,
72597
+ stateMutability: "view",
72598
+ type: "function"
72599
+ },
72600
+ {
72601
+ constant: true,
72602
+ inputs: [
72603
+ {
72604
+ name: "",
72605
+ type: "address"
72606
+ }
72607
+ ],
72608
+ name: "balances",
72609
+ outputs: [
72610
+ {
72611
+ name: "",
72612
+ type: "uint256"
72613
+ }
72614
+ ],
72615
+ payable: false,
72616
+ stateMutability: "view",
72617
+ type: "function"
72618
+ },
72619
+ {
72620
+ constant: true,
72621
+ inputs: [
72622
+ ],
72623
+ name: "decimals",
72624
+ outputs: [
72625
+ {
72626
+ name: "",
72627
+ type: "uint256"
72628
+ }
72629
+ ],
72630
+ payable: false,
72631
+ stateMutability: "view",
72632
+ type: "function"
72633
+ },
72634
+ {
72635
+ constant: true,
72636
+ inputs: [
72637
+ ],
72638
+ name: "maximumFee",
72639
+ outputs: [
72640
+ {
72641
+ name: "",
72642
+ type: "uint256"
72643
+ }
72644
+ ],
72645
+ payable: false,
72646
+ stateMutability: "view",
72647
+ type: "function"
72648
+ },
72649
+ {
72650
+ constant: true,
72651
+ inputs: [
72652
+ ],
72653
+ name: "_totalSupply",
72654
+ outputs: [
72655
+ {
72656
+ name: "",
72657
+ type: "uint256"
72658
+ }
72659
+ ],
72660
+ payable: false,
72661
+ stateMutability: "view",
72662
+ type: "function"
72663
+ },
72664
+ {
72665
+ constant: false,
72666
+ inputs: [
72667
+ ],
72668
+ name: "unpause",
72669
+ outputs: [
72670
+ ],
72671
+ payable: false,
72672
+ stateMutability: "nonpayable",
72673
+ type: "function"
72674
+ },
72675
+ {
72676
+ constant: true,
72677
+ inputs: [
72678
+ {
72679
+ name: "_maker",
72680
+ type: "address"
72681
+ }
72682
+ ],
72683
+ name: "getBlackListStatus",
72684
+ outputs: [
72685
+ {
72686
+ name: "",
72687
+ type: "bool"
72688
+ }
72689
+ ],
72690
+ payable: false,
72691
+ stateMutability: "view",
72692
+ type: "function"
72693
+ },
72694
+ {
72695
+ constant: true,
72696
+ inputs: [
72697
+ {
72698
+ name: "",
72699
+ type: "address"
72700
+ },
72701
+ {
72702
+ name: "",
72703
+ type: "address"
72704
+ }
72705
+ ],
72706
+ name: "allowed",
72707
+ outputs: [
72708
+ {
72709
+ name: "",
72710
+ type: "uint256"
72711
+ }
72712
+ ],
72713
+ payable: false,
72714
+ stateMutability: "view",
72715
+ type: "function"
72716
+ },
72717
+ {
72718
+ constant: true,
72719
+ inputs: [
72720
+ ],
72721
+ name: "paused",
72722
+ outputs: [
72723
+ {
72724
+ name: "",
72725
+ type: "bool"
72726
+ }
72727
+ ],
72728
+ payable: false,
72729
+ stateMutability: "view",
72730
+ type: "function"
72731
+ },
72732
+ {
72733
+ constant: true,
72734
+ inputs: [
72735
+ {
72736
+ name: "who",
72737
+ type: "address"
72738
+ }
72739
+ ],
72740
+ name: "balanceOf",
72741
+ outputs: [
72742
+ {
72743
+ name: "",
72744
+ type: "uint256"
72745
+ }
72746
+ ],
72747
+ payable: false,
72748
+ stateMutability: "view",
72749
+ type: "function"
72750
+ },
72751
+ {
72752
+ constant: false,
72753
+ inputs: [
72754
+ ],
72755
+ name: "pause",
72756
+ outputs: [
72757
+ ],
72758
+ payable: false,
72759
+ stateMutability: "nonpayable",
72760
+ type: "function"
72761
+ },
72762
+ {
72763
+ constant: true,
72764
+ inputs: [
72765
+ ],
72766
+ name: "getOwner",
72767
+ outputs: [
72768
+ {
72769
+ name: "",
72770
+ type: "address"
72771
+ }
72772
+ ],
72773
+ payable: false,
72774
+ stateMutability: "view",
72775
+ type: "function"
72776
+ },
72777
+ {
72778
+ constant: true,
72779
+ inputs: [
72780
+ ],
72781
+ name: "owner",
72782
+ outputs: [
72783
+ {
72784
+ name: "",
72785
+ type: "address"
72786
+ }
72787
+ ],
72788
+ payable: false,
72789
+ stateMutability: "view",
72790
+ type: "function"
72791
+ },
72792
+ {
72793
+ constant: true,
72794
+ inputs: [
72795
+ ],
72796
+ name: "symbol",
72797
+ outputs: [
72798
+ {
72799
+ name: "",
72800
+ type: "string"
72801
+ }
72802
+ ],
72803
+ payable: false,
72804
+ stateMutability: "view",
72805
+ type: "function"
72806
+ },
72807
+ {
72808
+ constant: false,
72809
+ inputs: [
72810
+ {
72811
+ name: "_to",
72812
+ type: "address"
72813
+ },
72814
+ {
72815
+ name: "_value",
72816
+ type: "uint256"
72817
+ }
72818
+ ],
72819
+ name: "transfer",
72820
+ outputs: [
72821
+ ],
72822
+ payable: false,
72823
+ stateMutability: "nonpayable",
72824
+ type: "function"
72825
+ },
72826
+ {
72827
+ constant: false,
72828
+ inputs: [
72829
+ {
72830
+ name: "newBasisPoints",
72831
+ type: "uint256"
72832
+ },
72833
+ {
72834
+ name: "newMaxFee",
72835
+ type: "uint256"
72836
+ }
72837
+ ],
72838
+ name: "setParams",
72839
+ outputs: [
72840
+ ],
72841
+ payable: false,
72842
+ stateMutability: "nonpayable",
72843
+ type: "function"
72844
+ },
72845
+ {
72846
+ constant: false,
72847
+ inputs: [
72848
+ {
72849
+ name: "amount",
72850
+ type: "uint256"
72851
+ }
72852
+ ],
72853
+ name: "issue",
72854
+ outputs: [
72855
+ ],
72856
+ payable: false,
72857
+ stateMutability: "nonpayable",
72858
+ type: "function"
72859
+ },
72860
+ {
72861
+ constant: false,
72862
+ inputs: [
72863
+ {
72864
+ name: "amount",
72865
+ type: "uint256"
72866
+ }
72867
+ ],
72868
+ name: "redeem",
72869
+ outputs: [
72870
+ ],
72871
+ payable: false,
72872
+ stateMutability: "nonpayable",
72873
+ type: "function"
72874
+ },
72875
+ {
72876
+ constant: true,
72877
+ inputs: [
72878
+ {
72879
+ name: "_owner",
72880
+ type: "address"
72881
+ },
72882
+ {
72883
+ name: "_spender",
72884
+ type: "address"
72885
+ }
72886
+ ],
72887
+ name: "allowance",
72888
+ outputs: [
72889
+ {
72890
+ name: "remaining",
72891
+ type: "uint256"
72892
+ }
72893
+ ],
72894
+ payable: false,
72895
+ stateMutability: "view",
72896
+ type: "function"
72897
+ },
72898
+ {
72899
+ constant: true,
72900
+ inputs: [
72901
+ ],
72902
+ name: "basisPointsRate",
72903
+ outputs: [
72904
+ {
72905
+ name: "",
72906
+ type: "uint256"
72907
+ }
72908
+ ],
72909
+ payable: false,
72910
+ stateMutability: "view",
72911
+ type: "function"
72912
+ },
72913
+ {
72914
+ constant: true,
72915
+ inputs: [
72916
+ {
72917
+ name: "",
72918
+ type: "address"
72919
+ }
72920
+ ],
72921
+ name: "isBlackListed",
72922
+ outputs: [
72923
+ {
72924
+ name: "",
72925
+ type: "bool"
72926
+ }
72927
+ ],
72928
+ payable: false,
72929
+ stateMutability: "view",
72930
+ type: "function"
72931
+ },
72932
+ {
72933
+ constant: false,
72934
+ inputs: [
72935
+ {
72936
+ name: "_clearedUser",
72937
+ type: "address"
72938
+ }
72939
+ ],
72940
+ name: "removeBlackList",
72941
+ outputs: [
72942
+ ],
72943
+ payable: false,
72944
+ stateMutability: "nonpayable",
72945
+ type: "function"
72946
+ },
72947
+ {
72948
+ constant: true,
72949
+ inputs: [
72950
+ ],
72951
+ name: "MAX_UINT",
72952
+ outputs: [
72953
+ {
72954
+ name: "",
72955
+ type: "uint256"
72956
+ }
72957
+ ],
72958
+ payable: false,
72959
+ stateMutability: "view",
72960
+ type: "function"
72961
+ },
72962
+ {
72963
+ constant: false,
72964
+ inputs: [
72965
+ {
72966
+ name: "newOwner",
72967
+ type: "address"
72968
+ }
72969
+ ],
72970
+ name: "transferOwnership",
72971
+ outputs: [
72972
+ ],
72973
+ payable: false,
72974
+ stateMutability: "nonpayable",
72975
+ type: "function"
72976
+ },
72977
+ {
72978
+ constant: false,
72979
+ inputs: [
72980
+ {
72981
+ name: "_blackListedUser",
72982
+ type: "address"
72983
+ }
72984
+ ],
72985
+ name: "destroyBlackFunds",
72986
+ outputs: [
72987
+ ],
72988
+ payable: false,
72989
+ stateMutability: "nonpayable",
72990
+ type: "function"
72991
+ },
72992
+ {
72993
+ inputs: [
72994
+ {
72995
+ name: "_initialSupply",
72996
+ type: "uint256"
72997
+ },
72998
+ {
72999
+ name: "_name",
73000
+ type: "string"
73001
+ },
73002
+ {
73003
+ name: "_symbol",
73004
+ type: "string"
73005
+ },
73006
+ {
73007
+ name: "_decimals",
73008
+ type: "uint256"
73009
+ }
73010
+ ],
73011
+ payable: false,
73012
+ stateMutability: "nonpayable",
73013
+ type: "constructor"
73014
+ },
73015
+ {
73016
+ anonymous: false,
73017
+ inputs: [
73018
+ {
73019
+ indexed: false,
73020
+ name: "amount",
73021
+ type: "uint256"
73022
+ }
73023
+ ],
73024
+ name: "Issue",
73025
+ type: "event"
73026
+ },
73027
+ {
73028
+ anonymous: false,
73029
+ inputs: [
73030
+ {
73031
+ indexed: false,
73032
+ name: "amount",
73033
+ type: "uint256"
73034
+ }
73035
+ ],
73036
+ name: "Redeem",
73037
+ type: "event"
73038
+ },
73039
+ {
73040
+ anonymous: false,
73041
+ inputs: [
73042
+ {
73043
+ indexed: false,
73044
+ name: "newAddress",
73045
+ type: "address"
73046
+ }
73047
+ ],
73048
+ name: "Deprecate",
73049
+ type: "event"
73050
+ },
73051
+ {
73052
+ anonymous: false,
73053
+ inputs: [
73054
+ {
73055
+ indexed: false,
73056
+ name: "feeBasisPoints",
73057
+ type: "uint256"
73058
+ },
73059
+ {
73060
+ indexed: false,
73061
+ name: "maxFee",
73062
+ type: "uint256"
73063
+ }
73064
+ ],
73065
+ name: "Params",
73066
+ type: "event"
73067
+ },
73068
+ {
73069
+ anonymous: false,
73070
+ inputs: [
73071
+ {
73072
+ indexed: false,
73073
+ name: "_blackListedUser",
73074
+ type: "address"
73075
+ },
73076
+ {
73077
+ indexed: false,
73078
+ name: "_balance",
73079
+ type: "uint256"
73080
+ }
73081
+ ],
73082
+ name: "DestroyedBlackFunds",
73083
+ type: "event"
73084
+ },
73085
+ {
73086
+ anonymous: false,
73087
+ inputs: [
73088
+ {
73089
+ indexed: false,
73090
+ name: "_user",
73091
+ type: "address"
73092
+ }
73093
+ ],
73094
+ name: "AddedBlackList",
73095
+ type: "event"
73096
+ },
73097
+ {
73098
+ anonymous: false,
73099
+ inputs: [
73100
+ {
73101
+ indexed: false,
73102
+ name: "_user",
73103
+ type: "address"
73104
+ }
73105
+ ],
73106
+ name: "RemovedBlackList",
73107
+ type: "event"
73108
+ },
73109
+ {
73110
+ anonymous: false,
73111
+ inputs: [
73112
+ {
73113
+ indexed: true,
73114
+ name: "owner",
73115
+ type: "address"
73116
+ },
73117
+ {
73118
+ indexed: true,
73119
+ name: "spender",
73120
+ type: "address"
73121
+ },
73122
+ {
73123
+ indexed: false,
73124
+ name: "value",
73125
+ type: "uint256"
73126
+ }
73127
+ ],
73128
+ name: "Approval",
73129
+ type: "event"
73130
+ },
73131
+ {
73132
+ anonymous: false,
73133
+ inputs: [
73134
+ {
73135
+ indexed: true,
73136
+ name: "from",
73137
+ type: "address"
73138
+ },
73139
+ {
73140
+ indexed: true,
73141
+ name: "to",
73142
+ type: "address"
73143
+ },
73144
+ {
73145
+ indexed: false,
73146
+ name: "value",
73147
+ type: "uint256"
73148
+ }
73149
+ ],
73150
+ name: "Transfer",
73151
+ type: "event"
73152
+ },
73153
+ {
73154
+ anonymous: false,
73155
+ inputs: [
73156
+ ],
73157
+ name: "Pause",
73158
+ type: "event"
73159
+ },
73160
+ {
73161
+ anonymous: false,
73162
+ inputs: [
73163
+ ],
73164
+ name: "Unpause",
73165
+ type: "event"
73166
+ }
73167
+ ];
73168
+
72462
73169
  /**
72463
73170
  * useAllowance hook: fetches the amount approved by the user for a given token
72464
73171
  * useApproval hook: returns the approval state (not approved, pending or approved) and a function to approve on chain
@@ -72537,7 +73244,9 @@ const useApproval = (amount, currency, spender, account, chainId) => {
72537
73244
  setConfirmingTxOnWallet(true);
72538
73245
  const hash = yield writeContractAsync({
72539
73246
  address: tokenAddress,
72540
- abi: ERC_20_ABI,
73247
+ abi: (tokenAddress === null || tokenAddress === void 0 ? void 0 : tokenAddress.toLowerCase()) === '0xdAC17F958D2ee523a2206206994597C13D831ec7'.toLowerCase()
73248
+ ? USDT_ETH_ABI
73249
+ : ERC_20_ABI,
72541
73250
  functionName: 'approve',
72542
73251
  args: [spender, bigishAmount],
72543
73252
  });
@@ -73712,7 +74421,7 @@ const getHotBonds = (bondData, hotBondContracts) => __awaiter$9(void 0, void 0,
73712
74421
  const HotBondCards = () => {
73713
74422
  var _a;
73714
74423
  const { data: hotBonds } = useHotBonds();
73715
- const filteredBonds = (_a = hotBonds === null || hotBonds === void 0 ? void 0 : hotBonds.sort((a, b) => { var _a, _b; return ((_a = b === null || b === void 0 ? void 0 : b.discount) !== null && _a !== void 0 ? _a : 0) - ((_b = a === null || a === void 0 ? void 0 : a.discount) !== null && _b !== void 0 ? _b : 0); })) === null || _a === void 0 ? void 0 : _a.filter((bond) => { var _a; return ((_a = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _a !== void 0 ? _a : 0) > 0; });
74424
+ const filteredBonds = (_a = hotBonds === null || hotBonds === void 0 ? void 0 : hotBonds.sort((a, b) => { var _a, _b; return ((_a = b === null || b === void 0 ? void 0 : b.discount) !== null && _a !== void 0 ? _a : 0) - ((_b = a === null || a === void 0 ? void 0 : a.discount) !== null && _b !== void 0 ? _b : 0); })) === null || _a === void 0 ? void 0 : _a.filter((bond) => (bond === null || bond === void 0 ? void 0 : bond.discount) > 0 && (bond === null || bond === void 0 ? void 0 : bond.discount) < 50);
73716
74425
  const [activeSlide, setActiveSlide] = useState(0);
73717
74426
  const { swiper, setSwiper } = useSwiper();
73718
74427
  const handleSlide = (event) => {
@@ -73794,10 +74503,12 @@ function useUserApiStats() {
73794
74503
  const BuyAgainRow = () => {
73795
74504
  const { data: userData } = useUserApiStats();
73796
74505
  const { data: bills } = useBondsData();
74506
+ const SDKConfig = useSDKConfig();
74507
+ const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
73797
74508
  const buyAgainBond = useMemo(() => {
73798
74509
  if (userData && (userData === null || userData === void 0 ? void 0 : userData.Sales.length) > 0) {
73799
74510
  const sortedPurchases = userData === null || userData === void 0 ? void 0 : userData.Sales.sort((a, b) => b.dollarValue - a.dollarValue);
73800
- const activeBills = bills === null || bills === void 0 ? void 0 : bills.filter((bill) => !isBondSoldOut(bill));
74511
+ const activeBills = bills === null || bills === void 0 ? void 0 : bills.filter((bill) => (chains === null || chains === void 0 ? void 0 : chains.includes(bill.chainId)));
73801
74512
  const highestActivePurchase = sortedPurchases === null || sortedPurchases === void 0 ? void 0 : sortedPurchases.find((purchase) => activeBills === null || activeBills === void 0 ? void 0 : activeBills.find((bill) => {
73802
74513
  var _a;
73803
74514
  if (purchase.contractAddress.toLowerCase() === ((_a = bill === null || bill === void 0 ? void 0 : bill.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()))
@@ -73805,7 +74516,7 @@ const BuyAgainRow = () => {
73805
74516
  }));
73806
74517
  return activeBills === null || activeBills === void 0 ? void 0 : activeBills.find((bill) => { var _a, _b; return ((_a = bill === null || bill === void 0 ? void 0 : bill.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = highestActivePurchase === null || highestActivePurchase === void 0 ? void 0 : highestActivePurchase.contractAddress) === null || _b === void 0 ? void 0 : _b.toLowerCase()); });
73807
74518
  }
73808
- }, [bills, userData === null || userData === void 0 ? void 0 : userData.Sales.length]);
74519
+ }, [bills, userData === null || userData === void 0 ? void 0 : userData.Sales.length, chains]);
73809
74520
  return buyAgainBond ? (jsx$2(AnimatePresence, { children: jsx$2(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
73810
74521
  position: 'relative',
73811
74522
  overflow: 'hidden',
@@ -73959,13 +74670,14 @@ const Bonds = () => {
73959
74670
  const [filterOption, setFilterOption] = useState('ALL');
73960
74671
  const sortedBonds = sortBonds(sortConfig, bondData);
73961
74672
  const topTags = useTopTags(sortedBonds);
74673
+ // remove favorites for seedify
73962
74674
  const filterOptions = SDKConfig.referenceId !== 'seedify' ? ['ALL', 'FAVORITES', ...topTags, 'SOLD OUT'] : ['ALL', ...topTags, 'SOLD OUT'];
73963
74675
  const billsToRender = useMemo(() => {
73964
74676
  let billsToReturn = filterOption === 'SOLD OUT' ? (allBonds !== null && allBonds !== void 0 ? allBonds : []) : (sortedBonds !== null && sortedBonds !== void 0 ? sortedBonds : []);
73965
74677
  if (searchQuery) {
73966
74678
  billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
73967
74679
  var _a, _b;
73968
- return [`${(_a = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _a === void 0 ? void 0 : _a.symbol.toUpperCase()}`, `${(_b = bill === null || bill === void 0 ? void 0 : bill.lpToken) === null || _b === void 0 ? void 0 : _b.symbol.toUpperCase()}`].includes(searchQuery.toUpperCase());
74680
+ return [`${(_a = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _a === void 0 ? void 0 : _a.symbol.toUpperCase()}`, `${(_b = bill === null || bill === void 0 ? void 0 : bill.lpToken) === null || _b === void 0 ? void 0 : _b.symbol.toUpperCase()}`].some((property) => property === null || property === void 0 ? void 0 : property.includes(searchQuery.toUpperCase()));
73969
74681
  });
73970
74682
  }
73971
74683
  if (topTags.includes(filterOption)) {
@@ -73975,7 +74687,7 @@ const Bonds = () => {
73975
74687
  billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => { var _a; return chainFilterOption === null || chainFilterOption === void 0 ? void 0 : chainFilterOption.includes((_a = bill === null || bill === void 0 ? void 0 : bill.chainId) === null || _a === void 0 ? void 0 : _a.toString()); });
73976
74688
  }
73977
74689
  if (filterOption !== 'SOLD OUT') {
73978
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bond) => !isBondSoldOut(bond));
74690
+ billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bond) => !isBondSoldOut());
73979
74691
  }
73980
74692
  if (filterOption === 'SOLD OUT') {
73981
74693
  billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bond) => !bond.soldOut);
@@ -74005,7 +74717,7 @@ const Bonds = () => {
74005
74717
  alignItems: 'center',
74006
74718
  flexDirection: 'column',
74007
74719
  mt: '10px',
74008
- }, children: [jsx$2(Svg, { icon: "StarFilled", width: 75, height: 75 }), jsx$2(Flex$1, { sx: { mt: '10px' }, children: `You don't have any Favorite Bonds yet!` }), jsx$2(Flex$1, { sx: { fontSize: '12px', fontWeight: 400, color: 'textDisabledButton', mt: '10px' }, children: `Click on the 'star' or 'fire' icon to add Bonds to the list.` })] })) : (jsx$2(Flex$1, { className: "bonds-spinner", children: jsx$2(Spinner, { size: 100 }) })), jsx$2(RecommendationCards$1, {})] }));
74720
+ }, children: [jsx$2(Svg, { icon: "StarFilled", width: 75, height: 75 }), jsx$2(Flex$1, { sx: { mt: '10px' }, children: `You don't have any Favorite Bonds yet!` }), jsx$2(Flex$1, { sx: { fontSize: '12px', fontWeight: 400, color: 'textDisabledButton', mt: '10px' }, children: `Click on the 'star' or 'fire' icon to add Bonds to the list.` })] })) : (jsx$2(Flex$1, { className: "bonds-spinner", children: jsx$2(Spinner, { size: 100 }) })), SDKConfig.useHotBonds && jsx$2(RecommendationCards$1, {})] }));
74009
74721
  };
74010
74722
 
74011
74723
  var BondsViewOptions;
@@ -2,4 +2,4 @@ import { UseQueryResult } from '@tanstack/react-query';
2
2
  import { BillsConfig } from '@ape.swap/apeswap-lists';
3
3
  import { UserBill } from '../../types/yourbonds';
4
4
  export default function useUserBonds(): UseQueryResult<UserBill[]>;
5
- export declare const getUserBonds: (account: string, bondList: BillsConfig[]) => Promise<UserBill[]>;
5
+ export declare const getUserBonds: (account: string, bondList: BillsConfig[], chains: number[]) => Promise<UserBill[]>;
package/dist/styles.css CHANGED
@@ -255,7 +255,7 @@
255
255
  padding-left: 10px;
256
256
  }
257
257
 
258
- .modaltable-container.description-container {
258
+ .description-container {
259
259
  display: flex;
260
260
  align-items: flex-start;
261
261
  font-weight: 400;
@@ -1745,8 +1745,8 @@ span.flex-inline {
1745
1745
  background-color: rgba(255, 255, 255, 0.1);
1746
1746
  backdrop-filter: blur(34px);
1747
1747
  border-radius: 10px;
1748
- justify-content: start;
1749
- align-items: start;
1748
+ justify-content: flex-start;
1749
+ align-items: flex-start;
1750
1750
  flex-direction: column;
1751
1751
  padding: 10px 8px 10px 8px;
1752
1752
  margin-top: -3px;
@@ -1754,7 +1754,7 @@ span.flex-inline {
1754
1754
 
1755
1755
  .sharebondimage-container-discount {
1756
1756
  display: flex;
1757
- justify-content: start;
1757
+ justify-content: flex-start;
1758
1758
  align-items: center;
1759
1759
  width: 100%;
1760
1760
  background-color: rgba(255, 255, 255, 0.05);
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": "2.1.0",
6
+ "version": "2.1.1-test.0",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",