@ape.swap/bonds-sdk 2.0.0-test.3 → 2.0.1
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
|
@@ -18442,7 +18442,6 @@ var types = {};
|
|
|
18442
18442
|
// Network chain ids
|
|
18443
18443
|
// These are the lists we will display to the user
|
|
18444
18444
|
const MAINNET_CHAINS = [
|
|
18445
|
-
types.ChainId.GRAPHLINQ,
|
|
18446
18445
|
types.ChainId.MAINNET,
|
|
18447
18446
|
types.ChainId.BSC,
|
|
18448
18447
|
types.ChainId.MATIC,
|
|
@@ -18451,6 +18450,8 @@ const MAINNET_CHAINS = [
|
|
|
18451
18450
|
types.ChainId.LINEA,
|
|
18452
18451
|
types.ChainId.ARBITRUM,
|
|
18453
18452
|
types.ChainId.LIGHTLINK,
|
|
18453
|
+
types.ChainId.GRAPHLINQ,
|
|
18454
|
+
types.ChainId.AVAX,
|
|
18454
18455
|
];
|
|
18455
18456
|
// Network Icons
|
|
18456
18457
|
const NETWORK_ICONS = {
|
|
@@ -18466,6 +18467,7 @@ const NETWORK_ICONS = {
|
|
|
18466
18467
|
[types.ChainId.IOTA]: icons.IOTA,
|
|
18467
18468
|
[types.ChainId.BASE]: icons.BASE,
|
|
18468
18469
|
[types.ChainId.GRAPHLINQ]: icons.GRAPHLINQ,
|
|
18470
|
+
[types.ChainId.AVAX]: icons.AVAX_TOKEN,
|
|
18469
18471
|
};
|
|
18470
18472
|
// Network labels
|
|
18471
18473
|
const NETWORK_LABEL = {
|
|
@@ -18483,6 +18485,7 @@ const NETWORK_LABEL = {
|
|
|
18483
18485
|
[types.ChainId.IOTA_TESTNET]: 'Iota Testnet',
|
|
18484
18486
|
[types.ChainId.BASE]: 'Base',
|
|
18485
18487
|
[types.ChainId.GRAPHLINQ]: 'GraphLinq',
|
|
18488
|
+
[types.ChainId.AVAX]: 'Avalanche',
|
|
18486
18489
|
};
|
|
18487
18490
|
// Network block explorers
|
|
18488
18491
|
const BLOCK_EXPLORER = {
|
|
@@ -18500,6 +18503,7 @@ const BLOCK_EXPLORER = {
|
|
|
18500
18503
|
[types.ChainId.IOTA_TESTNET]: 'https://explorer.evm.testnet.iotaledger.net/',
|
|
18501
18504
|
[types.ChainId.BASE]: 'https://basescan.org',
|
|
18502
18505
|
[types.ChainId.GRAPHLINQ]: 'https://graphlinq.dex.guru',
|
|
18506
|
+
[types.ChainId.AVAX]: 'https://snowscan.xyz',
|
|
18503
18507
|
};
|
|
18504
18508
|
|
|
18505
18509
|
const supportedByLIFI = [
|
|
@@ -18509,6 +18513,7 @@ const supportedByLIFI = [
|
|
|
18509
18513
|
types.ChainId.ARBITRUM,
|
|
18510
18514
|
types.ChainId.LINEA,
|
|
18511
18515
|
types.ChainId.BASE,
|
|
18516
|
+
types.ChainId.AVAX,
|
|
18512
18517
|
];
|
|
18513
18518
|
// we should be good just by using staging on this, as it is only used for token images
|
|
18514
18519
|
const APESWAP_LIST_REPO = `https://raw.githubusercontent.com/ApeSwapFinance/apeswap-token-lists/staging`;
|
|
@@ -18685,6 +18690,7 @@ const NETWORK_COLORS = {
|
|
|
18685
18690
|
[types.ChainId.LINEA]: '#fff',
|
|
18686
18691
|
[types.ChainId.IOTA]: '#fff',
|
|
18687
18692
|
[types.ChainId.GRAPHLINQ]: '#ded2ff',
|
|
18693
|
+
[types.ChainId.AVAX]: '#e74344',
|
|
18688
18694
|
};
|
|
18689
18695
|
const TokenInfoAndName = ({ bill, vestEnds, isHotBond, }) => {
|
|
18690
18696
|
var _a, _b, _c, _d;
|
|
@@ -48745,6 +48751,7 @@ const PRICE_GETTER_ADDRESSES = {
|
|
|
48745
48751
|
[types.ChainId.LIGHTLINK]: '0xC22Db8dDe3A3591fFB02be868Ce2901d30671FE4',
|
|
48746
48752
|
[types.ChainId.IOTA]: '0xC22Db8dDe3A3591fFB02be868Ce2901d30671FE4',
|
|
48747
48753
|
[types.ChainId.BASE]: '0x2e6AB3cc819BE64886C1bB403813cCBec0407a5b',
|
|
48754
|
+
[types.ChainId.AVAX]: '0x70005Da62E17041977f7F99f91098b125CcDE1a7',
|
|
48748
48755
|
};
|
|
48749
48756
|
const MULTICALL_V2 = {
|
|
48750
48757
|
[types.ChainId.BSC]: '0x38ce767d81de3940CFa5020B55af1A400ED4F657',
|
|
@@ -48760,6 +48767,7 @@ const MULTICALL_V2 = {
|
|
|
48760
48767
|
[types.ChainId.IOTA]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
48761
48768
|
[types.ChainId.BASE]: '0xDF845ff2dA2325Df9C6CC3DDF7418C54E16bbFDF',
|
|
48762
48769
|
[types.ChainId.GRAPHLINQ]: '0xCc88b233BbcE04c064C627ad5627da6e24a8A067',
|
|
48770
|
+
[types.ChainId.AVAX]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
48763
48771
|
};
|
|
48764
48772
|
const SoulZapTokenManager = {
|
|
48765
48773
|
[types.ChainId.MAINNET]: '0x2F87f76336A560bbB0d18d357D10646bB96E8802',
|
|
@@ -48768,6 +48776,7 @@ const SoulZapTokenManager = {
|
|
|
48768
48776
|
[types.ChainId.BSC]: '0x7119014f0d75A7a31b875F79cE14b2a32B34B067',
|
|
48769
48777
|
[types.ChainId.BASE]: '0x0B750790dCa8f289fAB5eFd1a48EfAb969e51D16',
|
|
48770
48778
|
[types.ChainId.ARBITRUM]: '0x22572A548Ff26Fc5725a17dfd233F49a98c17EE7',
|
|
48779
|
+
[types.ChainId.AVAX]: '0xC4dE46cBE21400dabE2E7c66E04F43acE4b5b910',
|
|
48771
48780
|
};
|
|
48772
48781
|
const ACF_TO_ABOND = '0xEce2b9C3704632Ce760271B0b84E3A4A698Ca962';
|
|
48773
48782
|
|
|
@@ -67357,6 +67366,7 @@ const PUBLIC_RPC_URLS = {
|
|
|
67357
67366
|
[types.ChainId.IOTA_TESTNET]: ['https://json-rpc.evm.testnet.iotaledger.net/'],
|
|
67358
67367
|
[types.ChainId.BASE]: ['https://base-rpc.publicnode.com', 'https://mainnet.base.org'],
|
|
67359
67368
|
[types.ChainId.GRAPHLINQ]: ['https://glq-dataseed.graphlinq.io'],
|
|
67369
|
+
[types.ChainId.AVAX]: ['https://avax.meowrpc.com'],
|
|
67360
67370
|
};
|
|
67361
67371
|
|
|
67362
67372
|
// This is the legacy multicall
|
|
@@ -71297,7 +71307,7 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
|
71297
71307
|
width: '100vw',
|
|
71298
71308
|
height: '100vh',
|
|
71299
71309
|
zIndex: 1000,
|
|
71300
|
-
}, onClick: () => setIsOpen(false)
|
|
71310
|
+
}, onClick: () => setIsOpen(false) })), jsxs(Flex, { sx: {
|
|
71301
71311
|
background: 'white2',
|
|
71302
71312
|
p: '6px',
|
|
71303
71313
|
borderRadius: 'normal',
|
|
@@ -71563,25 +71573,103 @@ const calculateARR = (bond) => {
|
|
|
71563
71573
|
};
|
|
71564
71574
|
|
|
71565
71575
|
function useBondsData() {
|
|
71576
|
+
const { data: tokenPrices } = useTokenPrices();
|
|
71577
|
+
const { data: bondList } = useBondsList();
|
|
71566
71578
|
const realTimeApiURL = useURLByEnvironment('realTimeApi');
|
|
71567
71579
|
return useQuery({
|
|
71568
71580
|
queryKey: [QUERY_KEYS.BONDS_DATA],
|
|
71569
|
-
queryFn: () => getBondsData(realTimeApiURL),
|
|
71570
|
-
refetchInterval:
|
|
71581
|
+
queryFn: () => getBondsData(realTimeApiURL, tokenPrices, bondList),
|
|
71582
|
+
refetchInterval: 45000, // i.e. 45 sec
|
|
71571
71583
|
refetchOnWindowFocus: false,
|
|
71572
71584
|
retry: 1,
|
|
71573
71585
|
initialData: [],
|
|
71574
71586
|
});
|
|
71575
71587
|
}
|
|
71576
|
-
const getBondsData = (realTimeApiURL) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
71588
|
+
const getBondsData = (realTimeApiURL, tokenPrices, bondList) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
71577
71589
|
try {
|
|
71578
71590
|
const response = yield axios.get(realTimeApiURL);
|
|
71579
71591
|
return response.data.bonds;
|
|
71580
71592
|
}
|
|
71581
71593
|
catch (_a) {
|
|
71582
|
-
|
|
71594
|
+
const billData = [];
|
|
71595
|
+
if (tokenPrices && bondList) {
|
|
71596
|
+
yield Promise.all(MAINNET_CHAINS.map((chainId) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
71597
|
+
var _a;
|
|
71598
|
+
const bills = (_a = bondList === null || bondList === void 0 ? void 0 : bondList.filter((bill) => {
|
|
71599
|
+
var _a, _b;
|
|
71600
|
+
return ((_b = (_a = bill === null || bill === void 0 ? void 0 : bill.contractAddress) === null || _a === void 0 ? void 0 : _a[chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) !== ACF_TO_ABOND.toLowerCase() &&
|
|
71601
|
+
!bill.soldOut &&
|
|
71602
|
+
bill.chainId === chainId;
|
|
71603
|
+
})) !== null && _a !== void 0 ? _a : [];
|
|
71604
|
+
const returnedBills = yield fetchBills(chainId, tokenPrices, bills);
|
|
71605
|
+
billData.push(returnedBills);
|
|
71606
|
+
})));
|
|
71607
|
+
}
|
|
71608
|
+
return billData === null || billData === void 0 ? void 0 : billData.flat();
|
|
71583
71609
|
}
|
|
71584
71610
|
});
|
|
71611
|
+
const fetchBills = (chainId, tokenPrices, bills) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
71612
|
+
const billIds = [];
|
|
71613
|
+
const billCalls = bills.flatMap((bill) => {
|
|
71614
|
+
var _a, _b, _c, _d;
|
|
71615
|
+
billIds.push(bill.index);
|
|
71616
|
+
return [
|
|
71617
|
+
// Get bill price with LP fees
|
|
71618
|
+
{
|
|
71619
|
+
address: (_a = bill.contractAddress[bill.chainId]) !== null && _a !== void 0 ? _a : '',
|
|
71620
|
+
name: 'trueBillPrice',
|
|
71621
|
+
},
|
|
71622
|
+
// Get bill debt ratio
|
|
71623
|
+
{
|
|
71624
|
+
address: (_b = bill.contractAddress[bill.chainId]) !== null && _b !== void 0 ? _b : '',
|
|
71625
|
+
name: 'totalPayoutGiven',
|
|
71626
|
+
},
|
|
71627
|
+
// Terms
|
|
71628
|
+
// (1) controlVariable (2) vestingTerm (3) minimumPrice (4) maxPayout (5) maxDebt
|
|
71629
|
+
{
|
|
71630
|
+
address: (_c = bill.contractAddress[bill.chainId]) !== null && _c !== void 0 ? _c : '',
|
|
71631
|
+
name: 'terms',
|
|
71632
|
+
},
|
|
71633
|
+
{
|
|
71634
|
+
address: (_d = bill.contractAddress[bill.chainId]) !== null && _d !== void 0 ? _d : '',
|
|
71635
|
+
name: bill.billVersion !== types.BillVersion.V1 ? 'getMaxTotalPayout' : 'maxTotalPayout',
|
|
71636
|
+
},
|
|
71637
|
+
];
|
|
71638
|
+
});
|
|
71639
|
+
const vals = yield multicall(chainId, BOND_ABI, billCalls);
|
|
71640
|
+
const chunkSize = (vals === null || vals === void 0 ? void 0 : vals.length) / (bills === null || bills === void 0 ? void 0 : bills.length);
|
|
71641
|
+
const chunkedBills = lodashExports.chunk(vals, chunkSize);
|
|
71642
|
+
return cleanBillsData(billIds, chunkedBills, tokenPrices, chainId, bills);
|
|
71643
|
+
});
|
|
71644
|
+
const cleanBillsData = (billIds, chunkedBills, tokenPrices, chainId, bills) => {
|
|
71645
|
+
const data = chunkedBills === null || chunkedBills === void 0 ? void 0 : chunkedBills.map((chunk, index) => {
|
|
71646
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
71647
|
+
const bill = bills === null || bills === void 0 ? void 0 : bills.find((bill) => (bill === null || bill === void 0 ? void 0 : bill.index) === billIds[index]);
|
|
71648
|
+
const lpPrice = (_a = tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.find((tokenPrice) => {
|
|
71649
|
+
var _a, _b, _c, _d;
|
|
71650
|
+
return ((_a = tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_d = (_c = (_b = bill === null || bill === void 0 ? void 0 : bill.lpToken) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c[bill === null || bill === void 0 ? void 0 : bill.chainId]) === null || _d === void 0 ? void 0 : _d.toLowerCase()) &&
|
|
71651
|
+
(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.chainId) === chainId;
|
|
71652
|
+
})) === null || _a === void 0 ? void 0 : _a.price;
|
|
71653
|
+
const earnTokenPrice = (_b = tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.find((tokenPrice) => {
|
|
71654
|
+
var _a, _b, _c, _d;
|
|
71655
|
+
return ((_a = tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_d = (_c = (_b = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c[bill === null || bill === void 0 ? void 0 : bill.chainId]) === null || _d === void 0 ? void 0 : _d.toLowerCase()) &&
|
|
71656
|
+
(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.chainId) === chainId;
|
|
71657
|
+
})) === null || _b === void 0 ? void 0 : _b.price;
|
|
71658
|
+
const [trueBillPrice, totalPayoutGiven, terms, maxTotalPayout] = chunk;
|
|
71659
|
+
const [, vestingTerm, , maxPayout] = terms;
|
|
71660
|
+
const priceUsd = lpPrice && trueBillPrice && getBalanceNumber(trueBillPrice === null || trueBillPrice === void 0 ? void 0 : trueBillPrice.toString()) * lpPrice;
|
|
71661
|
+
const discount = earnTokenPrice && priceUsd && ((earnTokenPrice - priceUsd) / earnTokenPrice) * 100;
|
|
71662
|
+
const tokensRemaining = new BigNumber$1(maxTotalPayout !== null && maxTotalPayout !== void 0 ? maxTotalPayout : '0')
|
|
71663
|
+
.minus(new BigNumber$1(totalPayoutGiven))
|
|
71664
|
+
.div(new BigNumber$1(10).pow((_c = bill === null || bill === void 0 ? void 0 : bill.earnToken.decimals[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _c !== void 0 ? _c : 18))
|
|
71665
|
+
.toString();
|
|
71666
|
+
//I've added a ts ignore here due to some props marked as optional in the list repo which are actually not optional
|
|
71667
|
+
//@ts-ignore
|
|
71668
|
+
const cleanedData = Object.assign(Object.assign({}, bill), { type: (_d = bill === null || bill === void 0 ? void 0 : bill.billType) !== null && _d !== void 0 ? _d : '', billAddress: (_e = bill === null || bill === void 0 ? void 0 : bill.contractAddress[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _e !== void 0 ? _e : '', billNftAddress: (_f = bill === null || bill === void 0 ? void 0 : bill.billNnftAddress[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _f !== void 0 ? _f : '', showcaseTokenName: (_j = (_h = (_g = bill === null || bill === void 0 ? void 0 : bill.showcaseToken) === null || _g === void 0 ? void 0 : _g.symbol) !== null && _h !== void 0 ? _h : bill === null || bill === void 0 ? void 0 : bill.earnToken.symbol) !== null && _j !== void 0 ? _j : '', discount: discount, principalTokenPrice: (_k = lpPrice === null || lpPrice === void 0 ? void 0 : lpPrice.toString()) !== null && _k !== void 0 ? _k : '0', payoutTokenPrice: (_l = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.toString()) !== null && _l !== void 0 ? _l : '0', tokensRemaining, maxTotalPayout: maxTotalPayout === null || maxTotalPayout === void 0 ? void 0 : maxTotalPayout.toString(), trueBillPrice: trueBillPrice === null || trueBillPrice === void 0 ? void 0 : trueBillPrice.toString(), maxPayout: maxPayout === null || maxPayout === void 0 ? void 0 : maxPayout.toString(), totalPayoutGiven: totalPayoutGiven === null || totalPayoutGiven === void 0 ? void 0 : totalPayoutGiven.toString(), vestingTerm: vestingTerm.toNumber() });
|
|
71669
|
+
return cleanedData;
|
|
71670
|
+
});
|
|
71671
|
+
return data;
|
|
71672
|
+
};
|
|
71585
71673
|
|
|
71586
71674
|
function adjustDecimals(numStr) {
|
|
71587
71675
|
const parts = numStr.split('.');
|
|
@@ -72155,6 +72243,7 @@ var NetworkNames;
|
|
|
72155
72243
|
NetworkNames["ARBITRUM"] = "arb";
|
|
72156
72244
|
NetworkNames["LINEA"] = "lna";
|
|
72157
72245
|
NetworkNames["BASE"] = "bas";
|
|
72246
|
+
NetworkNames["AVAX"] = "ava";
|
|
72158
72247
|
})(NetworkNames || (NetworkNames = {}));
|
|
72159
72248
|
const getChainParam = (chain) => {
|
|
72160
72249
|
return chain === types.ChainId.LINEA
|
|
@@ -72169,7 +72258,9 @@ const getChainParam = (chain) => {
|
|
|
72169
72258
|
? NetworkNames.ARBITRUM
|
|
72170
72259
|
: chain === types.ChainId.MAINNET
|
|
72171
72260
|
? NetworkNames.MAINNET
|
|
72172
|
-
:
|
|
72261
|
+
: chain === types.ChainId.AVAX
|
|
72262
|
+
? NetworkNames.AVAX
|
|
72263
|
+
: null;
|
|
72173
72264
|
};
|
|
72174
72265
|
const getLpType = (protocol) => {
|
|
72175
72266
|
return protocol === types.Protocols.Algebra
|
|
@@ -73725,9 +73816,17 @@ const Bonds = () => {
|
|
|
73725
73816
|
// Fetch data
|
|
73726
73817
|
useHotBonds();
|
|
73727
73818
|
const { favTokens } = useFavoriteTokens();
|
|
73728
|
-
const { data: bondData } = useBondsData();
|
|
73819
|
+
const { data: bondData, refetch: refetchBondsData } = useBondsData();
|
|
73729
73820
|
const { data: allBonds } = useBondsList();
|
|
73730
73821
|
const { data: chainFilterOption, setChainFilterOption } = useChainFilterOption();
|
|
73822
|
+
const { data: tokenPrices } = useTokenPrices();
|
|
73823
|
+
useEffect(() => {
|
|
73824
|
+
//@ts-ignore
|
|
73825
|
+
if ((bondData === null || bondData === void 0 ? void 0 : bondData.length) === 0 && (tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length) > 0 && (allBonds === null || allBonds === void 0 ? void 0 : allBonds.length) > 0) {
|
|
73826
|
+
console.log('Real time api call failed, triggering fallback strategy');
|
|
73827
|
+
refetchBondsData();
|
|
73828
|
+
}
|
|
73829
|
+
}, [bondData === null || bondData === void 0 ? void 0 : bondData.length, tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length]);
|
|
73731
73830
|
// State
|
|
73732
73831
|
const [sortConfig, setSortConfig] = useState({ key: 'discount', direction: 'desc' });
|
|
73733
73832
|
const [searchQuery, setSearchQuery] = useState('');
|
|
@@ -73739,14 +73838,15 @@ const Bonds = () => {
|
|
|
73739
73838
|
let billsToReturn = filterOption === 'SOLD OUT' ? (allBonds !== null && allBonds !== void 0 ? allBonds : []) : (sortedBonds !== null && sortedBonds !== void 0 ? sortedBonds : []);
|
|
73740
73839
|
if (searchQuery) {
|
|
73741
73840
|
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
|
|
73742
|
-
|
|
73841
|
+
var _a, _b;
|
|
73842
|
+
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());
|
|
73743
73843
|
});
|
|
73744
73844
|
}
|
|
73745
73845
|
if (topTags.includes(filterOption)) {
|
|
73746
73846
|
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => { var _a; return (_a = bill === null || bill === void 0 ? void 0 : bill.tags) === null || _a === void 0 ? void 0 : _a.includes(filterOption); });
|
|
73747
73847
|
}
|
|
73748
73848
|
if (!(chainFilterOption === null || chainFilterOption === void 0 ? void 0 : chainFilterOption.includes('All Chains'))) {
|
|
73749
|
-
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => chainFilterOption === null || chainFilterOption === void 0 ? void 0 : chainFilterOption.includes(bill.chainId.toString()));
|
|
73849
|
+
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()); });
|
|
73750
73850
|
}
|
|
73751
73851
|
if (filterOption !== 'SOLD OUT') {
|
|
73752
73852
|
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bond) => !isBondSoldOut(bond));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { BondsData } from '../../types/bonds';
|
|
3
|
+
import { TokenPrices } from '../tokenPrices/useTokenPrices';
|
|
4
|
+
import { BillsConfig } from '@ape.swap/apeswap-lists';
|
|
3
5
|
export default function useBondsData(): UseQueryResult<BondsData[]>;
|
|
4
|
-
export declare const getBondsData: (realTimeApiURL: string) => Promise<BondsData[]>;
|
|
6
|
+
export declare const getBondsData: (realTimeApiURL: string, tokenPrices?: TokenPrices[], bondList?: BillsConfig[]) => Promise<BondsData[]>;
|
|
@@ -5,7 +5,8 @@ declare enum NetworkNames {
|
|
|
5
5
|
POLYGON = "pol",
|
|
6
6
|
ARBITRUM = "arb",
|
|
7
7
|
LINEA = "lna",
|
|
8
|
-
BASE = "bas"
|
|
8
|
+
BASE = "bas",
|
|
9
|
+
AVAX = "ava"
|
|
9
10
|
}
|
|
10
11
|
export declare const getChainParam: (chain?: ChainId) => NetworkNames | null;
|
|
11
12
|
export declare const getLpType: (protocol?: Protocols) => "ichi" | "solidly" | "univ2" | null;
|
package/dist/types/bonds.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ChainId, Token } from '@ape.swap/apeswap-lists';
|
|
2
2
|
export interface BondsData {
|
|
3
|
-
index
|
|
3
|
+
index?: number;
|
|
4
4
|
cmcId?: number;
|
|
5
5
|
chainId: ChainId;
|
|
6
6
|
type: string;
|
|
7
7
|
discount: number;
|
|
8
8
|
billAddress?: string;
|
|
9
9
|
billNftAddress: string;
|
|
10
|
-
soldOut
|
|
11
|
-
inactive
|
|
10
|
+
soldOut?: boolean;
|
|
11
|
+
inactive?: boolean;
|
|
12
12
|
trueBillPrice: string;
|
|
13
13
|
maxTotalPayout: string;
|
|
14
14
|
totalPayoutGiven: string;
|
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.0.
|
|
6
|
+
"version": "2.0.1",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"types": "dist/main.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^18.2.0",
|
|
24
24
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
25
|
-
"axios": "
|
|
25
|
+
"axios": "1.7.2",
|
|
26
26
|
"wagmi": "2.12.17",
|
|
27
27
|
"@tanstack/react-query": "5.51.5",
|
|
28
28
|
"@rainbow-me/rainbowkit": "^2.1.6"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/react": "^18.3.3",
|
|
39
39
|
"@types/react-dom": "^18.3.0",
|
|
40
40
|
"@vitejs/plugin-react": "^4.2.1",
|
|
41
|
-
"axios": "
|
|
41
|
+
"axios": "1.7.2",
|
|
42
42
|
"eslint": "^9.10.0",
|
|
43
43
|
"eslint-plugin-react": "^7.35.2",
|
|
44
44
|
"ethers": "5.7.2",
|