@rhinestone/deposit-modal 0.1.55 → 0.1.57
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-5QKEE7R3.mjs → DepositModalReown-C3WPJW3E.mjs} +2 -2
- package/dist/{DepositModalReown-XKP2Z55X.cjs → DepositModalReown-KONUZXHJ.cjs} +3 -3
- package/dist/{WithdrawModalReown-K57JK52O.mjs → WithdrawModalReown-PFGUPZFN.mjs} +2 -2
- package/dist/{WithdrawModalReown-CN2NJUYL.cjs → WithdrawModalReown-TUBSUJQ6.cjs} +3 -3
- package/dist/{chunk-QOEACKBH.mjs → chunk-3ESBSOB7.mjs} +2 -2
- package/dist/{chunk-XMNGYDDB.cjs → chunk-3FEFGN7H.cjs} +33 -33
- package/dist/{chunk-JQTV5JTB.mjs → chunk-7TTEHQBD.mjs} +28 -16
- package/dist/{chunk-EAEDK474.cjs → chunk-TQ6IIGRS.cjs} +77 -65
- package/dist/{chunk-AJUR6FAP.mjs → chunk-VOGD6Y4U.mjs} +2 -2
- package/dist/{chunk-QJVXCBUI.cjs → chunk-Z2TKNB6C.cjs} +82 -82
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +4 -4
- package/dist/reown.mjs +3 -3
- package/dist/styles.css +5 -1
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -810,45 +810,57 @@ function formatUserError(raw) {
|
|
|
810
810
|
}
|
|
811
811
|
|
|
812
812
|
// src/core/theme.ts
|
|
813
|
-
var
|
|
814
|
-
none: "0",
|
|
815
|
-
sm: "8px",
|
|
816
|
-
md: "10px",
|
|
817
|
-
lg: "14px",
|
|
818
|
-
full: "9999px"
|
|
813
|
+
var RADIUS_SCALE = {
|
|
814
|
+
none: { sm: "0", md: "0", lg: "0" },
|
|
815
|
+
sm: { sm: "4px", md: "6px", lg: "8px" },
|
|
816
|
+
md: { sm: "8px", md: "10px", lg: "14px" },
|
|
817
|
+
lg: { sm: "10px", md: "14px", lg: "18px" },
|
|
818
|
+
full: { sm: "9999px", md: "9999px", lg: "9999px" }
|
|
819
819
|
};
|
|
820
|
+
function setVar(targets, prop, value) {
|
|
821
|
+
for (const el of targets) {
|
|
822
|
+
el.style.setProperty(prop, value);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
820
825
|
function applyTheme(element, theme) {
|
|
821
826
|
if (!element) return;
|
|
822
|
-
|
|
827
|
+
const parent = element.parentElement;
|
|
828
|
+
const targets = _optionalChain([parent, 'optionalAccess', _38 => _38.classList, 'access', _39 => _39.contains, 'call', _40 => _40("rs-modal-content")]) ? [element, parent] : [element];
|
|
829
|
+
if (_optionalChain([theme, 'optionalAccess', _41 => _41.mode])) {
|
|
823
830
|
element.setAttribute("data-theme", theme.mode);
|
|
824
831
|
} else {
|
|
825
832
|
element.removeAttribute("data-theme");
|
|
826
833
|
}
|
|
827
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
828
|
-
|
|
834
|
+
if (_optionalChain([theme, 'optionalAccess', _42 => _42.fontColor])) {
|
|
835
|
+
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
829
836
|
}
|
|
830
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
831
|
-
|
|
837
|
+
if (_optionalChain([theme, 'optionalAccess', _43 => _43.iconColor])) {
|
|
838
|
+
setVar(targets, "--rs-icon", theme.iconColor);
|
|
832
839
|
}
|
|
833
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
840
|
+
if (_optionalChain([theme, 'optionalAccess', _44 => _44.ctaColor])) {
|
|
841
|
+
setVar(targets, "--rs-primary", theme.ctaColor);
|
|
842
|
+
setVar(targets, "--rs-border-accent", theme.ctaColor);
|
|
843
|
+
setVar(
|
|
844
|
+
targets,
|
|
837
845
|
"--rs-primary-hover",
|
|
838
846
|
_nullishCoalesce(theme.ctaHoverColor, () => ( theme.ctaColor))
|
|
839
847
|
);
|
|
840
|
-
} else if (_optionalChain([theme, 'optionalAccess',
|
|
841
|
-
|
|
848
|
+
} else if (_optionalChain([theme, 'optionalAccess', _45 => _45.ctaHoverColor])) {
|
|
849
|
+
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
842
850
|
}
|
|
843
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
844
|
-
|
|
845
|
-
|
|
851
|
+
if (_optionalChain([theme, 'optionalAccess', _46 => _46.borderColor])) {
|
|
852
|
+
setVar(targets, "--rs-border", theme.borderColor);
|
|
853
|
+
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
846
854
|
}
|
|
847
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
848
|
-
|
|
855
|
+
if (_optionalChain([theme, 'optionalAccess', _47 => _47.backgroundColor])) {
|
|
856
|
+
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
849
857
|
}
|
|
850
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
851
|
-
|
|
858
|
+
if (_optionalChain([theme, 'optionalAccess', _48 => _48.radius])) {
|
|
859
|
+
const scale = RADIUS_SCALE[theme.radius];
|
|
860
|
+
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
861
|
+
setVar(targets, "--rs-radius-md", scale.md);
|
|
862
|
+
setVar(targets, "--rs-radius-lg", scale.lg);
|
|
863
|
+
setVar(targets, "--rs-radius", scale.md);
|
|
852
864
|
}
|
|
853
865
|
}
|
|
854
866
|
|
|
@@ -1009,16 +1021,16 @@ function ConnectStep({
|
|
|
1009
1021
|
continueButtonLabel = "Continue",
|
|
1010
1022
|
connectButtonLabel = "Connect external wallet"
|
|
1011
1023
|
}) {
|
|
1012
|
-
const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess',
|
|
1024
|
+
const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _49 => _49.length]), () => ( 0))) > 0;
|
|
1013
1025
|
if (hasWalletOptions) {
|
|
1014
|
-
const hasReownWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess',
|
|
1026
|
+
const hasReownWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _50 => _50.some, 'call', _51 => _51(
|
|
1015
1027
|
(option) => option.kind === "external" || option.kind === "solana"
|
|
1016
1028
|
)]), () => ( false));
|
|
1017
1029
|
const showConnectDifferentWalletOption = Boolean(onConnect) && !hasReownWallet;
|
|
1018
1030
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1019
1031
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-centered rs-connect-centered--wallets", children: [
|
|
1020
1032
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-list", children: [
|
|
1021
|
-
_optionalChain([walletOptions, 'optionalAccess',
|
|
1033
|
+
_optionalChain([walletOptions, 'optionalAccess', _52 => _52.map, 'call', _53 => _53((option) => {
|
|
1022
1034
|
const isSelected = option.id === selectedWalletId;
|
|
1023
1035
|
const rawAddress = _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id));
|
|
1024
1036
|
const shortAddress = rawAddress.length > 12 ? `${rawAddress.slice(0, 6)}...${rawAddress.slice(-4)}` : rawAddress;
|
|
@@ -1027,7 +1039,7 @@ function ConnectStep({
|
|
|
1027
1039
|
{
|
|
1028
1040
|
type: "button",
|
|
1029
1041
|
className: `rs-connect-wallet-row ${isSelected ? "rs-connect-wallet-row--selected" : ""}`,
|
|
1030
|
-
onClick: () => _optionalChain([onSelectWallet, 'optionalCall',
|
|
1042
|
+
onClick: () => _optionalChain([onSelectWallet, 'optionalCall', _54 => _54(option.id)]),
|
|
1031
1043
|
children: [
|
|
1032
1044
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1033
1045
|
"div",
|
|
@@ -1086,7 +1098,7 @@ function ConnectStep({
|
|
|
1086
1098
|
}
|
|
1087
1099
|
)
|
|
1088
1100
|
] }),
|
|
1089
|
-
(onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess',
|
|
1101
|
+
(onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess', _55 => _55.some, 'call', _56 => _56(
|
|
1090
1102
|
(option) => option.kind === "external" || option.kind === "solana"
|
|
1091
1103
|
)]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1092
1104
|
"button",
|
|
@@ -1303,7 +1315,7 @@ function asNumber(value) {
|
|
|
1303
1315
|
const trimmed = value.trim();
|
|
1304
1316
|
if (!trimmed) return void 0;
|
|
1305
1317
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
1306
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
1318
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _57 => _57[1]])) {
|
|
1307
1319
|
const parsed2 = Number(caipMatch[1]);
|
|
1308
1320
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
1309
1321
|
}
|
|
@@ -1322,24 +1334,24 @@ function asAddress(value) {
|
|
|
1322
1334
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
1323
1335
|
}
|
|
1324
1336
|
function getEventTxHash(event) {
|
|
1325
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1337
|
+
if (!_optionalChain([event, 'optionalAccess', _58 => _58.type])) return void 0;
|
|
1326
1338
|
if (event.type === "deposit-received") {
|
|
1327
|
-
return asString(_optionalChain([event, 'access',
|
|
1339
|
+
return asString(_optionalChain([event, 'access', _59 => _59.data, 'optionalAccess', _60 => _60.transactionHash]));
|
|
1328
1340
|
}
|
|
1329
1341
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
1330
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1331
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
1332
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
1342
|
+
const deposit = isRecord(_optionalChain([event, 'access', _61 => _61.data, 'optionalAccess', _62 => _62.deposit])) ? event.data.deposit : void 0;
|
|
1343
|
+
const source = isRecord(_optionalChain([event, 'access', _63 => _63.data, 'optionalAccess', _64 => _64.source])) ? event.data.source : void 0;
|
|
1344
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _65 => _65.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _66 => _66.transactionHash]))));
|
|
1333
1345
|
}
|
|
1334
1346
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
1335
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1336
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
1337
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
1347
|
+
const deposit = isRecord(_optionalChain([event, 'access', _67 => _67.data, 'optionalAccess', _68 => _68.deposit])) ? event.data.deposit : void 0;
|
|
1348
|
+
const source = isRecord(_optionalChain([event, 'access', _69 => _69.data, 'optionalAccess', _70 => _70.source])) ? event.data.source : void 0;
|
|
1349
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _71 => _71.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _72 => _72.transactionHash]))));
|
|
1338
1350
|
}
|
|
1339
1351
|
return void 0;
|
|
1340
1352
|
}
|
|
1341
1353
|
function getEventSourceDetails(event) {
|
|
1342
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1354
|
+
if (!_optionalChain([event, 'optionalAccess', _73 => _73.type]) || !isRecord(event.data)) return {};
|
|
1343
1355
|
if (event.type === "deposit-received") {
|
|
1344
1356
|
return {
|
|
1345
1357
|
chainId: asNumber(event.data.chain),
|
|
@@ -1351,15 +1363,15 @@ function getEventSourceDetails(event) {
|
|
|
1351
1363
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
1352
1364
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
1353
1365
|
return {
|
|
1354
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
1355
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
1356
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
1366
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _74 => _74.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _75 => _75.chain])))),
|
|
1367
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _76 => _76.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _77 => _77.amount])))),
|
|
1368
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _78 => _78.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _79 => _79.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _80 => _80.token]))))
|
|
1357
1369
|
};
|
|
1358
1370
|
}
|
|
1359
1371
|
return {};
|
|
1360
1372
|
}
|
|
1361
1373
|
function isDepositEvent(event) {
|
|
1362
|
-
return _optionalChain([event, 'optionalAccess',
|
|
1374
|
+
return _optionalChain([event, 'optionalAccess', _81 => _81.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _82 => _82.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _83 => _83.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _84 => _84.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _85 => _85.type]) === "error";
|
|
1363
1375
|
}
|
|
1364
1376
|
function isHexString(value) {
|
|
1365
1377
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -1414,7 +1426,7 @@ function isEventForTx(event, txHash) {
|
|
|
1414
1426
|
return txRefsMatch(eventTxHash, txHash);
|
|
1415
1427
|
}
|
|
1416
1428
|
function formatBridgeFailedMessage(event) {
|
|
1417
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1429
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _86 => _86.data]), () => ( {}));
|
|
1418
1430
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
1419
1431
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1420
1432
|
function toUserFacingFailure(raw) {
|
|
@@ -1446,12 +1458,12 @@ function formatBridgeFailedMessage(event) {
|
|
|
1446
1458
|
return { message: "Bridge failed" };
|
|
1447
1459
|
}
|
|
1448
1460
|
function parseWebhookTimestamp(event) {
|
|
1449
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
1461
|
+
if (typeof _optionalChain([event, 'optionalAccess', _87 => _87.time]) !== "string") return void 0;
|
|
1450
1462
|
const timestamp = Date.parse(event.time);
|
|
1451
1463
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
1452
1464
|
}
|
|
1453
1465
|
function syncPhaseTimings(previous, event) {
|
|
1454
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1466
|
+
if (!_optionalChain([event, 'optionalAccess', _88 => _88.type])) return previous;
|
|
1455
1467
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
1456
1468
|
const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") && previous.receivedAt === void 0;
|
|
1457
1469
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -1492,8 +1504,8 @@ function getCurrentPhaseId(state, phaseTimings, isEarlyComplete) {
|
|
|
1492
1504
|
if (state.type === "complete") {
|
|
1493
1505
|
return void 0;
|
|
1494
1506
|
}
|
|
1495
|
-
if (_optionalChain([state, 'access',
|
|
1496
|
-
if (_optionalChain([state, 'access',
|
|
1507
|
+
if (_optionalChain([state, 'access', _89 => _89.lastEvent, 'optionalAccess', _90 => _90.type]) === "bridge-started") return "bridging";
|
|
1508
|
+
if (_optionalChain([state, 'access', _91 => _91.lastEvent, 'optionalAccess', _92 => _92.type]) === "deposit-received") return "received";
|
|
1497
1509
|
return "confirming";
|
|
1498
1510
|
}
|
|
1499
1511
|
function ProcessingStep({
|
|
@@ -1546,7 +1558,7 @@ function ProcessingStep({
|
|
|
1546
1558
|
txHash,
|
|
1547
1559
|
flowLabel
|
|
1548
1560
|
});
|
|
1549
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1561
|
+
_optionalChain([onDepositComplete, 'optionalCall', _93 => _93(txHash, void 0, {
|
|
1550
1562
|
amount,
|
|
1551
1563
|
sourceChain,
|
|
1552
1564
|
sourceToken,
|
|
@@ -1587,7 +1599,7 @@ function ProcessingStep({
|
|
|
1587
1599
|
_react.useEffect.call(void 0, () => {
|
|
1588
1600
|
if (!state.lastEvent) return;
|
|
1589
1601
|
setPhaseTimings((previous) => syncPhaseTimings(previous, state.lastEvent));
|
|
1590
|
-
}, [_optionalChain([state, 'access',
|
|
1602
|
+
}, [_optionalChain([state, 'access', _94 => _94.lastEvent, 'optionalAccess', _95 => _95.time]), _optionalChain([state, 'access', _96 => _96.lastEvent, 'optionalAccess', _97 => _97.type])]);
|
|
1591
1603
|
_react.useEffect.call(void 0, () => {
|
|
1592
1604
|
savePhaseTimings(txHash, phaseTimings);
|
|
1593
1605
|
}, [txHash, phaseTimings]);
|
|
@@ -1614,19 +1626,19 @@ function ProcessingStep({
|
|
|
1614
1626
|
debugLog(debug, "processing", "poll:event", {
|
|
1615
1627
|
type: lastEvent2.type,
|
|
1616
1628
|
matchesTx: eventMatchesTx,
|
|
1617
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
1629
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _98 => _98.intentId])
|
|
1618
1630
|
});
|
|
1619
1631
|
}
|
|
1620
1632
|
if (!isMounted) return;
|
|
1621
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1633
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _99 => _99.type]) === "bridge-complete") {
|
|
1622
1634
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1623
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
1635
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _100 => _100.data, 'optionalAccess', _101 => _101.destination, 'optionalAccess', _102 => _102.transactionHash]);
|
|
1624
1636
|
debugLog(debug, "processing", "state:complete", {
|
|
1625
1637
|
txHash,
|
|
1626
1638
|
destinationTxHash: destinationTxHash2,
|
|
1627
1639
|
event: eventForCurrentTx.type
|
|
1628
1640
|
});
|
|
1629
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1641
|
+
_optionalChain([onDepositComplete, 'optionalCall', _103 => _103(txHash, destinationTxHash2, {
|
|
1630
1642
|
amount,
|
|
1631
1643
|
sourceChain,
|
|
1632
1644
|
sourceToken,
|
|
@@ -1635,13 +1647,13 @@ function ProcessingStep({
|
|
|
1635
1647
|
})]);
|
|
1636
1648
|
return;
|
|
1637
1649
|
}
|
|
1638
|
-
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1650
|
+
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _104 => _104.type]) === "bridge-started") {
|
|
1639
1651
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1640
1652
|
debugLog(debug, "processing", "state:early-complete", {
|
|
1641
1653
|
txHash,
|
|
1642
1654
|
event: eventForCurrentTx.type
|
|
1643
1655
|
});
|
|
1644
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1656
|
+
_optionalChain([onDepositComplete, 'optionalCall', _105 => _105(txHash, void 0, {
|
|
1645
1657
|
amount,
|
|
1646
1658
|
sourceChain,
|
|
1647
1659
|
sourceToken,
|
|
@@ -1650,7 +1662,7 @@ function ProcessingStep({
|
|
|
1650
1662
|
})]);
|
|
1651
1663
|
return;
|
|
1652
1664
|
}
|
|
1653
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1665
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _106 => _106.type]) === "bridge-failed") {
|
|
1654
1666
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
1655
1667
|
setState({
|
|
1656
1668
|
type: "failed",
|
|
@@ -1662,11 +1674,11 @@ function ProcessingStep({
|
|
|
1662
1674
|
message: formatted.message,
|
|
1663
1675
|
code: formatted.code
|
|
1664
1676
|
});
|
|
1665
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1677
|
+
_optionalChain([onDepositFailed, 'optionalCall', _107 => _107(txHash, formatted.message)]);
|
|
1666
1678
|
return;
|
|
1667
1679
|
}
|
|
1668
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1669
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
1680
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _108 => _108.type]) === "error") {
|
|
1681
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _109 => _109.data, 'optionalAccess', _110 => _110.message]), () => ( "Unknown error"));
|
|
1670
1682
|
setState({
|
|
1671
1683
|
type: "failed",
|
|
1672
1684
|
message: errorMessage,
|
|
@@ -1676,7 +1688,7 @@ function ProcessingStep({
|
|
|
1676
1688
|
txHash,
|
|
1677
1689
|
message: errorMessage
|
|
1678
1690
|
});
|
|
1679
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1691
|
+
_optionalChain([onDepositFailed, 'optionalCall', _111 => _111(txHash, errorMessage)]);
|
|
1680
1692
|
return;
|
|
1681
1693
|
}
|
|
1682
1694
|
setState((previous) => ({
|
|
@@ -1740,7 +1752,7 @@ function ProcessingStep({
|
|
|
1740
1752
|
txHash,
|
|
1741
1753
|
timeoutMs: ESCALATED_DELAY_MS
|
|
1742
1754
|
});
|
|
1743
|
-
_optionalChain([onError, 'optionalCall',
|
|
1755
|
+
_optionalChain([onError, 'optionalCall', _112 => _112(message, "PROCESS_TIMEOUT")]);
|
|
1744
1756
|
}, ESCALATED_DELAY_MS);
|
|
1745
1757
|
return () => clearTimeout(timeoutId);
|
|
1746
1758
|
}, [debug, directTransfer, onError, state.type, txHash]);
|
|
@@ -1749,11 +1761,11 @@ function ProcessingStep({
|
|
|
1749
1761
|
const isProcessing = state.type === "processing";
|
|
1750
1762
|
const lastEvent = state.lastEvent;
|
|
1751
1763
|
const failureMessage = state.type === "failed" ? state.message : void 0;
|
|
1752
|
-
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess',
|
|
1764
|
+
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _113 => _113.type]) === "bridge-started";
|
|
1753
1765
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
1754
1766
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
1755
1767
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
1756
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
1768
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _114 => _114.data, 'optionalAccess', _115 => _115.destination, 'optionalAccess', _116 => _116.transactionHash]) || null;
|
|
1757
1769
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
1758
1770
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
1759
1771
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
@@ -1783,7 +1795,7 @@ function ProcessingStep({
|
|
|
1783
1795
|
const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
|
|
1784
1796
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
1785
1797
|
const headerTitle = isFailed ? `${flowCapitalized} could not be completed` : isComplete ? isEarlyComplete ? `${flowCapitalized} confirmed` : `${flowCapitalized} successful` : delayPhaseId === "received" ? "Bridge pending" : delayPhaseId === "bridging" ? "Bridge delayed" : delayPhaseId === "confirming" ? `Confirming ${flowNoun}` : `Submitting transaction...`;
|
|
1786
|
-
const headerDescription = isFailed ? _nullishCoalesce(failureMessage, () => ( "The transfer could not be completed.")) : isComplete ? directTransfer ? "Your transfer is complete." : isEarlyComplete ? "The bridge has started. Funds will arrive shortly." : "Your funds were successfully deposited." : delayPhaseId === "received" ? "Funds are in. We are still waiting for the bridge transaction to begin." : delayPhaseId === "bridging" ? "The bridge has started but settlement is taking longer than expected." : delayPhaseId === "confirming" ? "The source transaction has not been picked up yet, but we are still polling automatically." : _optionalChain([state, 'access',
|
|
1798
|
+
const headerDescription = isFailed ? _nullishCoalesce(failureMessage, () => ( "The transfer could not be completed.")) : isComplete ? directTransfer ? "Your transfer is complete." : isEarlyComplete ? "The bridge has started. Funds will arrive shortly." : "Your funds were successfully deposited." : delayPhaseId === "received" ? "Funds are in. We are still waiting for the bridge transaction to begin." : delayPhaseId === "bridging" ? "The bridge has started but settlement is taking longer than expected." : delayPhaseId === "confirming" ? "The source transaction has not been picked up yet, but we are still polling automatically." : _optionalChain([state, 'access', _117 => _117.lastEvent, 'optionalAccess', _118 => _118.type]) === "deposit-received" ? "Transfer received. Preparing bridge execution." : _optionalChain([state, 'access', _119 => _119.lastEvent, 'optionalAccess', _120 => _120.type]) === "bridge-started" ? `Bridge started. Sending funds to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain)}.` : "Filling your transaction on the blockchain.";
|
|
1787
1799
|
const showAlert = !isFailed && (delayPhaseId !== void 0 || hasEscalatedDelay);
|
|
1788
1800
|
const alertMessage = hasEscalatedDelay ? "Taking longer than expected. You can close this window \u2014 processing continues in the background." : "This step is slower than usual but still processing.";
|
|
1789
1801
|
const fillStatus = isComplete ? "Successful" : isFailed ? "Failed" : "Processing";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
toEvmCaip2,
|
|
26
26
|
tokenFormatter,
|
|
27
27
|
txRefsMatch
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7TTEHQBD.mjs";
|
|
29
29
|
import {
|
|
30
30
|
DEFAULT_BACKEND_URL,
|
|
31
31
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -3570,7 +3570,7 @@ function DepositFlow({
|
|
|
3570
3570
|
// src/DepositModal.tsx
|
|
3571
3571
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3572
3572
|
var ReownDepositInner = lazy(
|
|
3573
|
-
() => import("./DepositModalReown-
|
|
3573
|
+
() => import("./DepositModalReown-C3WPJW3E.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
3574
3574
|
);
|
|
3575
3575
|
function DepositModal(props) {
|
|
3576
3576
|
const needsReown = !!props.reownAppId;
|