@rhinestone/deposit-modal 0.0.0-dev-20260611141108 → 0.0.0-dev-20260617120607
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/{DepositModalReown-QVVFHL2N.cjs → DepositModalReown-KFTMS2WX.cjs} +9 -9
- package/dist/{DepositModalReown-O4VWVJYG.mjs → DepositModalReown-PC7EX5VK.mjs} +6 -6
- package/dist/{WithdrawModalReown-GLOHYSUG.mjs → WithdrawModalReown-BE23LUMT.mjs} +5 -5
- package/dist/{WithdrawModalReown-3GK2F2AF.cjs → WithdrawModalReown-Z2YF2FSJ.cjs} +8 -8
- package/dist/{chunk-7KHWMSID.cjs → chunk-3MXWIYAT.cjs} +16 -6
- package/dist/{chunk-NWCRGZG3.mjs → chunk-3PVDRSJ7.mjs} +36 -52
- package/dist/{chunk-MMPRPDLS.cjs → chunk-7MP2UWIQ.cjs} +349 -365
- package/dist/{chunk-MILJQWPT.cjs → chunk-ABVRVW3P.cjs} +133 -8
- package/dist/{chunk-7AADPL52.cjs → chunk-AE5LHTPM.cjs} +121 -101
- package/dist/{chunk-TQ2AYMWS.mjs → chunk-F7P4MV72.mjs} +1 -1
- package/dist/{chunk-BAEB5AFZ.mjs → chunk-FJWLC4AM.mjs} +1 -1
- package/dist/{chunk-E25DOT37.mjs → chunk-GKC22JC4.mjs} +217 -103
- package/dist/{chunk-R5CPOBCF.cjs → chunk-NRNJAQUA.cjs} +4 -4
- package/dist/{chunk-GQCEQZGF.cjs → chunk-OQVLEVNR.cjs} +256 -142
- package/dist/{chunk-AJHFNHG3.cjs → chunk-UEKPBRBY.cjs} +3 -3
- package/dist/{chunk-KAYBLYUS.mjs → chunk-UFKFSGT3.mjs} +14 -4
- package/dist/{chunk-RVBLNCWE.mjs → chunk-WCIGOV34.mjs} +32 -12
- package/dist/{chunk-6YRDD462.mjs → chunk-WJX3TJFK.mjs} +135 -10
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +6 -6
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +3 -3
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkABVRVW3Pcjs = require('./chunk-ABVRVW3P.cjs');
|
|
17
17
|
|
|
18
18
|
// src/components/ui/Modal.tsx
|
|
19
19
|
|
|
@@ -949,7 +949,7 @@ function createDepositService(baseUrl, options) {
|
|
|
949
949
|
},
|
|
950
950
|
async checkLiquidity(params) {
|
|
951
951
|
if (params.destinationChainId === "solana") {
|
|
952
|
-
const token =
|
|
952
|
+
const token = _chunkABVRVW3Pcjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
|
|
953
953
|
return {
|
|
954
954
|
hasLiquidity: true,
|
|
955
955
|
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _22 => _22.symbol]), () => ( "Token")),
|
|
@@ -1240,14 +1240,14 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1240
1240
|
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _29 => _29.balance, 'optionalAccess', _30 => _30.unlocked]), () => ( "0"));
|
|
1241
1241
|
const normalizedName = tokenData.tokenName.trim();
|
|
1242
1242
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1243
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
1244
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
1243
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkABVRVW3Pcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
1244
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
1245
1245
|
if (!resolvedTokenAddress) {
|
|
1246
1246
|
continue;
|
|
1247
1247
|
}
|
|
1248
|
-
const registrySymbol =
|
|
1248
|
+
const registrySymbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
1249
1249
|
const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
|
|
1250
|
-
const decimals = registrySymbol !== "Token" ?
|
|
1250
|
+
const decimals = registrySymbol !== "Token" ? _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
|
|
1251
1251
|
tokens.push({
|
|
1252
1252
|
chainId: chainBalance.chainId,
|
|
1253
1253
|
address: resolvedTokenAddress,
|
|
@@ -1267,7 +1267,7 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1267
1267
|
function normalizeDirectToken(token) {
|
|
1268
1268
|
const rawChainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
|
|
1269
1269
|
const rawChainString = _nullishCoalesce(extractString(token, "chainId"), () => ( extractString(token.chain, "id")));
|
|
1270
|
-
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ?
|
|
1270
|
+
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? _chunkABVRVW3Pcjs.isSolanaCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : _chunkABVRVW3Pcjs.parseEvmChainId.call(void 0, rawChainString) : null)));
|
|
1271
1271
|
if (chainId === null) return null;
|
|
1272
1272
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1273
1273
|
if (!symbol) return null;
|
|
@@ -1276,14 +1276,14 @@ function normalizeDirectToken(token) {
|
|
|
1276
1276
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1277
1277
|
token.token,
|
|
1278
1278
|
"address"
|
|
1279
|
-
))), () => ( (typeof chainId === "number" ?
|
|
1279
|
+
))), () => ( (typeof chainId === "number" ? _chunkABVRVW3Pcjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
|
|
1280
1280
|
if (!address) return null;
|
|
1281
1281
|
const balanceUsd = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractNumber(token, "balanceUsd"), () => ( extractNumber(token, "usdValue"))), () => ( extractNumber(token, "valueUsd"))), () => ( extractNumericString(token, "balanceUsd"))), () => ( extractNumericString(token, "usdValue"))), () => ( extractNumericString(token, "valueUsd"))), () => ( 0));
|
|
1282
1282
|
const isSolanaToken = chainId === "solana";
|
|
1283
|
-
const registrySymbol = isSolanaToken ? "Token" :
|
|
1283
|
+
const registrySymbol = isSolanaToken ? "Token" : _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, address, chainId);
|
|
1284
1284
|
const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
1285
1285
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1286
|
-
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ?
|
|
1286
|
+
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
|
|
1287
1287
|
return {
|
|
1288
1288
|
chainId,
|
|
1289
1289
|
address,
|
|
@@ -1402,7 +1402,7 @@ var clientCache = /* @__PURE__ */ new Map();
|
|
|
1402
1402
|
function getPublicClient(chainId) {
|
|
1403
1403
|
let client = clientCache.get(chainId);
|
|
1404
1404
|
if (!client) {
|
|
1405
|
-
const chain =
|
|
1405
|
+
const chain = _chunkABVRVW3Pcjs.CHAIN_BY_ID[chainId];
|
|
1406
1406
|
client = _viem.createPublicClient.call(void 0, {
|
|
1407
1407
|
chain,
|
|
1408
1408
|
transport: _viem.http.call(void 0, )
|
|
@@ -2268,7 +2268,7 @@ var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fr
|
|
|
2268
2268
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
2269
2269
|
"+6"
|
|
2270
2270
|
] });
|
|
2271
|
-
var EXTRA_CHAIN_COUNT = Math.max(0,
|
|
2271
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
2272
2272
|
var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2273
2273
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
2274
2274
|
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
|
|
@@ -2526,7 +2526,6 @@ ConnectStep.displayName = "ConnectStep";
|
|
|
2526
2526
|
// src/components/steps/ProcessingStep.tsx
|
|
2527
2527
|
|
|
2528
2528
|
|
|
2529
|
-
|
|
2530
2529
|
// src/components/ui/Button.tsx
|
|
2531
2530
|
|
|
2532
2531
|
function Button({
|
|
@@ -2819,11 +2818,31 @@ function getEventSourceDetails(event) {
|
|
|
2819
2818
|
}
|
|
2820
2819
|
return {};
|
|
2821
2820
|
}
|
|
2821
|
+
function asChain(value) {
|
|
2822
|
+
if (typeof value === "string" && value.trim().startsWith("solana")) {
|
|
2823
|
+
return "solana";
|
|
2824
|
+
}
|
|
2825
|
+
return asNumber(value);
|
|
2826
|
+
}
|
|
2827
|
+
function getEventDestinationDetails(event) {
|
|
2828
|
+
if (!_optionalChain([event, 'optionalAccess', _100 => _100.type]) || !isRecord(event.data)) return {};
|
|
2829
|
+
if (event.type !== "bridge-started" && event.type !== "bridge-complete" && event.type !== "post-bridge-swap-complete") {
|
|
2830
|
+
return {};
|
|
2831
|
+
}
|
|
2832
|
+
const destination = isRecord(event.data.destination) ? event.data.destination : void 0;
|
|
2833
|
+
if (!destination) return {};
|
|
2834
|
+
const token = asString(destination.asset);
|
|
2835
|
+
return {
|
|
2836
|
+
chainId: asChain(destination.chain),
|
|
2837
|
+
amount: asAmount(destination.amount),
|
|
2838
|
+
token: _optionalChain([token, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]) || void 0
|
|
2839
|
+
};
|
|
2840
|
+
}
|
|
2822
2841
|
function isDepositEvent(event) {
|
|
2823
|
-
return _optionalChain([event, 'optionalAccess',
|
|
2842
|
+
return _optionalChain([event, 'optionalAccess', _103 => _103.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _104 => _104.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _105 => _105.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _106 => _106.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _107 => _107.type]) === "post-bridge-swap-complete" || _optionalChain([event, 'optionalAccess', _108 => _108.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _109 => _109.type]) === "error";
|
|
2824
2843
|
}
|
|
2825
2844
|
function isFailedEvent(event) {
|
|
2826
|
-
return _optionalChain([event, 'optionalAccess',
|
|
2845
|
+
return _optionalChain([event, 'optionalAccess', _110 => _110.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _111 => _111.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _112 => _112.type]) === "error";
|
|
2827
2846
|
}
|
|
2828
2847
|
function isHexString(value) {
|
|
2829
2848
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -2835,7 +2854,7 @@ function txRefsMatch(a, b) {
|
|
|
2835
2854
|
return a === b;
|
|
2836
2855
|
}
|
|
2837
2856
|
function formatBridgeFailedMessage(event) {
|
|
2838
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
2857
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _113 => _113.data]), () => ( {}));
|
|
2839
2858
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
2840
2859
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
2841
2860
|
function toUserFacingFailure(raw) {
|
|
@@ -2863,13 +2882,134 @@ function formatBridgeFailedMessage(event) {
|
|
|
2863
2882
|
return { message: "Bridge failed" };
|
|
2864
2883
|
}
|
|
2865
2884
|
function failureMessageForEvent(event) {
|
|
2866
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
2885
|
+
if (_optionalChain([event, 'optionalAccess', _114 => _114.type]) === "error") {
|
|
2867
2886
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
2868
2887
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
2869
2888
|
}
|
|
2870
2889
|
return formatBridgeFailedMessage(event).message;
|
|
2871
2890
|
}
|
|
2872
2891
|
|
|
2892
|
+
// src/core/token-amount.ts
|
|
2893
|
+
|
|
2894
|
+
var STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set([
|
|
2895
|
+
"USDC",
|
|
2896
|
+
"USDT",
|
|
2897
|
+
"USDT0",
|
|
2898
|
+
"DAI",
|
|
2899
|
+
"FRAX",
|
|
2900
|
+
"PYUSD",
|
|
2901
|
+
"USDP",
|
|
2902
|
+
"TUSD",
|
|
2903
|
+
"GUSD",
|
|
2904
|
+
"USDS",
|
|
2905
|
+
"LUSD",
|
|
2906
|
+
"BUSD",
|
|
2907
|
+
"USDE"
|
|
2908
|
+
]);
|
|
2909
|
+
var EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
2910
|
+
function resolveTokenDisplay(token, chain, fallback) {
|
|
2911
|
+
if (token !== void 0) {
|
|
2912
|
+
if (chain === "solana") {
|
|
2913
|
+
const solanaToken = _chunkABVRVW3Pcjs.getSolanaTokenByMint.call(void 0, token);
|
|
2914
|
+
if (solanaToken) {
|
|
2915
|
+
return { symbol: solanaToken.symbol, decimals: solanaToken.decimals };
|
|
2916
|
+
}
|
|
2917
|
+
} else if (EVM_ADDRESS_RE.test(token)) {
|
|
2918
|
+
const symbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, token, chain);
|
|
2919
|
+
const decimals = _chunkABVRVW3Pcjs.findTokenDecimals.call(void 0, token, chain);
|
|
2920
|
+
if (symbol !== "Token" || decimals !== void 0) {
|
|
2921
|
+
return {
|
|
2922
|
+
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _115 => _115.symbol]), () => ( symbol)),
|
|
2923
|
+
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess', _116 => _116.decimals])))
|
|
2924
|
+
};
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
return {
|
|
2929
|
+
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _117 => _117.symbol]), () => ( "Token")),
|
|
2930
|
+
decimals: _optionalChain([fallback, 'optionalAccess', _118 => _118.decimals])
|
|
2931
|
+
};
|
|
2932
|
+
}
|
|
2933
|
+
function maxFractionDigitsFor(symbol) {
|
|
2934
|
+
if (!symbol) return 6;
|
|
2935
|
+
return STABLECOIN_SYMBOLS.has(symbol.toUpperCase()) ? 3 : 6;
|
|
2936
|
+
}
|
|
2937
|
+
function formatTokenAmount(amount, symbol) {
|
|
2938
|
+
if (!Number.isFinite(amount)) return void 0;
|
|
2939
|
+
return amount.toLocaleString("en-US", {
|
|
2940
|
+
minimumFractionDigits: 2,
|
|
2941
|
+
maximumFractionDigits: maxFractionDigitsFor(symbol)
|
|
2942
|
+
});
|
|
2943
|
+
}
|
|
2944
|
+
function tokenAmountToNumber(rawAmount, decimals) {
|
|
2945
|
+
if (decimals === void 0) return void 0;
|
|
2946
|
+
try {
|
|
2947
|
+
const value = Number(_viem.formatUnits.call(void 0, BigInt(rawAmount), decimals));
|
|
2948
|
+
return Number.isFinite(value) ? value : void 0;
|
|
2949
|
+
} catch (e4) {
|
|
2950
|
+
return void 0;
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
function formatRawTokenAmount(rawAmount, token) {
|
|
2954
|
+
const value = tokenAmountToNumber(rawAmount, token.decimals);
|
|
2955
|
+
if (value === void 0) return void 0;
|
|
2956
|
+
return formatTokenAmount(value, token.symbol);
|
|
2957
|
+
}
|
|
2958
|
+
function priceUsdFor(symbol, prices) {
|
|
2959
|
+
if (!symbol) return void 0;
|
|
2960
|
+
const upper = symbol.toUpperCase();
|
|
2961
|
+
const quoted = prices[upper];
|
|
2962
|
+
if (typeof quoted === "number" && quoted > 0) return quoted;
|
|
2963
|
+
return STABLECOIN_SYMBOLS.has(upper) ? 1 : void 0;
|
|
2964
|
+
}
|
|
2965
|
+
function estimateReceiveAmount(params) {
|
|
2966
|
+
const { sourceAmount, sourceSymbol, targetSymbol, sourceAmountUsd, prices } = params;
|
|
2967
|
+
if (sourceSymbol !== void 0 && sourceSymbol.toUpperCase() === targetSymbol.toUpperCase()) {
|
|
2968
|
+
return sourceAmount;
|
|
2969
|
+
}
|
|
2970
|
+
const usdValue = sourceAmountUsd !== void 0 && Number.isFinite(sourceAmountUsd) ? sourceAmountUsd : sourceAmount !== void 0 ? (() => {
|
|
2971
|
+
const sourcePrice = priceUsdFor(sourceSymbol, prices);
|
|
2972
|
+
return sourcePrice !== void 0 ? sourceAmount * sourcePrice : void 0;
|
|
2973
|
+
})() : void 0;
|
|
2974
|
+
if (usdValue === void 0) return void 0;
|
|
2975
|
+
const targetPrice = priceUsdFor(targetSymbol, prices);
|
|
2976
|
+
if (targetPrice === void 0) return void 0;
|
|
2977
|
+
return usdValue / targetPrice;
|
|
2978
|
+
}
|
|
2979
|
+
function formatReceiveEstimate(params) {
|
|
2980
|
+
const estimate = estimateReceiveAmount(params);
|
|
2981
|
+
if (estimate === void 0) return void 0;
|
|
2982
|
+
const formatted = formatTokenAmount(estimate, params.targetSymbol);
|
|
2983
|
+
if (formatted === void 0) return void 0;
|
|
2984
|
+
const sameSymbol = params.sourceSymbol.toUpperCase() === params.targetSymbol.toUpperCase();
|
|
2985
|
+
return sameSymbol ? `${formatted} ${params.targetSymbol}` : `~${formatted} ${params.targetSymbol}`;
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
// src/core/useTokenPrices.ts
|
|
2989
|
+
|
|
2990
|
+
function useTokenPrices(service, symbols) {
|
|
2991
|
+
const [prices, setPrices] = _react.useState.call(void 0, {});
|
|
2992
|
+
const symbolsKey = [
|
|
2993
|
+
...new Set(
|
|
2994
|
+
symbols.filter((symbol) => Boolean(symbol)).map((symbol) => symbol.toUpperCase())
|
|
2995
|
+
)
|
|
2996
|
+
].sort().join(",");
|
|
2997
|
+
_react.useEffect.call(void 0, () => {
|
|
2998
|
+
if (!symbolsKey) return;
|
|
2999
|
+
let cancelled = false;
|
|
3000
|
+
service.fetchPrices(symbolsKey.split(",")).then((result) => {
|
|
3001
|
+
if (!cancelled && result && Object.keys(result).length > 0) {
|
|
3002
|
+
setPrices(result);
|
|
3003
|
+
}
|
|
3004
|
+
}).catch(() => {
|
|
3005
|
+
});
|
|
3006
|
+
return () => {
|
|
3007
|
+
cancelled = true;
|
|
3008
|
+
};
|
|
3009
|
+
}, [service, symbolsKey]);
|
|
3010
|
+
return prices;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
2873
3013
|
// src/components/steps/ProcessingStep.tsx
|
|
2874
3014
|
|
|
2875
3015
|
function SuccessBadge() {
|
|
@@ -2942,24 +3082,6 @@ var SOFT_DELAY_MS = {
|
|
|
2942
3082
|
bridging: 4 * 60 * 1e3
|
|
2943
3083
|
};
|
|
2944
3084
|
var PHASE_TIMINGS_PREFIX = "rhinestone:phase-timings";
|
|
2945
|
-
var STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set([
|
|
2946
|
-
"USDC",
|
|
2947
|
-
"USDT",
|
|
2948
|
-
"DAI",
|
|
2949
|
-
"FRAX",
|
|
2950
|
-
"PYUSD",
|
|
2951
|
-
"USDP",
|
|
2952
|
-
"TUSD",
|
|
2953
|
-
"GUSD",
|
|
2954
|
-
"USDS",
|
|
2955
|
-
"LUSD",
|
|
2956
|
-
"BUSD",
|
|
2957
|
-
"USDE"
|
|
2958
|
-
]);
|
|
2959
|
-
function maxFractionDigitsFor(symbol) {
|
|
2960
|
-
if (!symbol) return 6;
|
|
2961
|
-
return STABLECOIN_SYMBOLS.has(symbol.toUpperCase()) ? 3 : 6;
|
|
2962
|
-
}
|
|
2963
3085
|
var PAYMENT_METHOD_LABELS = {
|
|
2964
3086
|
creditcard: "Card",
|
|
2965
3087
|
debitcard: "Card",
|
|
@@ -2991,7 +3113,7 @@ function loadPhaseTimings(txHash) {
|
|
|
2991
3113
|
const parsed = JSON.parse(raw);
|
|
2992
3114
|
if (typeof parsed.startedAt !== "number") return null;
|
|
2993
3115
|
return parsed;
|
|
2994
|
-
} catch (
|
|
3116
|
+
} catch (e5) {
|
|
2995
3117
|
return null;
|
|
2996
3118
|
}
|
|
2997
3119
|
}
|
|
@@ -3002,7 +3124,7 @@ function savePhaseTimings(txHash, timings) {
|
|
|
3002
3124
|
`${PHASE_TIMINGS_PREFIX}:${txHash}`,
|
|
3003
3125
|
JSON.stringify(timings)
|
|
3004
3126
|
);
|
|
3005
|
-
} catch (
|
|
3127
|
+
} catch (e6) {
|
|
3006
3128
|
}
|
|
3007
3129
|
}
|
|
3008
3130
|
function isEventForTx(event, txHash) {
|
|
@@ -3011,12 +3133,12 @@ function isEventForTx(event, txHash) {
|
|
|
3011
3133
|
return txRefsMatch(eventTxHash, txHash);
|
|
3012
3134
|
}
|
|
3013
3135
|
function parseWebhookTimestamp(event) {
|
|
3014
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
3136
|
+
if (typeof _optionalChain([event, 'optionalAccess', _119 => _119.time]) !== "string") return void 0;
|
|
3015
3137
|
const timestamp = Date.parse(event.time);
|
|
3016
3138
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
3017
3139
|
}
|
|
3018
3140
|
function syncPhaseTimings(previous, event) {
|
|
3019
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
3141
|
+
if (!_optionalChain([event, 'optionalAccess', _120 => _120.type])) return previous;
|
|
3020
3142
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
3021
3143
|
const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed" || event.type === "error") && previous.receivedAt === void 0;
|
|
3022
3144
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "post-bridge-swap-complete") && previous.bridgingAt === void 0;
|
|
@@ -3078,9 +3200,9 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
3078
3200
|
if (state.type === "complete") {
|
|
3079
3201
|
return void 0;
|
|
3080
3202
|
}
|
|
3081
|
-
if (_optionalChain([state, 'access',
|
|
3203
|
+
if (_optionalChain([state, 'access', _121 => _121.lastEvent, 'optionalAccess', _122 => _122.type]) === "bridge-started" || _optionalChain([state, 'access', _123 => _123.lastEvent, 'optionalAccess', _124 => _124.type]) === "bridge-complete")
|
|
3082
3204
|
return "bridging";
|
|
3083
|
-
if (_optionalChain([state, 'access',
|
|
3205
|
+
if (_optionalChain([state, 'access', _125 => _125.lastEvent, 'optionalAccess', _126 => _126.type]) === "deposit-received") return "received";
|
|
3084
3206
|
return "confirming";
|
|
3085
3207
|
}
|
|
3086
3208
|
function ProcessingStep({
|
|
@@ -3165,7 +3287,7 @@ function ProcessingStep({
|
|
|
3165
3287
|
flowLabel
|
|
3166
3288
|
});
|
|
3167
3289
|
const context = processingContextRef.current;
|
|
3168
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3290
|
+
_optionalChain([onDepositCompleteRef, 'access', _127 => _127.current, 'optionalCall', _128 => _128(txHash, void 0, {
|
|
3169
3291
|
amount: context.amount,
|
|
3170
3292
|
sourceChain: context.sourceChain,
|
|
3171
3293
|
sourceToken: context.sourceToken,
|
|
@@ -3207,7 +3329,7 @@ function ProcessingStep({
|
|
|
3207
3329
|
updatePhaseTimings(
|
|
3208
3330
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
3209
3331
|
);
|
|
3210
|
-
}, [_optionalChain([state, 'access',
|
|
3332
|
+
}, [_optionalChain([state, 'access', _129 => _129.lastEvent, 'optionalAccess', _130 => _130.time]), _optionalChain([state, 'access', _131 => _131.lastEvent, 'optionalAccess', _132 => _132.type]), updatePhaseTimings]);
|
|
3211
3333
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
3212
3334
|
_react.useEffect.call(void 0, () => {
|
|
3213
3335
|
let cancelled = false;
|
|
@@ -3254,21 +3376,21 @@ function ProcessingStep({
|
|
|
3254
3376
|
debugLog(debug, "processing", "poll:event", {
|
|
3255
3377
|
type: lastEvent2.type,
|
|
3256
3378
|
matchesTx: eventMatchesTx,
|
|
3257
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
3379
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _133 => _133.intentId])
|
|
3258
3380
|
});
|
|
3259
3381
|
}
|
|
3260
3382
|
if (!isMounted) return;
|
|
3261
3383
|
const awaitingPostBridgeSwap = processingContextRef.current.hasPostBridgeActions;
|
|
3262
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3384
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _134 => _134.type]) === "post-bridge-swap-complete") {
|
|
3263
3385
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
3264
|
-
const swapTxHash = _optionalChain([eventForCurrentTx, 'access',
|
|
3386
|
+
const swapTxHash = _optionalChain([eventForCurrentTx, 'access', _135 => _135.data, 'optionalAccess', _136 => _136.swap, 'optionalAccess', _137 => _137.transactionHash]);
|
|
3265
3387
|
debugLog(debug, "processing", "state:complete", {
|
|
3266
3388
|
txHash,
|
|
3267
3389
|
destinationTxHash: swapTxHash,
|
|
3268
3390
|
event: eventForCurrentTx.type
|
|
3269
3391
|
});
|
|
3270
3392
|
const context = processingContextRef.current;
|
|
3271
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3393
|
+
_optionalChain([onDepositCompleteRef, 'access', _138 => _138.current, 'optionalCall', _139 => _139(txHash, swapTxHash, {
|
|
3272
3394
|
amount: context.amount,
|
|
3273
3395
|
sourceChain: context.sourceChain,
|
|
3274
3396
|
sourceToken: context.sourceToken,
|
|
@@ -3279,7 +3401,7 @@ function ProcessingStep({
|
|
|
3279
3401
|
})]);
|
|
3280
3402
|
return;
|
|
3281
3403
|
}
|
|
3282
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3404
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _140 => _140.type]) === "post-bridge-swap-failed") {
|
|
3283
3405
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
3284
3406
|
setState({
|
|
3285
3407
|
type: "failed",
|
|
@@ -3291,19 +3413,19 @@ function ProcessingStep({
|
|
|
3291
3413
|
message: formatted.message,
|
|
3292
3414
|
code: formatted.code
|
|
3293
3415
|
});
|
|
3294
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3416
|
+
_optionalChain([onDepositFailedRef, 'access', _141 => _141.current, 'optionalCall', _142 => _142(txHash, formatted.message)]);
|
|
3295
3417
|
return;
|
|
3296
3418
|
}
|
|
3297
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3419
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _143 => _143.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
3298
3420
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
3299
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
3421
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _144 => _144.data, 'optionalAccess', _145 => _145.destination, 'optionalAccess', _146 => _146.transactionHash]);
|
|
3300
3422
|
debugLog(debug, "processing", "state:complete", {
|
|
3301
3423
|
txHash,
|
|
3302
3424
|
destinationTxHash: destinationTxHash2,
|
|
3303
3425
|
event: eventForCurrentTx.type
|
|
3304
3426
|
});
|
|
3305
3427
|
const context = processingContextRef.current;
|
|
3306
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3428
|
+
_optionalChain([onDepositCompleteRef, 'access', _147 => _147.current, 'optionalCall', _148 => _148(txHash, destinationTxHash2, {
|
|
3307
3429
|
amount: context.amount,
|
|
3308
3430
|
sourceChain: context.sourceChain,
|
|
3309
3431
|
sourceToken: context.sourceToken,
|
|
@@ -3314,7 +3436,7 @@ function ProcessingStep({
|
|
|
3314
3436
|
})]);
|
|
3315
3437
|
return;
|
|
3316
3438
|
}
|
|
3317
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3439
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _149 => _149.type]) === "bridge-failed") {
|
|
3318
3440
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
3319
3441
|
setState({
|
|
3320
3442
|
type: "failed",
|
|
@@ -3326,11 +3448,11 @@ function ProcessingStep({
|
|
|
3326
3448
|
message: formatted.message,
|
|
3327
3449
|
code: formatted.code
|
|
3328
3450
|
});
|
|
3329
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3451
|
+
_optionalChain([onDepositFailedRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151(txHash, formatted.message)]);
|
|
3330
3452
|
return;
|
|
3331
3453
|
}
|
|
3332
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3333
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
3454
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _152 => _152.type]) === "error") {
|
|
3455
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _153 => _153.data, 'optionalAccess', _154 => _154.message]), () => ( "Unknown error"));
|
|
3334
3456
|
setState({
|
|
3335
3457
|
type: "failed",
|
|
3336
3458
|
message: errorMessage,
|
|
@@ -3340,7 +3462,7 @@ function ProcessingStep({
|
|
|
3340
3462
|
txHash,
|
|
3341
3463
|
message: errorMessage
|
|
3342
3464
|
});
|
|
3343
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3465
|
+
_optionalChain([onDepositFailedRef, 'access', _155 => _155.current, 'optionalCall', _156 => _156(txHash, errorMessage)]);
|
|
3344
3466
|
return;
|
|
3345
3467
|
}
|
|
3346
3468
|
setState((previous) => ({
|
|
@@ -3401,7 +3523,7 @@ function ProcessingStep({
|
|
|
3401
3523
|
txHash,
|
|
3402
3524
|
timeoutMs: ESCALATED_DELAY_MS
|
|
3403
3525
|
});
|
|
3404
|
-
_optionalChain([onErrorRef, 'access',
|
|
3526
|
+
_optionalChain([onErrorRef, 'access', _157 => _157.current, 'optionalCall', _158 => _158(message, "PROCESS_TIMEOUT")]);
|
|
3405
3527
|
}, ESCALATED_DELAY_MS);
|
|
3406
3528
|
return () => clearTimeout(timeoutId);
|
|
3407
3529
|
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
@@ -3413,99 +3535,88 @@ function ProcessingStep({
|
|
|
3413
3535
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
3414
3536
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
3415
3537
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
3416
|
-
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess',
|
|
3417
|
-
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess',
|
|
3538
|
+
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess', _159 => _159.type]) === "post-bridge-swap-complete" || _optionalChain([lastEvent, 'optionalAccess', _160 => _160.type]) === "post-bridge-swap-failed";
|
|
3539
|
+
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _161 => _161.data, 'optionalAccess', _162 => _162.swap, 'optionalAccess', _163 => _163.transactionHash]) || null : _optionalChain([lastEvent, 'optionalAccess', _164 => _164.data, 'optionalAccess', _165 => _165.destination, 'optionalAccess', _166 => _166.transactionHash]) || null;
|
|
3418
3540
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
3419
3541
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
3420
3542
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
3421
3543
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
3422
|
-
const sourceExplorerUrl =
|
|
3423
|
-
const destExplorerUrl = destinationTxHash ?
|
|
3424
|
-
const
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
const raw = _viem.formatUnits.call(void 0, BigInt(displayAmount), sourceDecimals);
|
|
3434
|
-
const numeric = Number(raw);
|
|
3435
|
-
if (!Number.isFinite(numeric)) return raw;
|
|
3436
|
-
return numeric.toLocaleString("en-US", {
|
|
3437
|
-
minimumFractionDigits: 2,
|
|
3438
|
-
maximumFractionDigits: amountMaxDigits
|
|
3439
|
-
});
|
|
3440
|
-
} catch (e6) {
|
|
3441
|
-
return Number(displayAmount).toLocaleString("en-US", {
|
|
3442
|
-
minimumFractionDigits: 2,
|
|
3443
|
-
maximumFractionDigits: amountMaxDigits
|
|
3444
|
-
});
|
|
3445
|
-
}
|
|
3544
|
+
const sourceExplorerUrl = _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
|
|
3545
|
+
const destExplorerUrl = destinationTxHash ? _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
3546
|
+
const sourceDisplay = (() => {
|
|
3547
|
+
const resolved = resolveTokenDisplay(displaySourceToken, displaySourceChain, {
|
|
3548
|
+
symbol: _nullishCoalesce(providedSourceSymbol, () => ( (displaySourceChain === "solana" ? "SOL" : "Token"))),
|
|
3549
|
+
decimals: providedSourceDecimals
|
|
3550
|
+
});
|
|
3551
|
+
return {
|
|
3552
|
+
symbol: resolved.symbol,
|
|
3553
|
+
decimals: _nullishCoalesce(resolved.decimals, () => ( (displaySourceChain === "solana" ? 9 : 18)))
|
|
3554
|
+
};
|
|
3446
3555
|
})();
|
|
3447
|
-
const
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3556
|
+
const sourceSymbol = sourceDisplay.symbol;
|
|
3557
|
+
const formattedSentAmount = _nullishCoalesce(_nullishCoalesce(formatRawTokenAmount(displayAmount, sourceDisplay), () => ( // Not raw base units (e.g. a decimal string) — render the number as-is.
|
|
3558
|
+
formatTokenAmount(Number(displayAmount), sourceDisplay.symbol))), () => ( displayAmount));
|
|
3559
|
+
const isBridgeHopDestination = hasPostBridgeActions && (_optionalChain([lastEvent, 'optionalAccess', _167 => _167.type]) === "bridge-started" || _optionalChain([lastEvent, 'optionalAccess', _168 => _168.type]) === "bridge-complete");
|
|
3560
|
+
const eventDestination = isBridgeHopDestination ? {} : getEventDestinationDetails(lastEvent);
|
|
3561
|
+
const targetDisplay = resolveTokenDisplay(
|
|
3562
|
+
_nullishCoalesce(eventDestination.token, () => ( targetToken)),
|
|
3563
|
+
_nullishCoalesce(eventDestination.chainId, () => ( targetChain)),
|
|
3564
|
+
// Dapp deposits default to USDC targets; mirror the source symbol last so
|
|
3565
|
+
// unresolvable same-token routes still label sensibly.
|
|
3566
|
+
{ symbol: _nullishCoalesce(providedSourceSymbol, () => ( "USDC")) }
|
|
3567
|
+
);
|
|
3568
|
+
const targetSymbol = targetDisplay.symbol;
|
|
3569
|
+
const formattedDestinationAmount = eventDestination.amount !== void 0 ? formatRawTokenAmount(eventDestination.amount, targetDisplay) : void 0;
|
|
3570
|
+
const amountUsdNumber = amountUsd !== void 0 && Number(amountUsd) > 0 ? Number(amountUsd) : void 0;
|
|
3571
|
+
const prices = useTokenPrices(service, [
|
|
3572
|
+
sourceDisplay.symbol,
|
|
3573
|
+
targetDisplay.symbol
|
|
3574
|
+
]);
|
|
3575
|
+
const estimatedReceiveAmount = (() => {
|
|
3576
|
+
const estimate = estimateReceiveAmount({
|
|
3577
|
+
sourceAmount: tokenAmountToNumber(displayAmount, sourceDisplay.decimals),
|
|
3578
|
+
sourceSymbol: sourceDisplay.symbol,
|
|
3579
|
+
targetSymbol: targetDisplay.symbol,
|
|
3580
|
+
sourceAmountUsd: amountUsdNumber,
|
|
3581
|
+
prices
|
|
3582
|
+
});
|
|
3583
|
+
return estimate !== void 0 ? formatTokenAmount(estimate, targetDisplay.symbol) : void 0;
|
|
3455
3584
|
})();
|
|
3456
|
-
const
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3585
|
+
const receiveDisplay = formattedDestinationAmount ? `${formattedDestinationAmount} ${targetSymbol}` : estimatedReceiveAmount !== void 0 ? `~${estimatedReceiveAmount} ${targetSymbol}` : amountUsdNumber !== void 0 ? `~$${amountUsdNumber.toFixed(2)}` : (
|
|
3586
|
+
// Cross-token with no price and no USD context (rare QR case):
|
|
3587
|
+
// an honest dash beats a wrong number.
|
|
3588
|
+
"\u2014"
|
|
3589
|
+
);
|
|
3590
|
+
const formattedBridgingCost = (() => {
|
|
3591
|
+
if (sourceSymbol.toUpperCase() !== targetSymbol.toUpperCase()) {
|
|
3460
3592
|
return void 0;
|
|
3461
3593
|
}
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
try {
|
|
3466
|
-
const raw = _viem.formatUnits.call(void 0, destinationAmountRaw, sourceDecimals);
|
|
3467
|
-
const numeric = Number(raw);
|
|
3468
|
-
if (!Number.isFinite(numeric)) return raw;
|
|
3469
|
-
return numeric.toLocaleString("en-US", {
|
|
3470
|
-
minimumFractionDigits: 2,
|
|
3471
|
-
maximumFractionDigits: amountMaxDigits
|
|
3472
|
-
});
|
|
3473
|
-
} catch (e9) {
|
|
3594
|
+
const sentValue = tokenAmountToNumber(displayAmount, sourceDisplay.decimals);
|
|
3595
|
+
const receivedValue = eventDestination.amount !== void 0 ? tokenAmountToNumber(eventDestination.amount, targetDisplay.decimals) : void 0;
|
|
3596
|
+
if (sentValue === void 0 || receivedValue === void 0 || sentValue <= receivedValue) {
|
|
3474
3597
|
return void 0;
|
|
3475
3598
|
}
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
try {
|
|
3479
|
-
const raw = _viem.formatUnits.call(void 0, bridgingCostRaw, sourceDecimals);
|
|
3480
|
-
const numeric = Number(raw);
|
|
3481
|
-
if (!Number.isFinite(numeric)) return raw;
|
|
3482
|
-
return numeric.toLocaleString("en-US", {
|
|
3483
|
-
minimumFractionDigits: 2,
|
|
3484
|
-
maximumFractionDigits: amountMaxDigits
|
|
3485
|
-
});
|
|
3486
|
-
} catch (e10) {
|
|
3599
|
+
const formatted = formatTokenAmount(sentValue - receivedValue, sourceSymbol);
|
|
3600
|
+
if (formatted === void 0 || Number(formatted.replace(/,/g, "")) === 0) {
|
|
3487
3601
|
return void 0;
|
|
3488
3602
|
}
|
|
3489
|
-
|
|
3603
|
+
return formatted;
|
|
3604
|
+
})();
|
|
3490
3605
|
const currentPhaseId = getCurrentPhaseId(state, phaseTimings);
|
|
3491
3606
|
const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
|
|
3492
3607
|
const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
|
|
3493
3608
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
3494
3609
|
void delayPhaseId;
|
|
3495
3610
|
void hasEscalatedDelay;
|
|
3496
|
-
const
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
const
|
|
3501
|
-
const
|
|
3502
|
-
const targetChainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain);
|
|
3503
|
-
const sourceTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
3504
|
-
const sourceChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, displaySourceChain);
|
|
3505
|
-
const targetChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
3611
|
+
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
3612
|
+
const sourceChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, displaySourceChain);
|
|
3613
|
+
const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
|
|
3614
|
+
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
3615
|
+
const sourceChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, displaySourceChain);
|
|
3616
|
+
const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
3506
3617
|
const timerText = formatTimer(elapsedSeconds);
|
|
3507
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3508
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3618
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _169 => _169.feeSponsored]), () => ( false));
|
|
3619
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _170 => _170.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3509
3620
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
3510
3621
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
3511
3622
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -3516,10 +3627,10 @@ function ProcessingStep({
|
|
|
3516
3627
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-body-header-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
3517
3628
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}), title: stateTitle });
|
|
3518
3629
|
if (isComplete && isSwappedOrder) {
|
|
3519
|
-
const onrampMethod = _optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3520
|
-
const amountPaid = _optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3521
|
-
const depositedAmount =
|
|
3522
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3630
|
+
const onrampMethod = _optionalChain([swappedFiatContext, 'optionalAccess', _171 => _171.paymentMethod]) ? formatPaymentMethod(swappedFiatContext.paymentMethod) : null;
|
|
3631
|
+
const amountPaid = _optionalChain([swappedFiatContext, 'optionalAccess', _172 => _172.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null;
|
|
3632
|
+
const depositedAmount = receiveDisplay;
|
|
3633
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _173 => _173.onrampFeeUsd]), () => ( null));
|
|
3523
3634
|
const networkFeeUsd = quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
|
|
3524
3635
|
const feeRows = [];
|
|
3525
3636
|
if (onrampFeeUsd != null) {
|
|
@@ -3595,7 +3706,7 @@ function ProcessingStep({
|
|
|
3595
3706
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
3596
3707
|
] }),
|
|
3597
3708
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3598
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3709
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _174 => _174.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3599
3710
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
3600
3711
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3601
3712
|
"$",
|
|
@@ -3607,7 +3718,7 @@ function ProcessingStep({
|
|
|
3607
3718
|
] })
|
|
3608
3719
|
] })
|
|
3609
3720
|
] }),
|
|
3610
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3721
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _175 => _175.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3611
3722
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
3612
3723
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3613
3724
|
"$",
|
|
@@ -3629,7 +3740,7 @@ function ProcessingStep({
|
|
|
3629
3740
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isProcessing ? "You send" : "You sent" }),
|
|
3630
3741
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3631
3742
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
3632
|
-
|
|
3743
|
+
formattedSentAmount,
|
|
3633
3744
|
" ",
|
|
3634
3745
|
sourceSymbol
|
|
3635
3746
|
] }),
|
|
@@ -3639,7 +3750,7 @@ function ProcessingStep({
|
|
|
3639
3750
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3640
3751
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isProcessing ? "Receive" : "Received" }),
|
|
3641
3752
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3642
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
3753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
3643
3754
|
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetTokenIcon, alt: "" }) })
|
|
3644
3755
|
] })
|
|
3645
3756
|
] }),
|
|
@@ -3751,7 +3862,7 @@ function loadSessionOwnerFromStorage(eoaAddress) {
|
|
|
3751
3862
|
privateKey: parsed.privateKey,
|
|
3752
3863
|
address: account.address
|
|
3753
3864
|
};
|
|
3754
|
-
} catch (
|
|
3865
|
+
} catch (e7) {
|
|
3755
3866
|
return null;
|
|
3756
3867
|
}
|
|
3757
3868
|
}
|
|
@@ -3832,4 +3943,7 @@ function accountFromPrivateKey(privateKey) {
|
|
|
3832
3943
|
|
|
3833
3944
|
|
|
3834
3945
|
|
|
3835
|
-
|
|
3946
|
+
|
|
3947
|
+
|
|
3948
|
+
|
|
3949
|
+
exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.HistoryIcon = HistoryIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.ArrowUpRightIcon = ArrowUpRightIcon; exports.AlertTriangleIcon = AlertTriangleIcon; exports.PercentIcon = PercentIcon; exports.ClockIcon = ClockIcon; exports.PlusCircleIcon = PlusCircleIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.BankIcon = BankIcon; exports.UnplugIcon = UnplugIcon; exports.Callout = Callout; exports.BodyHeader = BodyHeader; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.ConnectStep = ConnectStep; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.debugLog = debugLog; exports.debugError = debugError; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.formatTokenAmount = formatTokenAmount; exports.formatReceiveEstimate = formatReceiveEstimate; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.useTokenPrices = useTokenPrices; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.getHyperEvmReadClient = getHyperEvmReadClient; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.applyTheme = applyTheme;
|