@goodaofi/bonds-sdk 3.0.126 → 3.0.127
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 -15
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -68752,7 +68752,7 @@ const getSaleInfo = (isFake, apiAddress) => __awaiter$9(void 0, void 0, void 0,
|
|
|
68752
68752
|
totalBilled: 0,
|
|
68753
68753
|
overallProgress: 0,
|
|
68754
68754
|
TGEPrice: 4,
|
|
68755
|
-
TGEDate: new Date('2025-11-
|
|
68755
|
+
TGEDate: new Date('2025-11-25T15:00:00'),
|
|
68756
68756
|
};
|
|
68757
68757
|
}
|
|
68758
68758
|
});
|
|
@@ -68841,7 +68841,7 @@ const transformSaleData = (rawData, isFake) => {
|
|
|
68841
68841
|
totalBilled,
|
|
68842
68842
|
overallProgress,
|
|
68843
68843
|
TGEPrice: gooTGEPrice,
|
|
68844
|
-
TGEDate: new Date('2025-11-
|
|
68844
|
+
TGEDate: new Date('2025-11-25T15:00:00'),
|
|
68845
68845
|
};
|
|
68846
68846
|
};
|
|
68847
68847
|
|
|
@@ -94635,11 +94635,6 @@ const ProgressBar = ({ saleInfo }) => {
|
|
|
94635
94635
|
? saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages.find((stage) => stage.stageNumber === nextStageNumber - 1)
|
|
94636
94636
|
: saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage;
|
|
94637
94637
|
const stageSoldOut = (stage === null || stage === void 0 ? void 0 : stage.progressPercentage) === 100;
|
|
94638
|
-
console.log('is in break', saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod);
|
|
94639
|
-
console.log('next stage number', nextStageNumber);
|
|
94640
|
-
console.log('stage', stage);
|
|
94641
|
-
console.log('stage sold out', stageSoldOut);
|
|
94642
|
-
console.log('sale info', stage === null || stage === void 0 ? void 0 : stage.hasEnded);
|
|
94643
94638
|
const value = useMemo(() => { var _a; return (_a = stage === null || stage === void 0 ? void 0 : stage.progressPercentage) !== null && _a !== void 0 ? _a : 0; }, [stage]);
|
|
94644
94639
|
const hardCap = useMemo(() => { var _a; return ((_a = stage === null || stage === void 0 ? void 0 : stage.hardCapSats) !== null && _a !== void 0 ? _a : 0) / 100000000; }, [stage]);
|
|
94645
94640
|
const billed = useMemo(() => { var _a; return ((_a = stage === null || stage === void 0 ? void 0 : stage.totalBilledSats) !== null && _a !== void 0 ? _a : 0) / 100000000; }, [stage]);
|
|
@@ -94681,7 +94676,7 @@ const ProgressBar = ({ saleInfo }) => {
|
|
|
94681
94676
|
fontWeight: '400',
|
|
94682
94677
|
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
94683
94678
|
}, children: (stage === null || stage === void 0 ? void 0 : stage.hasEnded)
|
|
94684
|
-
? 'Stage ' + nextStageNumber + ' starts
|
|
94679
|
+
? 'Stage ' + nextStageNumber + ' starts: ' + nextStageStartTime + ' UTC'
|
|
94685
94680
|
: 'Stage ' + stageNumber + ' Ends: ' + endTime + ' UTC' })] }), jsx$2(Flex$1, { sx: { width: ['100%'], alignItems: 'center', flexDirection: 'row', my: '1rem' }, children: jsx$2(Box$1, { style: {
|
|
94686
94681
|
width: '100%',
|
|
94687
94682
|
height: '11px',
|
|
@@ -95027,11 +95022,19 @@ var BondsViewOptions;
|
|
|
95027
95022
|
BondsViewOptions["YOURBONDS"] = "Your Bonds";
|
|
95028
95023
|
})(BondsViewOptions || (BondsViewOptions = {}));
|
|
95029
95024
|
const GooSale = () => {
|
|
95030
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
95025
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
95031
95026
|
// Fetch data
|
|
95032
95027
|
const { data: chainFilterOption, setChainFilterOption } = useChainFilterOption();
|
|
95033
95028
|
const { data: saleInfo, isLoading: isLoadingSaleInfo } = useSaleInfo();
|
|
95034
|
-
const
|
|
95029
|
+
const contractsByChain = (_b = (_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.contractsByChain;
|
|
95030
|
+
const saleContracts = contractsByChain === null || contractsByChain === void 0 ? void 0 : contractsByChain[types.ChainId.BASE];
|
|
95031
|
+
const saleData = saleContracts === null || saleContracts === void 0 ? void 0 : saleContracts[0];
|
|
95032
|
+
// Get BTC price
|
|
95033
|
+
const btcPriceData = useCurrencyPrice(saleData === null || saleData === void 0 ? void 0 : saleData.principalToken, types.ChainId.BASE);
|
|
95034
|
+
const btcPrice = (_c = btcPriceData === null || btcPriceData === void 0 ? void 0 : btcPriceData.price) !== null && _c !== void 0 ? _c : 0;
|
|
95035
|
+
const currentStageNumber = (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod)
|
|
95036
|
+
? ((_d = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _d === void 0 ? void 0 : _d.stageNumber) || 1
|
|
95037
|
+
: ((_e = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _e === void 0 ? void 0 : _e.stageNumber) || 1;
|
|
95035
95038
|
const { activeView, handleToogle } = useActiveView(true);
|
|
95036
95039
|
const { address } = useAccount();
|
|
95037
95040
|
const chainId = useChainId();
|
|
@@ -95039,7 +95042,13 @@ const GooSale = () => {
|
|
|
95039
95042
|
const { data: elegibleForSale } = useGooEligibility();
|
|
95040
95043
|
const [checkButtonPushed, setCheckButtonPushed] = useState(false);
|
|
95041
95044
|
const elegible = checkButtonPushed ? elegibleForSale : undefined;
|
|
95042
|
-
const currentStageSoldOut = ((
|
|
95045
|
+
const currentStageSoldOut = ((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _f === void 0 ? void 0 : _f.progressPercentage) === 100;
|
|
95046
|
+
const totalBilledBTC = (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.totalBilled) ? (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.totalBilled) / 100000000 : 0;
|
|
95047
|
+
const totalBilledUSD = (totalBilledBTC * btcPrice).toLocaleString('en-US', {
|
|
95048
|
+
style: 'currency',
|
|
95049
|
+
currency: 'USD',
|
|
95050
|
+
maximumFractionDigits: 0,
|
|
95051
|
+
});
|
|
95043
95052
|
// Wrapper function that sets chain filter AND switches wallet chain
|
|
95044
95053
|
const handleChainFilterChange = useCallback((newChainFilter) => {
|
|
95045
95054
|
setChainFilterOption(newChainFilter);
|
|
@@ -95075,12 +95084,17 @@ const GooSale = () => {
|
|
|
95075
95084
|
}
|
|
95076
95085
|
});
|
|
95077
95086
|
return filtered;
|
|
95078
|
-
}, [(
|
|
95079
|
-
return (jsxs(Flex, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), jsxs(Flex, { sx: { width: '100%', alignItems: 'center', px: '12%', pb: '4rem' }, children: [jsx$2(StepBubble, { number: 1, title: 'STAGE 1', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 2, title: 'STAGE 2', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 3, title: 'STAGE 3', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 5, title: 'TGE', currentStep: currentStageNumber, loading: false, hideBar: true })] }),
|
|
95087
|
+
}, [(_g = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _g === void 0 ? void 0 : _g.contractsByChain, chainFilterOption]);
|
|
95088
|
+
return (jsxs(Flex, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), jsxs(Flex, { sx: { width: '100%', alignItems: 'center', px: '12%', pb: '4rem' }, children: [jsx$2(StepBubble, { number: 1, title: 'STAGE 1', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 2, title: 'STAGE 2', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 3, title: 'STAGE 3', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 5, title: 'TGE', currentStep: currentStageNumber, loading: false, hideBar: true })] }), jsxs(Flex, { sx: { flexDirection: 'column', width: '200px' }, children: [jsx$2(Text, { sx: {
|
|
95089
|
+
fontSize: '14px',
|
|
95090
|
+
fontWeight: '700',
|
|
95091
|
+
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
95092
|
+
mb: '0.2rem',
|
|
95093
|
+
}, children: "Total Raised" }), jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center' }, children: [jsx$2(Text, { sx: { fontSize: '22px', fontWeight: '700' }, children: `${totalBilledBTC.toFixed(0)} BTC` }), jsx$2(Text, { sx: { fontSize: '14px', fontWeight: '400', ml: '10px' }, children: `(${totalBilledUSD})` })] })] }), jsx$2(ProgressBar, { saleInfo: saleInfo }), ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) || currentStageSoldOut) && (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) && !isLoadingSaleInfo && (jsxs(Flex, { sx: { width: '100%', justifyContent: 'center', mt: '40px', flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Text, { sx: { fontSize: '20px', fontWeight: 'bold', mb: '20px' }, children: [((_h = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _h === void 0 ? void 0 : _h.stageNumber) === 4
|
|
95080
95094
|
? 'Refund Period '
|
|
95081
|
-
: ((
|
|
95095
|
+
: ((_j = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _j === void 0 ? void 0 : _j.stageNumber) === 5
|
|
95082
95096
|
? 'TGE '
|
|
95083
|
-
: 'Stage ' + ((
|
|
95097
|
+
: 'Stage ' + ((_k = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _k === void 0 ? void 0 : _k.stageNumber) + ' ', "starts in:"] }), jsx$2(CountdownTimer, { targetTime: ((_l = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _l === void 0 ? void 0 : _l.startTime) || 0 }), !(((_m = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _m === void 0 ? void 0 : _m.stageNumber) === 4 || ((_o = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _o === void 0 ? void 0 : _o.stageNumber) === 5) ? (jsxs(Fragment$1, { children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center', mt: '30px' }, children: [address && (jsxs(Flex, { sx: { mr: '1rem', p: '10px', borderRadius: 'normal', background: 'white3', alignItems: 'center' }, children: [jsx$2(Flex, { sx: { mr: '10px' }, children: jsx$2(Svg, { icon: "wallet" }) }), jsxs(Text, { sx: { fontSize: '14px', fontWeight: 400 }, children: [address === null || address === void 0 ? void 0 : address.slice(0, 4), "...", address === null || address === void 0 ? void 0 : address.slice((address === null || address === void 0 ? void 0 : address.length) - 4, address === null || address === void 0 ? void 0 : address.length)] })] })), jsx$2(Flex, { sx: { fontSize: '18px', fontWeight: 500 }, children: "Are You Eligible?" })] }), !address ? (jsx$2(Flex, { sx: { my: '20px', width: '100%' }, children: jsx$2(ConnectButton, {}) })) : (jsx$2(Button, { sx: { m: '20px', width: '100%' }, onClick: () => setCheckButtonPushed(true), children: "CHECK ELIGIBILITY" }))] }), elegible !== null && elegible !== undefined && (jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center' }, children: [jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["You ", jsx$2("span", { sx: { fontWeight: 700 }, children: "ARE" }), " eligible for Stage ", elegible, " and beyond!"] }), jsxs(Text, { color: "primaryButton", sx: { fontSize: '12px', fontWeight: 400, pl: '1rem' }, children: ["Tier ", elegible, " Access"] })] })), elegible === null && (jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center' }, children: [jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["You are ", jsx$2("span", { sx: { fontWeight: 700 }, children: "NOT" }), " eligible for the sale"] }), jsxs(Link, { href: "https://gmoney.site/whitelist", target: "_blank", color: "primaryButton", sx: { fontSize: '12px', fontWeight: 400, pl: '1rem' }, children: ["Get Your Whitelist Spot ", '>'] })] }))] })) : (jsx$2(Fragment$1, {}))] })), !(saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) && !currentStageSoldOut && (jsxs(Fragment$1, { children: [jsx$2(BondsMenu, { setChainFilterOption: handleChainFilterChange, chainFilterOption: chainFilterOption, handleToogle: handleToogle }), activeView === BondsViewOptions.BONDSMARKET && filteredContractsByChain && !isLoadingSaleInfo ? (jsx$2(BondRowsByChain, { contractsByChain: filteredContractsByChain })) : activeView === BondsViewOptions.YOURBONDS && !isLoadingSaleInfo ? (jsx$2(YourGoo, {})) : (jsx$2(Fragment$1, {}))] }))] }));
|
|
95084
95098
|
};
|
|
95085
95099
|
|
|
95086
95100
|
const GooSaleWithProviders = (props) => {
|