@avail-project/widgets 0.0.1
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/README.md +34 -0
- package/dist/common/components/ErrorBoundary.d.ts +44 -0
- package/dist/common/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/common/components/ErrorBoundary.js +65 -0
- package/dist/common/hooks/useDebouncedCallback.d.ts +13 -0
- package/dist/common/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/common/hooks/useDebouncedCallback.js +42 -0
- package/dist/common/hooks/useDebouncedValue.d.ts +5 -0
- package/dist/common/hooks/useDebouncedValue.d.ts.map +1 -0
- package/dist/common/hooks/useDebouncedValue.js +15 -0
- package/dist/common/hooks/useInterval.d.ts +11 -0
- package/dist/common/hooks/useInterval.d.ts.map +1 -0
- package/dist/common/hooks/useInterval.js +25 -0
- package/dist/common/hooks/useLatest.d.ts +12 -0
- package/dist/common/hooks/useLatest.d.ts.map +1 -0
- package/dist/common/hooks/useLatest.js +19 -0
- package/dist/common/hooks/useNexusError.d.ts +20 -0
- package/dist/common/hooks/useNexusError.d.ts.map +1 -0
- package/dist/common/hooks/useNexusError.js +120 -0
- package/dist/common/hooks/usePolling.d.ts +7 -0
- package/dist/common/hooks/usePolling.d.ts.map +1 -0
- package/dist/common/hooks/usePolling.js +29 -0
- package/dist/common/hooks/useStableCallback.d.ts +6 -0
- package/dist/common/hooks/useStableCallback.d.ts.map +1 -0
- package/dist/common/hooks/useStableCallback.js +13 -0
- package/dist/common/hooks/useStopwatch.d.ts +17 -0
- package/dist/common/hooks/useStopwatch.d.ts.map +1 -0
- package/dist/common/hooks/useStopwatch.js +44 -0
- package/dist/common/hooks/useTransactionExecution.d.ts +62 -0
- package/dist/common/hooks/useTransactionExecution.d.ts.map +1 -0
- package/dist/common/hooks/useTransactionExecution.js +273 -0
- package/dist/common/hooks/useTransactionFlow.d.ts +71 -0
- package/dist/common/hooks/useTransactionFlow.d.ts.map +1 -0
- package/dist/common/hooks/useTransactionFlow.js +435 -0
- package/dist/common/index.d.ts +17 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +16 -0
- package/dist/common/tx/steps.d.ts +19 -0
- package/dist/common/tx/steps.d.ts.map +1 -0
- package/dist/common/tx/steps.js +89 -0
- package/dist/common/tx/types.d.ts +11 -0
- package/dist/common/tx/types.d.ts.map +1 -0
- package/dist/common/tx/types.js +19 -0
- package/dist/common/tx/useTransactionSteps.d.ts +21 -0
- package/dist/common/tx/useTransactionSteps.d.ts.map +1 -0
- package/dist/common/tx/useTransactionSteps.js +40 -0
- package/dist/common/types/transaction-flow.d.ts +48 -0
- package/dist/common/types/transaction-flow.d.ts.map +1 -0
- package/dist/common/types/transaction-flow.js +2 -0
- package/dist/common/utils/constant.d.ts +99 -0
- package/dist/common/utils/constant.d.ts.map +1 -0
- package/dist/common/utils/constant.js +370 -0
- package/dist/common/utils/token-pricing.d.ts +33 -0
- package/dist/common/utils/token-pricing.d.ts.map +1 -0
- package/dist/common/utils/token-pricing.js +255 -0
- package/dist/common/utils/transaction-flow.d.ts +35 -0
- package/dist/common/utils/transaction-flow.d.ts.map +1 -0
- package/dist/common/utils/transaction-flow.js +65 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/nexus/NexusProvider.d.ts +50 -0
- package/dist/nexus/NexusProvider.d.ts.map +1 -0
- package/dist/nexus/NexusProvider.js +572 -0
- package/dist/nexus-widget/components/address-identicon.d.ts +5 -0
- package/dist/nexus-widget/components/address-identicon.d.ts.map +1 -0
- package/dist/nexus-widget/components/address-identicon.js +39 -0
- package/dist/nexus-widget/components/amount-input-unified.d.ts +18 -0
- package/dist/nexus-widget/components/amount-input-unified.d.ts.map +1 -0
- package/dist/nexus-widget/components/amount-input-unified.js +88 -0
- package/dist/nexus-widget/components/deposit-idle-form.d.ts +29 -0
- package/dist/nexus-widget/components/deposit-idle-form.d.ts.map +1 -0
- package/dist/nexus-widget/components/deposit-idle-form.js +506 -0
- package/dist/nexus-widget/components/nexus-widget-progress-screen.d.ts +36 -0
- package/dist/nexus-widget/components/nexus-widget-progress-screen.d.ts.map +1 -0
- package/dist/nexus-widget/components/nexus-widget-progress-screen.js +737 -0
- package/dist/nexus-widget/components/pay-using-selector.d.ts +9 -0
- package/dist/nexus-widget/components/pay-using-selector.d.ts.map +1 -0
- package/dist/nexus-widget/components/pay-using-selector.js +37 -0
- package/dist/nexus-widget/components/pay-with-sources.d.ts +11 -0
- package/dist/nexus-widget/components/pay-with-sources.d.ts.map +1 -0
- package/dist/nexus-widget/components/pay-with-sources.js +266 -0
- package/dist/nexus-widget/components/receive-asset-selector.d.ts +28 -0
- package/dist/nexus-widget/components/receive-asset-selector.d.ts.map +1 -0
- package/dist/nexus-widget/components/receive-asset-selector.js +1178 -0
- package/dist/nexus-widget/components/recipient-input.d.ts +10 -0
- package/dist/nexus-widget/components/recipient-input.d.ts.map +1 -0
- package/dist/nexus-widget/components/recipient-input.js +44 -0
- package/dist/nexus-widget/components/send-idle-form.d.ts +29 -0
- package/dist/nexus-widget/components/send-idle-form.d.ts.map +1 -0
- package/dist/nexus-widget/components/send-idle-form.js +548 -0
- package/dist/nexus-widget/components/status-alerts.d.ts +7 -0
- package/dist/nexus-widget/components/status-alerts.d.ts.map +1 -0
- package/dist/nexus-widget/components/status-alerts.js +17 -0
- package/dist/nexus-widget/components/swap-asset-selector.d.ts +74 -0
- package/dist/nexus-widget/components/swap-asset-selector.d.ts.map +1 -0
- package/dist/nexus-widget/components/swap-asset-selector.js +1910 -0
- package/dist/nexus-widget/components/swap-idle-form.d.ts +29 -0
- package/dist/nexus-widget/components/swap-idle-form.d.ts.map +1 -0
- package/dist/nexus-widget/components/swap-idle-form.js +1289 -0
- package/dist/nexus-widget/components/swap-intent-preview.d.ts +95 -0
- package/dist/nexus-widget/components/swap-intent-preview.d.ts.map +1 -0
- package/dist/nexus-widget/components/swap-intent-preview.js +1050 -0
- package/dist/nexus-widget/nexus-widget.d.ts +4 -0
- package/dist/nexus-widget/nexus-widget.d.ts.map +1 -0
- package/dist/nexus-widget/nexus-widget.js +7819 -0
- package/dist/nexus-widget/sdk-types.d.ts +13 -0
- package/dist/nexus-widget/sdk-types.d.ts.map +1 -0
- package/dist/nexus-widget/sdk-types.js +1 -0
- package/dist/nexus-widget/theme.d.ts +156 -0
- package/dist/nexus-widget/theme.d.ts.map +1 -0
- package/dist/nexus-widget/theme.js +159 -0
- package/dist/nexus-widget/types.d.ts +141 -0
- package/dist/nexus-widget/types.d.ts.map +1 -0
- package/dist/nexus-widget/types.js +1 -0
- package/dist/nexus-widget/utils/citrea-tokens.d.ts +82 -0
- package/dist/nexus-widget/utils/citrea-tokens.d.ts.map +1 -0
- package/dist/nexus-widget/utils/citrea-tokens.js +136 -0
- package/dist/nexus-widget/utils/deposit-source-selection.d.ts +55 -0
- package/dist/nexus-widget/utils/deposit-source-selection.d.ts.map +1 -0
- package/dist/nexus-widget/utils/deposit-source-selection.js +219 -0
- package/dist/swaps/components/stacked-token-icons.d.ts +15 -0
- package/dist/swaps/components/stacked-token-icons.d.ts.map +1 -0
- package/dist/swaps/components/stacked-token-icons.js +38 -0
- package/dist/swaps/components/step-flow.d.ts +32 -0
- package/dist/swaps/components/step-flow.d.ts.map +1 -0
- package/dist/swaps/components/step-flow.js +54 -0
- package/dist/swaps/components/token-icon.d.ts +11 -0
- package/dist/swaps/components/token-icon.d.ts.map +1 -0
- package/dist/swaps/components/token-icon.js +16 -0
- package/dist/swaps/components/transaction-progress.d.ts +43 -0
- package/dist/swaps/components/transaction-progress.d.ts.map +1 -0
- package/dist/swaps/components/transaction-progress.js +94 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +34 -0
- package/dist/ui/dialog.d.ts +17 -0
- package/dist/ui/dialog.d.ts.map +1 -0
- package/dist/ui/dialog.js +47 -0
- package/package.json +60 -0
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createNexusClient, } from "@avail-project/nexus-core";
|
|
4
|
+
import { getCoinbaseRates } from "@avail-project/nexus-core/utils";
|
|
5
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
6
|
+
import { useAccountEffect } from "wagmi";
|
|
7
|
+
import { isSwapSupportedBySdkChainList, } from "../common/utils/constant";
|
|
8
|
+
import { buildUsdPeggedSymbolSet, DEFAULT_USD_PEGGED_TOKEN_SYMBOLS, fetchCoinbaseUsdRate, fetchCoinGeckoUsdRate, getCoinbaseSymbolCandidates, normalizeTokenSymbol, resolveBaseSymbol, toFinitePositiveNumber, TOKEN_PRICE_PEGS, TokenPricingError, USD_PEGGED_FALLBACK_RATE, } from "../common/utils/token-pricing";
|
|
9
|
+
export const NexusContext = createContext(undefined);
|
|
10
|
+
const defaultConfig = {
|
|
11
|
+
// this is place to switch between "canary" and "mainnet"
|
|
12
|
+
network: "mainnet",
|
|
13
|
+
debug: true,
|
|
14
|
+
};
|
|
15
|
+
const sumSourceBalances = (sources) => sources.reduce((sum, source) => {
|
|
16
|
+
const balance = Number.parseFloat(String(source.balance ?? "0"));
|
|
17
|
+
return Number.isFinite(balance) && balance > 0 ? sum + balance : sum;
|
|
18
|
+
}, 0);
|
|
19
|
+
const getSourceBalanceChainId = (source) => source.chain?.id ?? source.chainId;
|
|
20
|
+
const filterUnsupportedSwapSources = (assets, swapSupportedChains) => {
|
|
21
|
+
if (!assets) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return assets.flatMap((asset) => {
|
|
25
|
+
const assetWithSources = asset;
|
|
26
|
+
const sourceBalances = assetWithSources.chainBalances ?? assetWithSources.breakdown ?? [];
|
|
27
|
+
const filteredSources = sourceBalances.filter((source) => isSwapSupportedBySdkChainList(getSourceBalanceChainId(source), swapSupportedChains));
|
|
28
|
+
if (filteredSources.length === 0) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
...asset,
|
|
34
|
+
balance: String(sumSourceBalances(filteredSources)),
|
|
35
|
+
balanceInFiat: undefined,
|
|
36
|
+
breakdown: filteredSources,
|
|
37
|
+
chainBalances: filteredSources,
|
|
38
|
+
value: "0",
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const NexusProvider = ({ children, config = defaultConfig, }) => {
|
|
44
|
+
const configNetwork = config?.network;
|
|
45
|
+
const configDebug = config?.debug;
|
|
46
|
+
const configMode = config?.mode;
|
|
47
|
+
const stableConfig = useMemo(() => ({ ...defaultConfig, ...config }), [config]);
|
|
48
|
+
console.log("NEXUS PROVIDER CONFIG", stableConfig, defaultConfig, config);
|
|
49
|
+
const sdkRef = useRef(null);
|
|
50
|
+
const [sdk, setSdk] = useState(null);
|
|
51
|
+
const [nexusSDK, setNexusSDK] = useState(null);
|
|
52
|
+
const [loading, setLoading] = useState(false);
|
|
53
|
+
const supportedChainsAndTokens = useRef(null);
|
|
54
|
+
const swapSupportedChainsAndTokens = useRef(null);
|
|
55
|
+
const [supportedChainsAndTokensState, setSupportedChainsAndTokensState] = useState(null);
|
|
56
|
+
const [swapSupportedChainsAndTokensState, setSwapSupportedChainsAndTokensState,] = useState(null);
|
|
57
|
+
const [bridgableBalance, setBridgableBalance] = useState(null);
|
|
58
|
+
const [swapBalance, setSwapBalance] = useState(null);
|
|
59
|
+
const swapBalanceRef = useRef(null);
|
|
60
|
+
const [exchangeRateState, setExchangeRateState] = useState(null);
|
|
61
|
+
const exchangeRate = useRef(null);
|
|
62
|
+
const coinbaseUsdRateCache = useRef({});
|
|
63
|
+
const coinbaseUsdRateRequests = useRef({});
|
|
64
|
+
const initRequest = useRef(null);
|
|
65
|
+
const bridgableBalanceRequest = useRef(null);
|
|
66
|
+
const swapBalanceRequest = useRef(null);
|
|
67
|
+
const lastSwapBalanceFetchAt = useRef(0);
|
|
68
|
+
const usdPeggedSymbols = useRef(new Set(DEFAULT_USD_PEGGED_TOKEN_SYMBOLS));
|
|
69
|
+
const intent = useRef(null);
|
|
70
|
+
const allowance = useRef(null);
|
|
71
|
+
const swapIntent = useRef(null);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
let cancelled = false;
|
|
74
|
+
console.log("NEXUS CONFIG", stableConfig);
|
|
75
|
+
const nextSdk = createNexusClient({
|
|
76
|
+
network: stableConfig.network,
|
|
77
|
+
debug: stableConfig.debug,
|
|
78
|
+
});
|
|
79
|
+
void nextSdk
|
|
80
|
+
.initialize()
|
|
81
|
+
.then(() => {
|
|
82
|
+
if (cancelled) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
sdkRef.current = nextSdk;
|
|
86
|
+
setSdk(nextSdk);
|
|
87
|
+
console.log("ChainList", nextSdk.chainList.chains);
|
|
88
|
+
console.log("SupportedChains", nextSdk.getSupportedChains());
|
|
89
|
+
})
|
|
90
|
+
.catch((err) => {
|
|
91
|
+
console.error("Failed to initialize default read-only Nexus client:", err);
|
|
92
|
+
});
|
|
93
|
+
return () => {
|
|
94
|
+
cancelled = true;
|
|
95
|
+
nextSdk.destroy();
|
|
96
|
+
if (sdkRef.current === nextSdk) {
|
|
97
|
+
sdkRef.current = null;
|
|
98
|
+
}
|
|
99
|
+
setSdk(null);
|
|
100
|
+
setNexusSDK(null);
|
|
101
|
+
};
|
|
102
|
+
}, [stableConfig]);
|
|
103
|
+
const cacheUsdRate = useCallback((tokenSymbol, usdRate) => {
|
|
104
|
+
const normalized = normalizeTokenSymbol(tokenSymbol);
|
|
105
|
+
const rate = toFinitePositiveNumber(usdRate);
|
|
106
|
+
if (!(normalized && rate)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
coinbaseUsdRateCache.current[normalized] = rate;
|
|
110
|
+
const currentRates = exchangeRate.current ?? {};
|
|
111
|
+
if (currentRates[normalized] === rate) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const nextRates = {
|
|
115
|
+
...currentRates,
|
|
116
|
+
[normalized]: rate,
|
|
117
|
+
};
|
|
118
|
+
exchangeRate.current = nextRates;
|
|
119
|
+
setExchangeRateState(nextRates);
|
|
120
|
+
}, []);
|
|
121
|
+
const getUsdRateFromLocalSources = useCallback((tokenSymbol) => {
|
|
122
|
+
const normalizedSymbol = normalizeTokenSymbol(tokenSymbol);
|
|
123
|
+
if (!normalizedSymbol) {
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
const _debug = normalizedSymbol === "WCBTC" || normalizedSymbol === "CBTC";
|
|
127
|
+
if (_debug) {
|
|
128
|
+
console.debug(`[PRICING DEBUG] resolving "${normalizedSymbol}"`, {
|
|
129
|
+
candidates: getCoinbaseSymbolCandidates(normalizedSymbol),
|
|
130
|
+
exchangeRateKeys: Object.keys(exchangeRate.current ?? {}),
|
|
131
|
+
hasBTC: exchangeRate.current?.["BTC"],
|
|
132
|
+
pegBase: resolveBaseSymbol(normalizedSymbol),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// 1. Direct SDK / cache lookup for the original symbol candidates
|
|
136
|
+
for (const candidate of getCoinbaseSymbolCandidates(normalizedSymbol)) {
|
|
137
|
+
const sdkRate = toFinitePositiveNumber(exchangeRate.current?.[candidate]);
|
|
138
|
+
if (sdkRate) {
|
|
139
|
+
return sdkRate;
|
|
140
|
+
}
|
|
141
|
+
const cachedRate = toFinitePositiveNumber(coinbaseUsdRateCache.current[candidate]);
|
|
142
|
+
if (cachedRate) {
|
|
143
|
+
return cachedRate;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// 2. Explicit pegging fallback (e.g. WCBTC→BTC, WETH→ETH) — checked
|
|
147
|
+
// BEFORE usdPeggedSymbols so the SDK's dynamic set can't override it.
|
|
148
|
+
const baseSymbol = resolveBaseSymbol(normalizedSymbol);
|
|
149
|
+
if (baseSymbol) {
|
|
150
|
+
if (usdPeggedSymbols.current.has(baseSymbol) || baseSymbol === "USD") {
|
|
151
|
+
if (_debug)
|
|
152
|
+
console.debug(`[PRICING DEBUG] "${normalizedSymbol}" → base "${baseSymbol}" is USD-pegged, returning 1`);
|
|
153
|
+
return USD_PEGGED_FALLBACK_RATE;
|
|
154
|
+
}
|
|
155
|
+
for (const candidate of getCoinbaseSymbolCandidates(baseSymbol)) {
|
|
156
|
+
const sdkRate = toFinitePositiveNumber(exchangeRate.current?.[candidate]);
|
|
157
|
+
if (sdkRate) {
|
|
158
|
+
if (_debug)
|
|
159
|
+
console.debug(`[PRICING DEBUG] "${normalizedSymbol}" → base "${baseSymbol}" → SDK candidate "${candidate}" = ${sdkRate}`);
|
|
160
|
+
return sdkRate;
|
|
161
|
+
}
|
|
162
|
+
const cachedRate = toFinitePositiveNumber(coinbaseUsdRateCache.current[candidate]);
|
|
163
|
+
if (cachedRate) {
|
|
164
|
+
if (_debug)
|
|
165
|
+
console.debug(`[PRICING DEBUG] "${normalizedSymbol}" → base "${baseSymbol}" → cached candidate "${candidate}" = ${cachedRate}`);
|
|
166
|
+
return cachedRate;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (_debug)
|
|
170
|
+
console.debug(`[PRICING DEBUG] "${normalizedSymbol}" → base "${baseSymbol}" NOT found in any source`);
|
|
171
|
+
}
|
|
172
|
+
// 3. Dynamic USD-pegged set (only if no explicit peg was defined)
|
|
173
|
+
if (!baseSymbol && usdPeggedSymbols.current.has(normalizedSymbol)) {
|
|
174
|
+
if (_debug)
|
|
175
|
+
console.debug(`[PRICING DEBUG] "${normalizedSymbol}" → in usdPeggedSymbols, returning 1`);
|
|
176
|
+
return USD_PEGGED_FALLBACK_RATE;
|
|
177
|
+
}
|
|
178
|
+
if (_debug)
|
|
179
|
+
console.debug(`[PRICING DEBUG] "${normalizedSymbol}" → NO RATE FOUND, returning 0`);
|
|
180
|
+
return 0;
|
|
181
|
+
}, []);
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
if (!sdk) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
let cancelled = false;
|
|
187
|
+
let list = null;
|
|
188
|
+
let swapList = null;
|
|
189
|
+
try {
|
|
190
|
+
list = sdk.getSupportedChains();
|
|
191
|
+
swapList = sdk.getSupportedChains();
|
|
192
|
+
}
|
|
193
|
+
catch (e) {
|
|
194
|
+
console.warn("SDK getSupportedChains failed (likely not initialized yet):", e);
|
|
195
|
+
}
|
|
196
|
+
supportedChainsAndTokens.current = list;
|
|
197
|
+
swapSupportedChainsAndTokens.current = swapList;
|
|
198
|
+
usdPeggedSymbols.current = buildUsdPeggedSymbolSet(list);
|
|
199
|
+
setSupportedChainsAndTokensState(list);
|
|
200
|
+
setSwapSupportedChainsAndTokensState(swapList);
|
|
201
|
+
void getCoinbaseRates()
|
|
202
|
+
.then((rates) => {
|
|
203
|
+
if (cancelled) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const usdPerUnit = {};
|
|
207
|
+
for (const [symbol, value] of Object.entries(rates)) {
|
|
208
|
+
const unitsPerUsd = Number.parseFloat(String(value));
|
|
209
|
+
if (Number.isFinite(unitsPerUsd) && unitsPerUsd > 0) {
|
|
210
|
+
usdPerUnit[normalizeTokenSymbol(symbol)] = 1 / unitsPerUsd;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exchangeRate.current = usdPerUnit;
|
|
214
|
+
setExchangeRateState(usdPerUnit);
|
|
215
|
+
})
|
|
216
|
+
.catch((error) => {
|
|
217
|
+
if (!cancelled) {
|
|
218
|
+
console.warn("Unable to preload Nexus rates", error);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
return () => {
|
|
222
|
+
cancelled = true;
|
|
223
|
+
};
|
|
224
|
+
}, [sdk, stableConfig.network]);
|
|
225
|
+
const normalizeUserAssetFiatValues = useCallback((assets) => {
|
|
226
|
+
if (!assets) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
return assets.map((asset) => {
|
|
230
|
+
const assetWithSources = asset;
|
|
231
|
+
let computedAssetUsd = 0;
|
|
232
|
+
const sourceBalances = assetWithSources.chainBalances ?? assetWithSources.breakdown ?? [];
|
|
233
|
+
const breakdown = sourceBalances.map((entry) => {
|
|
234
|
+
const balance = Number.parseFloat(String(entry.balance ?? "0"));
|
|
235
|
+
const safeBalance = Number.isFinite(balance) && balance > 0 ? balance : 0;
|
|
236
|
+
const entrySymbol = normalizeTokenSymbol(entry.symbol ?? asset.symbol);
|
|
237
|
+
const existingUsd = Number.parseFloat(String(entry.value ?? entry.balanceInFiat ?? "0"));
|
|
238
|
+
const safeExistingUsd = Number.isFinite(existingUsd) && existingUsd >= 0 ? existingUsd : 0;
|
|
239
|
+
// For pegged tokens (e.g. wcBTC→BTC) the SDK may return a
|
|
240
|
+
// bogus 1:1 USD value — always recalculate with our rate.
|
|
241
|
+
const hasPeg = Boolean(resolveBaseSymbol(entrySymbol));
|
|
242
|
+
let normalizedUsd = safeExistingUsd;
|
|
243
|
+
if (safeBalance > 0 && normalizedUsd <= 0) {
|
|
244
|
+
const rate = getUsdRateFromLocalSources(entry.symbol ?? asset.symbol);
|
|
245
|
+
if (rate > 0) {
|
|
246
|
+
normalizedUsd = safeBalance * rate;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
computedAssetUsd += normalizedUsd;
|
|
250
|
+
return {
|
|
251
|
+
...entry,
|
|
252
|
+
balanceInFiat: normalizedUsd,
|
|
253
|
+
};
|
|
254
|
+
});
|
|
255
|
+
const assetBalance = Number.parseFloat(String(asset.balance ?? "0"));
|
|
256
|
+
const safeAssetBalance = Number.isFinite(assetBalance) && assetBalance > 0 ? assetBalance : 0;
|
|
257
|
+
const rawAssetUsd = Number.parseFloat(String(assetWithSources.value ?? assetWithSources.balanceInFiat ?? "0"));
|
|
258
|
+
const safeAssetUsd = Number.isFinite(rawAssetUsd) && rawAssetUsd >= 0 ? rawAssetUsd : 0;
|
|
259
|
+
const assetHasPeg = Boolean(resolveBaseSymbol(normalizeTokenSymbol(asset.symbol)));
|
|
260
|
+
let normalizedAssetUsd = safeAssetUsd;
|
|
261
|
+
if (normalizedAssetUsd <= 0 || assetHasPeg) {
|
|
262
|
+
if (computedAssetUsd > 0) {
|
|
263
|
+
normalizedAssetUsd = computedAssetUsd;
|
|
264
|
+
}
|
|
265
|
+
else if (safeAssetBalance > 0) {
|
|
266
|
+
const rate = getUsdRateFromLocalSources(asset.symbol);
|
|
267
|
+
if (rate > 0) {
|
|
268
|
+
normalizedAssetUsd = safeAssetBalance * rate;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
...asset,
|
|
274
|
+
balanceInFiat: normalizedAssetUsd,
|
|
275
|
+
breakdown,
|
|
276
|
+
};
|
|
277
|
+
});
|
|
278
|
+
}, [getUsdRateFromLocalSources]);
|
|
279
|
+
const resolveTokenUsdRate = useCallback(async (tokenSymbol) => {
|
|
280
|
+
const normalizedSymbol = normalizeTokenSymbol(tokenSymbol);
|
|
281
|
+
if (!normalizedSymbol) {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
const sdkRate = toFinitePositiveNumber(exchangeRate.current?.[normalizedSymbol]);
|
|
285
|
+
if (sdkRate) {
|
|
286
|
+
return sdkRate;
|
|
287
|
+
}
|
|
288
|
+
const cachedRate = toFinitePositiveNumber(coinbaseUsdRateCache.current[normalizedSymbol]);
|
|
289
|
+
if (cachedRate) {
|
|
290
|
+
return cachedRate;
|
|
291
|
+
}
|
|
292
|
+
const inFlightRequest = coinbaseUsdRateRequests.current[normalizedSymbol];
|
|
293
|
+
if (inFlightRequest) {
|
|
294
|
+
return inFlightRequest;
|
|
295
|
+
}
|
|
296
|
+
const requestPromise = (async () => {
|
|
297
|
+
// 1. Check SDK / cache candidates for the original symbol
|
|
298
|
+
for (const candidate of getCoinbaseSymbolCandidates(normalizedSymbol)) {
|
|
299
|
+
const sdkCandidateRate = toFinitePositiveNumber(exchangeRate.current?.[candidate]);
|
|
300
|
+
if (sdkCandidateRate) {
|
|
301
|
+
cacheUsdRate(normalizedSymbol, sdkCandidateRate);
|
|
302
|
+
return sdkCandidateRate;
|
|
303
|
+
}
|
|
304
|
+
const cachedCandidateRate = toFinitePositiveNumber(coinbaseUsdRateCache.current[candidate]);
|
|
305
|
+
if (cachedCandidateRate) {
|
|
306
|
+
cacheUsdRate(normalizedSymbol, cachedCandidateRate);
|
|
307
|
+
return cachedCandidateRate;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
// 2. Try Coinbase API for the original symbol
|
|
311
|
+
const coinbaseRate = await fetchCoinbaseUsdRate(normalizedSymbol);
|
|
312
|
+
if (coinbaseRate) {
|
|
313
|
+
cacheUsdRate(normalizedSymbol, coinbaseRate);
|
|
314
|
+
return coinbaseRate;
|
|
315
|
+
}
|
|
316
|
+
const coinGeckoRate = await fetchCoinGeckoUsdRate(normalizedSymbol);
|
|
317
|
+
if (coinGeckoRate) {
|
|
318
|
+
cacheUsdRate(normalizedSymbol, coinGeckoRate);
|
|
319
|
+
return coinGeckoRate;
|
|
320
|
+
}
|
|
321
|
+
if (usdPeggedSymbols.current.has(normalizedSymbol)) {
|
|
322
|
+
cacheUsdRate(normalizedSymbol, USD_PEGGED_FALLBACK_RATE);
|
|
323
|
+
return USD_PEGGED_FALLBACK_RATE;
|
|
324
|
+
}
|
|
325
|
+
// 5. All paths exhausted — throw a pricing error
|
|
326
|
+
throw new TokenPricingError(normalizedSymbol);
|
|
327
|
+
})();
|
|
328
|
+
coinbaseUsdRateRequests.current[normalizedSymbol] = requestPromise;
|
|
329
|
+
try {
|
|
330
|
+
return await requestPromise;
|
|
331
|
+
}
|
|
332
|
+
finally {
|
|
333
|
+
delete coinbaseUsdRateRequests.current[normalizedSymbol];
|
|
334
|
+
}
|
|
335
|
+
}, [cacheUsdRate]);
|
|
336
|
+
const initializedRef = useRef(false);
|
|
337
|
+
const setIntent = useCallback((data) => {
|
|
338
|
+
intent.current = data;
|
|
339
|
+
}, []);
|
|
340
|
+
const setAllowance = useCallback((data) => {
|
|
341
|
+
allowance.current = data;
|
|
342
|
+
}, []);
|
|
343
|
+
const setupNexus = useCallback(async () => {
|
|
344
|
+
const activeSdk = sdkRef.current;
|
|
345
|
+
if (!activeSdk) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const list = activeSdk.getSupportedChains();
|
|
349
|
+
supportedChainsAndTokens.current = list ?? null;
|
|
350
|
+
setSupportedChainsAndTokensState(list ?? null);
|
|
351
|
+
usdPeggedSymbols.current = buildUsdPeggedSymbolSet(list ?? null);
|
|
352
|
+
const swapList = activeSdk.getSupportedChains();
|
|
353
|
+
swapSupportedChainsAndTokens.current = swapList ?? null;
|
|
354
|
+
setSwapSupportedChainsAndTokensState(swapList ?? null);
|
|
355
|
+
const [bridgeAbleBalanceResult, swapBalanceResult, rates] = await Promise.allSettled([
|
|
356
|
+
activeSdk.getBalancesForBridge(),
|
|
357
|
+
activeSdk.getBalancesForSwap(),
|
|
358
|
+
getCoinbaseRates(),
|
|
359
|
+
]);
|
|
360
|
+
if (rates?.status === "fulfilled") {
|
|
361
|
+
const usdPerUnit = {};
|
|
362
|
+
for (const [symbol, value] of Object.entries(rates.value)) {
|
|
363
|
+
const normalized = normalizeTokenSymbol(symbol);
|
|
364
|
+
// Skip tokens with an explicit peg (e.g. WCBTC→BTC) — the SDK
|
|
365
|
+
// may return a bogus 1:1 USD rate for these. Our pegging map
|
|
366
|
+
// will resolve them correctly via their base symbol.
|
|
367
|
+
if (TOKEN_PRICE_PEGS[normalized])
|
|
368
|
+
continue;
|
|
369
|
+
const unitsPerUsd = Number.parseFloat(String(value));
|
|
370
|
+
if (Number.isFinite(unitsPerUsd) && unitsPerUsd > 0) {
|
|
371
|
+
usdPerUnit[normalized] = 1 / unitsPerUsd;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
exchangeRate.current = usdPerUnit;
|
|
375
|
+
setExchangeRateState(usdPerUnit);
|
|
376
|
+
}
|
|
377
|
+
if (bridgeAbleBalanceResult.status === "fulfilled") {
|
|
378
|
+
setBridgableBalance(normalizeUserAssetFiatValues(bridgeAbleBalanceResult.value));
|
|
379
|
+
}
|
|
380
|
+
if (swapBalanceResult.status === "fulfilled") {
|
|
381
|
+
const rawSwapBalance = swapBalanceResult.value;
|
|
382
|
+
const filteredSwapBalance = filterUnsupportedSwapSources(rawSwapBalance, swapList);
|
|
383
|
+
const normalizedSwapBalance = normalizeUserAssetFiatValues(filteredSwapBalance);
|
|
384
|
+
console.log("[NexusProvider] getBalancesForSwap:init raw", rawSwapBalance);
|
|
385
|
+
setSwapBalance(normalizedSwapBalance);
|
|
386
|
+
}
|
|
387
|
+
}, [config?.network, normalizeUserAssetFiatValues]);
|
|
388
|
+
const initializeNexus = useCallback(async (provider) => {
|
|
389
|
+
setLoading(true);
|
|
390
|
+
try {
|
|
391
|
+
console.log("INITIALIZE NEXUS CONFIG", stableConfig);
|
|
392
|
+
const nextSdk = createNexusClient({
|
|
393
|
+
network: stableConfig.network,
|
|
394
|
+
debug: stableConfig.debug,
|
|
395
|
+
});
|
|
396
|
+
await nextSdk.initialize();
|
|
397
|
+
await nextSdk.setEVMProvider(provider);
|
|
398
|
+
sdkRef.current = nextSdk;
|
|
399
|
+
setSdk(nextSdk);
|
|
400
|
+
initializedRef.current = true;
|
|
401
|
+
setNexusSDK(nextSdk);
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
console.error("Error initializing Nexus:", error);
|
|
405
|
+
throw error;
|
|
406
|
+
}
|
|
407
|
+
finally {
|
|
408
|
+
setLoading(false);
|
|
409
|
+
}
|
|
410
|
+
}, [stableConfig]);
|
|
411
|
+
const deinitializeNexus = useCallback(() => {
|
|
412
|
+
try {
|
|
413
|
+
const activeSdk = nexusSDK ?? sdkRef.current;
|
|
414
|
+
if (!activeSdk) {
|
|
415
|
+
return Promise.resolve();
|
|
416
|
+
}
|
|
417
|
+
activeSdk.destroy();
|
|
418
|
+
initializedRef.current = false;
|
|
419
|
+
setNexusSDK(null);
|
|
420
|
+
setBridgableBalance(null);
|
|
421
|
+
swapBalanceRef.current = null;
|
|
422
|
+
setSwapBalance(null);
|
|
423
|
+
intent.current = null;
|
|
424
|
+
swapIntent.current = null;
|
|
425
|
+
allowance.current = null;
|
|
426
|
+
setLoading(false);
|
|
427
|
+
}
|
|
428
|
+
catch (error) {
|
|
429
|
+
console.error("Error deinitializing Nexus:", error);
|
|
430
|
+
}
|
|
431
|
+
return Promise.resolve();
|
|
432
|
+
}, [nexusSDK]);
|
|
433
|
+
const attachEventHooks = useCallback(() => {
|
|
434
|
+
// Dummy signature for backward compatibility, hooks are now per-call
|
|
435
|
+
}, []);
|
|
436
|
+
const handleInit = useCallback(async (provider) => {
|
|
437
|
+
if (initializedRef.current || loading) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (!provider || typeof provider.request !== "function") {
|
|
441
|
+
throw new Error("Invalid EIP-1193 provider");
|
|
442
|
+
}
|
|
443
|
+
const nextInitRequest = (async () => {
|
|
444
|
+
await initializeNexus(provider);
|
|
445
|
+
await setupNexus();
|
|
446
|
+
attachEventHooks();
|
|
447
|
+
})();
|
|
448
|
+
initRequest.current = nextInitRequest;
|
|
449
|
+
try {
|
|
450
|
+
await nextInitRequest;
|
|
451
|
+
}
|
|
452
|
+
catch (error) {
|
|
453
|
+
console.error("Error during Nexus setup flow:", error);
|
|
454
|
+
throw error;
|
|
455
|
+
}
|
|
456
|
+
finally {
|
|
457
|
+
if (initRequest.current === nextInitRequest) {
|
|
458
|
+
initRequest.current = null;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}, [loading, initializeNexus, setupNexus, attachEventHooks]);
|
|
462
|
+
const fetchBridgableBalance = useCallback(async () => {
|
|
463
|
+
let request = bridgableBalanceRequest.current;
|
|
464
|
+
try {
|
|
465
|
+
const activeSdk = sdkRef.current;
|
|
466
|
+
if (!activeSdk) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
const updatedBalance = await activeSdk.getBalancesForBridge();
|
|
470
|
+
setBridgableBalance(normalizeUserAssetFiatValues(updatedBalance));
|
|
471
|
+
}
|
|
472
|
+
catch (error) {
|
|
473
|
+
console.error("Error fetching bridgable balance:", error);
|
|
474
|
+
}
|
|
475
|
+
finally {
|
|
476
|
+
if (request && bridgableBalanceRequest.current === request) {
|
|
477
|
+
bridgableBalanceRequest.current = null;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}, [normalizeUserAssetFiatValues]);
|
|
481
|
+
const fetchSwapBalance = useCallback(async () => {
|
|
482
|
+
try {
|
|
483
|
+
const activeSdk = sdkRef.current;
|
|
484
|
+
if (!activeSdk) {
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
const updatedBalance = await activeSdk.getBalancesForSwap();
|
|
488
|
+
const filteredSwapBalance = filterUnsupportedSwapSources(updatedBalance, swapSupportedChainsAndTokens.current);
|
|
489
|
+
const normalizedSwapBalance = normalizeUserAssetFiatValues(filteredSwapBalance);
|
|
490
|
+
console.log("[NexusProvider] getBalancesForSwap:refresh raw", updatedBalance);
|
|
491
|
+
setSwapBalance(normalizedSwapBalance);
|
|
492
|
+
return normalizedSwapBalance;
|
|
493
|
+
}
|
|
494
|
+
catch (error) {
|
|
495
|
+
console.error("Error fetching swap balance:", error);
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
}, [normalizeUserAssetFiatValues]);
|
|
499
|
+
const getFiatValue = useCallback((amount, token) => {
|
|
500
|
+
const rate = getUsdRateFromLocalSources(token);
|
|
501
|
+
const normalized = normalizeTokenSymbol(token);
|
|
502
|
+
if (normalized === "WCBTC" || normalized === "CBTC") {
|
|
503
|
+
console.debug(`[PRICING] getFiatValue("${token}") → rate=${rate}, amount=${amount}, result=${rate * amount}`);
|
|
504
|
+
}
|
|
505
|
+
return rate * amount;
|
|
506
|
+
}, [getUsdRateFromLocalSources]);
|
|
507
|
+
// Backfill USD values once rates arrive so downstream selectors/max logic
|
|
508
|
+
// do not treat supported assets as $0 simply due to timing.
|
|
509
|
+
useEffect(() => {
|
|
510
|
+
if (!exchangeRateState) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
setSwapBalance((prev) => normalizeUserAssetFiatValues(prev));
|
|
514
|
+
setBridgableBalance((prev) => normalizeUserAssetFiatValues(prev));
|
|
515
|
+
}, [exchangeRateState, normalizeUserAssetFiatValues]);
|
|
516
|
+
useAccountEffect({
|
|
517
|
+
onDisconnect() {
|
|
518
|
+
deinitializeNexus();
|
|
519
|
+
},
|
|
520
|
+
});
|
|
521
|
+
const value = useMemo(() => ({
|
|
522
|
+
nexusSDK,
|
|
523
|
+
initializeNexus,
|
|
524
|
+
deinitializeNexus,
|
|
525
|
+
attachEventHooks,
|
|
526
|
+
intent,
|
|
527
|
+
allowance,
|
|
528
|
+
handleInit,
|
|
529
|
+
supportedChainsAndTokens: supportedChainsAndTokensState,
|
|
530
|
+
swapSupportedChainsAndTokens: swapSupportedChainsAndTokensState,
|
|
531
|
+
bridgableBalance,
|
|
532
|
+
swapBalance,
|
|
533
|
+
network: config?.network,
|
|
534
|
+
loading,
|
|
535
|
+
fetchBridgableBalance,
|
|
536
|
+
fetchSwapBalance,
|
|
537
|
+
setAllowance,
|
|
538
|
+
setIntent,
|
|
539
|
+
swapIntent,
|
|
540
|
+
exchangeRate: exchangeRateState,
|
|
541
|
+
getFiatValue,
|
|
542
|
+
resolveTokenUsdRate,
|
|
543
|
+
}), [
|
|
544
|
+
nexusSDK,
|
|
545
|
+
initializeNexus,
|
|
546
|
+
deinitializeNexus,
|
|
547
|
+
attachEventHooks,
|
|
548
|
+
handleInit,
|
|
549
|
+
bridgableBalance,
|
|
550
|
+
swapBalance,
|
|
551
|
+
stableConfig.network,
|
|
552
|
+
loading,
|
|
553
|
+
fetchBridgableBalance,
|
|
554
|
+
fetchSwapBalance,
|
|
555
|
+
setAllowance,
|
|
556
|
+
setIntent,
|
|
557
|
+
exchangeRateState,
|
|
558
|
+
getFiatValue,
|
|
559
|
+
resolveTokenUsdRate,
|
|
560
|
+
supportedChainsAndTokensState,
|
|
561
|
+
swapSupportedChainsAndTokensState,
|
|
562
|
+
]);
|
|
563
|
+
return (_jsx(NexusContext.Provider, { value: value, children: children }));
|
|
564
|
+
};
|
|
565
|
+
export function useNexus() {
|
|
566
|
+
const context = useContext(NexusContext);
|
|
567
|
+
if (!context) {
|
|
568
|
+
throw new Error("useNexus must be used within a NexusProvider");
|
|
569
|
+
}
|
|
570
|
+
return context;
|
|
571
|
+
}
|
|
572
|
+
export default NexusProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-identicon.d.ts","sourceRoot":"","sources":["../../../.build-src/nexus-widget/components/address-identicon.tsx"],"names":[],"mappings":"AAwBA,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,IAAS,GACV,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,2CAyBA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// biome-ignore-all lint: NexusWidget registry component from shadcn registry.
|
|
3
|
+
import React from "react";
|
|
4
|
+
const identiconPalette = [
|
|
5
|
+
"var(--foreground-brand)",
|
|
6
|
+
"#16A34A",
|
|
7
|
+
"#B7791F",
|
|
8
|
+
"#7C3AED",
|
|
9
|
+
"#DB2777",
|
|
10
|
+
"#0891B2",
|
|
11
|
+
"#EA580C",
|
|
12
|
+
"#475569",
|
|
13
|
+
];
|
|
14
|
+
const hashAddress = (address) => {
|
|
15
|
+
let hash = 0;
|
|
16
|
+
for (const char of address.toLowerCase()) {
|
|
17
|
+
hash = (hash << 5) - hash + char.charCodeAt(0);
|
|
18
|
+
hash |= 0;
|
|
19
|
+
}
|
|
20
|
+
return Math.abs(hash);
|
|
21
|
+
};
|
|
22
|
+
export function AddressIdenticon({ address, size = 18, }) {
|
|
23
|
+
const hash = hashAddress(address);
|
|
24
|
+
const primary = identiconPalette[hash % identiconPalette.length];
|
|
25
|
+
const secondary = identiconPalette[Math.floor(hash / 7) % identiconPalette.length];
|
|
26
|
+
const accent = identiconPalette[Math.floor(hash / 13) % identiconPalette.length];
|
|
27
|
+
const rotation = hash % 360;
|
|
28
|
+
return (_jsx("span", { "aria-hidden": "true", style: {
|
|
29
|
+
background: `conic-gradient(from ${rotation}deg, ${primary}, ${secondary}, ${accent}, ${primary})`,
|
|
30
|
+
border: "1px solid #FFFFFE",
|
|
31
|
+
borderRadius: "999px",
|
|
32
|
+
boxShadow: "0 0 0 1px #E8E8E7",
|
|
33
|
+
boxSizing: "border-box",
|
|
34
|
+
display: "inline-block",
|
|
35
|
+
flexShrink: 0,
|
|
36
|
+
height: size,
|
|
37
|
+
width: size,
|
|
38
|
+
} }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { UserAsset } from "../../nexus/NexusProvider";
|
|
3
|
+
interface AmountInputUnifiedProps {
|
|
4
|
+
amount: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
header?: React.ReactNode;
|
|
7
|
+
maxAvailableAmount?: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
onCommit?: (value: string) => void;
|
|
10
|
+
tokenIcon?: React.ReactNode;
|
|
11
|
+
/** Label shown beside Balance text, e.g. "USDC" */
|
|
12
|
+
tokenSymbol?: string;
|
|
13
|
+
unifiedBalances?: UserAsset[];
|
|
14
|
+
usdValue?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function AmountInputUnified({ amount, onChange, onCommit, disabled, maxAvailableAmount, unifiedBalances, tokenIcon, usdValue, tokenSymbol, header, }: AmountInputUnifiedProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=amount-input-unified.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amount-input-unified.d.ts","sourceRoot":"","sources":["../../../.build-src/nexus-widget/components/amount-input-unified.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAM3D,UAAU,uBAAuB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,SAAS,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,WAAW,EACX,MAAM,GACP,EAAE,uBAAuB,2CAoJzB"}
|