@ape.swap/bonds-sdk 3.0.36 → 3.0.38
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 +29 -10
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -70993,13 +70993,7 @@ const getBondsList = (apeswapListsURL) => __awaiter$9(void 0, void 0, void 0, fu
|
|
|
70993
70993
|
/* MODIFIED FUNCTION FROM FRONTEND SPECIFICALLY FOR THE SDK */
|
|
70994
70994
|
const fetchUserOwnedBillsDataAsync = (chainId, account, bondData, tokenPrices) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70995
70995
|
try {
|
|
70996
|
-
const bonds = bondData
|
|
70997
|
-
var _a;
|
|
70998
|
-
return bond.billVersion !== types.BillVersion.FixedPrice &&
|
|
70999
|
-
(bond === null || bond === void 0 ? void 0 : bond.chainId) === chainId &&
|
|
71000
|
-
bond.billType !== 'migration' &&
|
|
71001
|
-
((_a = bond.contractAddress[bond.chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== ACF_TO_ABOND.toLowerCase();
|
|
71002
|
-
});
|
|
70996
|
+
const bonds = bondData;
|
|
71003
70997
|
// Fetch and set user owned bill data without NFT Data
|
|
71004
70998
|
const userOwnedBills = yield fetchUserOwnedBills(chainId, account, bonds, tokenPrices);
|
|
71005
70999
|
const mapUserOwnedBills = bonds.map((bill) => userOwnedBills.filter((b) => { var _a; return b.address.toLowerCase() === ((_a = bill.contractAddress[bill.chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()); }));
|
|
@@ -71113,7 +71107,28 @@ function useUserBonds() {
|
|
|
71113
71107
|
}
|
|
71114
71108
|
const getUserBonds = (account, bondList, chains, tokenPrices) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
71115
71109
|
try {
|
|
71116
|
-
const
|
|
71110
|
+
const bondsByChain = bondList.reduce((acc, bond) => {
|
|
71111
|
+
var _a;
|
|
71112
|
+
// Exclude ACF to ABOND bonds, fixed price bonds, and migration bonds
|
|
71113
|
+
if (((_a = bond.contractAddress[bond.chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ACF_TO_ABOND.toLowerCase() ||
|
|
71114
|
+
bond.billVersion === types.BillVersion.FixedPrice ||
|
|
71115
|
+
bond.billType === 'migration') {
|
|
71116
|
+
return acc; // Skip this bond
|
|
71117
|
+
}
|
|
71118
|
+
// Only process bonds that belong to the specified chains
|
|
71119
|
+
if (chains.includes(bond.chainId)) {
|
|
71120
|
+
// Initialize acc[bond.chainId] if it doesn't exist yet
|
|
71121
|
+
if (!acc[bond.chainId]) {
|
|
71122
|
+
acc[bond.chainId] = [];
|
|
71123
|
+
}
|
|
71124
|
+
// Safely push the bond to the array
|
|
71125
|
+
acc[bond.chainId].push(bond);
|
|
71126
|
+
}
|
|
71127
|
+
return acc;
|
|
71128
|
+
}, {});
|
|
71129
|
+
const results = yield Promise.allSettled(chains
|
|
71130
|
+
.filter((chain) => bondsByChain[chain])
|
|
71131
|
+
.map((chain) => fetchUserOwnedBillsDataAsync(chain, account, bondsByChain[chain], tokenPrices)));
|
|
71117
71132
|
// Filter out only fulfilled promises
|
|
71118
71133
|
const fulfilledResults = results
|
|
71119
71134
|
.filter((result) => result.status === 'fulfilled')
|
|
@@ -75765,7 +75780,7 @@ const useApproval = (amount, currency, spender, account, chainId) => {
|
|
|
75765
75780
|
return [approvalState !== null && approvalState !== void 0 ? approvalState : ApprovalState.NOT_APPROVED, handleApprove];
|
|
75766
75781
|
};
|
|
75767
75782
|
|
|
75768
|
-
const version$1 = '2.
|
|
75783
|
+
const version$1 = '2.24.3';
|
|
75769
75784
|
|
|
75770
75785
|
let errorConfig = {
|
|
75771
75786
|
getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
|
|
@@ -77239,9 +77254,13 @@ const HotBondCards = () => {
|
|
|
77239
77254
|
const BANNER_INFO = {
|
|
77240
77255
|
[types.ChainId.MONAD_TESTNET]: {
|
|
77241
77256
|
title: 'Test and Play on Monad Testnet',
|
|
77242
|
-
subtitle: 'Explore
|
|
77257
|
+
subtitle: 'Explore Bonds on the Monad Testnet for free.',
|
|
77243
77258
|
buttons: [
|
|
77244
77259
|
{ label: 'GET MON TOKENS', href: 'https://testnet.monad.xyz' },
|
|
77260
|
+
{
|
|
77261
|
+
label: 'LEARN MORE',
|
|
77262
|
+
href: 'https://apebond.medium.com/apebond-integrates-testnet-bonds-paving-the-way-for-exciting-new-chains-3f62e2204746?source=social.tw',
|
|
77263
|
+
},
|
|
77245
77264
|
],
|
|
77246
77265
|
background: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner_jpkg38.png',
|
|
77247
77266
|
backgroundMobile: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner-mobile_y6xveu.png',
|