@ape.swap/bonds-sdk 5.0.2 → 5.0.4
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 +6 -22
- package/dist/state/useSDKConfig.d.ts +2 -0
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -47132,6 +47132,8 @@ const isBondSoldOut = (bill, showLowValueBonds) => {
|
|
|
47132
47132
|
return false;
|
|
47133
47133
|
const thresholdToHide = new BigNumber$1(100).div(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : 0);
|
|
47134
47134
|
if (((_c = (_b = findHighestTrueBondPrice('0', bill === null || bill === void 0 ? void 0 : bill.trueBondPrices)) === null || _b === void 0 ? void 0 : _b.bonusWithFee) !== null && _c !== void 0 ? _c : 0) > 50) {
|
|
47135
|
+
if (bill.earnToken.symbol === 'sGOO')
|
|
47136
|
+
return false;
|
|
47135
47137
|
//if bonus is higher than 50% for regular bonds, hide them
|
|
47136
47138
|
return true;
|
|
47137
47139
|
}
|
|
@@ -67263,33 +67265,15 @@ const BondRow = ({ bondAddress, bondChain, marketingCampaign, payoutToken, billT
|
|
|
67263
67265
|
}, showTooltip: true, toolTip: remainingTokensString })) }), jsx$2("div", { className: "tooltip-column", children: soldoutBondsCount ? (jsxs(Flex, { sx: { gap: '5px', fontSize: '13px', fontWeight: 500, opacity: 0.5 }, children: ["(", soldoutBondsCount, ")", jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down', width: "8px" })] })) : (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_b = (_a = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.address) === null || _a === void 0 ? void 0 : _a[bondChain]) !== null && _b !== void 0 ? _b : '', earnTokenSymbol: (_c = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol) !== null && _c !== void 0 ? _c : '', bondContract: bondAddress !== null && bondAddress !== void 0 ? bondAddress : '', projectLink: projectURL, twitter: twitterURL, chain: bondChain, isSoldOut: bondSoldOut, billType: billType, cgId: cgId }), width: "205px", placement: "bottomRight", transformTip: "translate(7%, -2%)", children: jsx$2(Flex, { className: "more-icon", sx: { opacity: 0.8 }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) })) })] })] }, `${bondAddress}-${bondChain}`));
|
|
67264
67266
|
};
|
|
67265
67267
|
|
|
67266
|
-
// import useUserApiStats from '../../../../state/bondApiStats/useUserApiStats'
|
|
67267
67268
|
const BuyAgainRow = () => {
|
|
67268
67269
|
var _a, _b, _c;
|
|
67269
|
-
// const { data: userData } = useUserApiStats()
|
|
67270
67270
|
const { data: bills } = useBondsData();
|
|
67271
67271
|
const SDKConfig = useSDKConfig();
|
|
67272
|
+
const highlightedBond = SDKConfig.highlightedBond;
|
|
67272
67273
|
const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
|
|
67273
|
-
|
|
67274
|
-
|
|
67275
|
-
|
|
67276
|
-
// const activeBills = bills?.filter(
|
|
67277
|
-
// (bill) => !isBondSoldOut(bill, SDKConfig.showLowValueBonds) && chains?.includes(bill.chainId),
|
|
67278
|
-
// )
|
|
67279
|
-
// const highestActivePurchase = sortedPurchases?.find((purchase) =>
|
|
67280
|
-
// activeBills?.find((bill) => {
|
|
67281
|
-
// if (purchase.contractAddress.toLowerCase() === bill?.contractAddress?.[bill.chainId]?.toLowerCase())
|
|
67282
|
-
// return true
|
|
67283
|
-
// }),
|
|
67284
|
-
// )
|
|
67285
|
-
// return activeBills?.find(
|
|
67286
|
-
// (bill) =>
|
|
67287
|
-
// bill?.contractAddress?.[bill.chainId]?.toLowerCase() ===
|
|
67288
|
-
// highestActivePurchase?.contractAddress?.toLowerCase(),
|
|
67289
|
-
// )
|
|
67290
|
-
// }
|
|
67291
|
-
// }, [SDKConfig.showLowValueBonds, bills, chains, userData])
|
|
67292
|
-
const bond = useMemo(() => bills === null || bills === void 0 ? void 0 : bills.find((bill) => bill.earnToken.symbol === 'pmUSD' && !bill.soldOut && chains.includes(bill.chainId)), [bills, chains]);
|
|
67274
|
+
const bond = useMemo(() => bills === null || bills === void 0 ? void 0 : bills.find((bill) => bill.earnToken.symbol.toLowerCase() === (highlightedBond === null || highlightedBond === void 0 ? void 0 : highlightedBond.toLowerCase()) &&
|
|
67275
|
+
!bill.soldOut &&
|
|
67276
|
+
chains.includes(bill.chainId)), [bills, chains, highlightedBond]);
|
|
67293
67277
|
const bondAddress = (_a = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId];
|
|
67294
67278
|
const remainingTokensFormat = (bond) => {
|
|
67295
67279
|
const tokensRemaining = 'tokensRemaining' in bond ? bond.tokensRemaining : '0';
|
|
@@ -15,6 +15,7 @@ export interface SDKPropsDTO {
|
|
|
15
15
|
highestCompatibleVersion?: string;
|
|
16
16
|
blockSales?: boolean;
|
|
17
17
|
customBranch?: string;
|
|
18
|
+
highlightedBond?: string;
|
|
18
19
|
}
|
|
19
20
|
export interface SDKProps {
|
|
20
21
|
referenceId: string;
|
|
@@ -35,6 +36,7 @@ export interface SDKProps {
|
|
|
35
36
|
useCardsView?: boolean;
|
|
36
37
|
blockSales?: boolean;
|
|
37
38
|
customBranch?: string;
|
|
39
|
+
highlightedBond?: string;
|
|
38
40
|
}
|
|
39
41
|
export declare const useSDKConfig: (config?: SDKPropsDTO) => SDKProps;
|
|
40
42
|
export type URLKeys = 'apiV2' | 'realTimeApi' | 'mainUrl' | 'priceApi';
|