@ape.swap/bonds-sdk 4.0.0-test.7 → 4.0.0-test.9
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/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/uikit-sdk/Svg/tokens/UNICHAIN.d.ts +4 -0
- package/dist/components/uikit-sdk/Svg/tokens/index.d.ts +1 -0
- package/dist/components/uikit-sdk/Svg/types.d.ts +1 -0
- package/dist/config/constants/networks.d.ts +1 -0
- package/dist/main.js +235 -83
- package/dist/state/allowance/useAllowance.d.ts +1 -1
- package/dist/state/balance/useCurrencyBalance.d.ts +1 -1
- package/dist/state/balance/useCurrencyBalanceSolana.d.ts +1 -1
- package/dist/state/bonds/useBondNFTData.d.ts +1 -1
- package/dist/state/bonds/useBondsData.d.ts +1 -2
- package/dist/state/bonds/useBondsList.d.ts +1 -1
- package/dist/state/bonds/useTierProofSignature.d.ts +1 -1
- package/dist/styles.css +2 -1
- package/dist/types/bonds.d.ts +1 -0
- package/dist/utils/calculateSolanaTrueBillPrice.d.ts +5 -1
- package/dist/utils/formatNumber.d.ts +1 -1
- package/dist/utils/formatNumbers.d.ts +2 -1
- package/dist/views/Bonds/components/ChainBanner/ChainBanner.d.ts +6 -0
- package/dist/views/YourBondsModal/YourSolanaBondsModal.d.ts +2 -2
- package/package.json +4 -3
- package/dist/views/Bonds/components/BannerTestnet/BannerTestnet.d.ts +0 -6
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
2
2
|
export declare const PUBLIC_RPC_URLS: Partial<Record<ChainId, string[]>>;
|
|
3
|
+
export declare const HELIUS_SOL_RPC = "https://mainnet.helius-rpc.com/?api-key=d80b11e0-692f-4da0-91d6-830799c8c385";
|
|
3
4
|
export declare const getRPC: (chain: ChainId) => string;
|
package/dist/main.js
CHANGED
|
@@ -3938,6 +3938,7 @@ var icons;
|
|
|
3938
3938
|
icons["BERA"] = "bera";
|
|
3939
3939
|
icons["SOL"] = "sol";
|
|
3940
3940
|
icons["KATANA"] = "katana";
|
|
3941
|
+
icons["UNICHAIN"] = "unichain";
|
|
3941
3942
|
//Social media icons
|
|
3942
3943
|
icons["DISCORD"] = "discord";
|
|
3943
3944
|
icons["REDDIT"] = "reddit";
|
|
@@ -6804,6 +6805,10 @@ const KATANA = ({ width }) => {
|
|
|
6804
6805
|
return (jsx$2("svg", { width: width || '30', height: width || '30', viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { children: [jsx$2("title", { children: "Layer 1" }), jsx$2("rect", { width: "64", height: "64", fill: "#068be3", id: "svg_1" }), jsx$2("path", { d: "m28.8015,25.6354l0,-14.6354l-8.45798,0l-6.34352,20.9476l5.07482,0l-5.07482,16.7582l14.8015,0l0,-10.437l12.6876,14.7312l8.5109,-12.6734l-16.9159,-8.379l-4.2826,0l10.5724,0l6.3433,-20.9476l-8.4579,0l-8.4578,14.6354z", fill: "#F6FF0D", id: "svg_3" })] }) }));
|
|
6805
6806
|
};
|
|
6806
6807
|
|
|
6808
|
+
const UNICHAIN = ({ width }) => {
|
|
6809
|
+
return (jsx$2("svg", { width: width || '30', height: width || '30', viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { children: [jsx$2("title", { children: "Layer 1" }), jsx$2("rect", { id: "svg_1", fill: "#f50db4", height: "64", width: "64" }), jsx$2("path", { id: "svg_2", fill: "white", d: "m52.00002,31.61947c-10.8407,0 -19.6195,-8.7876 -19.6195,-19.61945l-0.761,0l0,19.61945l-19.61954,0l0,0.7611c10.84074,0 19.61954,8.7876 19.61954,19.6194l0.761,0l0,-19.6194l19.6195,0l0,-0.7611z" })] }) }));
|
|
6810
|
+
};
|
|
6811
|
+
|
|
6807
6812
|
const Icon$a = ({ width }) => {
|
|
6808
6813
|
return (jsxs("svg", { viewBox: "0 0 32 32", width: width || '128px', children: [jsx$2("path", { d: "M24 0H8C3.58172 0 0 3.58172 0 8V24C0 28.4183 3.58172 32 8 32H24C28.4183 32 32 28.4183 32 24V8C32 3.58172 28.4183 0 24 0Z", fill: "#1E2026" }), jsx$2("path", { d: "M16.2857 4L9.97035 7.6761L12.2922 9.03415L16.2857 6.7161L20.2792 9.03415L22.6011 7.6761L16.2857 4Z", fill: "#F0B90B" }), jsx$2("path", { d: "M20.2792 10.9541L22.6011 12.3122V15.0283L18.6075 17.3463V21.9824L16.2857 23.3405L13.9639 21.9824V17.3463L9.97035 15.0283V12.3122L12.2922 10.9541L16.2857 13.2722L20.2792 10.9541Z", fill: "#F0B90B" }), jsx$2("path", { d: "M22.6011 16.9483V19.6644L20.2792 21.0224V18.3063L22.6011 16.9483Z", fill: "#F0B90B" }), jsx$2("path", { d: "M20.2561 22.9424L24.2496 20.6244V15.9883L26.5714 14.6302V21.9824L20.2561 25.6585V22.9424Z", fill: "#F0B90B" }), jsx$2("path", { d: "M24.2496 11.3522L21.9278 9.99414L24.2496 8.63609L26.5714 9.99414V12.7102L24.2496 14.0683V11.3522Z", fill: "#F0B90B" }), jsx$2("path", { d: "M13.9639 26.642V23.9259L16.2857 25.2839L18.6075 23.9259V26.642L16.2857 28L13.9639 26.642Z", fill: "#F0B90B" }), jsx$2("path", { d: "M12.2922 21.0224L9.97035 19.6644V16.9483L12.2922 18.3063V21.0224Z", fill: "#F0B90B" }), jsx$2("path", { d: "M16.2857 11.3522L13.9639 9.99414L16.2857 8.63609L18.6075 9.99414L16.2857 11.3522Z", fill: "#F0B90B" }), jsx$2("path", { d: "M10.6437 9.99414L8.32183 11.3522V14.0683L6 12.7102V9.99414L8.32183 8.63609L10.6437 9.99414Z", fill: "#F0B90B" }), jsx$2("path", { d: "M6 14.6302L8.32183 15.9883V20.6244L12.3154 22.9424V25.6585L6 21.9824V14.6302Z", fill: "#F0B90B" })] }));
|
|
6809
6814
|
};
|
|
@@ -7220,6 +7225,8 @@ const Svg = (_a) => {
|
|
|
7220
7225
|
return jsx$2(SOL, Object.assign({}, props, { getStyles: getStyles }));
|
|
7221
7226
|
case icons.KATANA:
|
|
7222
7227
|
return jsx$2(KATANA, Object.assign({}, props, { getStyles: getStyles }));
|
|
7228
|
+
case icons.UNICHAIN:
|
|
7229
|
+
return jsx$2(UNICHAIN, Object.assign({}, props, { getStyles: getStyles }));
|
|
7223
7230
|
default:
|
|
7224
7231
|
return null;
|
|
7225
7232
|
}
|
|
@@ -18784,6 +18791,7 @@ const MAINNET_CHAINS = [
|
|
|
18784
18791
|
types$1.ChainId.BERACHAIN,
|
|
18785
18792
|
types$1.ChainId.SOL,
|
|
18786
18793
|
types$1.ChainId.KATANA,
|
|
18794
|
+
types$1.ChainId.UNICHAIN,
|
|
18787
18795
|
];
|
|
18788
18796
|
const TESTNET_CHAINS = [types$1.ChainId.MONAD_TESTNET];
|
|
18789
18797
|
// Network Icons
|
|
@@ -18808,6 +18816,7 @@ const NETWORK_ICONS = {
|
|
|
18808
18816
|
[types$1.ChainId.BERACHAIN]: icons.BERA,
|
|
18809
18817
|
[types$1.ChainId.SOL]: icons.SOL,
|
|
18810
18818
|
[types$1.ChainId.KATANA]: icons.KATANA,
|
|
18819
|
+
[types$1.ChainId.UNICHAIN]: icons.UNICHAIN,
|
|
18811
18820
|
};
|
|
18812
18821
|
// Network labels
|
|
18813
18822
|
const NETWORK_LABEL = {
|
|
@@ -18833,6 +18842,7 @@ const NETWORK_LABEL = {
|
|
|
18833
18842
|
[types$1.ChainId.BERACHAIN]: 'Berachain',
|
|
18834
18843
|
[types$1.ChainId.SOL]: 'Solana',
|
|
18835
18844
|
[types$1.ChainId.KATANA]: 'Katana',
|
|
18845
|
+
[types$1.ChainId.UNICHAIN]: 'Unichain',
|
|
18836
18846
|
};
|
|
18837
18847
|
// Network block explorers
|
|
18838
18848
|
const BLOCK_EXPLORER = {
|
|
@@ -18858,6 +18868,7 @@ const BLOCK_EXPLORER = {
|
|
|
18858
18868
|
[types$1.ChainId.BERACHAIN]: 'https://berascan.com',
|
|
18859
18869
|
[types$1.ChainId.SOL]: 'https://solscan.io',
|
|
18860
18870
|
[types$1.ChainId.KATANA]: 'https://explorer.katanarpc.com',
|
|
18871
|
+
[types$1.ChainId.UNICHAIN]: 'https://uniscan.xyz',
|
|
18861
18872
|
};
|
|
18862
18873
|
|
|
18863
18874
|
const supportedByLIFI = [
|
|
@@ -18871,6 +18882,7 @@ const supportedByLIFI = [
|
|
|
18871
18882
|
types$1.ChainId.BLAST,
|
|
18872
18883
|
types$1.ChainId.SONIC,
|
|
18873
18884
|
types$1.ChainId.BERACHAIN,
|
|
18885
|
+
types$1.ChainId.UNICHAIN,
|
|
18874
18886
|
];
|
|
18875
18887
|
const STRAPI_URL = `https://strapi-api.ape.bond`;
|
|
18876
18888
|
const SOUL_ZAP_API = `https://zap-api.ape.bond/zap?batch=1`;
|
|
@@ -19058,6 +19070,7 @@ const NETWORK_COLORS = {
|
|
|
19058
19070
|
[types$1.ChainId.SONIC]: '#fb9a4c4d',
|
|
19059
19071
|
[types$1.ChainId.BERACHAIN]: '#783e244d',
|
|
19060
19072
|
[types$1.ChainId.KATANA]: '#068be34d',
|
|
19073
|
+
[types$1.ChainId.UNICHAIN]: '#f50db44d',
|
|
19061
19074
|
};
|
|
19062
19075
|
const TokenInfoAndName = ({ tokenSymbol, chain, tag, vestEnds, isHotBond, }) => {
|
|
19063
19076
|
return (jsxs(Flex, { className: "tokeninfoname container", children: [jsx$2(Flex, { sx: {
|
|
@@ -21989,37 +22002,34 @@ function toFixedPoint(str, e, z) {
|
|
|
21989
22002
|
var BigNumber$1 = clone$2();
|
|
21990
22003
|
|
|
21991
22004
|
// Ideally let's keep all formating in this file and DO NOT CREATE MORE FILES
|
|
21992
|
-
const
|
|
22005
|
+
const localeFormat = (number, precision = 2) => {
|
|
21993
22006
|
const options = {
|
|
21994
|
-
minimumFractionDigits:
|
|
21995
|
-
maximumFractionDigits:
|
|
22007
|
+
minimumFractionDigits: precision,
|
|
22008
|
+
maximumFractionDigits: precision,
|
|
21996
22009
|
};
|
|
21997
22010
|
return number.toLocaleString('en-US', options);
|
|
21998
22011
|
};
|
|
21999
|
-
// Formats a number with SI (International System of Units) sufixes
|
|
22000
22012
|
const formatNumberSI = (num, digits = 2) => {
|
|
22001
22013
|
const number = typeof num === 'string' ? parseFloat(num) : num;
|
|
22002
|
-
const
|
|
22003
|
-
{ value: 1, symbol: '' },
|
|
22004
|
-
{ value: 1e6, symbol: 'M' },
|
|
22005
|
-
{ value: 1e9, symbol: 'B' },
|
|
22014
|
+
const suffixes = [
|
|
22006
22015
|
{ value: 1e12, symbol: 'T' },
|
|
22016
|
+
{ value: 1e9, symbol: 'B' },
|
|
22017
|
+
{ value: 1e6, symbol: 'M' },
|
|
22018
|
+
{ value: 1, symbol: '' },
|
|
22007
22019
|
];
|
|
22008
|
-
const
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
formatted = '∞';
|
|
22020
|
+
const suffix = suffixes.find(({ value }) => number >= value);
|
|
22021
|
+
if (number > 1e6 && suffix) {
|
|
22022
|
+
return `${localeFormat(number / suffix.value)} ${suffix.symbol}`;
|
|
22012
22023
|
}
|
|
22013
|
-
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
|
|
22018
|
-
}
|
|
22019
|
-
}
|
|
22020
|
-
formatted = formatNumber$3(number / lookupSI[i].value, digits, digits).replace(regEx, '$1') + lookupSI[i].symbol;
|
|
22024
|
+
if (number > 1000) {
|
|
22025
|
+
return localeFormat(Math.round(number), 0);
|
|
22026
|
+
}
|
|
22027
|
+
if (number > 1) {
|
|
22028
|
+
return localeFormat(number);
|
|
22021
22029
|
}
|
|
22022
|
-
|
|
22030
|
+
if (number === 0)
|
|
22031
|
+
return '0';
|
|
22032
|
+
return localeFormat(number, digits);
|
|
22023
22033
|
};
|
|
22024
22034
|
const formatUSDNumber$1 = (input) => {
|
|
22025
22035
|
const number = new BigNumber$1(input);
|
|
@@ -22523,6 +22533,7 @@ const MULTICALL_V2 = {
|
|
|
22523
22533
|
[types$1.ChainId.SONIC]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
22524
22534
|
[types$1.ChainId.BERACHAIN]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
22525
22535
|
[types$1.ChainId.KATANA]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
22536
|
+
[types$1.ChainId.UNICHAIN]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
22526
22537
|
};
|
|
22527
22538
|
const SoulZapTokenManager = {
|
|
22528
22539
|
[types$1.ChainId.MAINNET]: '0x2F87f76336A560bbB0d18d357D10646bB96E8802',
|
|
@@ -63613,9 +63624,16 @@ const PUBLIC_RPC_URLS = {
|
|
|
63613
63624
|
[types$1.ChainId.SONIC]: ['https://rpc.soniclabs.com'],
|
|
63614
63625
|
[types$1.ChainId.BERACHAIN]: ['https://rpc.berachain.com'],
|
|
63615
63626
|
[types$1.ChainId.KATANA]: ['https://rpc-katana.t.conduit.xyz/NRcSLqEG4Hw55GzTSu6Sratq94kKtUGfH'],
|
|
63616
|
-
[types$1.ChainId.
|
|
63627
|
+
[types$1.ChainId.UNICHAIN]: ['https://unichain.drpc.org'],
|
|
63628
|
+
[types$1.ChainId.SOL]: process.env.NODE_ENV === 'production'
|
|
63629
|
+
? ['https://morning-autumn-dream.solana-mainnet.quiknode.pro/1ef6069950c798a43a112c0fe5eb157309427db8']
|
|
63630
|
+
: [
|
|
63631
|
+
'https://ancient-cold-sailboat.solana-mainnet.quiknode.pro/da13400ad8d0035313f3e71c6a37c107d0d0334b',
|
|
63632
|
+
'https://mainnet.helius-rpc.com/?api-key=d80b11e0-692f-4da0-91d6-830799c8c385',
|
|
63633
|
+
], // mainnet
|
|
63617
63634
|
// [ChainId.SOL]: ['https://devnet.helius-rpc.com/?api-key=095f6fc7-1be0-4d94-a737-4a5ee0d82ea5'], // devnet
|
|
63618
63635
|
};
|
|
63636
|
+
const HELIUS_SOL_RPC = 'https://mainnet.helius-rpc.com/?api-key=d80b11e0-692f-4da0-91d6-830799c8c385';
|
|
63619
63637
|
const getRPC = (chain) => {
|
|
63620
63638
|
var _a;
|
|
63621
63639
|
return (_a = PUBLIC_RPC_URLS === null || PUBLIC_RPC_URLS === void 0 ? void 0 : PUBLIC_RPC_URLS[chain]) === null || _a === void 0 ? void 0 : _a[0];
|
|
@@ -63674,6 +63692,9 @@ const useSDKConfig = (config) => {
|
|
|
63674
63692
|
const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], hotBondChains: [types$1.ChainId.BSC, types$1.ChainId.MATIC], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.2.0' });
|
|
63675
63693
|
const { data } = useQuery({
|
|
63676
63694
|
queryKey: [QUERY_KEYS.SDK_CONFIG],
|
|
63695
|
+
queryFn: () => {
|
|
63696
|
+
throw new Error('Just a hotfix for latest versions of react-query that make queryFn a required prop');
|
|
63697
|
+
},
|
|
63677
63698
|
initialData,
|
|
63678
63699
|
});
|
|
63679
63700
|
return data;
|
|
@@ -63963,8 +63984,6 @@ const getPayoutAmount = (bond, inputValue, userPoints) => {
|
|
|
63963
63984
|
const trueBondPrice = new BigNumber$1((_e = trueBondPriceObject === null || trueBondPriceObject === void 0 ? void 0 : trueBondPriceObject.trueBondPrice) !== null && _e !== void 0 ? _e : '0');
|
|
63964
63985
|
const reverseFee = new BigNumber$1(fee / 100 / (1 - fee / 100));
|
|
63965
63986
|
const billValue = bigValue.div(trueBondPrice.plus(trueBondPrice.times(reverseFee)));
|
|
63966
|
-
// console.log('raw estimation', bigValue.div(trueBondPrice).toFixed(9))
|
|
63967
|
-
// console.log('estimation substracting feeInPayout', billValue.toFixed(9))
|
|
63968
63987
|
return billValue.toNumber();
|
|
63969
63988
|
};
|
|
63970
63989
|
const youGetUSD = (bond, inputValue, userPoints) => {
|
|
@@ -67703,6 +67722,9 @@ var BOND_NFT_ABI = [
|
|
|
67703
67722
|
const usePopups = () => {
|
|
67704
67723
|
const { data } = useQuery({
|
|
67705
67724
|
queryKey: [QUERY_KEYS.POP_UPS],
|
|
67725
|
+
queryFn: () => {
|
|
67726
|
+
throw new Error('Just a hotfix for latest versions of react-query that make queryFn a required prop');
|
|
67727
|
+
},
|
|
67706
67728
|
initialData: [],
|
|
67707
67729
|
});
|
|
67708
67730
|
const queryClient = useQueryClient();
|
|
@@ -69992,7 +70014,7 @@ function fetchUserOwnedSolanaBonds(user, bondData, tokenPrices) {
|
|
|
69992
70014
|
params: { groupKey: 'collection', groupValue: collection },
|
|
69993
70015
|
}),
|
|
69994
70016
|
};
|
|
69995
|
-
const response = yield fetch(
|
|
70017
|
+
const response = yield fetch(HELIUS_SOL_RPC, options);
|
|
69996
70018
|
const data = yield response.json();
|
|
69997
70019
|
const userOwnedAssets = data.result.items;
|
|
69998
70020
|
const userAssets = userOwnedAssets.filter((asset) => {
|
|
@@ -70026,15 +70048,15 @@ function fetchUserOwnedSolanaBonds(user, bondData, tokenPrices) {
|
|
|
70026
70048
|
totalPayout: bondAccount.payout.toString(),
|
|
70027
70049
|
truePricePaid: bondAccount.truePricePaid.toString(),
|
|
70028
70050
|
lastBlockTimestamp: bondAccount.lastClaimTimestamp.toString(),
|
|
70029
|
-
pendingRewards
|
|
70030
|
-
? pendingRewards
|
|
70031
|
-
: (Number(bondAccount.payout) - Number(bondAccount.payoutClaimed)).toString(),
|
|
70051
|
+
pendingRewards,
|
|
70032
70052
|
billNftAddress: collection,
|
|
70033
70053
|
bondCounter: bondIssuanceAccount.bondCounter.toString(),
|
|
70034
70054
|
payoutClaimed: '0', //TODO: fix this
|
|
70035
70055
|
//@ts-ignore
|
|
70036
70056
|
bond: Object.assign(Object.assign({}, bond), { payoutTokenPrice }),
|
|
70037
70057
|
});
|
|
70058
|
+
// ULTRA HOT FIX :( until we can figure out a multicall strategy
|
|
70059
|
+
yield new Promise((r) => setTimeout(r, 50));
|
|
70038
70060
|
}
|
|
70039
70061
|
catch (e) {
|
|
70040
70062
|
console.log(e);
|
|
@@ -70046,6 +70068,7 @@ function fetchUserOwnedSolanaBonds(user, bondData, tokenPrices) {
|
|
|
70046
70068
|
userOwnedBills: userBills,
|
|
70047
70069
|
});
|
|
70048
70070
|
}
|
|
70071
|
+
console.log('finished fetching solana bonds');
|
|
70049
70072
|
return results;
|
|
70050
70073
|
}
|
|
70051
70074
|
catch (err) {
|
|
@@ -70119,9 +70142,12 @@ function useUserBonds() {
|
|
|
70119
70142
|
return useQuery({
|
|
70120
70143
|
queryKey: [QUERY_KEYS.USER_BONDS, address, publicKey],
|
|
70121
70144
|
queryFn: () => getUserBonds(address, solanaAccount, bondList, chains, tokenPrices, apiUrl),
|
|
70122
|
-
|
|
70123
|
-
refetchInterval: 60000,
|
|
70145
|
+
refetchInterval: 120000,
|
|
70124
70146
|
enabled: !!bondList && !!(address || solanaAccount) && !!tokenPrices,
|
|
70147
|
+
refetchOnWindowFocus: false,
|
|
70148
|
+
refetchOnMount: false,
|
|
70149
|
+
refetchOnReconnect: false,
|
|
70150
|
+
retry: 1,
|
|
70125
70151
|
});
|
|
70126
70152
|
}
|
|
70127
70153
|
const getUserBonds = (account, solanaAccount, bondList, chains, tokenPrices, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
@@ -70229,7 +70255,7 @@ const TransferAction = ({ userBill, toAddress, disabled, }) => {
|
|
|
70229
70255
|
blockhash,
|
|
70230
70256
|
lastValidBlockHeight,
|
|
70231
70257
|
}, 'confirmed');
|
|
70232
|
-
|
|
70258
|
+
refetch();
|
|
70233
70259
|
addToastSuccess(signature, (_a = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _a === void 0 ? void 0 : _a.chainId);
|
|
70234
70260
|
}
|
|
70235
70261
|
catch (error) {
|
|
@@ -70292,6 +70318,7 @@ const SwiperProvider = ({ children }) => {
|
|
|
70292
70318
|
|
|
70293
70319
|
/* Copied from Uniswap/v-3: https://github.com/Uniswap/v3-info/blob/master/src/utils/numbers.ts */
|
|
70294
70320
|
/**
|
|
70321
|
+
* @deprecated PLEASE DO NOT USE
|
|
70295
70322
|
* Returns a USD dollar or equivalent denominated numerical value formatted
|
|
70296
70323
|
* in human readable string for use in template.
|
|
70297
70324
|
*
|
|
@@ -70352,6 +70379,7 @@ const formatDollar = ({ num, isPrice = false, lessPreciseStablecoinValues = fals
|
|
|
70352
70379
|
}
|
|
70353
70380
|
};
|
|
70354
70381
|
/**
|
|
70382
|
+
* @deprecated PLEASE DO NOT USE
|
|
70355
70383
|
* Returns a numerical amount of any token formatted in human readable string for use in template.
|
|
70356
70384
|
*
|
|
70357
70385
|
* For transaction review numbers, such as token quantities, NFT price (token-denominated),
|
|
@@ -76123,7 +76151,7 @@ const SafeHTMLComponent = ({ html }) => {
|
|
|
76123
76151
|
return jsx$2("div", { dangerouslySetInnerHTML: { __html: sanitizedHTML } });
|
|
76124
76152
|
};
|
|
76125
76153
|
|
|
76126
|
-
const YourBondsModal
|
|
76154
|
+
const YourBondsModal = ({ onDismiss, bill }) => {
|
|
76127
76155
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
|
|
76128
76156
|
// Hooks
|
|
76129
76157
|
const SDKConfig = useSDKConfig();
|
|
@@ -76332,7 +76360,7 @@ const ExpandedViewButton = ({ handleNavigation, rightPos }) => {
|
|
|
76332
76360
|
}, onClick: handleNavigation, children: ["Project Info", jsx$2(Flex, { sx: { ml: '4px' }, children: jsx$2(Svg, { icon: "expand", width: 20, color: "white" }) })] }) }));
|
|
76333
76361
|
};
|
|
76334
76362
|
|
|
76335
|
-
const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, projectLink, twitter, audit, chain, isSoldOut = false, }) => {
|
|
76363
|
+
const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, projectLink, twitter, audit, chain, isSoldOut = false, billType, }) => {
|
|
76336
76364
|
const config = useSDKConfig();
|
|
76337
76365
|
const explorerLink = BLOCK_EXPLORER[chain];
|
|
76338
76366
|
const tokenLink = `${explorerLink}/address/${earnTokenContract}`;
|
|
@@ -76350,7 +76378,7 @@ const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, pro
|
|
|
76350
76378
|
},
|
|
76351
76379
|
});
|
|
76352
76380
|
};
|
|
76353
|
-
return (jsxs(Flex, { sx: { flexDirection: 'column', flexWrap: 'wrap' }, children: [jsx$2(ButtonsRow, { twitter: twitter, projectLink: projectLink, bubble: earnTokenContract, audit: audit, chain: chain }), (config === null || config === void 0 ? void 0 : config.referenceId) === 'apebond' && !isSoldOut && (jsx$2(Flex, { sx: { width: '100%', my: '5px', justifyContent: 'center', position: 'relative', height: '25px' }, children: jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation, rightPos: '-5px' }) })), jsx$2(Flex, { sx: { justifyContent: 'center' }, children: jsxs(Flex, { sx: { width: '144px', flexDirection: 'column' }, children: [jsx$2(Flex, { sx: styles$b.linkRow, children: tokenLink && (jsxs(Link, { href: tokenLink, sx: styles$b.link, target: "_blank", children: ["View Token Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$b.linkRow, children: bondLink && (jsxs(Link, { href: bondLink, sx: styles$b.link, target: "_blank", children: ["View Bond Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$b.linkRow, children:
|
|
76381
|
+
return (jsxs(Flex, { sx: { flexDirection: 'column', flexWrap: 'wrap' }, children: [jsx$2(ButtonsRow, { twitter: twitter, projectLink: projectLink, bubble: earnTokenContract, audit: audit, chain: chain }), (config === null || config === void 0 ? void 0 : config.referenceId) === 'apebond' && !isSoldOut && (jsx$2(Flex, { sx: { width: '100%', my: '5px', justifyContent: 'center', position: 'relative', height: '25px' }, children: jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation, rightPos: '-5px' }) })), jsx$2(Flex, { sx: { justifyContent: 'center' }, children: jsxs(Flex, { sx: { width: '144px', flexDirection: 'column' }, children: [jsx$2(Flex, { sx: styles$b.linkRow, children: tokenLink && (jsxs(Link, { href: tokenLink, sx: styles$b.link, target: "_blank", children: ["View Token Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$b.linkRow, children: bondLink && (jsxs(Link, { href: bondLink, sx: styles$b.link, target: "_blank", children: ["View Bond Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$b.linkRow, children: billType !== 'fcfs' && (jsxs(Link, { href: bondDashboard, sx: styles$b.link, target: "_blank", children: ["View Bond Insights", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) })] }) })] }));
|
|
76354
76382
|
};
|
|
76355
76383
|
|
|
76356
76384
|
const UserBondRow = ({ bill }) => {
|
|
@@ -76365,7 +76393,7 @@ const UserBondRow = ({ bill }) => {
|
|
|
76365
76393
|
const { isLoading: isConfirming, isSuccess: isConfirmed } = useMonitorTxHash(claimTxHash, (_a = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _a === void 0 ? void 0 : _a.chainId);
|
|
76366
76394
|
const [loadingTx, setLoadingTx] = useState(false);
|
|
76367
76395
|
const load = loadingTx || (isConfirming && !isConfirmed);
|
|
76368
|
-
const [onOpenPurchasedBond] = useModal(jsx$2(YourBondsModal
|
|
76396
|
+
const [onOpenPurchasedBond] = useModal(jsx$2(YourBondsModal, { bill: bill }));
|
|
76369
76397
|
const handleClaim = (billId, billAddress) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
76370
76398
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
76371
76399
|
const address = billAddress;
|
|
@@ -79579,8 +79607,8 @@ const COMMON_PDA_PROGRAM = new PublicKey(buffer.Buffer.from([
|
|
|
79579
79607
|
123, 216, 219, 233, 248, 89,
|
|
79580
79608
|
]));
|
|
79581
79609
|
const CLAIM_DISCRIMINATOR = buffer.Buffer.from([62, 198, 214, 193, 213, 159, 108, 210]);
|
|
79582
|
-
const
|
|
79583
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
79610
|
+
const YourSolanaBondsModal = ({ onDismiss, userBill }) => {
|
|
79611
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
79584
79612
|
// Hooks
|
|
79585
79613
|
const { publicKey: accountSolana, signTransaction } = useWallet();
|
|
79586
79614
|
const { setVisible } = useWalletModal();
|
|
@@ -79684,8 +79712,11 @@ const YourBondsModal = ({ onDismiss, userBill }) => {
|
|
|
79684
79712
|
blockhash,
|
|
79685
79713
|
lastValidBlockHeight,
|
|
79686
79714
|
}, 'confirmed');
|
|
79687
|
-
yield refetch();
|
|
79688
79715
|
addToastSuccess(txId, (_e = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _e === void 0 ? void 0 : _e.chainId);
|
|
79716
|
+
setTimeout(() => {
|
|
79717
|
+
// a little cheat to refetch bonds after the tx is confirmed on chain :)
|
|
79718
|
+
refetch();
|
|
79719
|
+
}, 3000);
|
|
79689
79720
|
}
|
|
79690
79721
|
catch (error) {
|
|
79691
79722
|
console.error('Claim failed:', error);
|
|
@@ -79700,7 +79731,6 @@ const YourBondsModal = ({ onDismiss, userBill }) => {
|
|
|
79700
79731
|
var _a, _b, _c, _d, _e, _f;
|
|
79701
79732
|
return getBalanceNumber(new BigNumber$1((_a = userBill === null || userBill === void 0 ? void 0 : userBill.payout) !== null && _a !== void 0 ? _a : 0), (_f = (_d = (_c = (_b = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _b === void 0 ? void 0 : _b.earnToken) === null || _c === void 0 ? void 0 : _c.decimals) === null || _d === void 0 ? void 0 : _d[(_e = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _e === void 0 ? void 0 : _e.chainId]) !== null && _f !== void 0 ? _f : 18);
|
|
79702
79733
|
};
|
|
79703
|
-
console.log('totalPending: ', totalPending(userBill));
|
|
79704
79734
|
const claimable = (userBill) => {
|
|
79705
79735
|
var _a, _b, _c, _d, _e, _f;
|
|
79706
79736
|
return getBalanceNumber(new BigNumber$1((_a = userBill === null || userBill === void 0 ? void 0 : userBill.pendingRewards) !== null && _a !== void 0 ? _a : '0'), (_f = (_d = (_c = (_b = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _b === void 0 ? void 0 : _b.earnToken) === null || _c === void 0 ? void 0 : _c.decimals) === null || _d === void 0 ? void 0 : _d[(_e = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _e === void 0 ? void 0 : _e.chainId]) !== null && _f !== void 0 ? _f : 18);
|
|
@@ -79709,32 +79739,32 @@ const YourBondsModal = ({ onDismiss, userBill }) => {
|
|
|
79709
79739
|
setImgLoaded(true);
|
|
79710
79740
|
};
|
|
79711
79741
|
const [onTransferBondModal] = useModal(jsx$2(TransferBondModal, { userBill: userBill }), true, true, `transferModal${userBill === null || userBill === void 0 ? void 0 : userBill.id}}`);
|
|
79712
|
-
return (jsx$2(Modal, { className: "modal", children: jsxs(Flex$1, { className: "yourbondsmodal-content", children: [jsx$2(Flex$1, { className: "yourbondsmodal-header", children: jsx$2(Flex$1, { className: "svg-close", onClick: onDismiss, children: jsx$2(Svg, { icon: "close" }) }) }), jsxs(Flex$1, { className: "yourbondsmodal table-container", children: [jsxs(Flex$1, { className: "yourbondsmodal bondimage", children: [jsx$2("img", { src:
|
|
79742
|
+
return (jsx$2(Modal, { className: "modal", children: jsxs(Flex$1, { className: "yourbondsmodal-content", children: [jsx$2(Flex$1, { className: "yourbondsmodal-header", children: jsx$2(Flex$1, { className: "svg-close", onClick: onDismiss, children: jsx$2(Svg, { icon: "close" }) }) }), jsxs(Flex$1, { className: "yourbondsmodal table-container", children: [jsxs(Flex$1, { className: "yourbondsmodal bondimage", children: [jsx$2("img", { src: `https://ape.bond/solBonds/${(_e = (_d = (_c = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _c === void 0 ? void 0 : _c.earnToken) === null || _d === void 0 ? void 0 : _d.symbol) === null || _e === void 0 ? void 0 : _e.toLowerCase()}.png`, alt: "Solana Bonds Banner", onLoad: handleImageLoad, style: { zIndex: 2, width: '100%', height: '100%' } }), !imgLoaded && (jsx$2(Flex$1, { sx: {
|
|
79713
79743
|
position: 'absolute',
|
|
79714
79744
|
top: 'calc(50% - 24px)',
|
|
79715
79745
|
right: 'calc(50% - 50px)',
|
|
79716
79746
|
justifyContent: 'center',
|
|
79717
79747
|
alignItems: 'center',
|
|
79718
79748
|
zIndex: 1,
|
|
79719
|
-
}, children: jsx$2(Spinner, { width: 100 }) }))] }), jsxs(Flex$1, { className: "yourbondsmodal yourbondinfo", children: [jsxs(Flex$1, { className: "yourbondinfo title-container", children: [jsx$2(Flex$1, { className: "title-container bondicon", children: userBill && (jsx$2(TokenImage, { symbol: (
|
|
79749
|
+
}, children: jsx$2(Spinner, { width: 100 }) }))] }), jsxs(Flex$1, { className: "yourbondsmodal yourbondinfo", children: [jsxs(Flex$1, { className: "yourbondinfo title-container", children: [jsx$2(Flex$1, { className: "title-container bondicon", children: userBill && (jsx$2(TokenImage, { symbol: (_g = (_f = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _f === void 0 ? void 0 : _f.showcaseTokenName) !== null && _g !== void 0 ? _g : (_j = (_h = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _h === void 0 ? void 0 : _h.earnToken) === null || _j === void 0 ? void 0 : _j.symbol, size: 40, chain: (_k = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _k === void 0 ? void 0 : _k.chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: (_m = (_l = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _l === void 0 ? void 0 : _l.showcaseTokenName) !== null && _m !== void 0 ? _m : (_o = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _o === void 0 ? void 0 : _o.earnToken.symbol }), jsx$2(Flex$1, { className: "title-container tokentags", children: (_q = (_p = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _p === void 0 ? void 0 : _p.tags) === null || _q === void 0 ? void 0 : _q.slice(0, 1).map((tag) => {
|
|
79720
79750
|
return (jsx$2(Flex$1, { sx: { marginRight: '10px' }, children: jsx$2(ListTag, { text: tag === null || tag === void 0 ? void 0 : tag.toUpperCase() }) }, tag));
|
|
79721
|
-
}) }), jsxs(Text, { sx: { color: 'text', opacity: '0.6', fontSize: ['12px', '12px', '12px', '16px'] }, children: ["ID # ", (
|
|
79751
|
+
}) }), jsxs(Text, { sx: { color: 'text', opacity: '0.6', fontSize: ['12px', '12px', '12px', '16px'] }, children: ["ID # ", (_r = userBill === null || userBill === void 0 ? void 0 : userBill.id) === null || _r === void 0 ? void 0 : _r.slice(0, 3), "...", (_s = userBill === null || userBill === void 0 ? void 0 : userBill.id) === null || _s === void 0 ? void 0 : _s.slice(userBill.id.length - 3, userBill.id.length)] })] }), jsxs(Flex$1, { className: "yourbondinfo blocks-container", children: [jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Fully Vested" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.FullyVested }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon" }), jsx$2(Flex$1, { className: "block-info text", children: jsxs(Flex$1, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: [vestingTimeRemainingString(userBill), isPendingCliff && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex$1, { children: ["Bond will be claimable in", ' ', `${cliffCountdown.days !== 0 ? `${cliffCountdown.days} days` : cliffCountdown.hours !== 0 ? `${cliffCountdown.hours} hours` : `${cliffCountdown.minutes} mins`}`, "."] }), width: "180px", placement: "bottomRight", transformTip: "translate(13%, 0%)", children: jsx$2(Flex$1, { sx: { opacity: 0.6, ml: '6px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }) })] })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-pending", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Pending" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.Pending }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_u = (_t = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _t === void 0 ? void 0 : _t.showcaseTokenName) !== null && _u !== void 0 ? _u : (_w = (_v = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _v === void 0 ? void 0 : _v.earnToken) === null || _w === void 0 ? void 0 : _w.symbol, size: 25, chain: (_x = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _x === void 0 ? void 0 : _x.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(totalPending(userBill), 4) }), jsx$2(Text, { sx: {
|
|
79722
79752
|
fontSize: ['10px', '10px', '10px', '12px'],
|
|
79723
79753
|
fontWeight: [500, 500, 500, 400],
|
|
79724
79754
|
paddingLeft: '10px',
|
|
79725
|
-
}, children: `($${(totalPending(userBill) * parseFloat((
|
|
79755
|
+
}, children: `($${(totalPending(userBill) * parseFloat((_z = (_y = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _y === void 0 ? void 0 : _y.payoutTokenPrice) !== null && _z !== void 0 ? _z : '0')).toFixed(2)})` })] })] })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-claimable", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Claimable" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.Claimable }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_1 = (_0 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _0 === void 0 ? void 0 : _0.showcaseTokenName) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _2 === void 0 ? void 0 : _2.earnToken) === null || _3 === void 0 ? void 0 : _3.symbol, size: 25, chain: (_4 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _4 === void 0 ? void 0 : _4.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(claimable(userBill), 4) }), jsx$2(Text, { sx: {
|
|
79726
79756
|
fontSize: ['10px', '10px', '10px', '12px'],
|
|
79727
79757
|
fontWeight: [500, 500, 500, 400],
|
|
79728
79758
|
paddingLeft: '10px',
|
|
79729
|
-
}, children: `($${(claimable(userBill) * parseFloat((
|
|
79759
|
+
}, children: `($${(claimable(userBill) * parseFloat((_6 = (_5 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _5 === void 0 ? void 0 : _5.payoutTokenPrice) !== null && _6 !== void 0 ? _6 : '0')).toFixed(2)})` })] })] })] })] }), ((_7 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _7 === void 0 ? void 0 : _7.warningCard) && (jsx$2(Flex$1, { sx: {
|
|
79730
79760
|
width: '100%',
|
|
79731
79761
|
background: '#DE62F366',
|
|
79732
79762
|
justifyContent: 'center',
|
|
79733
79763
|
borderRadius: 'normal',
|
|
79734
|
-
}, children: jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, p: '2px 10px' }, children: jsx$2(SafeHTMLComponent, { html: (
|
|
79764
|
+
}, children: jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, p: '2px 10px' }, children: jsx$2(SafeHTMLComponent, { html: (_8 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _8 === void 0 ? void 0 : _8.warningCard }) }) })), jsxs(Flex$1, { className: "yourbondinfo button-container", children: [jsx$2(Flex$1, { className: "button-container claim", children: userBill && !accountSolana ? (jsxs(Button, { className: "switch-button", disabled: claimable(userBill) === 0 || load, onClick: (event) => {
|
|
79735
79765
|
event.stopPropagation();
|
|
79736
79766
|
setVisible(true);
|
|
79737
|
-
}, children: ["Switch to ", NETWORK_LABEL[(
|
|
79767
|
+
}, children: ["Switch to ", NETWORK_LABEL[(_9 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _9 === void 0 ? void 0 : _9.chainId]] })) : (jsx$2(Button, { className: "claim-button", disabled: claimable(userBill) === 0 || load || !userBill || isPendingCliff, load: load, onClick: (event) => {
|
|
79738
79768
|
event.stopPropagation();
|
|
79739
79769
|
handleClaim();
|
|
79740
79770
|
}, children: isPendingCliff
|
|
@@ -79750,7 +79780,7 @@ const UserBondRowSolana = ({ bill }) => {
|
|
|
79750
79780
|
const { refetch } = useUserBonds();
|
|
79751
79781
|
const [loadingTx, setLoadingTx] = useState(false);
|
|
79752
79782
|
const load = loadingTx;
|
|
79753
|
-
const [onOpenPurchasedBond] = useModal(jsx$2(
|
|
79783
|
+
const [onOpenPurchasedBond] = useModal(jsx$2(YourSolanaBondsModal, { userBill: bill }), true, true, `yoursolanabondsModal-${bill.id}`);
|
|
79754
79784
|
const connection = new Connection(getRPC(types$1.ChainId.SOL));
|
|
79755
79785
|
const ensureUserPayoutAtaExists = (_a) => __awaiter$9(void 0, [_a], void 0, function* ({ connection, payer, payoutMint, user, }) {
|
|
79756
79786
|
const userPayoutAta = yield getAssociatedTokenAddress(payoutMint, user);
|
|
@@ -79839,8 +79869,11 @@ const UserBondRowSolana = ({ bill }) => {
|
|
|
79839
79869
|
blockhash,
|
|
79840
79870
|
lastValidBlockHeight,
|
|
79841
79871
|
}, 'confirmed');
|
|
79842
|
-
yield refetch();
|
|
79843
79872
|
addToastSuccess(txId, (_e = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _e === void 0 ? void 0 : _e.chainId);
|
|
79873
|
+
setTimeout(() => {
|
|
79874
|
+
// a little cheat to refetch bonds after the tx is confirmed on chain :)
|
|
79875
|
+
refetch();
|
|
79876
|
+
}, 3000);
|
|
79844
79877
|
}
|
|
79845
79878
|
catch (error) {
|
|
79846
79879
|
console.error('Claim failed:', error);
|
|
@@ -79857,9 +79890,9 @@ const UserBondRowSolana = ({ bill }) => {
|
|
|
79857
79890
|
const lastBlockTimestamp = parseInt((_d = bill === null || bill === void 0 ? void 0 : bill.lastBlockTimestamp) !== null && _d !== void 0 ? _d : '0');
|
|
79858
79891
|
const isPendingCliff = vestingCliff ? currentTime - lastBlockTimestamp < vestingCliff : false;
|
|
79859
79892
|
const cliffCountdown = getTimePeriods(lastBlockTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
|
|
79860
|
-
return (jsxs("div", { className: "your-bonds", onClick: () => onOpenPurchasedBond(), children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_e = bill.bond) === null || _e === void 0 ? void 0 : _e.earnToken.symbol, chain: (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.chainId, vestEnds: `Ends in ${getPendingVestingString(bill)}
|
|
79893
|
+
return (jsxs("div", { className: "your-bonds", onClick: () => onOpenPurchasedBond(), children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_e = bill.bond) === null || _e === void 0 ? void 0 : _e.earnToken.symbol, chain: (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.chainId, vestEnds: `Ends in ${getPendingVestingString(bill)}`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_g = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _g === void 0 ? void 0 : _g.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.earnToken.symbol) || '', bondContract: (_j = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _j !== void 0 ? _j : '', projectLink: (_k = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _k === void 0 ? void 0 : _k.projectLink, twitter: (_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.twitter, audit: (_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.audit, chain: (_o = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _o === void 0 ? void 0 : _o.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
|
|
79861
79894
|
opacity: 0.8,
|
|
79862
|
-
}, 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(claimable(bill),
|
|
79895
|
+
}, 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(claimable(bill), 4), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(claimable(bill) * earnTokenPrice).toFixed(2)})` })] })] }), 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(totalPending(bill), 4), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(totalPending(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingTimeRemainingString(bill) }), jsx$2("div", { className: "your-bonds-column-button", children: !accountSolana ? (jsxs(Button, { className: "button", disabled: claimable(bill) === 0 || load, load: load, onClick: (event) => {
|
|
79863
79896
|
event.stopPropagation();
|
|
79864
79897
|
setVisible(true);
|
|
79865
79898
|
}, fullWidth: true, children: ["Connect to ", NETWORK_LABEL[(_p = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _p === void 0 ? void 0 : _p.chainId]] })) : (jsx$2(Button, { className: "button", disabled: claimable(bill) === 0 || load || isPendingCliff, load: load, onClick: (event) => {
|
|
@@ -82930,7 +82963,7 @@ function calculateSolanaTrueBillPrice(bondIssuanceAddress) {
|
|
|
82930
82963
|
try {
|
|
82931
82964
|
if (!bondIssuanceAddress) {
|
|
82932
82965
|
console.error('No bond issuance address');
|
|
82933
|
-
return
|
|
82966
|
+
return '0';
|
|
82934
82967
|
}
|
|
82935
82968
|
const connection = new Connection(getRPC(types$1.ChainId.SOL), 'confirmed');
|
|
82936
82969
|
const bondIssuancePubkey = new PublicKey(bondIssuanceAddress);
|
|
@@ -82961,14 +82994,72 @@ function calculateSolanaTrueBillPrice(bondIssuanceAddress) {
|
|
|
82961
82994
|
}
|
|
82962
82995
|
const decodedData = buffer.Buffer.from(data, 'base64');
|
|
82963
82996
|
const trueBillPrice = new BigNumber$1(decodedData.readBigUInt64LE(0).toString());
|
|
82964
|
-
return trueBillPrice.multipliedBy(1e6);
|
|
82997
|
+
return trueBillPrice.multipliedBy(1e6).toString();
|
|
82965
82998
|
}
|
|
82966
82999
|
catch (e) {
|
|
82967
83000
|
console.error('Error calculating true bill price:', e);
|
|
82968
|
-
return
|
|
83001
|
+
return '0';
|
|
82969
83002
|
}
|
|
82970
83003
|
});
|
|
82971
83004
|
}
|
|
83005
|
+
/**
|
|
83006
|
+
* This is the Typescript implementation of the Rust true_bond_price function since the on-chain program requires a real wallet
|
|
83007
|
+
*/
|
|
83008
|
+
function calculateTrueBondPrice(bondPricing, bondTerm, currentTimestamp, principalMintDecimals, payoutMintDecimals) {
|
|
83009
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
83010
|
+
try {
|
|
83011
|
+
// Extract values from the account data
|
|
83012
|
+
const totalDebt = new BigNumber$1((_b = (_a = bondPricing.totalDebt) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '0');
|
|
83013
|
+
const lastDecay = new BigNumber$1((_d = (_c = bondPricing.lastDecay) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '0');
|
|
83014
|
+
const controlVariable = new BigNumber$1((_f = (_e = bondTerm.controlVariable) === null || _e === void 0 ? void 0 : _e.toString()) !== null && _f !== void 0 ? _f : '0');
|
|
83015
|
+
const vestingEnd = new BigNumber$1((_h = (_g = bondTerm.vestingEnd) === null || _g === void 0 ? void 0 : _g.toString()) !== null && _h !== void 0 ? _h : '0');
|
|
83016
|
+
const minimumDebt = new BigNumber$1((_k = (_j = bondTerm.minimumDebt) === null || _j === void 0 ? void 0 : _j.toString()) !== null && _k !== void 0 ? _k : '0');
|
|
83017
|
+
const payoutTokenInitialSupply = new BigNumber$1((_m = (_l = bondTerm.payoutTokenInitialSupply) === null || _l === void 0 ? void 0 : _l.toString()) !== null && _m !== void 0 ? _m : '0');
|
|
83018
|
+
// Constants for price calculation (1e16 and 1e18)
|
|
83019
|
+
const e16 = new BigNumber$1('10000000000000000');
|
|
83020
|
+
const e18 = new BigNumber$1('1000000000000000000');
|
|
83021
|
+
const principalDecimalsMultiplier = new BigNumber$1(10).pow(principalMintDecimals);
|
|
83022
|
+
// Calculate debt ratio
|
|
83023
|
+
const debtRatio = calculateDebtRatio(totalDebt, lastDecay, new BigNumber$1(currentTimestamp), vestingEnd, payoutMintDecimals, payoutTokenInitialSupply);
|
|
83024
|
+
// Calculate price: (control_variable * debt_ratio * 1e16) / principal_decimals / 1e18
|
|
83025
|
+
const numerator = controlVariable.multipliedBy(debtRatio).multipliedBy(e16);
|
|
83026
|
+
const price = numerator.dividedBy(principalDecimalsMultiplier).dividedBy(e18);
|
|
83027
|
+
// Apply minimum debt floor
|
|
83028
|
+
return price.lt(minimumDebt) ? minimumDebt : price;
|
|
83029
|
+
}
|
|
83030
|
+
catch (error) {
|
|
83031
|
+
console.error('Error in price calculation:', error);
|
|
83032
|
+
return new BigNumber$1(0);
|
|
83033
|
+
}
|
|
83034
|
+
}
|
|
83035
|
+
/**
|
|
83036
|
+
* This is the Typescript implementation of the Rust debt_ratio function
|
|
83037
|
+
*/
|
|
83038
|
+
function calculateDebtRatio(totalDebt, lastDecay, currentTimestamp, vestingEnd, payoutDecimals, payoutTokenInitialSupply) {
|
|
83039
|
+
try {
|
|
83040
|
+
// If vesting term is 0 or initial supply is 0, return 0
|
|
83041
|
+
if (vestingEnd.isZero() || payoutTokenInitialSupply.isZero()) {
|
|
83042
|
+
return new BigNumber$1(0);
|
|
83043
|
+
}
|
|
83044
|
+
// Calculate time elapsed since last decay (with underflow protection)
|
|
83045
|
+
const timeSinceLast = currentTimestamp.isLessThan(lastDecay) ? new BigNumber$1(0) : currentTimestamp.minus(lastDecay);
|
|
83046
|
+
// Calculate decay amount: (total_debt * time_since_last) / vesting_term
|
|
83047
|
+
const decayAmount = totalDebt.multipliedBy(timeSinceLast).dividedBy(vestingEnd);
|
|
83048
|
+
// Cap decay amount at total debt
|
|
83049
|
+
const finalDecayAmount = decayAmount.isGreaterThan(totalDebt) ? totalDebt : decayAmount;
|
|
83050
|
+
// Calculate current debt: total_debt - decay_amount
|
|
83051
|
+
const currentDebt = totalDebt.minus(finalDecayAmount);
|
|
83052
|
+
// Calculate debt ratio: (current_debt * payout_decimals_multiplier * 1e18) / initial_supply
|
|
83053
|
+
const payoutDecimalsMultiplier = new BigNumber$1(10).pow(payoutDecimals);
|
|
83054
|
+
const e18 = new BigNumber$1('1000000000000000000');
|
|
83055
|
+
const numerator = currentDebt.multipliedBy(payoutDecimalsMultiplier).multipliedBy(e18);
|
|
83056
|
+
return numerator.dividedBy(payoutTokenInitialSupply);
|
|
83057
|
+
}
|
|
83058
|
+
catch (error) {
|
|
83059
|
+
console.error('Error calculating debt ratio:', error);
|
|
83060
|
+
return new BigNumber$1(0);
|
|
83061
|
+
}
|
|
83062
|
+
}
|
|
82972
83063
|
|
|
82973
83064
|
function useSolPrices() {
|
|
82974
83065
|
var _a;
|
|
@@ -83001,11 +83092,13 @@ function useBondsData() {
|
|
|
83001
83092
|
return useQuery({
|
|
83002
83093
|
queryKey: [QUERY_KEYS.BONDS_DATA, bondList === null || bondList === void 0 ? void 0 : bondList.length, preTGEList === null || preTGEList === void 0 ? void 0 : preTGEList.length],
|
|
83003
83094
|
queryFn: () => getBondsData(chains, bondList, preTGEList, realTimeApiURL, apiUrl, solPrices, queryClient),
|
|
83004
|
-
refetchInterval:
|
|
83095
|
+
refetchInterval: 30000, // i.e. 30 sec
|
|
83096
|
+
enabled: !!bondList && !!preTGEList,
|
|
83005
83097
|
refetchOnWindowFocus: false,
|
|
83098
|
+
refetchOnMount: false,
|
|
83099
|
+
refetchOnReconnect: false,
|
|
83006
83100
|
retry: 0,
|
|
83007
83101
|
initialData: [],
|
|
83008
|
-
enabled: !!bondList && !!preTGEList,
|
|
83009
83102
|
});
|
|
83010
83103
|
}
|
|
83011
83104
|
//TODO: move this function to utils once SOLANA code is merged
|
|
@@ -83088,6 +83181,10 @@ const fetchBills = (chainId, bills, apiUrl, tokenPrices) => __awaiter$9(void 0,
|
|
|
83088
83181
|
[bill.terms.controlVariable, vestingTermDuration, bill.terms.minimumDebt, bill.terms.maxPayout],
|
|
83089
83182
|
bill.terms.maxTotalPayout,
|
|
83090
83183
|
parseFloat(bill.feeInPayout.toString()),
|
|
83184
|
+
parseFloat(bill.feeInPrincipal.toString()) / 10000,
|
|
83185
|
+
undefined,
|
|
83186
|
+
solanaResults.bondPricing[index],
|
|
83187
|
+
solanaResults.bondTerm[index],
|
|
83091
83188
|
]; // Map to reflect evm structure
|
|
83092
83189
|
}).filter((bill) => typeof bill !== 'undefined')) !== null && _b !== void 0 ? _b : [];
|
|
83093
83190
|
const allBillsIds = [];
|
|
@@ -83187,7 +83284,7 @@ const cleanBillsData = (billIds, chunkedBills, chainId, bills, tokenPrices) => _
|
|
|
83187
83284
|
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()) &&
|
|
83188
83285
|
(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.chainId) === chainId;
|
|
83189
83286
|
})) === null || _c === void 0 ? void 0 : _c.price) !== null && _d !== void 0 ? _d : 0;
|
|
83190
|
-
const [trueBillPriceFromChunk, totalPayoutGiven, terms, maxTotalPayout, fee, , customTreasuryBalance] = chunk;
|
|
83287
|
+
const [trueBillPriceFromChunk, totalPayoutGiven, terms, maxTotalPayout, fee, feeInPrincipal, customTreasuryBalance, bondPricing, bondTerms,] = chunk;
|
|
83191
83288
|
let trueBillPrice = trueBillPriceFromChunk;
|
|
83192
83289
|
const feeInPayout = Number(fee / 10000);
|
|
83193
83290
|
const [, vestingTerm, , maxPayout] = terms;
|
|
@@ -83197,11 +83294,25 @@ const cleanBillsData = (billIds, chunkedBills, chainId, bills, tokenPrices) => _
|
|
|
83197
83294
|
.toNumber();
|
|
83198
83295
|
const treasuryBalance = getBalanceNumber(customTreasuryBalance);
|
|
83199
83296
|
if (chainId === types$1.ChainId.SOL) {
|
|
83200
|
-
const
|
|
83201
|
-
|
|
83297
|
+
const asyncTrueBillPrice = yield calculateSolanaTrueBillPrice((_f = bill === null || bill === void 0 ? void 0 : bill.contractAddress[types$1.ChainId.SOL]) !== null && _f !== void 0 ? _f : '');
|
|
83298
|
+
const principalDecimals = bill === null || bill === void 0 ? void 0 : bill.lpToken.decimals[types$1.ChainId.SOL];
|
|
83299
|
+
const payoutDecimals = bill === null || bill === void 0 ? void 0 : bill.earnToken.decimals[types$1.ChainId.SOL];
|
|
83300
|
+
const timeStamp = Math.floor(Date.now() / 1000);
|
|
83301
|
+
const price = calculateTrueBondPrice(bondPricing, bondTerms, timeStamp, principalDecimals, payoutDecimals);
|
|
83302
|
+
const reverseFee = new BigNumber$1(feeInPrincipal / 100 / (1 - feeInPrincipal / 100));
|
|
83303
|
+
const syncTrueBillPrice = new BigNumber$1(price).plus(new BigNumber$1(price).times(reverseFee)).toFixed(0);
|
|
83304
|
+
const percentageDifference = (Math.abs(parseFloat(asyncTrueBillPrice) - parseFloat(syncTrueBillPrice)) / parseFloat(syncTrueBillPrice)) *
|
|
83305
|
+
100;
|
|
83306
|
+
const isDiffSmall = percentageDifference <= 0.0001;
|
|
83307
|
+
if (!isDiffSmall) {
|
|
83308
|
+
console.error('Something is off between async and sync truebillprices');
|
|
83309
|
+
console.log(syncTrueBillPrice);
|
|
83310
|
+
console.log(asyncTrueBillPrice);
|
|
83311
|
+
console.log(percentageDifference);
|
|
83312
|
+
console.log(isDiffSmall);
|
|
83313
|
+
}
|
|
83314
|
+
trueBillPrice = asyncTrueBillPrice;
|
|
83202
83315
|
}
|
|
83203
|
-
const bonus = getRawBonus(trueBillPrice, lpPrice, earnTokenPrice);
|
|
83204
|
-
const bonusWithFee = getBonusWithFee(feeInPayout, trueBillPrice, lpPrice, earnTokenPrice);
|
|
83205
83316
|
let trueBondPrices = [];
|
|
83206
83317
|
if ((bill === null || bill === void 0 ? void 0 : bill.billVersion) === types$1.BillVersion.V4) {
|
|
83207
83318
|
trueBondPrices = trueBillPrice[0].map((data) => {
|
|
@@ -83214,6 +83325,8 @@ const cleanBillsData = (billIds, chunkedBills, chainId, bills, tokenPrices) => _
|
|
|
83214
83325
|
});
|
|
83215
83326
|
}
|
|
83216
83327
|
else {
|
|
83328
|
+
const bonus = getRawBonus(trueBillPrice, lpPrice, earnTokenPrice);
|
|
83329
|
+
const bonusWithFee = getBonusWithFee(feeInPayout, trueBillPrice, lpPrice, earnTokenPrice);
|
|
83217
83330
|
trueBondPrices = [
|
|
83218
83331
|
{
|
|
83219
83332
|
points: '0',
|
|
@@ -83224,7 +83337,8 @@ const cleanBillsData = (billIds, chunkedBills, chainId, bills, tokenPrices) => _
|
|
|
83224
83337
|
];
|
|
83225
83338
|
}
|
|
83226
83339
|
//@ts-ignore
|
|
83227
|
-
const cleanedData = Object.assign(Object.assign({}, bill), { feeInPayout,
|
|
83340
|
+
const cleanedData = Object.assign(Object.assign({}, bill), { feeInPayout,
|
|
83341
|
+
feeInPrincipal, 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 : '', trueBondPrices, 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: treasuryBalance
|
|
83228
83342
|
? Math.min(treasuryBalance, tokensRemaining).toString()
|
|
83229
83343
|
: tokensRemaining.toString(), maxTotalPayout: maxTotalPayout === null || maxTotalPayout === void 0 ? void 0 : maxTotalPayout.toString(), maxPayout: maxPayout === null || maxPayout === void 0 ? void 0 : maxPayout.toString(), totalPayoutGiven: totalPayoutGiven === null || totalPayoutGiven === void 0 ? void 0 : totalPayoutGiven.toString(), vestingTerm: typeof vestingTerm === 'number' ? vestingTerm : vestingTerm.toNumber() });
|
|
83230
83344
|
return cleanedData;
|
|
@@ -83233,8 +83347,9 @@ const cleanBillsData = (billIds, chunkedBills, chainId, bills, tokenPrices) => _
|
|
|
83233
83347
|
});
|
|
83234
83348
|
const getBonusWithFee = (feeInPayout, trueBillPrice, lpPrice, earnTokenPrice) => {
|
|
83235
83349
|
const fee = feeInPayout !== null && feeInPayout !== void 0 ? feeInPayout : 0;
|
|
83236
|
-
const
|
|
83237
|
-
const
|
|
83350
|
+
const reverseFee = new BigNumber$1(fee / 100 / (1 - fee / 100));
|
|
83351
|
+
const trueBondPrice = new BigNumber$1(trueBillPrice).plus(new BigNumber$1(trueBillPrice).times(reverseFee));
|
|
83352
|
+
const priceUSDMinusFee = getBalanceNumber(trueBondPrice) * lpPrice;
|
|
83238
83353
|
const discountWithoutFee = ((earnTokenPrice - priceUSDMinusFee) / earnTokenPrice) * 100;
|
|
83239
83354
|
return discountWithoutFee > 0 ? (discountWithoutFee / (100 - discountWithoutFee)) * 100 : 0;
|
|
83240
83355
|
};
|
|
@@ -83615,6 +83730,9 @@ const useSlippage = () => {
|
|
|
83615
83730
|
queryKey: [QUERY_KEYS.SLIPPAGE],
|
|
83616
83731
|
staleTime: Infinity,
|
|
83617
83732
|
initialData: 0.5,
|
|
83733
|
+
queryFn: () => {
|
|
83734
|
+
throw new Error('Just a hotfix for latest versions of react-query that make queryFn a required prop');
|
|
83735
|
+
},
|
|
83618
83736
|
});
|
|
83619
83737
|
// Handler to modify the setting within React Query's cache
|
|
83620
83738
|
const setSlippage = (newValue) => {
|
|
@@ -84933,7 +85051,7 @@ const ZapModal = ({ onDismiss, outputToken, account, chainId }) => {
|
|
|
84933
85051
|
});
|
|
84934
85052
|
});
|
|
84935
85053
|
};
|
|
84936
|
-
return (jsxs(Modal, { children: [jsx$2(ModalHeader, { onDismiss: onDismiss, children: jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsxs(Text, { sx: { fontSize: '22px', fontWeight: 700, lineHeight: '30px' }, children: ["Zap ", jsx$2(Svg, { icon: "ZapIcon" })] }), jsx$2(Flex, { onClick: onOpenSlippageModal, sx: { mr: '15px' }, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] }) }), jsxs(Flex, { sx: { flexDirection: 'column', pt: '10px', gap: '10px' }, children: [jsx$2(Flex, { sx: { position: 'relative' }, children: jsx$2(Text, { children: "From:" }) }), jsx$2(Flex, { sx: { width: '100%', height: 'auto', justifyContent: 'space-between' }, children: jsx$2(TokenSelectorPanel, { typedValue: typedValue, setTypedValue: setTypedValue, selectedToken: inputToken, handleValueBtn: handleMaxInput, handleCurrencySelect: handleCurrencySelect, chainId: chainId, enableZap: true, tokenBalance: inputTokenBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }) }), jsxs(Flex, { sx: { position: 'relative', mt: '10px' }, children: [jsx$2(Text, { children: "To:" }), jsx$2(Box$1, { sx: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)' }, children: jsx$2(Svg, { icon: "ZapArrow" }) })] }), jsx$2(TokenSelectorPanel, { typedValue: isWrap ? typedValue : outputValue === 0 ? '' : outputValue.toFixed(18), setTypedValue: () => null, selectedToken: outputToken, handleCurrencySelect: () => null, chainId: chainId, enableZap: false, tokenBalance: outputTokenBalanceString, selectedTokenPrice: outputTokenPrice === null || outputTokenPrice === void 0 ? void 0 : outputTokenPrice.price }), jsx$2(Flex, { className: "button-container zap", children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== chainId ? (jsxs(Button, { className: "switch-button zap", onClick: (event) => {
|
|
85054
|
+
return (jsxs(Modal, { children: [jsx$2(ModalHeader, { onDismiss: onDismiss, children: jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsxs(Text, { sx: { fontSize: '22px', fontWeight: 700, lineHeight: '30px' }, children: ["Zap ", jsx$2(Svg, { icon: "ZapIcon" })] }), jsx$2(Flex, { onClick: onOpenSlippageModal, sx: { mr: '15px' }, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] }) }), jsxs(Flex, { sx: { flexDirection: 'column', pt: '10px', gap: '10px' }, children: [jsx$2(Flex, { sx: { position: 'relative' }, children: jsx$2(Text, { children: "From:" }) }), jsx$2(Flex, { sx: { width: '100%', height: 'auto', justifyContent: 'space-between' }, children: jsx$2(TokenSelectorPanel, { typedValue: typedValue, setTypedValue: setTypedValue, selectedToken: inputToken, handleValueBtn: handleMaxInput, handleCurrencySelect: handleCurrencySelect, chainId: chainId, enableZap: true, tokenBalance: inputTokenBalance !== null && inputTokenBalance !== void 0 ? inputTokenBalance : undefined, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }) }), jsxs(Flex, { sx: { position: 'relative', mt: '10px' }, children: [jsx$2(Text, { children: "To:" }), jsx$2(Box$1, { sx: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)' }, children: jsx$2(Svg, { icon: "ZapArrow" }) })] }), jsx$2(TokenSelectorPanel, { typedValue: isWrap ? typedValue : outputValue === 0 ? '' : outputValue.toFixed(18), setTypedValue: () => null, selectedToken: outputToken, handleCurrencySelect: () => null, chainId: chainId, enableZap: false, tokenBalance: outputTokenBalanceString, selectedTokenPrice: outputTokenPrice === null || outputTokenPrice === void 0 ? void 0 : outputTokenPrice.price }), jsx$2(Flex, { className: "button-container zap", children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== chainId ? (jsxs(Button, { className: "switch-button zap", onClick: (event) => {
|
|
84937
85055
|
event.stopPropagation();
|
|
84938
85056
|
switchChain({ chainId: chainId });
|
|
84939
85057
|
}, children: ["Switch to ", NETWORK_LABEL[chainId]] })) : approvalState === ApprovalState.NOT_APPROVED || approvalState === ApprovalState.PENDING ? (jsx$2(Button, { onClick: handleApprove, fullWidth: true, load: approvalState === ApprovalState.PENDING, disable: approvalState === ApprovalState.PENDING, children: pendingTx || approvalState === ApprovalState.PENDING ? 'ENABLING' : 'ENABLE' })) : (jsx$2(Button, { onClick: soulZapCallback, fullWidth: true, load: pendingTx || fetchingQuote || isConfirming, disabled: pendingTx || fetchingQuote || !zapData || !hasEnoughBalance || isConfirming || zapError, children: zapError
|
|
@@ -85767,7 +85885,7 @@ const BuyBond$1 = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isP
|
|
|
85767
85885
|
// On-chain Data
|
|
85768
85886
|
const inputToken = useTokenFromZapList(inputTokenString, bondData === null || bondData === void 0 ? void 0 : bondData.chainId, bondData === null || bondData === void 0 ? void 0 : bondData.lpToken);
|
|
85769
85887
|
const isZap = (inputTokenString === null || inputTokenString === void 0 ? void 0 : inputTokenString.toLowerCase()) !== ((_e = (_d = (_c = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _c === void 0 ? void 0 : _c.address) === null || _d === void 0 ? void 0 : _d[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) === null || _e === void 0 ? void 0 : _e.toLowerCase());
|
|
85770
|
-
const [fetchingZapQuote, zapData, zapDepositAmount, zapError, zapTrueBondPrice] = useSoulZapBondQuote(inputValue, inputToken, bondData, account, tierProofSig);
|
|
85888
|
+
const [fetchingZapQuote, zapData, zapDepositAmount, zapError, zapTrueBondPrice] = useSoulZapBondQuote(inputValue, inputToken, bondData, account, tierProofSig !== null && tierProofSig !== void 0 ? tierProofSig : undefined);
|
|
85771
85889
|
const sortedZapList = useSortedZapList(bondChain, bondData === null || bondData === void 0 ? void 0 : bondData.lpToken);
|
|
85772
85890
|
const enrichedTokenData = sortedZapList.find((item) => {
|
|
85773
85891
|
var _a, _b, _c, _d, _e;
|
|
@@ -86132,18 +86250,18 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, isProjectView, setBillId }
|
|
|
86132
86250
|
setInputTokenString(newInputToken);
|
|
86133
86251
|
}, []);
|
|
86134
86252
|
const handleBuyCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
86135
|
-
var _a, _b, _c;
|
|
86253
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
86136
86254
|
if (!accountSolana || !bondData || !inputValue || !inputToken || !bondData)
|
|
86137
86255
|
return;
|
|
86138
86256
|
try {
|
|
86139
86257
|
setLoadingTx(true);
|
|
86140
86258
|
const connection = new Connection(getRPC(types$1.ChainId.SOL), 'confirmed');
|
|
86141
86259
|
// Convert input value
|
|
86142
|
-
const depositAmount = new BigNumber$1(
|
|
86260
|
+
const depositAmount = new BigNumber$1(new BigNumber$1(inputValue).times(new BigNumber$1(10).pow(bondData.lpToken.decimals[types$1.ChainId.SOL])));
|
|
86143
86261
|
const amountBigInt = BigInt(depositAmount.toFixed(0));
|
|
86144
86262
|
const user = accountSolana;
|
|
86145
86263
|
const trueBondPriceWithoutFee = (_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.trueBondPrices) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.trueBondPrice;
|
|
86146
|
-
const feeInPrincipal =
|
|
86264
|
+
const feeInPrincipal = (_c = bondData.feeInPrincipal) !== null && _c !== void 0 ? _c : 0;
|
|
86147
86265
|
const slippage = feeInPrincipal + 2;
|
|
86148
86266
|
const maxPrice = new BigNumber$1(trueBondPriceWithoutFee !== null && trueBondPriceWithoutFee !== void 0 ? trueBondPriceWithoutFee : '0')
|
|
86149
86267
|
.times((100 + slippage) / 100)
|
|
@@ -86228,12 +86346,18 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, isProjectView, setBillId }
|
|
|
86228
86346
|
if (nftMint.publicKey.toString()) {
|
|
86229
86347
|
setBillId === null || setBillId === void 0 ? void 0 : setBillId(nftMint.publicKey.toString());
|
|
86230
86348
|
}
|
|
86349
|
+
const inputAmountUSD = parseFloat(inputValue) * parseFloat((_d = bondData === null || bondData === void 0 ? void 0 : bondData.principalTokenPrice) !== null && _d !== void 0 ? _d : '0');
|
|
86350
|
+
axios.post(`${(_e = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _e === void 0 ? void 0 : _e.apiV2}/bills/galxe/quest`, {
|
|
86351
|
+
wallet: accountSolana === null || accountSolana === void 0 ? void 0 : accountSolana.toString(),
|
|
86352
|
+
bond: (_f = bondData === null || bondData === void 0 ? void 0 : bondData.contractAddress) === null || _f === void 0 ? void 0 : _f[bondData === null || bondData === void 0 ? void 0 : bondData.chainId],
|
|
86353
|
+
amount: inputAmountUSD,
|
|
86354
|
+
});
|
|
86231
86355
|
}
|
|
86232
86356
|
catch (error) {
|
|
86233
86357
|
console.error('Error during bond purchase:', error);
|
|
86234
86358
|
addToastError((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error');
|
|
86235
86359
|
reportError$1({
|
|
86236
|
-
apiUrl: (
|
|
86360
|
+
apiUrl: (_g = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _g === void 0 ? void 0 : _g.apiV2,
|
|
86237
86361
|
error: error.message,
|
|
86238
86362
|
extraInfo: { type: 'solanaBuyBond', error: error.message },
|
|
86239
86363
|
chainId: bondChain,
|
|
@@ -86274,7 +86398,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, isProjectView, setBillId }
|
|
|
86274
86398
|
}
|
|
86275
86399
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
86276
86400
|
}, [inputCurrencyBalance]);
|
|
86277
|
-
return bondData ? (jsx$2(Flex, { className: "modal-content", children: jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss }), jsx$2(ProjectDescription, { description: bondData.shortDescription, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards$1, { bondData: bondData }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, inputDisabled: false }), SDKConfig.useTiers && jsx$2(GetUpToComponent, { bond: bondData, depositAmount: depositAmount }), ((_e = NETWORK_LABEL[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) === null || _e === void 0 ? void 0 : _e.toLowerCase().includes('testnet')) && (jsx$2(Flex, { sx: {
|
|
86401
|
+
return bondData ? (jsx$2(Flex, { className: "modal-content", children: jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss }), jsx$2(ProjectDescription, { description: bondData.shortDescription, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards$1, { bondData: bondData }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : undefined, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, inputDisabled: false }), SDKConfig.useTiers && jsx$2(GetUpToComponent, { bond: bondData, depositAmount: depositAmount }), ((_e = NETWORK_LABEL[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) === null || _e === void 0 ? void 0 : _e.toLowerCase().includes('testnet')) && (jsx$2(Flex, { sx: {
|
|
86278
86402
|
width: '100%',
|
|
86279
86403
|
background: '#DE62F366',
|
|
86280
86404
|
justifyContent: 'center',
|
|
@@ -86328,7 +86452,12 @@ const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
|
|
|
86328
86452
|
}
|
|
86329
86453
|
}
|
|
86330
86454
|
const { data: userBonds, refetch } = useUserBonds();
|
|
86331
|
-
const userBill = userBonds === null || userBonds === void 0 ? void 0 : userBonds.find((bond) =>
|
|
86455
|
+
const userBill = userBonds === null || userBonds === void 0 ? void 0 : userBonds.find((bond) => {
|
|
86456
|
+
var _a, _b, _c, _d, _e;
|
|
86457
|
+
return bond.id === billId &&
|
|
86458
|
+
((_d = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.bond) === null || _a === void 0 ? void 0 : _a.contractAddress) === null || _b === void 0 ? void 0 : _b[(_c = bond === null || bond === void 0 ? void 0 : bond.bond) === null || _c === void 0 ? void 0 : _c.chainId]) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === bondAddress.toLowerCase() &&
|
|
86459
|
+
((_e = bond === null || bond === void 0 ? void 0 : bond.bond) === null || _e === void 0 ? void 0 : _e.chainId) === bondChain;
|
|
86460
|
+
});
|
|
86332
86461
|
useEffect(() => {
|
|
86333
86462
|
if (billId) {
|
|
86334
86463
|
console.log('BillId detected, Refetching user bonds');
|
|
@@ -86336,7 +86465,7 @@ const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
|
|
|
86336
86465
|
}
|
|
86337
86466
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
86338
86467
|
}, [billId]);
|
|
86339
|
-
return billId ? (((_c = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _c === void 0 ? void 0 : _c.chainId) === types$1.ChainId.SOL ? (jsx$2(
|
|
86468
|
+
return billId ? (((_c = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _c === void 0 ? void 0 : _c.chainId) === types$1.ChainId.SOL ? (jsx$2(YourSolanaBondsModal, { userBill: userBill, onDismiss: onDismiss })) : (jsx$2(YourBondsModal, { bill: userBill, onDismiss: onDismiss }))) : (jsx$2(BuyBondModal, { bondAddress: bondAddress, bondChain: bondChain, handlePurchasedBond: setBuyTxHash, setBillId: setBillId, onDismiss: () => {
|
|
86340
86469
|
window.history.pushState({}, '', `${locationPath !== '/bonds' ? locationPath : '/bonds'}`);
|
|
86341
86470
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
86342
86471
|
} }));
|
|
@@ -86519,7 +86648,7 @@ const PreTGEBuyComponent = ({ bondAddress, bondChain, onDismiss, handlePurchased
|
|
|
86519
86648
|
: !bond
|
|
86520
86649
|
? 'no bond'
|
|
86521
86650
|
: null;
|
|
86522
|
-
return (jsxs(Modal, { onDismiss: handleClose, sx: { width: '740px' }, children: [jsx$2(ModalHeader, { onDismiss: handleClose, hideDivider: true }), jsx$2(Flex, { sx: styles$8.buyContainer, children: jsxs(Flex, { sx: styles$8.cardContainer, children: [jsx$2(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: jsxs(Flex, { children: [jsxs(Flex, { children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: bond.earnToken.symbol, size: 50, chain: bond.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bond.earnToken.symbol, jsx$2(ListTag, { text: (_j = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _j === void 0 ? void 0 : _j[0] })] })] }), jsxs(Flex, { sx: { flexDirection: 'column', ml: '15px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", bond.tgePrice] }), jsxs(Flex, { sx: { fontSize: '24px', fontWeight: 700 }, children: ["$", bond.initPrice] })] })] }) }), jsx$2(ProjectDescription, { description: bond.shortDescription, isProjectView: true }), jsx$2(BondCards, { bond: bond }), jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$8.infoRowsContainer), { mt: '10px' }), children: [jsxs(Flex, { sx: styles$8.infoRow, children: [jsx$2(Text, { sx: styles$8.infoTitle, children: "You Spend:" }), jsxs(Text, { sx: styles$8.infoData, children: [isNaN(parseFloat(inputValueToDisplay)) ? 0 : inputValueToDisplay, " ", bond === null || bond === void 0 ? void 0 : bond.lpToken.symbol, " = $", isNaN(inputValueToDisplayUSD) ? '0' : inputValueToDisplayUSD.toFixed(2)] })] }), jsxs(Flex, { sx: styles$8.infoRow, children: [jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$8.infoTitle), { alignItems: 'center' }), children: ["Bonus:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs(Text, { sx: Object.assign(Object.assign({}, styles$8.infoData), { color: 'success' }), children: ["$", isNaN(bonusUSD) ? '0' : bonusUSD.toFixed(2)] })] }), jsxs(Flex, { sx: styles$8.infoRow, children: [jsx$2(Text, { sx: styles$8.infoTitle, children: "You Get:" }), jsxs(Text, { sx: styles$8.infoData, children: [isNaN(youGet) ? 0 : formatNumberSI(youGet, 0), " ", bond === null || bond === void 0 ? void 0 : bond.earnToken.symbol, " = $", isNaN(youGetUSD) ? '0' : youGetUSD.toFixed(2)] })] })] }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: bond === null || bond === void 0 ? void 0 : bond.lpToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(principalTokenBalance !== null && principalTokenBalance !== void 0 ? principalTokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: () => null, chainId: bond === null || bond === void 0 ? void 0 : bond.chainId, enableZap: false, bondPrincipalToken: bond === null || bond === void 0 ? void 0 : bond.lpToken, tokenBalance: principalTokenBalance, selectedTokenPrice: parseFloat((_k = bond === null || bond === void 0 ? void 0 : bond.principalTokenPrice) !== null && _k !== void 0 ? _k : '0'), inputDisabled: false }), jsxs(Flex, { sx: {
|
|
86651
|
+
return (jsxs(Modal, { onDismiss: handleClose, sx: { width: '740px' }, children: [jsx$2(ModalHeader, { onDismiss: handleClose, hideDivider: true }), jsx$2(Flex, { sx: styles$8.buyContainer, children: jsxs(Flex, { sx: styles$8.cardContainer, children: [jsx$2(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: jsxs(Flex, { children: [jsxs(Flex, { children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: bond.earnToken.symbol, size: 50, chain: bond.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bond.earnToken.symbol, jsx$2(ListTag, { text: (_j = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _j === void 0 ? void 0 : _j[0] })] })] }), jsxs(Flex, { sx: { flexDirection: 'column', ml: '15px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", bond.tgePrice] }), jsxs(Flex, { sx: { fontSize: '24px', fontWeight: 700 }, children: ["$", bond.initPrice] })] })] }) }), jsx$2(ProjectDescription, { description: bond.shortDescription, isProjectView: true }), jsx$2(BondCards, { bond: bond }), jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$8.infoRowsContainer), { mt: '10px' }), children: [jsxs(Flex, { sx: styles$8.infoRow, children: [jsx$2(Text, { sx: styles$8.infoTitle, children: "You Spend:" }), jsxs(Text, { sx: styles$8.infoData, children: [isNaN(parseFloat(inputValueToDisplay)) ? 0 : inputValueToDisplay, " ", bond === null || bond === void 0 ? void 0 : bond.lpToken.symbol, " = $", isNaN(inputValueToDisplayUSD) ? '0' : inputValueToDisplayUSD.toFixed(2)] })] }), jsxs(Flex, { sx: styles$8.infoRow, children: [jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$8.infoTitle), { alignItems: 'center' }), children: ["Bonus:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs(Text, { sx: Object.assign(Object.assign({}, styles$8.infoData), { color: 'success' }), children: ["$", isNaN(bonusUSD) ? '0' : bonusUSD.toFixed(2)] })] }), jsxs(Flex, { sx: styles$8.infoRow, children: [jsx$2(Text, { sx: styles$8.infoTitle, children: "You Get:" }), jsxs(Text, { sx: styles$8.infoData, children: [isNaN(youGet) ? 0 : formatNumberSI(youGet, 0), " ", bond === null || bond === void 0 ? void 0 : bond.earnToken.symbol, " = $", isNaN(youGetUSD) ? '0' : youGetUSD.toFixed(2)] })] })] }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: bond === null || bond === void 0 ? void 0 : bond.lpToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(principalTokenBalance !== null && principalTokenBalance !== void 0 ? principalTokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: () => null, chainId: bond === null || bond === void 0 ? void 0 : bond.chainId, enableZap: false, bondPrincipalToken: bond === null || bond === void 0 ? void 0 : bond.lpToken, tokenBalance: principalTokenBalance !== null && principalTokenBalance !== void 0 ? principalTokenBalance : undefined, selectedTokenPrice: parseFloat((_k = bond === null || bond === void 0 ? void 0 : bond.principalTokenPrice) !== null && _k !== void 0 ? _k : '0'), inputDisabled: false }), jsxs(Flex, { sx: {
|
|
86523
86652
|
width: '100%',
|
|
86524
86653
|
background: '#DE62F366',
|
|
86525
86654
|
justifyContent: 'center',
|
|
@@ -86714,7 +86843,7 @@ const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldO
|
|
|
86714
86843
|
flexDirection: 'column',
|
|
86715
86844
|
justifyContent: 'center',
|
|
86716
86845
|
display: ['none', 'none', 'none', 'flex'],
|
|
86717
|
-
}, showTooltip: true, toolTip: remainingTokensString }) }), jsx$2("div", { className: "tooltip-column", children: 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, audit: auditURL, chain: bondChain, isSoldOut: bondSoldOut }), 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}`));
|
|
86846
|
+
}, showTooltip: true, toolTip: remainingTokensString }) }), jsx$2("div", { className: "tooltip-column", children: 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, audit: auditURL, chain: bondChain, isSoldOut: bondSoldOut, billType: billType }), 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}`));
|
|
86718
86847
|
};
|
|
86719
86848
|
|
|
86720
86849
|
const HotBondCard = ({ bond }) => {
|
|
@@ -86842,9 +86971,24 @@ const BANNER_INFO = {
|
|
|
86842
86971
|
backgroundMobile: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner-mobile_y6xveu.png',
|
|
86843
86972
|
logo: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/monad-logo_lkstid.png',
|
|
86844
86973
|
},
|
|
86974
|
+
[types$1.ChainId.SOL]: {
|
|
86975
|
+
title: 'Bonds are now Live on Solana',
|
|
86976
|
+
subtitle: 'Get tokens at a discount on Solana. Faster, cheaper, and fully on-chain.',
|
|
86977
|
+
buttons: [
|
|
86978
|
+
{
|
|
86979
|
+
label: 'LEARN MORE',
|
|
86980
|
+
href: 'https://apebond.click/sol-launch',
|
|
86981
|
+
variant: variants.SECONDARY,
|
|
86982
|
+
},
|
|
86983
|
+
],
|
|
86984
|
+
background: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1751667949/background_ldg88q.png',
|
|
86985
|
+
backgroundMobile: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1751668240/backgroundMobile_lht5tu.png',
|
|
86986
|
+
logo: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1751665836/solana_bonds_logo_1_jrbn4g.png',
|
|
86987
|
+
},
|
|
86845
86988
|
};
|
|
86846
|
-
const
|
|
86989
|
+
const ChainBanner = ({ chainId }) => {
|
|
86847
86990
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
86991
|
+
const { setVisible } = useWalletModal();
|
|
86848
86992
|
return (jsxs("div", { className: "banner-container", sx: {
|
|
86849
86993
|
backgroundImage: [
|
|
86850
86994
|
`url(${(_a = BANNER_INFO[chainId]) === null || _a === void 0 ? void 0 : _a.backgroundMobile})`,
|
|
@@ -86853,7 +86997,15 @@ const BannerTestnet = ({ chainId }) => {
|
|
|
86853
86997
|
`url(${(_d = BANNER_INFO[chainId]) === null || _d === void 0 ? void 0 : _d.background})`,
|
|
86854
86998
|
`url(${(_e = BANNER_INFO[chainId]) === null || _e === void 0 ? void 0 : _e.background})`,
|
|
86855
86999
|
],
|
|
86856
|
-
}, children: [jsxs("div", { className: "banner-logos", children: [jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/apebond-logo_vzt4dl.png", alt: "apebond-white-logo", style: { width: '
|
|
87000
|
+
}, children: [jsxs("div", { className: "banner-logos", children: [chainId === types$1.ChainId.MONAD_TESTNET && (jsxs(Fragment$1, { children: [jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/apebond-logo_vzt4dl.png", alt: "apebond-white-logo", style: { width: '120px' } }), jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/x-icono_va7sdu.png", alt: "x-white-logo" })] })), jsx$2("img", { src: `${(_f = BANNER_INFO[chainId]) === null || _f === void 0 ? void 0 : _f.logo}`, alt: "partner-logo", height: 19 })] }), jsx$2("div", { className: "banner-title", children: (_g = BANNER_INFO[chainId]) === null || _g === void 0 ? void 0 : _g.title }), jsx$2("div", { className: "banner-subtitle", children: (_h = BANNER_INFO[chainId]) === null || _h === void 0 ? void 0 : _h.subtitle }), jsxs("div", { className: "banner-actions", children: [(_j = BANNER_INFO[chainId]) === null || _j === void 0 ? void 0 : _j.buttons.map((button, index) => (jsx$2(Button, { className: "action-button", onClick: () => window.open(button.href, '_blank'), variant: button.variant || variants.PRIMARY, children: button.label }, `banner-button-${index}`))), chainId === types$1.ChainId.SOL && (jsx$2(Button, { className: "action-button", sx: {
|
|
87001
|
+
background: 'linear-gradient(93deg, #20EEA9 -19%, #9945FF 97.7%)',
|
|
87002
|
+
border: 'none',
|
|
87003
|
+
'&:hover': {
|
|
87004
|
+
'&:not([disabled])': {
|
|
87005
|
+
background: 'linear-gradient(93deg, #20EEA9 -19%, #9945FF 97.7%)',
|
|
87006
|
+
},
|
|
87007
|
+
},
|
|
87008
|
+
}, onClick: () => setVisible(true), children: "Get Started" }))] })] }, `banner-container-${chainId}`));
|
|
86857
87009
|
};
|
|
86858
87010
|
|
|
86859
87011
|
const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
@@ -86871,7 +87023,7 @@ const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
|
86871
87023
|
borderRadius: 'normal',
|
|
86872
87024
|
mb: '5px',
|
|
86873
87025
|
} }, `sol-shadow-${index}`));
|
|
86874
|
-
}) }, key)),
|
|
87026
|
+
}) }, key)), [types$1.ChainId.SOL, types$1.ChainId.MONAD_TESTNET].includes(chain) && jsx$2(ChainBanner, { chainId: chain }), bonds === null || bonds === void 0 ? void 0 : bonds.map((bondFromMap, index) => {
|
|
86875
87027
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
86876
87028
|
if (bondFromMap.soldOut) {
|
|
86877
87029
|
const bond = bondFromMap;
|
|
@@ -104496,7 +104648,7 @@ function getTemplateHTML(data) {
|
|
|
104496
104648
|
</div>
|
|
104497
104649
|
<div class="sharebondimage-container-off">
|
|
104498
104650
|
<span>
|
|
104499
|
-
${
|
|
104651
|
+
${localeFormat(getCalculateOff())}% OFF
|
|
104500
104652
|
</span>
|
|
104501
104653
|
</div>
|
|
104502
104654
|
</div>
|
|
@@ -104507,7 +104659,7 @@ function getTemplateHTML(data) {
|
|
|
104507
104659
|
${formatTransactionAmount((_j = data === null || data === void 0 ? void 0 : data.data) === null || _j === void 0 ? void 0 : _j.deposit)}
|
|
104508
104660
|
</div>
|
|
104509
104661
|
<div class="sharebondimage-dollarvalue">
|
|
104510
|
-
$${
|
|
104662
|
+
$${localeFormat((_k = data === null || data === void 0 ? void 0 : data.data) === null || _k === void 0 ? void 0 : _k.dollarValue)}
|
|
104511
104663
|
</div>
|
|
104512
104664
|
</div>
|
|
104513
104665
|
<div class="sharebondimage-container-token">
|
|
@@ -104515,15 +104667,15 @@ function getTemplateHTML(data) {
|
|
|
104515
104667
|
<div class="sharebondimage-container-earntoken">
|
|
104516
104668
|
<div class="sharebondimage-amount-earntoken">
|
|
104517
104669
|
<div class="sharebondimage-amount-payout">
|
|
104518
|
-
${
|
|
104670
|
+
${localeFormat((_o = data === null || data === void 0 ? void 0 : data.data) === null || _o === void 0 ? void 0 : _o.payout)}
|
|
104519
104671
|
</div>
|
|
104520
104672
|
<div class="sharebondimage-amount-dollarvalue">
|
|
104521
|
-
$${
|
|
104673
|
+
$${localeFormat(((_p = data === null || data === void 0 ? void 0 : data.data) === null || _p === void 0 ? void 0 : _p.payout) * +((_q = data === null || data === void 0 ? void 0 : data.data) === null || _q === void 0 ? void 0 : _q.payoutTokenPrice))}
|
|
104522
104674
|
</div>
|
|
104523
104675
|
</div>
|
|
104524
104676
|
<div class="sharebondimage-profit" style="${!isProfit ? 'display: none' : ''}">
|
|
104525
104677
|
<span>
|
|
104526
|
-
+${
|
|
104678
|
+
+${localeFormat(((_r = data === null || data === void 0 ? void 0 : data.data) === null || _r === void 0 ? void 0 : _r.payout) * +((_s = data === null || data === void 0 ? void 0 : data.data) === null || _s === void 0 ? void 0 : _s.payoutTokenPrice) - ((_t = data === null || data === void 0 ? void 0 : data.data) === null || _t === void 0 ? void 0 : _t.dollarValue))}
|
|
104527
104679
|
profit!
|
|
104528
104680
|
</span>
|
|
104529
104681
|
</div>
|
|
@@ -104677,7 +104829,7 @@ const SoldOutBuyBondPlaceholder = ({ bond }) => {
|
|
|
104677
104829
|
// onDismiss={onDismiss}
|
|
104678
104830
|
showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), jsx$2(BondCards$1, { bondData: Object.assign(Object.assign({}, bondData), { bonusWithFee: -1 }) }), jsx$2(Estimations, { depositAmount: '0',
|
|
104679
104831
|
/*@ts-ignore*/
|
|
104680
|
-
bondData: bondData, youSpendString: '0', isZap: isZap, fetchingZapQuote: false, zapError: false }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => null, handleCurrencySelect: () => null, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: 0, inputDisabled: true }), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (minTier === null || (userTier !== null && userTier >= minTier)) && (jsx$2(Flex, { className: "button-container get", children: jsxs(Button, { className: "action-button", variant: "secondary", fullWidth: true, disabled: true, children: ["Get ", getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)] }) })), jsx$2(Flex, { className: "button-container buy", children: jsx$2(Button, { className: "action-button", fullWidth: true, disabled: true, children: "Buy" }) })] })] }) })) : (jsx$2(Fragment$1, {}));
|
|
104832
|
+
bondData: bondData, youSpendString: '0', isZap: isZap, fetchingZapQuote: false, zapError: false }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => null, handleCurrencySelect: () => null, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : undefined, selectedTokenPrice: 0, inputDisabled: true }), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (minTier === null || (userTier !== null && userTier >= minTier)) && (jsx$2(Flex, { className: "button-container get", children: jsxs(Button, { className: "action-button", variant: "secondary", fullWidth: true, disabled: true, children: ["Get ", getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)] }) })), jsx$2(Flex, { className: "button-container buy", children: jsx$2(Button, { className: "action-button", fullWidth: true, disabled: true, children: "Buy" }) })] })] }) })) : (jsx$2(Fragment$1, {}));
|
|
104681
104833
|
};
|
|
104682
104834
|
|
|
104683
104835
|
const SingleBond = ({ tokenSymbol }) => {
|
|
@@ -10,6 +10,6 @@ export declare enum ApprovalState {
|
|
|
10
10
|
PENDING = "PENDING",
|
|
11
11
|
APPROVED = "APPROVED"
|
|
12
12
|
}
|
|
13
|
-
export default function useAllowance(currency: 'NATIVE' | Token | null, spender: string | null, account: string | null, chainId: ChainId | null): UseQueryResult<number>;
|
|
13
|
+
export default function useAllowance(currency: 'NATIVE' | Token | null, spender: string | null, account: string | null, chainId: ChainId | null): UseQueryResult<number | null>;
|
|
14
14
|
export declare const getTokenAllowance: (currency: "NATIVE" | Token | null, spender: string | null, account: string | null, chainId: ChainId | null) => Promise<number | null>;
|
|
15
15
|
export declare const useApproval: (amount: string, currency: "NATIVE" | Token | null, spender: string | null, account: string | null, chainId: ChainId | null) => [ApprovalState, () => Promise<string | null | undefined>];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { ChainId, Token } from '@ape.swap/apeswap-lists';
|
|
3
|
-
export default function useCurrencyBalance(currency: 'NATIVE' | Token | null, account: string | null, chainId: ChainId | null): UseQueryResult<string |
|
|
3
|
+
export default function useCurrencyBalance(currency: 'NATIVE' | Token | null, account: string | null, chainId: ChainId | null): UseQueryResult<string | null>;
|
|
4
4
|
export declare const getTokenBalance: (currency: "NATIVE" | Token | null, account: string | null, chainId: ChainId | null) => Promise<string | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { Token } from '@ape.swap/apeswap-lists';
|
|
3
|
-
export default function useCurrencyBalanceSolana(currency: 'NATIVE' | Token | null, account: string | null): UseQueryResult<string |
|
|
3
|
+
export default function useCurrencyBalanceSolana(currency: 'NATIVE' | Token | null, account: string | null): UseQueryResult<string | null>;
|
|
4
4
|
export declare const getTokenBalance: (currency: "NATIVE" | Token | null, account: string | null) => Promise<string | null>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
3
3
|
import { UserBillNftData } from '../../types/yourbonds';
|
|
4
|
-
export default function useBondNFTData(id?: string, billNftAddress?: string, chainId?: ChainId): UseQueryResult<UserBillNftData>;
|
|
4
|
+
export default function useBondNFTData(id?: string, billNftAddress?: string, chainId?: ChainId): UseQueryResult<UserBillNftData | null>;
|
|
5
5
|
export declare const getBondNFTData: (apiV2URL: string, id: string, billNftAddress: string, chainId: ChainId) => Promise<UserBillNftData | null>;
|
|
@@ -2,8 +2,7 @@ import { QueryClient, UseQueryResult } from '@tanstack/react-query';
|
|
|
2
2
|
import { BondsData } from '../../types/bonds';
|
|
3
3
|
import { TokenPrices } from '../tokenPrices/useTokenPrices';
|
|
4
4
|
import { BillsConfig, PreTGEConfig } from '@ape.swap/apeswap-lists';
|
|
5
|
-
import BigNumber from 'bignumber.js';
|
|
6
5
|
export default function useBondsData(): UseQueryResult<BondsData[]>;
|
|
7
6
|
export declare const getBondsData: (chains: number[], bondList: BillsConfig[], preTGEList: PreTGEConfig[], realTimeApiURL: string, apiUrl: string, solPrices?: TokenPrices[], queryClient?: QueryClient) => Promise<BondsData[]>;
|
|
8
|
-
export declare const getBonusWithFee: (feeInPayout: number, trueBillPrice:
|
|
7
|
+
export declare const getBonusWithFee: (feeInPayout: number, trueBillPrice: string, lpPrice: number, earnTokenPrice: number) => number;
|
|
9
8
|
export declare const getRawBonus: (trueBillPrice: any, lpPrice: number, earnTokenPrice: number) => number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { BillsConfig } from '@ape.swap/apeswap-lists';
|
|
3
3
|
export default function useBondsList(): UseQueryResult<BillsConfig[]>;
|
|
4
|
-
export declare const getBondsList: (realTimeapiURL: string, apiUrl: string) => Promise<BillsConfig[]
|
|
4
|
+
export declare const getBondsList: (realTimeapiURL: string, apiUrl: string) => Promise<BillsConfig[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
3
|
-
export default function useTierProofSignature(bondAddress?: string, chainId?: ChainId, isUserRestricted?: boolean): UseQueryResult<string>;
|
|
3
|
+
export default function useTierProofSignature(bondAddress?: string, chainId?: ChainId, isUserRestricted?: boolean): UseQueryResult<string | null>;
|
|
4
4
|
export declare const getTierProofSig: (apiAddress: string, account: string, bondAddress: string, chainId: ChainId) => Promise<string | null>;
|
package/dist/styles.css
CHANGED
|
@@ -1917,7 +1917,7 @@ html {
|
|
|
1917
1917
|
gap: 5px;
|
|
1918
1918
|
background-size: cover;
|
|
1919
1919
|
background-repeat: no-repeat;
|
|
1920
|
-
padding:
|
|
1920
|
+
padding: 15px;
|
|
1921
1921
|
}
|
|
1922
1922
|
.banner-container .banner-logos {
|
|
1923
1923
|
display: flex;
|
|
@@ -1932,6 +1932,7 @@ html {
|
|
|
1932
1932
|
letter-spacing: 0%;
|
|
1933
1933
|
text-align: center;
|
|
1934
1934
|
vertical-align: middle;
|
|
1935
|
+
margin-top: 10px;
|
|
1935
1936
|
background: linear-gradient(180deg, #FFFFFF 50%, #666666 100%);
|
|
1936
1937
|
background-clip: text;
|
|
1937
1938
|
-webkit-background-clip: text;
|
package/dist/types/bonds.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface BondsData extends PreTGEConfig, BillsConfig {
|
|
|
13
13
|
tokensRemaining?: string;
|
|
14
14
|
showcaseTokenName?: string;
|
|
15
15
|
feeInPayout?: number;
|
|
16
|
+
feeInPrincipal?: number;
|
|
16
17
|
trueBondPrices?: TrueBondPrices[];
|
|
17
18
|
payoutTokenPrice?: string;
|
|
18
19
|
principalTokenPrice?: string;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare function calculateSolanaTrueBillPrice(bondIssuanceAddress: string): Promise<
|
|
1
|
+
export declare function calculateSolanaTrueBillPrice(bondIssuanceAddress: string): Promise<string>;
|
|
2
|
+
/**
|
|
3
|
+
* This is the Typescript implementation of the Rust true_bond_price function since the on-chain program requires a real wallet
|
|
4
|
+
*/
|
|
5
|
+
export declare function calculateTrueBondPrice(bondPricing: any, bondTerm: any, currentTimestamp: number, principalMintDecimals: number, payoutMintDecimals: number): BigNumber;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const localeFormat: (number: number, precision?: number) => string;
|
|
2
2
|
export declare const formatNumberSI: (num: number | string, digits?: number) => string;
|
|
3
3
|
export declare const formatUSDNumber: (input: string | number) => string;
|
|
@@ -6,6 +6,7 @@ interface FormatDollarArgs {
|
|
|
6
6
|
round?: boolean;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
+
* @deprecated PLEASE DO NOT USE
|
|
9
10
|
* Returns a USD dollar or equivalent denominated numerical value formatted
|
|
10
11
|
* in human readable string for use in template.
|
|
11
12
|
*
|
|
@@ -19,8 +20,8 @@ interface FormatDollarArgs {
|
|
|
19
20
|
* @param round whether or not to round up non-price amounts
|
|
20
21
|
*/
|
|
21
22
|
export declare const formatDollar: ({ num, isPrice, lessPreciseStablecoinValues, digits, round, }: FormatDollarArgs) => string;
|
|
22
|
-
export declare const formatValue: ({ num, digits, round }: any) => string;
|
|
23
23
|
/**
|
|
24
|
+
* @deprecated PLEASE DO NOT USE
|
|
24
25
|
* Returns a numerical amount of any token formatted in human readable string for use in template.
|
|
25
26
|
*
|
|
26
27
|
* For transaction review numbers, such as token quantities, NFT price (token-denominated),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserBill } from '../../types/yourbonds';
|
|
2
|
-
declare const
|
|
2
|
+
declare const YourSolanaBondsModal: ({ onDismiss, userBill }: {
|
|
3
3
|
onDismiss?: () => void;
|
|
4
4
|
userBill?: UserBill;
|
|
5
5
|
}) => import("react").JSX.Element;
|
|
6
|
-
export default
|
|
6
|
+
export default YourSolanaBondsModal;
|
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": "4.0.0-test.
|
|
6
|
+
"version": "4.0.0-test.9",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"types": "dist/main.d.ts",
|
|
@@ -31,27 +31,28 @@
|
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@rainbow-me/rainbowkit": "^2.1.6",
|
|
34
|
+
"@tanstack/react-query": "5.x",
|
|
34
35
|
"@solana/kit": "2.1.1",
|
|
35
36
|
"@solana/spl-token": "0.4.13",
|
|
36
37
|
"@solana/wallet-adapter-react": "0.15.36",
|
|
37
38
|
"@solana/wallet-adapter-react-ui": "0.9.36",
|
|
38
39
|
"@solana/web3.js": "1.98.0",
|
|
39
|
-
"@tanstack/react-query": "5.51.5",
|
|
40
40
|
"axios": "1.7.2",
|
|
41
41
|
"react": "^18.2.0",
|
|
42
42
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
43
43
|
"wagmi": "2.12.17"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
+
"@tanstack/react-query": "5.81.5",
|
|
46
47
|
"@eslint/js": "^9.28.0",
|
|
47
48
|
"@rainbow-me/rainbowkit": "^2.1.6",
|
|
48
49
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
49
50
|
"@rollup/plugin-json": "^6.1.0",
|
|
50
51
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
51
52
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
53
|
+
"@tanstack/react-query-devtools": "5.81.5",
|
|
52
54
|
"@solana/wallet-adapter-base": "0.9.24",
|
|
53
55
|
"@solana/wallet-adapter-wallets": "0.19.33",
|
|
54
|
-
"@tanstack/react-query-devtools": "5.51.5",
|
|
55
56
|
"@types/dom-to-image": "^2.6.7",
|
|
56
57
|
"@types/lodash": "^4.17.6",
|
|
57
58
|
"@types/react": "^18.3.3",
|