@rhinestone/deposit-modal 0.3.0-alpha.14 → 0.3.0-alpha.16
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-4I47KSPN.cjs → DepositModalReown-QRLLANTS.cjs} +7 -7
- package/dist/{DepositModalReown-DIUIB3MU.mjs → DepositModalReown-THU2QG76.mjs} +4 -4
- package/dist/{WithdrawModalReown-Y3NRAKXJ.cjs → WithdrawModalReown-PHWLYDZQ.cjs} +7 -7
- package/dist/{WithdrawModalReown-WRUEALDP.mjs → WithdrawModalReown-SSRJNUGZ.mjs} +4 -4
- package/dist/{constants-DqVn968d.d.ts → caip-CrQ2KKU-.d.cts} +11 -1
- package/dist/{constants-DqVn968d.d.cts → caip-CrQ2KKU-.d.ts} +11 -1
- package/dist/{chunk-SZIYS42B.mjs → chunk-6YRDD462.mjs} +63 -3
- package/dist/{chunk-N4XRQPVA.cjs → chunk-7W5M6WEE.cjs} +226 -203
- package/dist/{chunk-JTMGFWXO.mjs → chunk-E2K7XWMN.mjs} +2 -2
- package/dist/{chunk-2NUXDEEO.cjs → chunk-G5YDICEN.cjs} +93 -93
- package/dist/{chunk-7JIDIX27.cjs → chunk-MILJQWPT.cjs} +73 -13
- package/dist/{chunk-VD4WTEHP.mjs → chunk-PAK3NUGY.mjs} +5 -5
- package/dist/{chunk-3CYGTYMY.cjs → chunk-PXQBJMNF.cjs} +526 -451
- package/dist/{chunk-JTULAFMU.cjs → chunk-UD6QUZJS.cjs} +5 -5
- package/dist/{chunk-XG474KUR.mjs → chunk-YX3I7C2R.mjs} +101 -26
- package/dist/{chunk-4ZN726P5.mjs → chunk-Z7OJPEV2.mjs} +258 -235
- package/dist/constants.cjs +6 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +5 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +9 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +8 -4
- package/dist/{types-C8i2ebY1.d.cts → types-cXr3j4NV.d.cts} +26 -0
- package/dist/{types-C8i2ebY1.d.ts → types-cXr3j4NV.d.ts} +26 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkMILJQWPTcjs = require('./chunk-MILJQWPT.cjs');
|
|
15
17
|
|
|
16
18
|
// src/components/ui/Modal.tsx
|
|
17
19
|
|
|
@@ -214,6 +216,46 @@ var CardIcon = _lucidereact.CreditCard;
|
|
|
214
216
|
var BankIcon = _lucidereact.Landmark;
|
|
215
217
|
var AppleIcon = _lucidereact.Apple;
|
|
216
218
|
|
|
219
|
+
// src/components/ui/Callout.tsx
|
|
220
|
+
|
|
221
|
+
function CircleAlertIcon() {
|
|
222
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
223
|
+
"svg",
|
|
224
|
+
{
|
|
225
|
+
width: "16",
|
|
226
|
+
height: "16",
|
|
227
|
+
viewBox: "0 0 16 16",
|
|
228
|
+
fill: "none",
|
|
229
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
230
|
+
"aria-hidden": "true",
|
|
231
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
232
|
+
"path",
|
|
233
|
+
{
|
|
234
|
+
d: "M10 5.99L6 9.99M6 5.99L10 9.99M14.66 7.99C14.66 11.68 11.68 14.66 8 14.66C4.31 14.66 1.33 11.68 1.33 7.99C1.33 4.31 4.31 1.33 8 1.33C11.68 1.33 14.66 4.31 14.66 7.99Z",
|
|
235
|
+
stroke: "currentColor",
|
|
236
|
+
strokeWidth: "1.33",
|
|
237
|
+
strokeLinecap: "round",
|
|
238
|
+
strokeLinejoin: "round"
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
function Callout({ variant = "error", children, role }) {
|
|
245
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
246
|
+
"div",
|
|
247
|
+
{
|
|
248
|
+
className: `rs-callout rs-callout--${variant}`,
|
|
249
|
+
role: _nullishCoalesce(role, () => ( (variant === "error" ? "alert" : "status"))),
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-callout-icon", children: variant === "error" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CircleAlertIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertTriangleIcon, {}) }),
|
|
252
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-callout-text", children })
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
Callout.displayName = "Callout";
|
|
258
|
+
|
|
217
259
|
// src/core/useLatestRef.ts
|
|
218
260
|
|
|
219
261
|
function useLatestRef(value) {
|
|
@@ -277,29 +319,6 @@ function debugError(enabled, scope, message, error, data) {
|
|
|
277
319
|
console.error(`[deposit-modal:${scope}] ${message}`, payload);
|
|
278
320
|
}
|
|
279
321
|
|
|
280
|
-
// src/core/caip.ts
|
|
281
|
-
var SOLANA_MAINNET_GENESIS = "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
282
|
-
var SOLANA_MAINNET_CAIP2 = `solana:${SOLANA_MAINNET_GENESIS}`;
|
|
283
|
-
function toEvmCaip2(chainId) {
|
|
284
|
-
return `eip155:${chainId}`;
|
|
285
|
-
}
|
|
286
|
-
function targetChainToCaip2(targetChain) {
|
|
287
|
-
return targetChain === "solana" ? SOLANA_MAINNET_CAIP2 : toEvmCaip2(targetChain);
|
|
288
|
-
}
|
|
289
|
-
function parseEvmChainId(value) {
|
|
290
|
-
if (typeof value === "number" && Number.isFinite(value)) {
|
|
291
|
-
return value;
|
|
292
|
-
}
|
|
293
|
-
if (typeof value !== "string") return null;
|
|
294
|
-
const match = value.match(/^eip155:(\d+)$/);
|
|
295
|
-
if (!_optionalChain([match, 'optionalAccess', _ => _[1]])) return null;
|
|
296
|
-
const parsed = Number.parseInt(match[1], 10);
|
|
297
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
298
|
-
}
|
|
299
|
-
function isSolanaCaip2(value) {
|
|
300
|
-
return typeof value === "string" && value.startsWith("solana:");
|
|
301
|
-
}
|
|
302
|
-
|
|
303
322
|
// src/core/deposit-asset-helpers.ts
|
|
304
323
|
function getAssetId(asset) {
|
|
305
324
|
return `${asset.chainId}:${asset.token.toLowerCase()}`;
|
|
@@ -477,8 +496,8 @@ function buildSessionDetails(unsigned, signature) {
|
|
|
477
496
|
}
|
|
478
497
|
function createDepositService(baseUrl, options) {
|
|
479
498
|
const normalizedBaseUrl = baseUrl.replace(/\/$/, "");
|
|
480
|
-
const debug = _optionalChain([options, 'optionalAccess',
|
|
481
|
-
const scope = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
499
|
+
const debug = _optionalChain([options, 'optionalAccess', _ => _.debug]) === true;
|
|
500
|
+
const scope = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _2 => _2.debugScope]), () => ( "service"));
|
|
482
501
|
function apiUrl(path) {
|
|
483
502
|
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
484
503
|
return `${normalizedBaseUrl}${normalizedPath}`;
|
|
@@ -515,7 +534,7 @@ function createDepositService(baseUrl, options) {
|
|
|
515
534
|
targetChain: params.targetChain,
|
|
516
535
|
targetToken: params.targetToken,
|
|
517
536
|
recipient: params.recipient ? shortRef(params.recipient) : void 0,
|
|
518
|
-
postBridgeActionCount: _nullishCoalesce(_optionalChain([params, 'access',
|
|
537
|
+
postBridgeActionCount: _nullishCoalesce(_optionalChain([params, 'access', _3 => _3.postBridgeActions, 'optionalAccess', _4 => _4.length]), () => ( 0)),
|
|
519
538
|
forceRegister: params.forceRegister
|
|
520
539
|
});
|
|
521
540
|
const response = await fetch(url, {
|
|
@@ -532,7 +551,7 @@ function createDepositService(baseUrl, options) {
|
|
|
532
551
|
error,
|
|
533
552
|
{ status: response.status, ownerAddress: params.ownerAddress }
|
|
534
553
|
);
|
|
535
|
-
const detail = Array.isArray(error.details) ? error.details.map((d) => _optionalChain([d, 'optionalAccess',
|
|
554
|
+
const detail = Array.isArray(error.details) ? error.details.map((d) => _optionalChain([d, 'optionalAccess', _5 => _5.message])).filter(Boolean).join("; ") : void 0;
|
|
536
555
|
const base = error.error || `Setup account failed: ${response.status}`;
|
|
537
556
|
throw new Error(detail ? `${base}: ${detail}` : base);
|
|
538
557
|
}
|
|
@@ -584,8 +603,8 @@ function createDepositService(baseUrl, options) {
|
|
|
584
603
|
const result = await response.json();
|
|
585
604
|
debugLog(debug, scope, "registerAccount:success", {
|
|
586
605
|
address: params.address,
|
|
587
|
-
evmDepositAddress: _optionalChain([result, 'optionalAccess',
|
|
588
|
-
hasSolanaDepositAddress: Boolean(_optionalChain([result, 'optionalAccess',
|
|
606
|
+
evmDepositAddress: _optionalChain([result, 'optionalAccess', _6 => _6.evmDepositAddress]),
|
|
607
|
+
hasSolanaDepositAddress: Boolean(_optionalChain([result, 'optionalAccess', _7 => _7.solanaDepositAddress]))
|
|
589
608
|
});
|
|
590
609
|
return result;
|
|
591
610
|
},
|
|
@@ -687,9 +706,9 @@ function createDepositService(baseUrl, options) {
|
|
|
687
706
|
}
|
|
688
707
|
const data = await response.json();
|
|
689
708
|
const result = {
|
|
690
|
-
isRegistered: _optionalChain([data, 'optionalAccess',
|
|
691
|
-
targetChain: _optionalChain([data, 'optionalAccess',
|
|
692
|
-
targetToken: _optionalChain([data, 'optionalAccess',
|
|
709
|
+
isRegistered: _optionalChain([data, 'optionalAccess', _8 => _8.isRegistered]) === true,
|
|
710
|
+
targetChain: _optionalChain([data, 'optionalAccess', _9 => _9.targetChain]),
|
|
711
|
+
targetToken: _optionalChain([data, 'optionalAccess', _10 => _10.targetToken])
|
|
693
712
|
};
|
|
694
713
|
debugLog(debug, scope, "checkAccount:success", {
|
|
695
714
|
address,
|
|
@@ -719,12 +738,12 @@ function createDepositService(baseUrl, options) {
|
|
|
719
738
|
return { lastEvent: void 0 };
|
|
720
739
|
}
|
|
721
740
|
const body = await response.json();
|
|
722
|
-
const row = _optionalChain([body, 'access',
|
|
741
|
+
const row = _optionalChain([body, 'access', _11 => _11.deposits, 'optionalAccess', _12 => _12[0]]);
|
|
723
742
|
const lastEvent = row ? depositRowToEvent(row) : void 0;
|
|
724
743
|
debugLog(debug, scope, "fetchStatus:success", {
|
|
725
744
|
address,
|
|
726
745
|
txHash: shortRef(normalized),
|
|
727
|
-
eventType: _optionalChain([lastEvent, 'optionalAccess',
|
|
746
|
+
eventType: _optionalChain([lastEvent, 'optionalAccess', _13 => _13.type])
|
|
728
747
|
});
|
|
729
748
|
return { lastEvent };
|
|
730
749
|
},
|
|
@@ -745,11 +764,11 @@ function createDepositService(baseUrl, options) {
|
|
|
745
764
|
return { lastEvent: void 0 };
|
|
746
765
|
}
|
|
747
766
|
const body = await response.json();
|
|
748
|
-
const row = _optionalChain([body, 'access',
|
|
767
|
+
const row = _optionalChain([body, 'access', _14 => _14.deposits, 'optionalAccess', _15 => _15[0]]);
|
|
749
768
|
const lastEvent = row ? depositRowToEvent(row) : void 0;
|
|
750
769
|
debugLog(debug, scope, "fetchLatestStatus:success", {
|
|
751
770
|
address,
|
|
752
|
-
eventType: _optionalChain([lastEvent, 'optionalAccess',
|
|
771
|
+
eventType: _optionalChain([lastEvent, 'optionalAccess', _16 => _16.type])
|
|
753
772
|
});
|
|
754
773
|
return { lastEvent };
|
|
755
774
|
},
|
|
@@ -811,7 +830,7 @@ function createDepositService(baseUrl, options) {
|
|
|
811
830
|
smartAccount,
|
|
812
831
|
chainId,
|
|
813
832
|
safeAddress,
|
|
814
|
-
txHash: _optionalChain([result, 'optionalAccess',
|
|
833
|
+
txHash: _optionalChain([result, 'optionalAccess', _17 => _17.txHash]) ? shortRef(result.txHash) : void 0
|
|
815
834
|
});
|
|
816
835
|
return result;
|
|
817
836
|
},
|
|
@@ -851,7 +870,7 @@ function createDepositService(baseUrl, options) {
|
|
|
851
870
|
const result = await response.json();
|
|
852
871
|
debugLog(debug, scope, "submitPolymarketWithdraw:success", {
|
|
853
872
|
depositWallet,
|
|
854
|
-
txHash: _optionalChain([result, 'optionalAccess',
|
|
873
|
+
txHash: _optionalChain([result, 'optionalAccess', _18 => _18.txHash]) ? shortRef(result.txHash) : void 0
|
|
855
874
|
});
|
|
856
875
|
return result;
|
|
857
876
|
},
|
|
@@ -886,8 +905,8 @@ function createDepositService(baseUrl, options) {
|
|
|
886
905
|
);
|
|
887
906
|
}
|
|
888
907
|
const data = await response.json();
|
|
889
|
-
const deposits = Array.isArray(_optionalChain([data, 'optionalAccess',
|
|
890
|
-
const nextCursor = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
908
|
+
const deposits = Array.isArray(_optionalChain([data, 'optionalAccess', _19 => _19.deposits])) ? data.deposits : [];
|
|
909
|
+
const nextCursor = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess', _20 => _20.nextCursor]), () => ( _optionalChain([data, 'optionalAccess', _21 => _21.next_cursor]))), () => ( null));
|
|
891
910
|
debugLog(debug, scope, "fetchDepositHistory:success", {
|
|
892
911
|
recipient: shortRef(params.recipient),
|
|
893
912
|
count: deposits.length,
|
|
@@ -897,11 +916,11 @@ function createDepositService(baseUrl, options) {
|
|
|
897
916
|
},
|
|
898
917
|
async checkLiquidity(params) {
|
|
899
918
|
if (params.destinationChainId === "solana") {
|
|
900
|
-
const token =
|
|
919
|
+
const token = _chunkMILJQWPTcjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
|
|
901
920
|
return {
|
|
902
921
|
hasLiquidity: true,
|
|
903
|
-
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess',
|
|
904
|
-
decimals: _nullishCoalesce(_optionalChain([token, 'optionalAccess',
|
|
922
|
+
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _22 => _22.symbol]), () => ( "Token")),
|
|
923
|
+
decimals: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _23 => _23.decimals]), () => ( 9)),
|
|
905
924
|
unlimited: true,
|
|
906
925
|
maxAmount: null
|
|
907
926
|
};
|
|
@@ -1127,16 +1146,16 @@ function createDepositService(baseUrl, options) {
|
|
|
1127
1146
|
}
|
|
1128
1147
|
function normalizeDirectPortfolio(data) {
|
|
1129
1148
|
const rawTokens = _nullishCoalesce(_nullishCoalesce(extractArray(data, "tokens"), () => ( extractArray(
|
|
1130
|
-
_optionalChain([data, 'optionalAccess',
|
|
1149
|
+
_optionalChain([data, 'optionalAccess', _24 => _24.data]),
|
|
1131
1150
|
"tokens"
|
|
1132
1151
|
))), () => ( []));
|
|
1133
|
-
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess',
|
|
1152
|
+
const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _25 => _25.data]), "totalUsd"))), () => ( 0));
|
|
1134
1153
|
const tokens = rawTokens.map((token) => normalizeDirectToken(token)).filter((token) => Boolean(token));
|
|
1135
1154
|
return { tokens, totalUsd };
|
|
1136
1155
|
}
|
|
1137
1156
|
function extractOrchestratorPortfolio(data) {
|
|
1138
1157
|
const portfolio = _nullishCoalesce(extractArray(data, "portfolio"), () => ( extractArray(
|
|
1139
|
-
_optionalChain([data, 'optionalAccess',
|
|
1158
|
+
_optionalChain([data, 'optionalAccess', _26 => _26.data]),
|
|
1140
1159
|
"portfolio"
|
|
1141
1160
|
)));
|
|
1142
1161
|
if (!portfolio || !Array.isArray(portfolio)) return null;
|
|
@@ -1147,17 +1166,17 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1147
1166
|
for (const tokenData of data.portfolio || []) {
|
|
1148
1167
|
const chainBalances = _nullishCoalesce(_nullishCoalesce(tokenData.tokenChainBalance, () => ( tokenData.chainBalances)), () => ( []));
|
|
1149
1168
|
for (const chainBalance of chainBalances) {
|
|
1150
|
-
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access',
|
|
1169
|
+
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _27 => _27.balance, 'optionalAccess', _28 => _28.unlocked]), () => ( "0"));
|
|
1151
1170
|
const normalizedName = tokenData.tokenName.trim();
|
|
1152
1171
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1153
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
1154
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
1172
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkMILJQWPTcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
1173
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunkMILJQWPTcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
1155
1174
|
if (!resolvedTokenAddress) {
|
|
1156
1175
|
continue;
|
|
1157
1176
|
}
|
|
1158
|
-
const registrySymbol =
|
|
1177
|
+
const registrySymbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
1159
1178
|
const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
|
|
1160
|
-
const decimals = registrySymbol !== "Token" ?
|
|
1179
|
+
const decimals = registrySymbol !== "Token" ? _chunkMILJQWPTcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
|
|
1161
1180
|
tokens.push({
|
|
1162
1181
|
chainId: chainBalance.chainId,
|
|
1163
1182
|
address: resolvedTokenAddress,
|
|
@@ -1177,23 +1196,23 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1177
1196
|
function normalizeDirectToken(token) {
|
|
1178
1197
|
const rawChainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
|
|
1179
1198
|
const rawChainString = _nullishCoalesce(extractString(token, "chainId"), () => ( extractString(token.chain, "id")));
|
|
1180
|
-
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? isSolanaCaip2(rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : parseEvmChainId(rawChainString) : null)));
|
|
1199
|
+
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? _chunkMILJQWPTcjs.isSolanaCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : _chunkMILJQWPTcjs.parseEvmChainId.call(void 0, rawChainString) : null)));
|
|
1181
1200
|
if (chainId === null) return null;
|
|
1182
1201
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1183
1202
|
if (!symbol) return null;
|
|
1184
|
-
const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call',
|
|
1203
|
+
const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _29 => _29(token, "balance"), 'optionalAccess', _30 => _30.toString, 'call', _31 => _31()]))), () => ( _optionalChain([extractNumber, 'call', _32 => _32(token, "amount"), 'optionalAccess', _33 => _33.toString, 'call', _34 => _34()]))), () => ( _optionalChain([extractNumber, 'call', _35 => _35(token, "value"), 'optionalAccess', _36 => _36.toString, 'call', _37 => _37()]))), () => ( _optionalChain([extractNumber, 'call', _38 => _38(token, "rawBalance"), 'optionalAccess', _39 => _39.toString, 'call', _40 => _40()])));
|
|
1185
1204
|
if (!balanceValue) return null;
|
|
1186
1205
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1187
1206
|
token.token,
|
|
1188
1207
|
"address"
|
|
1189
|
-
))), () => ( (typeof chainId === "number" ?
|
|
1208
|
+
))), () => ( (typeof chainId === "number" ? _chunkMILJQWPTcjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
|
|
1190
1209
|
if (!address) return null;
|
|
1191
1210
|
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));
|
|
1192
1211
|
const isSolanaToken = chainId === "solana";
|
|
1193
|
-
const registrySymbol = isSolanaToken ? "Token" :
|
|
1212
|
+
const registrySymbol = isSolanaToken ? "Token" : _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, address, chainId);
|
|
1194
1213
|
const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
1195
1214
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1196
|
-
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ?
|
|
1215
|
+
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkMILJQWPTcjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
|
|
1197
1216
|
return {
|
|
1198
1217
|
chainId,
|
|
1199
1218
|
address,
|
|
@@ -1206,7 +1225,7 @@ function normalizeDirectToken(token) {
|
|
|
1206
1225
|
}
|
|
1207
1226
|
function extractTokenAddress(tokenData, chainId) {
|
|
1208
1227
|
const token = tokenData;
|
|
1209
|
-
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access',
|
|
1228
|
+
return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access', _41 => _41.addresses, 'optionalAccess', _42 => _42[chainId]]))), () => ( _optionalChain([token, 'access', _43 => _43.token, 'optionalAccess', _44 => _44.address]))), () => ( _optionalChain([token, 'access', _45 => _45.token, 'optionalAccess', _46 => _46.addresses, 'optionalAccess', _47 => _47[chainId]])));
|
|
1210
1229
|
}
|
|
1211
1230
|
function extractArray(data, key) {
|
|
1212
1231
|
if (!data || typeof data !== "object") return null;
|
|
@@ -1305,6 +1324,33 @@ function formatUserError(raw) {
|
|
|
1305
1324
|
return cleaned;
|
|
1306
1325
|
}
|
|
1307
1326
|
|
|
1327
|
+
// src/core/public-client.ts
|
|
1328
|
+
var _viem = require('viem');
|
|
1329
|
+
var _chains = require('viem/chains');
|
|
1330
|
+
var clientCache = /* @__PURE__ */ new Map();
|
|
1331
|
+
function getPublicClient(chainId) {
|
|
1332
|
+
let client = clientCache.get(chainId);
|
|
1333
|
+
if (!client) {
|
|
1334
|
+
const chain = _chunkMILJQWPTcjs.CHAIN_BY_ID[chainId];
|
|
1335
|
+
client = _viem.createPublicClient.call(void 0, {
|
|
1336
|
+
chain,
|
|
1337
|
+
transport: _viem.http.call(void 0, )
|
|
1338
|
+
});
|
|
1339
|
+
clientCache.set(chainId, client);
|
|
1340
|
+
}
|
|
1341
|
+
return client;
|
|
1342
|
+
}
|
|
1343
|
+
var hyperEvmClient;
|
|
1344
|
+
function getHyperEvmReadClient() {
|
|
1345
|
+
if (!hyperEvmClient) {
|
|
1346
|
+
hyperEvmClient = _viem.createPublicClient.call(void 0, {
|
|
1347
|
+
chain: _chains.hyperliquid,
|
|
1348
|
+
transport: _viem.http.call(void 0, )
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
return hyperEvmClient;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1308
1354
|
// src/core/theme.ts
|
|
1309
1355
|
var RADIUS_SCALE = {
|
|
1310
1356
|
none: { sm: "0", md: "0", lg: "0" },
|
|
@@ -1407,19 +1453,19 @@ var CUSTOM_PRIMARY_VARS = [
|
|
|
1407
1453
|
function applyTheme(element, theme) {
|
|
1408
1454
|
if (!element) return;
|
|
1409
1455
|
const parent = element.parentElement;
|
|
1410
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
1411
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1456
|
+
const targets = _optionalChain([parent, 'optionalAccess', _48 => _48.classList, 'access', _49 => _49.contains, 'call', _50 => _50("rs-modal-content")]) ? [element, parent] : [element];
|
|
1457
|
+
if (_optionalChain([theme, 'optionalAccess', _51 => _51.mode])) {
|
|
1412
1458
|
for (const t of targets) t.setAttribute("data-theme", theme.mode);
|
|
1413
1459
|
} else {
|
|
1414
1460
|
for (const t of targets) t.removeAttribute("data-theme");
|
|
1415
1461
|
}
|
|
1416
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1462
|
+
if (_optionalChain([theme, 'optionalAccess', _52 => _52.fontColor])) {
|
|
1417
1463
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
1418
1464
|
}
|
|
1419
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1465
|
+
if (_optionalChain([theme, 'optionalAccess', _53 => _53.iconColor])) {
|
|
1420
1466
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
1421
1467
|
}
|
|
1422
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1468
|
+
if (_optionalChain([theme, 'optionalAccess', _54 => _54.ctaColor])) {
|
|
1423
1469
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
1424
1470
|
if (derived) {
|
|
1425
1471
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -1444,18 +1490,18 @@ function applyTheme(element, theme) {
|
|
|
1444
1490
|
}
|
|
1445
1491
|
} else {
|
|
1446
1492
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
1447
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1493
|
+
if (_optionalChain([theme, 'optionalAccess', _55 => _55.ctaHoverColor])) {
|
|
1448
1494
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
1449
1495
|
}
|
|
1450
1496
|
}
|
|
1451
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1497
|
+
if (_optionalChain([theme, 'optionalAccess', _56 => _56.borderColor])) {
|
|
1452
1498
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
1453
1499
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
1454
1500
|
}
|
|
1455
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1501
|
+
if (_optionalChain([theme, 'optionalAccess', _57 => _57.backgroundColor])) {
|
|
1456
1502
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
1457
1503
|
}
|
|
1458
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1504
|
+
if (_optionalChain([theme, 'optionalAccess', _58 => _58.radius])) {
|
|
1459
1505
|
const scale = RADIUS_SCALE[theme.radius];
|
|
1460
1506
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
1461
1507
|
setVar(targets, "--rs-radius-md", scale.md);
|
|
@@ -1631,7 +1677,7 @@ function ListRow({
|
|
|
1631
1677
|
if (disabled) return;
|
|
1632
1678
|
if (e.key === "Enter" || e.key === " ") {
|
|
1633
1679
|
e.preventDefault();
|
|
1634
|
-
_optionalChain([onClick, 'optionalCall',
|
|
1680
|
+
_optionalChain([onClick, 'optionalCall', _59 => _59(e)]);
|
|
1635
1681
|
}
|
|
1636
1682
|
};
|
|
1637
1683
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1641,7 +1687,7 @@ function ListRow({
|
|
|
1641
1687
|
role: "button",
|
|
1642
1688
|
tabIndex: disabled ? -1 : 0,
|
|
1643
1689
|
"aria-disabled": disabled || void 0,
|
|
1644
|
-
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall',
|
|
1690
|
+
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall', _60 => _60(e)]),
|
|
1645
1691
|
onKeyDown: handleKey,
|
|
1646
1692
|
children: inner
|
|
1647
1693
|
}
|
|
@@ -2011,7 +2057,7 @@ var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fra
|
|
|
2011
2057
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
2012
2058
|
"+100 wallets"
|
|
2013
2059
|
] });
|
|
2014
|
-
var EXTRA_CHAIN_COUNT = Math.max(0,
|
|
2060
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, _chunkMILJQWPTcjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
2015
2061
|
var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2016
2062
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
2017
2063
|
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT} chains` : "All chains"
|
|
@@ -2045,7 +2091,7 @@ function ConnectStep({
|
|
|
2045
2091
|
const hasReownWallet = rows.some(
|
|
2046
2092
|
(row) => row.kind === "external" || row.kind === "solana"
|
|
2047
2093
|
);
|
|
2048
|
-
const showDappImports = (_nullishCoalesce(_optionalChain([dappImports, 'optionalAccess',
|
|
2094
|
+
const showDappImports = (_nullishCoalesce(_optionalChain([dappImports, 'optionalAccess', _61 => _61.length]), () => ( 0))) > 0;
|
|
2049
2095
|
const defaultSubtitle = onSelectTransferCrypto ? "Add money to your balance" : "Choose a wallet to continue";
|
|
2050
2096
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2051
2097
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
@@ -2104,7 +2150,7 @@ function ConnectStep({
|
|
|
2104
2150
|
leading: renderWalletLeading(row),
|
|
2105
2151
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
2106
2152
|
subtitle: subtitleText,
|
|
2107
|
-
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall',
|
|
2153
|
+
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall', _62 => _62(row.id)]),
|
|
2108
2154
|
disabled: row.state === "loading",
|
|
2109
2155
|
trailing: renderRowTrailing(row.state)
|
|
2110
2156
|
},
|
|
@@ -2121,7 +2167,7 @@ function ConnectStep({
|
|
|
2121
2167
|
onClick: handleConnect
|
|
2122
2168
|
}
|
|
2123
2169
|
),
|
|
2124
|
-
showDappImports && _optionalChain([dappImports, 'optionalAccess',
|
|
2170
|
+
showDappImports && _optionalChain([dappImports, 'optionalAccess', _63 => _63.map, 'call', _64 => _64((row) => {
|
|
2125
2171
|
if (!hasReownWallet) {
|
|
2126
2172
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2127
2173
|
ListRow,
|
|
@@ -2155,7 +2201,7 @@ function ConnectStep({
|
|
|
2155
2201
|
leading: row.icon,
|
|
2156
2202
|
title: row.label,
|
|
2157
2203
|
subtitle: formatBalanceUsd(row.status.balanceUsd),
|
|
2158
|
-
onClick: () => _optionalChain([onSelectDappImport, 'optionalCall',
|
|
2204
|
+
onClick: () => _optionalChain([onSelectDappImport, 'optionalCall', _65 => _65(row.id)])
|
|
2159
2205
|
},
|
|
2160
2206
|
row.id
|
|
2161
2207
|
);
|
|
@@ -2167,7 +2213,7 @@ function ConnectStep({
|
|
|
2167
2213
|
leading: row.icon,
|
|
2168
2214
|
title: row.label,
|
|
2169
2215
|
subtitle: row.status.reason,
|
|
2170
|
-
onClick: () => _optionalChain([onSelectDappImport, 'optionalCall',
|
|
2216
|
+
onClick: () => _optionalChain([onSelectDappImport, 'optionalCall', _66 => _66(row.id)])
|
|
2171
2217
|
},
|
|
2172
2218
|
row.id
|
|
2173
2219
|
);
|
|
@@ -2201,7 +2247,7 @@ ConnectStep.displayName = "ConnectStep";
|
|
|
2201
2247
|
|
|
2202
2248
|
// src/components/steps/ProcessingStep.tsx
|
|
2203
2249
|
|
|
2204
|
-
|
|
2250
|
+
|
|
2205
2251
|
|
|
2206
2252
|
// src/components/ui/Button.tsx
|
|
2207
2253
|
|
|
@@ -2272,8 +2318,8 @@ function Tooltip({ content, children, className }) {
|
|
|
2272
2318
|
function handleOutside(event) {
|
|
2273
2319
|
const target = event.target;
|
|
2274
2320
|
if (!target) return;
|
|
2275
|
-
if (_optionalChain([triggerRef, 'access',
|
|
2276
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
2321
|
+
if (_optionalChain([triggerRef, 'access', _67 => _67.current, 'optionalAccess', _68 => _68.contains, 'call', _69 => _69(target)])) return;
|
|
2322
|
+
if (_optionalChain([bubbleRef, 'access', _70 => _70.current, 'optionalAccess', _71 => _71.contains, 'call', _72 => _72(target)])) return;
|
|
2277
2323
|
setOpen(false);
|
|
2278
2324
|
}
|
|
2279
2325
|
function handleKey(event) {
|
|
@@ -2340,46 +2386,6 @@ function Tooltip({ content, children, className }) {
|
|
|
2340
2386
|
}
|
|
2341
2387
|
Tooltip.displayName = "Tooltip";
|
|
2342
2388
|
|
|
2343
|
-
// src/components/ui/Callout.tsx
|
|
2344
|
-
|
|
2345
|
-
function CircleAlertIcon() {
|
|
2346
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2347
|
-
"svg",
|
|
2348
|
-
{
|
|
2349
|
-
width: "16",
|
|
2350
|
-
height: "16",
|
|
2351
|
-
viewBox: "0 0 16 16",
|
|
2352
|
-
fill: "none",
|
|
2353
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2354
|
-
"aria-hidden": "true",
|
|
2355
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2356
|
-
"path",
|
|
2357
|
-
{
|
|
2358
|
-
d: "M10 5.99L6 9.99M6 5.99L10 9.99M14.66 7.99C14.66 11.68 11.68 14.66 8 14.66C4.31 14.66 1.33 11.68 1.33 7.99C1.33 4.31 4.31 1.33 8 1.33C11.68 1.33 14.66 4.31 14.66 7.99Z",
|
|
2359
|
-
stroke: "currentColor",
|
|
2360
|
-
strokeWidth: "1.33",
|
|
2361
|
-
strokeLinecap: "round",
|
|
2362
|
-
strokeLinejoin: "round"
|
|
2363
|
-
}
|
|
2364
|
-
)
|
|
2365
|
-
}
|
|
2366
|
-
);
|
|
2367
|
-
}
|
|
2368
|
-
function Callout({ variant = "error", children, role }) {
|
|
2369
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2370
|
-
"div",
|
|
2371
|
-
{
|
|
2372
|
-
className: `rs-callout rs-callout--${variant}`,
|
|
2373
|
-
role: _nullishCoalesce(role, () => ( (variant === "error" ? "alert" : "status"))),
|
|
2374
|
-
children: [
|
|
2375
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-callout-icon", children: variant === "error" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CircleAlertIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertTriangleIcon, {}) }),
|
|
2376
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-callout-text", children })
|
|
2377
|
-
]
|
|
2378
|
-
}
|
|
2379
|
-
);
|
|
2380
|
-
}
|
|
2381
|
-
Callout.displayName = "Callout";
|
|
2382
|
-
|
|
2383
2389
|
// src/core/webhook.ts
|
|
2384
2390
|
function isRecord(value) {
|
|
2385
2391
|
return typeof value === "object" && value !== null;
|
|
@@ -2393,7 +2399,7 @@ function asNumber(value) {
|
|
|
2393
2399
|
const trimmed = value.trim();
|
|
2394
2400
|
if (!trimmed) return void 0;
|
|
2395
2401
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
2396
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
2402
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _73 => _73[1]])) {
|
|
2397
2403
|
const parsed2 = Number(caipMatch[1]);
|
|
2398
2404
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
2399
2405
|
}
|
|
@@ -2412,28 +2418,28 @@ function asAddress(value) {
|
|
|
2412
2418
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
2413
2419
|
}
|
|
2414
2420
|
function getEventTxHash(event) {
|
|
2415
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2421
|
+
if (!_optionalChain([event, 'optionalAccess', _74 => _74.type])) return void 0;
|
|
2416
2422
|
if (event.type === "deposit-received") {
|
|
2417
|
-
return asString(_optionalChain([event, 'access',
|
|
2423
|
+
return asString(_optionalChain([event, 'access', _75 => _75.data, 'optionalAccess', _76 => _76.transactionHash]));
|
|
2418
2424
|
}
|
|
2419
2425
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
2420
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
2421
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
2422
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
2426
|
+
const deposit = isRecord(_optionalChain([event, 'access', _77 => _77.data, 'optionalAccess', _78 => _78.deposit])) ? event.data.deposit : void 0;
|
|
2427
|
+
const source = isRecord(_optionalChain([event, 'access', _79 => _79.data, 'optionalAccess', _80 => _80.source])) ? event.data.source : void 0;
|
|
2428
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _81 => _81.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _82 => _82.transactionHash]))));
|
|
2423
2429
|
}
|
|
2424
2430
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
2425
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
2426
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
2427
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
2431
|
+
const deposit = isRecord(_optionalChain([event, 'access', _83 => _83.data, 'optionalAccess', _84 => _84.deposit])) ? event.data.deposit : void 0;
|
|
2432
|
+
const source = isRecord(_optionalChain([event, 'access', _85 => _85.data, 'optionalAccess', _86 => _86.source])) ? event.data.source : void 0;
|
|
2433
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _87 => _87.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _88 => _88.transactionHash]))));
|
|
2428
2434
|
}
|
|
2429
2435
|
if (event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
|
|
2430
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
2431
|
-
return asString(_optionalChain([deposit, 'optionalAccess',
|
|
2436
|
+
const deposit = isRecord(_optionalChain([event, 'access', _89 => _89.data, 'optionalAccess', _90 => _90.deposit])) ? event.data.deposit : void 0;
|
|
2437
|
+
return asString(_optionalChain([deposit, 'optionalAccess', _91 => _91.transactionHash]));
|
|
2432
2438
|
}
|
|
2433
2439
|
return void 0;
|
|
2434
2440
|
}
|
|
2435
2441
|
function getEventSourceDetails(event) {
|
|
2436
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2442
|
+
if (!_optionalChain([event, 'optionalAccess', _92 => _92.type]) || !isRecord(event.data)) return {};
|
|
2437
2443
|
if (event.type === "deposit-received") {
|
|
2438
2444
|
return {
|
|
2439
2445
|
chainId: asNumber(event.data.chain),
|
|
@@ -2445,18 +2451,18 @@ function getEventSourceDetails(event) {
|
|
|
2445
2451
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
2446
2452
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error" || event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
|
|
2447
2453
|
return {
|
|
2448
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
2449
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
2450
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
2454
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _93 => _93.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _94 => _94.chain])))),
|
|
2455
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _95 => _95.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _96 => _96.amount])))),
|
|
2456
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _97 => _97.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _98 => _98.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _99 => _99.token]))))
|
|
2451
2457
|
};
|
|
2452
2458
|
}
|
|
2453
2459
|
return {};
|
|
2454
2460
|
}
|
|
2455
2461
|
function isDepositEvent(event) {
|
|
2456
|
-
return _optionalChain([event, 'optionalAccess',
|
|
2462
|
+
return _optionalChain([event, 'optionalAccess', _100 => _100.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _101 => _101.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _102 => _102.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _103 => _103.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _104 => _104.type]) === "post-bridge-swap-complete" || _optionalChain([event, 'optionalAccess', _105 => _105.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _106 => _106.type]) === "error";
|
|
2457
2463
|
}
|
|
2458
2464
|
function isFailedEvent(event) {
|
|
2459
|
-
return _optionalChain([event, 'optionalAccess',
|
|
2465
|
+
return _optionalChain([event, 'optionalAccess', _107 => _107.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _108 => _108.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _109 => _109.type]) === "error";
|
|
2460
2466
|
}
|
|
2461
2467
|
function isHexString(value) {
|
|
2462
2468
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -2468,7 +2474,7 @@ function txRefsMatch(a, b) {
|
|
|
2468
2474
|
return a === b;
|
|
2469
2475
|
}
|
|
2470
2476
|
function formatBridgeFailedMessage(event) {
|
|
2471
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
2477
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _110 => _110.data]), () => ( {}));
|
|
2472
2478
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
2473
2479
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
2474
2480
|
function toUserFacingFailure(raw) {
|
|
@@ -2496,7 +2502,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
2496
2502
|
return { message: "Bridge failed" };
|
|
2497
2503
|
}
|
|
2498
2504
|
function failureMessageForEvent(event) {
|
|
2499
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
2505
|
+
if (_optionalChain([event, 'optionalAccess', _111 => _111.type]) === "error") {
|
|
2500
2506
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
2501
2507
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
2502
2508
|
}
|
|
@@ -2593,6 +2599,27 @@ function maxFractionDigitsFor(symbol) {
|
|
|
2593
2599
|
if (!symbol) return 6;
|
|
2594
2600
|
return STABLECOIN_SYMBOLS.has(symbol.toUpperCase()) ? 3 : 6;
|
|
2595
2601
|
}
|
|
2602
|
+
var PAYMENT_METHOD_LABELS = {
|
|
2603
|
+
creditcard: "Card",
|
|
2604
|
+
debitcard: "Card",
|
|
2605
|
+
card: "Card",
|
|
2606
|
+
applepay: "Apple Pay",
|
|
2607
|
+
googlepay: "Google Pay",
|
|
2608
|
+
"bank-transfer": "Bank Transfer",
|
|
2609
|
+
banktransfer: "Bank Transfer",
|
|
2610
|
+
sepa: "SEPA",
|
|
2611
|
+
"open-banking": "Open Banking",
|
|
2612
|
+
"krak-pay": "Kraken Pay",
|
|
2613
|
+
krakpay: "Kraken Pay",
|
|
2614
|
+
kraken: "Kraken",
|
|
2615
|
+
coinbase: "Coinbase",
|
|
2616
|
+
binance: "Binance"
|
|
2617
|
+
};
|
|
2618
|
+
function formatPaymentMethod(method) {
|
|
2619
|
+
const key = method.trim().toLowerCase();
|
|
2620
|
+
if (PAYMENT_METHOD_LABELS[key]) return PAYMENT_METHOD_LABELS[key];
|
|
2621
|
+
return key.replace(/[-_]+/g, " ").split(" ").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
2622
|
+
}
|
|
2596
2623
|
function loadPhaseTimings(txHash) {
|
|
2597
2624
|
if (typeof window === "undefined") return null;
|
|
2598
2625
|
try {
|
|
@@ -2621,12 +2648,12 @@ function isEventForTx(event, txHash) {
|
|
|
2621
2648
|
return txRefsMatch(eventTxHash, txHash);
|
|
2622
2649
|
}
|
|
2623
2650
|
function parseWebhookTimestamp(event) {
|
|
2624
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
2651
|
+
if (typeof _optionalChain([event, 'optionalAccess', _112 => _112.time]) !== "string") return void 0;
|
|
2625
2652
|
const timestamp = Date.parse(event.time);
|
|
2626
2653
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
2627
2654
|
}
|
|
2628
2655
|
function syncPhaseTimings(previous, event) {
|
|
2629
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2656
|
+
if (!_optionalChain([event, 'optionalAccess', _113 => _113.type])) return previous;
|
|
2630
2657
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
2631
2658
|
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;
|
|
2632
2659
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "post-bridge-swap-complete") && previous.bridgingAt === void 0;
|
|
@@ -2688,9 +2715,9 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
2688
2715
|
if (state.type === "complete") {
|
|
2689
2716
|
return void 0;
|
|
2690
2717
|
}
|
|
2691
|
-
if (_optionalChain([state, 'access',
|
|
2718
|
+
if (_optionalChain([state, 'access', _114 => _114.lastEvent, 'optionalAccess', _115 => _115.type]) === "bridge-started" || _optionalChain([state, 'access', _116 => _116.lastEvent, 'optionalAccess', _117 => _117.type]) === "bridge-complete")
|
|
2692
2719
|
return "bridging";
|
|
2693
|
-
if (_optionalChain([state, 'access',
|
|
2720
|
+
if (_optionalChain([state, 'access', _118 => _118.lastEvent, 'optionalAccess', _119 => _119.type]) === "deposit-received") return "received";
|
|
2694
2721
|
return "confirming";
|
|
2695
2722
|
}
|
|
2696
2723
|
function ProcessingStep({
|
|
@@ -2703,6 +2730,7 @@ function ProcessingStep({
|
|
|
2703
2730
|
amount,
|
|
2704
2731
|
sourceSymbol: providedSourceSymbol,
|
|
2705
2732
|
sourceDecimals: providedSourceDecimals,
|
|
2733
|
+
amountUsd,
|
|
2706
2734
|
hasPostBridgeActions,
|
|
2707
2735
|
service,
|
|
2708
2736
|
directTransfer,
|
|
@@ -2713,6 +2741,7 @@ function ProcessingStep({
|
|
|
2713
2741
|
quotedFeeAmount,
|
|
2714
2742
|
quotedFeeSymbol,
|
|
2715
2743
|
balanceAfterUsd,
|
|
2744
|
+
isSwappedOrder,
|
|
2716
2745
|
onClose,
|
|
2717
2746
|
onNewDeposit,
|
|
2718
2747
|
onRetry,
|
|
@@ -2728,6 +2757,8 @@ function ProcessingStep({
|
|
|
2728
2757
|
amount,
|
|
2729
2758
|
sourceChain,
|
|
2730
2759
|
sourceToken,
|
|
2760
|
+
sourceDecimals: providedSourceDecimals,
|
|
2761
|
+
amountUsd,
|
|
2731
2762
|
targetChain,
|
|
2732
2763
|
targetToken,
|
|
2733
2764
|
hasPostBridgeActions
|
|
@@ -2771,10 +2802,12 @@ function ProcessingStep({
|
|
|
2771
2802
|
flowLabel
|
|
2772
2803
|
});
|
|
2773
2804
|
const context = processingContextRef.current;
|
|
2774
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2805
|
+
_optionalChain([onDepositCompleteRef, 'access', _120 => _120.current, 'optionalCall', _121 => _121(txHash, void 0, {
|
|
2775
2806
|
amount: context.amount,
|
|
2776
2807
|
sourceChain: context.sourceChain,
|
|
2777
2808
|
sourceToken: context.sourceToken,
|
|
2809
|
+
sourceDecimals: context.sourceDecimals,
|
|
2810
|
+
amountUsd: context.amountUsd,
|
|
2778
2811
|
targetChain: context.targetChain,
|
|
2779
2812
|
targetToken: context.targetToken
|
|
2780
2813
|
})]);
|
|
@@ -2811,14 +2844,17 @@ function ProcessingStep({
|
|
|
2811
2844
|
updatePhaseTimings(
|
|
2812
2845
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
2813
2846
|
);
|
|
2814
|
-
}, [_optionalChain([state, 'access',
|
|
2847
|
+
}, [_optionalChain([state, 'access', _122 => _122.lastEvent, 'optionalAccess', _123 => _123.time]), _optionalChain([state, 'access', _124 => _124.lastEvent, 'optionalAccess', _125 => _125.type]), updatePhaseTimings]);
|
|
2815
2848
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
2816
2849
|
_react.useEffect.call(void 0, () => {
|
|
2817
2850
|
let cancelled = false;
|
|
2818
2851
|
service.fetchSwappedOrderStatus(smartAccount).then((res) => {
|
|
2819
2852
|
if (cancelled || !res) return;
|
|
2820
|
-
if (
|
|
2821
|
-
|
|
2853
|
+
if (res.transactionId != null) {
|
|
2854
|
+
if (res.transactionId.toLowerCase() !== txHash.toLowerCase()) return;
|
|
2855
|
+
} else if (!isSwappedOrder) {
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2822
2858
|
setSwappedFiatContext({
|
|
2823
2859
|
paidAmountUsd: res.paidAmountUsd,
|
|
2824
2860
|
paidAmountEur: res.paidAmountEur,
|
|
@@ -2830,7 +2866,7 @@ function ProcessingStep({
|
|
|
2830
2866
|
return () => {
|
|
2831
2867
|
cancelled = true;
|
|
2832
2868
|
};
|
|
2833
|
-
}, [service, smartAccount, txHash]);
|
|
2869
|
+
}, [service, smartAccount, txHash, isSwappedOrder]);
|
|
2834
2870
|
_react.useEffect.call(void 0, () => {
|
|
2835
2871
|
if (directTransfer) return;
|
|
2836
2872
|
if (state.type !== "processing") {
|
|
@@ -2855,30 +2891,32 @@ function ProcessingStep({
|
|
|
2855
2891
|
debugLog(debug, "processing", "poll:event", {
|
|
2856
2892
|
type: lastEvent2.type,
|
|
2857
2893
|
matchesTx: eventMatchesTx,
|
|
2858
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
2894
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _126 => _126.intentId])
|
|
2859
2895
|
});
|
|
2860
2896
|
}
|
|
2861
2897
|
if (!isMounted) return;
|
|
2862
2898
|
const awaitingPostBridgeSwap = processingContextRef.current.hasPostBridgeActions;
|
|
2863
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2899
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _127 => _127.type]) === "post-bridge-swap-complete") {
|
|
2864
2900
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
2865
|
-
const swapTxHash = _optionalChain([eventForCurrentTx, 'access',
|
|
2901
|
+
const swapTxHash = _optionalChain([eventForCurrentTx, 'access', _128 => _128.data, 'optionalAccess', _129 => _129.swap, 'optionalAccess', _130 => _130.transactionHash]);
|
|
2866
2902
|
debugLog(debug, "processing", "state:complete", {
|
|
2867
2903
|
txHash,
|
|
2868
2904
|
destinationTxHash: swapTxHash,
|
|
2869
2905
|
event: eventForCurrentTx.type
|
|
2870
2906
|
});
|
|
2871
2907
|
const context = processingContextRef.current;
|
|
2872
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2908
|
+
_optionalChain([onDepositCompleteRef, 'access', _131 => _131.current, 'optionalCall', _132 => _132(txHash, swapTxHash, {
|
|
2873
2909
|
amount: context.amount,
|
|
2874
2910
|
sourceChain: context.sourceChain,
|
|
2875
2911
|
sourceToken: context.sourceToken,
|
|
2912
|
+
sourceDecimals: context.sourceDecimals,
|
|
2913
|
+
amountUsd: context.amountUsd,
|
|
2876
2914
|
targetChain: context.targetChain,
|
|
2877
2915
|
targetToken: context.targetToken
|
|
2878
2916
|
})]);
|
|
2879
2917
|
return;
|
|
2880
2918
|
}
|
|
2881
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2919
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _133 => _133.type]) === "post-bridge-swap-failed") {
|
|
2882
2920
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
2883
2921
|
setState({
|
|
2884
2922
|
type: "failed",
|
|
@@ -2890,28 +2928,30 @@ function ProcessingStep({
|
|
|
2890
2928
|
message: formatted.message,
|
|
2891
2929
|
code: formatted.code
|
|
2892
2930
|
});
|
|
2893
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2931
|
+
_optionalChain([onDepositFailedRef, 'access', _134 => _134.current, 'optionalCall', _135 => _135(txHash, formatted.message)]);
|
|
2894
2932
|
return;
|
|
2895
2933
|
}
|
|
2896
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2934
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _136 => _136.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
2897
2935
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
2898
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
2936
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _137 => _137.data, 'optionalAccess', _138 => _138.destination, 'optionalAccess', _139 => _139.transactionHash]);
|
|
2899
2937
|
debugLog(debug, "processing", "state:complete", {
|
|
2900
2938
|
txHash,
|
|
2901
2939
|
destinationTxHash: destinationTxHash2,
|
|
2902
2940
|
event: eventForCurrentTx.type
|
|
2903
2941
|
});
|
|
2904
2942
|
const context = processingContextRef.current;
|
|
2905
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2943
|
+
_optionalChain([onDepositCompleteRef, 'access', _140 => _140.current, 'optionalCall', _141 => _141(txHash, destinationTxHash2, {
|
|
2906
2944
|
amount: context.amount,
|
|
2907
2945
|
sourceChain: context.sourceChain,
|
|
2908
2946
|
sourceToken: context.sourceToken,
|
|
2947
|
+
sourceDecimals: context.sourceDecimals,
|
|
2948
|
+
amountUsd: context.amountUsd,
|
|
2909
2949
|
targetChain: context.targetChain,
|
|
2910
2950
|
targetToken: context.targetToken
|
|
2911
2951
|
})]);
|
|
2912
2952
|
return;
|
|
2913
2953
|
}
|
|
2914
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2954
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _142 => _142.type]) === "bridge-failed") {
|
|
2915
2955
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
2916
2956
|
setState({
|
|
2917
2957
|
type: "failed",
|
|
@@ -2923,11 +2963,11 @@ function ProcessingStep({
|
|
|
2923
2963
|
message: formatted.message,
|
|
2924
2964
|
code: formatted.code
|
|
2925
2965
|
});
|
|
2926
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2966
|
+
_optionalChain([onDepositFailedRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144(txHash, formatted.message)]);
|
|
2927
2967
|
return;
|
|
2928
2968
|
}
|
|
2929
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2930
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
2969
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _145 => _145.type]) === "error") {
|
|
2970
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _146 => _146.data, 'optionalAccess', _147 => _147.message]), () => ( "Unknown error"));
|
|
2931
2971
|
setState({
|
|
2932
2972
|
type: "failed",
|
|
2933
2973
|
message: errorMessage,
|
|
@@ -2937,7 +2977,7 @@ function ProcessingStep({
|
|
|
2937
2977
|
txHash,
|
|
2938
2978
|
message: errorMessage
|
|
2939
2979
|
});
|
|
2940
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2980
|
+
_optionalChain([onDepositFailedRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149(txHash, errorMessage)]);
|
|
2941
2981
|
return;
|
|
2942
2982
|
}
|
|
2943
2983
|
setState((previous) => ({
|
|
@@ -2998,7 +3038,7 @@ function ProcessingStep({
|
|
|
2998
3038
|
txHash,
|
|
2999
3039
|
timeoutMs: ESCALATED_DELAY_MS
|
|
3000
3040
|
});
|
|
3001
|
-
_optionalChain([onErrorRef, 'access',
|
|
3041
|
+
_optionalChain([onErrorRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151(message, "PROCESS_TIMEOUT")]);
|
|
3002
3042
|
}, ESCALATED_DELAY_MS);
|
|
3003
3043
|
return () => clearTimeout(timeoutId);
|
|
3004
3044
|
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
@@ -3010,17 +3050,17 @@ function ProcessingStep({
|
|
|
3010
3050
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
3011
3051
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
3012
3052
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
3013
|
-
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess',
|
|
3014
|
-
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess',
|
|
3053
|
+
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess', _152 => _152.type]) === "post-bridge-swap-complete" || _optionalChain([lastEvent, 'optionalAccess', _153 => _153.type]) === "post-bridge-swap-failed";
|
|
3054
|
+
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _154 => _154.data, 'optionalAccess', _155 => _155.swap, 'optionalAccess', _156 => _156.transactionHash]) || null : _optionalChain([lastEvent, 'optionalAccess', _157 => _157.data, 'optionalAccess', _158 => _158.destination, 'optionalAccess', _159 => _159.transactionHash]) || null;
|
|
3015
3055
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
3016
3056
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
3017
3057
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
3018
3058
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
3019
|
-
const sourceExplorerUrl =
|
|
3020
|
-
const destExplorerUrl = destinationTxHash ?
|
|
3059
|
+
const sourceExplorerUrl = _chunkMILJQWPTcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
|
|
3060
|
+
const destExplorerUrl = destinationTxHash ? _chunkMILJQWPTcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
3021
3061
|
const isEvmSourceToken = /^0x[a-fA-F0-9]{40}$/.test(displaySourceToken);
|
|
3022
|
-
const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ?
|
|
3023
|
-
const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ?
|
|
3062
|
+
const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ? _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceSymbol, () => ( "Token"));
|
|
3063
|
+
const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ? _chunkMILJQWPTcjs.getTokenDecimalsByAddress.call(void 0,
|
|
3024
3064
|
displaySourceToken,
|
|
3025
3065
|
displaySourceChain
|
|
3026
3066
|
) : _nullishCoalesce(providedSourceDecimals, () => ( 18));
|
|
@@ -3042,7 +3082,7 @@ function ProcessingStep({
|
|
|
3042
3082
|
}
|
|
3043
3083
|
})();
|
|
3044
3084
|
const destinationAmountRaw = (() => {
|
|
3045
|
-
const dest = _optionalChain([lastEvent, 'optionalAccess',
|
|
3085
|
+
const dest = _optionalChain([lastEvent, 'optionalAccess', _160 => _160.data, 'optionalAccess', _161 => _161.destination]);
|
|
3046
3086
|
if (!dest || dest.amount === void 0) return void 0;
|
|
3047
3087
|
try {
|
|
3048
3088
|
return BigInt(dest.amount);
|
|
@@ -3064,6 +3104,7 @@ function ProcessingStep({
|
|
|
3064
3104
|
const numeric = Number(raw);
|
|
3065
3105
|
if (!Number.isFinite(numeric)) return raw;
|
|
3066
3106
|
return numeric.toLocaleString("en-US", {
|
|
3107
|
+
minimumFractionDigits: 2,
|
|
3067
3108
|
maximumFractionDigits: amountMaxDigits
|
|
3068
3109
|
});
|
|
3069
3110
|
} catch (e9) {
|
|
@@ -3076,6 +3117,7 @@ function ProcessingStep({
|
|
|
3076
3117
|
const numeric = Number(raw);
|
|
3077
3118
|
if (!Number.isFinite(numeric)) return raw;
|
|
3078
3119
|
return numeric.toLocaleString("en-US", {
|
|
3120
|
+
minimumFractionDigits: 2,
|
|
3079
3121
|
maximumFractionDigits: amountMaxDigits
|
|
3080
3122
|
});
|
|
3081
3123
|
} catch (e10) {
|
|
@@ -3089,18 +3131,18 @@ function ProcessingStep({
|
|
|
3089
3131
|
void delayPhaseId;
|
|
3090
3132
|
void hasEscalatedDelay;
|
|
3091
3133
|
const targetSymbol = (() => {
|
|
3092
|
-
const resolved =
|
|
3134
|
+
const resolved = _chunkMILJQWPTcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3093
3135
|
return resolved !== "Token" ? resolved : _nullishCoalesce(providedSourceSymbol, () => ( "USDC"));
|
|
3094
3136
|
})();
|
|
3095
|
-
const targetTokenIcon =
|
|
3096
|
-
const sourceChainIcon =
|
|
3097
|
-
const targetChainIcon =
|
|
3098
|
-
const sourceTokenIcon =
|
|
3099
|
-
const sourceChainName =
|
|
3100
|
-
const targetChainName =
|
|
3137
|
+
const targetTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
3138
|
+
const sourceChainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, displaySourceChain);
|
|
3139
|
+
const targetChainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain);
|
|
3140
|
+
const sourceTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
3141
|
+
const sourceChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, displaySourceChain);
|
|
3142
|
+
const targetChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
3101
3143
|
const timerText = formatTimer(elapsedSeconds);
|
|
3102
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3103
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3144
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _162 => _162.feeSponsored]), () => ( false));
|
|
3145
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _163 => _163.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3104
3146
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
3105
3147
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
3106
3148
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -3154,18 +3196,18 @@ function ProcessingStep({
|
|
|
3154
3196
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isProcessing ? "Time elapsed" : "Total time" }),
|
|
3155
3197
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
3156
3198
|
] }),
|
|
3157
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3158
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "
|
|
3199
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _164 => _164.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3200
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
3159
3201
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3160
3202
|
"$",
|
|
3161
3203
|
swappedFiatContext.paidAmountUsd.toFixed(2),
|
|
3162
3204
|
swappedFiatContext.paymentMethod && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "#71717b", marginLeft: 6 }, children: [
|
|
3163
3205
|
"via ",
|
|
3164
|
-
swappedFiatContext.paymentMethod
|
|
3206
|
+
formatPaymentMethod(swappedFiatContext.paymentMethod)
|
|
3165
3207
|
] })
|
|
3166
3208
|
] })
|
|
3167
3209
|
] }),
|
|
3168
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3210
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _165 => _165.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3169
3211
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
3170
3212
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3171
3213
|
"$",
|
|
@@ -3320,7 +3362,7 @@ async function executeSafeEthTransfer(params) {
|
|
|
3320
3362
|
throw new Error("Wallet not connected");
|
|
3321
3363
|
}
|
|
3322
3364
|
if (chain.id !== chainId) {
|
|
3323
|
-
throw new Error(`Switch to ${
|
|
3365
|
+
throw new Error(`Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, chainId)} to sign`);
|
|
3324
3366
|
}
|
|
3325
3367
|
const isOwner = await publicClient.readContract({
|
|
3326
3368
|
address: safeAddress,
|
|
@@ -3403,7 +3445,7 @@ async function executeSafeErc20Transfer(params) {
|
|
|
3403
3445
|
throw new Error("Wallet not connected");
|
|
3404
3446
|
}
|
|
3405
3447
|
if (chain.id !== chainId) {
|
|
3406
|
-
throw new Error(`Switch to ${
|
|
3448
|
+
throw new Error(`Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, chainId)} to sign`);
|
|
3407
3449
|
}
|
|
3408
3450
|
const isOwner = await publicClient.readContract({
|
|
3409
3451
|
address: safeAddress,
|
|
@@ -3527,22 +3569,6 @@ async function buildSafeTransaction(params) {
|
|
|
3527
3569
|
};
|
|
3528
3570
|
}
|
|
3529
3571
|
|
|
3530
|
-
// src/core/public-client.ts
|
|
3531
|
-
|
|
3532
|
-
var clientCache = /* @__PURE__ */ new Map();
|
|
3533
|
-
function getPublicClient(chainId) {
|
|
3534
|
-
let client = clientCache.get(chainId);
|
|
3535
|
-
if (!client) {
|
|
3536
|
-
const chain = _chunk7JIDIX27cjs.CHAIN_BY_ID[chainId];
|
|
3537
|
-
client = _viem.createPublicClient.call(void 0, {
|
|
3538
|
-
chain,
|
|
3539
|
-
transport: _viem.http.call(void 0, )
|
|
3540
|
-
});
|
|
3541
|
-
clientCache.set(chainId, client);
|
|
3542
|
-
}
|
|
3543
|
-
return client;
|
|
3544
|
-
}
|
|
3545
|
-
|
|
3546
3572
|
// src/core/session-owner.ts
|
|
3547
3573
|
|
|
3548
3574
|
|
|
@@ -3649,7 +3675,4 @@ function accountFromPrivateKey(privateKey) {
|
|
|
3649
3675
|
|
|
3650
3676
|
|
|
3651
3677
|
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
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.BodyHeader = BodyHeader; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.ConnectStep = ConnectStep; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.Callout = Callout; exports.debugLog = debugLog; exports.debugError = debugError; exports.toEvmCaip2 = toEvmCaip2; exports.targetChainToCaip2 = targetChainToCaip2; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; 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.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.ProcessingStep = ProcessingStep; exports.SAFE_ABI = SAFE_ABI; exports.executeSafeEthTransfer = executeSafeEthTransfer; exports.executeSafeErc20Transfer = executeSafeErc20Transfer; exports.buildSafeTransaction = buildSafeTransaction; exports.getPublicClient = getPublicClient; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.applyTheme = applyTheme;
|
|
3678
|
+
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.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.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.ProcessingStep = ProcessingStep; exports.SAFE_ABI = SAFE_ABI; exports.executeSafeEthTransfer = executeSafeEthTransfer; exports.executeSafeErc20Transfer = executeSafeErc20Transfer; exports.buildSafeTransaction = buildSafeTransaction; exports.getPublicClient = getPublicClient; exports.getHyperEvmReadClient = getHyperEvmReadClient; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.applyTheme = applyTheme;
|