@goodaofi/bonds-sdk 3.0.148 → 3.0.150
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
|
@@ -74046,6 +74046,11 @@ const PreTgeUserRow = ({ userBond, isGooSale }) => {
|
|
|
74046
74046
|
}, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimableAmount, 3), isGooSale && ' GOO', !isGooSale && (jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", formatUSDNumber$1(claimableUSD), ")"] }))] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(pendingAmount, 3), isGooSale && ' GOO', !isGooSale && jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", formatUSDNumber$1(pendingUSD), ")"] })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingString }), jsx$2("div", { className: "your-bonds-column-button", children: jsx$2(PreTgeActions, { userBond: userBond }) })] })] }));
|
|
74047
74047
|
};
|
|
74048
74048
|
|
|
74049
|
+
const formatTGEDate = (saleInfo) => {
|
|
74050
|
+
if (!saleInfo || saleInfo.isTGEPostponed)
|
|
74051
|
+
return 'TBD';
|
|
74052
|
+
return saleInfo.TGEDate.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
|
|
74053
|
+
};
|
|
74049
74054
|
function useSaleInfo() {
|
|
74050
74055
|
var _a, _b;
|
|
74051
74056
|
const SDKConfig = useSDKConfig();
|
|
@@ -74079,6 +74084,7 @@ const getSaleInfo = (isFake, apiAddress) => __awaiter$9(void 0, void 0, void 0,
|
|
|
74079
74084
|
overallProgress: 0,
|
|
74080
74085
|
TGEPrice: 4,
|
|
74081
74086
|
TGEDate: new Date('2025-11-25T15:00:00'),
|
|
74087
|
+
isTGEPostponed: true,
|
|
74082
74088
|
};
|
|
74083
74089
|
}
|
|
74084
74090
|
});
|
|
@@ -74170,6 +74176,7 @@ const transformSaleData = (rawData, isFake) => {
|
|
|
74170
74176
|
overallProgress,
|
|
74171
74177
|
TGEPrice: gooTGEPrice,
|
|
74172
74178
|
TGEDate: new Date('2025-11-25T15:00:00'),
|
|
74179
|
+
isTGEPostponed: true,
|
|
74173
74180
|
};
|
|
74174
74181
|
};
|
|
74175
74182
|
|
|
@@ -74189,7 +74196,7 @@ function usePreTGEUserGooBonds() {
|
|
|
74189
74196
|
queryKey: [QUERY_KEYS.PRE_TGE_USER_BONDS, (_b = gooContracts === null || gooContracts === void 0 ? void 0 : gooContracts.length) !== null && _b !== void 0 ? _b : '', address, tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length],
|
|
74190
74197
|
queryFn: () => {
|
|
74191
74198
|
var _a;
|
|
74192
|
-
return fetchGooPreTGEUserBonds(chains, tokenPrices, gooContracts, address, apiUrl, ((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.TGEDate) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000);
|
|
74199
|
+
return fetchGooPreTGEUserBonds(chains, tokenPrices, gooContracts, address, apiUrl, (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isTGEPostponed) ? undefined : ((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.TGEDate) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000);
|
|
74193
74200
|
},
|
|
74194
74201
|
refetchInterval: 30000,
|
|
74195
74202
|
refetchOnWindowFocus: false,
|
|
@@ -74305,7 +74312,7 @@ const fetchGooPreTGEUserBonds = (chains, tokenPrices, gooContracts, account, api
|
|
|
74305
74312
|
userOwnedBillsData,
|
|
74306
74313
|
finalized,
|
|
74307
74314
|
vestingTerm,
|
|
74308
|
-
initPrice, initialRelease: initialRelease / 10000, earnTokenPrice: null, redeemTime: tgeTimestamp + bondConfig.vestingCliff });
|
|
74315
|
+
initPrice, initialRelease: initialRelease / 10000, earnTokenPrice: null, redeemTime: tgeTimestamp ? tgeTimestamp + bondConfig.vestingCliff : undefined });
|
|
74309
74316
|
}
|
|
74310
74317
|
catch (error) {
|
|
74311
74318
|
console.error(`Error fetching bond data for contract ${contract.address} on chain ${contract.chainId}:`, error);
|
|
@@ -99542,9 +99549,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
99542
99549
|
}, [rateChanged]);
|
|
99543
99550
|
return bondData && !isLoading ? (jsx$2(Flex, { className: `modal-content ${isGoldRush ? 'gold-rush' : ''}`, children: jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, btcPrice: btcPrice, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), jsx$2(ProjectDescription, { description: bondData.type == 'goo'
|
|
99544
99551
|
? 'GooMoney is unlocking the full potential of BTC yields on-chain through sustainable, decentralized growth. Get $GOO at a discount versus TGE price during the Genesis Event, available only to whitelisted users. The liquid token $GOO is always backed by 1 satoshi by design, minimizing downside and keeping a Risk-Free Value.'
|
|
99545
|
-
: 'GooMoney is unlocking the full potential of BTC yields on-chain through sustainable, decentralized growth. Get $sGOO at a discount versus TGE price during the Genesis Event, available only to whitelisted users. $sGOO is the staked version of $GOO, distributing all protocol premiums to its holders. It can be vested and converted back to $GOO, which is always backed by 1 satoshi by design.', isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData, tgeDate: (saleInfo
|
|
99546
|
-
? saleInfo.TGEDate.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })
|
|
99547
|
-
: '-', maxUserBuy: maxUserBuyBTC, type: bondData.type }) }), jsx$2(Estimations, { depositAmount: depositAmount, saleData: saleData, bondData: bondData, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => {
|
|
99552
|
+
: 'GooMoney is unlocking the full potential of BTC yields on-chain through sustainable, decentralized growth. Get $sGOO at a discount versus TGE price during the Genesis Event, available only to whitelisted users. $sGOO is the staked version of $GOO, distributing all protocol premiums to its holders. It can be vested and converted back to $GOO, which is always backed by 1 satoshi by design.', isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData, tgeDate: formatTGEDate(saleInfo), maxUserBuy: maxUserBuyBTC, type: bondData.type }) }), jsx$2(Estimations, { depositAmount: depositAmount, saleData: saleData, bondData: bondData, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => {
|
|
99548
99553
|
var _a;
|
|
99549
99554
|
return setInputValue((_a = new BigNumber$1(Number(inputCurrencyBalance) > maxUserBuyBTC ? (maxUserBuyBTC !== null && maxUserBuyBTC !== void 0 ? maxUserBuyBTC : '0') : (inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0'))) === null || _a === void 0 ? void 0 : _a.toString());
|
|
99550
99555
|
}, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: zapEnabled, bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice, inputDisabled: isUserRestricted }), SDKConfig.useTiers && jsx$2(GetUpToComponent, { bond: bondData, depositAmount: depositAmount }), (bondData === null || bondData === void 0 ? void 0 : bondData.warningCard) && (jsx$2(Flex, { sx: {
|
|
@@ -99963,7 +99968,7 @@ const YourGoo = ({ yourGoo, isLoading, isFetching, }) => {
|
|
|
99963
99968
|
const depositSGooBtcTotal = Number(yourGoo === null || yourGoo === void 0 ? void 0 : yourGoo.depositToSGooBond) / 100000000;
|
|
99964
99969
|
const gooPriceSatsAverage = Number(yourGoo === null || yourGoo === void 0 ? void 0 : yourGoo.depositToGooBond) / Number(yourGoo === null || yourGoo === void 0 ? void 0 : yourGoo.gooPayout);
|
|
99965
99970
|
const sGooPriceSatsAverage = Number(yourGoo === null || yourGoo === void 0 ? void 0 : yourGoo.depositToSGooBond) / Number(yourGoo === null || yourGoo === void 0 ? void 0 : yourGoo.sGooPayout);
|
|
99966
|
-
const tgeDate = saleInfo
|
|
99971
|
+
const tgeDate = formatTGEDate(saleInfo);
|
|
99967
99972
|
const stages = (_c = yourGoo === null || yourGoo === void 0 ? void 0 : yourGoo.stages) === null || _c === void 0 ? void 0 : _c.map((stage, index) => {
|
|
99968
99973
|
const gooAmount = formatNumber$1(stage.gooPayout);
|
|
99969
99974
|
const sGooAmount = formatNumber$1(stage.sGooPayout);
|
|
@@ -36,6 +36,8 @@ export interface SaleInfo {
|
|
|
36
36
|
overallProgress: number;
|
|
37
37
|
TGEPrice: number;
|
|
38
38
|
TGEDate: Date;
|
|
39
|
+
isTGEPostponed: boolean;
|
|
39
40
|
}
|
|
41
|
+
export declare const formatTGEDate: (saleInfo?: SaleInfo) => string;
|
|
40
42
|
export default function useSaleInfo(): UseQueryResult<SaleInfo>;
|
|
41
43
|
export declare const getSaleInfo: (isFake: boolean, apiAddress: string) => Promise<SaleInfo>;
|