@rhinestone/deposit-modal 0.1.56 → 0.1.58
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-A5YFTV2E.mjs → DepositModalReown-C3WPJW3E.mjs} +2 -2
- package/dist/{DepositModalReown-ZBBLHE6Z.cjs → DepositModalReown-KONUZXHJ.cjs} +3 -3
- package/dist/{WithdrawModalReown-GS2QN3GA.mjs → WithdrawModalReown-PFGUPZFN.mjs} +2 -2
- package/dist/{WithdrawModalReown-45SPXE5O.cjs → WithdrawModalReown-TUBSUJQ6.cjs} +3 -3
- package/dist/{chunk-IUKSOPEY.mjs → chunk-3ESBSOB7.mjs} +2 -2
- package/dist/{chunk-TVGZCNBW.cjs → chunk-3FEFGN7H.cjs} +33 -33
- package/dist/{chunk-LY3AZLPH.mjs → chunk-7TTEHQBD.mjs} +21 -13
- package/dist/{chunk-3UQQU6BE.cjs → chunk-TQ6IIGRS.cjs} +70 -62
- package/dist/{chunk-6KDGB2W2.mjs → chunk-VOGD6Y4U.mjs} +2 -2
- package/dist/{chunk-6BYN2IMR.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 +6 -1
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -817,42 +817,50 @@ var RADIUS_SCALE = {
|
|
|
817
817
|
lg: { sm: "10px", md: "14px", lg: "18px" },
|
|
818
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',
|
|
858
|
+
if (_optionalChain([theme, 'optionalAccess', _48 => _48.radius])) {
|
|
851
859
|
const scale = RADIUS_SCALE[theme.radius];
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
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);
|
|
856
864
|
}
|
|
857
865
|
}
|
|
858
866
|
|
|
@@ -1013,16 +1021,16 @@ function ConnectStep({
|
|
|
1013
1021
|
continueButtonLabel = "Continue",
|
|
1014
1022
|
connectButtonLabel = "Connect external wallet"
|
|
1015
1023
|
}) {
|
|
1016
|
-
const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess',
|
|
1024
|
+
const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _49 => _49.length]), () => ( 0))) > 0;
|
|
1017
1025
|
if (hasWalletOptions) {
|
|
1018
|
-
const hasReownWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess',
|
|
1026
|
+
const hasReownWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _50 => _50.some, 'call', _51 => _51(
|
|
1019
1027
|
(option) => option.kind === "external" || option.kind === "solana"
|
|
1020
1028
|
)]), () => ( false));
|
|
1021
1029
|
const showConnectDifferentWalletOption = Boolean(onConnect) && !hasReownWallet;
|
|
1022
1030
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1023
1031
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-centered rs-connect-centered--wallets", children: [
|
|
1024
1032
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-list", children: [
|
|
1025
|
-
_optionalChain([walletOptions, 'optionalAccess',
|
|
1033
|
+
_optionalChain([walletOptions, 'optionalAccess', _52 => _52.map, 'call', _53 => _53((option) => {
|
|
1026
1034
|
const isSelected = option.id === selectedWalletId;
|
|
1027
1035
|
const rawAddress = _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id));
|
|
1028
1036
|
const shortAddress = rawAddress.length > 12 ? `${rawAddress.slice(0, 6)}...${rawAddress.slice(-4)}` : rawAddress;
|
|
@@ -1031,7 +1039,7 @@ function ConnectStep({
|
|
|
1031
1039
|
{
|
|
1032
1040
|
type: "button",
|
|
1033
1041
|
className: `rs-connect-wallet-row ${isSelected ? "rs-connect-wallet-row--selected" : ""}`,
|
|
1034
|
-
onClick: () => _optionalChain([onSelectWallet, 'optionalCall',
|
|
1042
|
+
onClick: () => _optionalChain([onSelectWallet, 'optionalCall', _54 => _54(option.id)]),
|
|
1035
1043
|
children: [
|
|
1036
1044
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1037
1045
|
"div",
|
|
@@ -1090,7 +1098,7 @@ function ConnectStep({
|
|
|
1090
1098
|
}
|
|
1091
1099
|
)
|
|
1092
1100
|
] }),
|
|
1093
|
-
(onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess',
|
|
1101
|
+
(onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess', _55 => _55.some, 'call', _56 => _56(
|
|
1094
1102
|
(option) => option.kind === "external" || option.kind === "solana"
|
|
1095
1103
|
)]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1096
1104
|
"button",
|
|
@@ -1307,7 +1315,7 @@ function asNumber(value) {
|
|
|
1307
1315
|
const trimmed = value.trim();
|
|
1308
1316
|
if (!trimmed) return void 0;
|
|
1309
1317
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
1310
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
1318
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _57 => _57[1]])) {
|
|
1311
1319
|
const parsed2 = Number(caipMatch[1]);
|
|
1312
1320
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
1313
1321
|
}
|
|
@@ -1326,24 +1334,24 @@ function asAddress(value) {
|
|
|
1326
1334
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
1327
1335
|
}
|
|
1328
1336
|
function getEventTxHash(event) {
|
|
1329
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1337
|
+
if (!_optionalChain([event, 'optionalAccess', _58 => _58.type])) return void 0;
|
|
1330
1338
|
if (event.type === "deposit-received") {
|
|
1331
|
-
return asString(_optionalChain([event, 'access',
|
|
1339
|
+
return asString(_optionalChain([event, 'access', _59 => _59.data, 'optionalAccess', _60 => _60.transactionHash]));
|
|
1332
1340
|
}
|
|
1333
1341
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
1334
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1335
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
1336
|
-
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]))));
|
|
1337
1345
|
}
|
|
1338
1346
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
1339
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1340
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
1341
|
-
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]))));
|
|
1342
1350
|
}
|
|
1343
1351
|
return void 0;
|
|
1344
1352
|
}
|
|
1345
1353
|
function getEventSourceDetails(event) {
|
|
1346
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1354
|
+
if (!_optionalChain([event, 'optionalAccess', _73 => _73.type]) || !isRecord(event.data)) return {};
|
|
1347
1355
|
if (event.type === "deposit-received") {
|
|
1348
1356
|
return {
|
|
1349
1357
|
chainId: asNumber(event.data.chain),
|
|
@@ -1355,15 +1363,15 @@ function getEventSourceDetails(event) {
|
|
|
1355
1363
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
1356
1364
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
1357
1365
|
return {
|
|
1358
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
1359
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
1360
|
-
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]))))
|
|
1361
1369
|
};
|
|
1362
1370
|
}
|
|
1363
1371
|
return {};
|
|
1364
1372
|
}
|
|
1365
1373
|
function isDepositEvent(event) {
|
|
1366
|
-
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";
|
|
1367
1375
|
}
|
|
1368
1376
|
function isHexString(value) {
|
|
1369
1377
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -1418,7 +1426,7 @@ function isEventForTx(event, txHash) {
|
|
|
1418
1426
|
return txRefsMatch(eventTxHash, txHash);
|
|
1419
1427
|
}
|
|
1420
1428
|
function formatBridgeFailedMessage(event) {
|
|
1421
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1429
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _86 => _86.data]), () => ( {}));
|
|
1422
1430
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
1423
1431
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1424
1432
|
function toUserFacingFailure(raw) {
|
|
@@ -1450,12 +1458,12 @@ function formatBridgeFailedMessage(event) {
|
|
|
1450
1458
|
return { message: "Bridge failed" };
|
|
1451
1459
|
}
|
|
1452
1460
|
function parseWebhookTimestamp(event) {
|
|
1453
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
1461
|
+
if (typeof _optionalChain([event, 'optionalAccess', _87 => _87.time]) !== "string") return void 0;
|
|
1454
1462
|
const timestamp = Date.parse(event.time);
|
|
1455
1463
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
1456
1464
|
}
|
|
1457
1465
|
function syncPhaseTimings(previous, event) {
|
|
1458
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1466
|
+
if (!_optionalChain([event, 'optionalAccess', _88 => _88.type])) return previous;
|
|
1459
1467
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
1460
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;
|
|
1461
1469
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -1496,8 +1504,8 @@ function getCurrentPhaseId(state, phaseTimings, isEarlyComplete) {
|
|
|
1496
1504
|
if (state.type === "complete") {
|
|
1497
1505
|
return void 0;
|
|
1498
1506
|
}
|
|
1499
|
-
if (_optionalChain([state, 'access',
|
|
1500
|
-
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";
|
|
1501
1509
|
return "confirming";
|
|
1502
1510
|
}
|
|
1503
1511
|
function ProcessingStep({
|
|
@@ -1550,7 +1558,7 @@ function ProcessingStep({
|
|
|
1550
1558
|
txHash,
|
|
1551
1559
|
flowLabel
|
|
1552
1560
|
});
|
|
1553
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1561
|
+
_optionalChain([onDepositComplete, 'optionalCall', _93 => _93(txHash, void 0, {
|
|
1554
1562
|
amount,
|
|
1555
1563
|
sourceChain,
|
|
1556
1564
|
sourceToken,
|
|
@@ -1591,7 +1599,7 @@ function ProcessingStep({
|
|
|
1591
1599
|
_react.useEffect.call(void 0, () => {
|
|
1592
1600
|
if (!state.lastEvent) return;
|
|
1593
1601
|
setPhaseTimings((previous) => syncPhaseTimings(previous, state.lastEvent));
|
|
1594
|
-
}, [_optionalChain([state, 'access',
|
|
1602
|
+
}, [_optionalChain([state, 'access', _94 => _94.lastEvent, 'optionalAccess', _95 => _95.time]), _optionalChain([state, 'access', _96 => _96.lastEvent, 'optionalAccess', _97 => _97.type])]);
|
|
1595
1603
|
_react.useEffect.call(void 0, () => {
|
|
1596
1604
|
savePhaseTimings(txHash, phaseTimings);
|
|
1597
1605
|
}, [txHash, phaseTimings]);
|
|
@@ -1618,19 +1626,19 @@ function ProcessingStep({
|
|
|
1618
1626
|
debugLog(debug, "processing", "poll:event", {
|
|
1619
1627
|
type: lastEvent2.type,
|
|
1620
1628
|
matchesTx: eventMatchesTx,
|
|
1621
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
1629
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _98 => _98.intentId])
|
|
1622
1630
|
});
|
|
1623
1631
|
}
|
|
1624
1632
|
if (!isMounted) return;
|
|
1625
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1633
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _99 => _99.type]) === "bridge-complete") {
|
|
1626
1634
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1627
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
1635
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _100 => _100.data, 'optionalAccess', _101 => _101.destination, 'optionalAccess', _102 => _102.transactionHash]);
|
|
1628
1636
|
debugLog(debug, "processing", "state:complete", {
|
|
1629
1637
|
txHash,
|
|
1630
1638
|
destinationTxHash: destinationTxHash2,
|
|
1631
1639
|
event: eventForCurrentTx.type
|
|
1632
1640
|
});
|
|
1633
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1641
|
+
_optionalChain([onDepositComplete, 'optionalCall', _103 => _103(txHash, destinationTxHash2, {
|
|
1634
1642
|
amount,
|
|
1635
1643
|
sourceChain,
|
|
1636
1644
|
sourceToken,
|
|
@@ -1639,13 +1647,13 @@ function ProcessingStep({
|
|
|
1639
1647
|
})]);
|
|
1640
1648
|
return;
|
|
1641
1649
|
}
|
|
1642
|
-
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1650
|
+
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _104 => _104.type]) === "bridge-started") {
|
|
1643
1651
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1644
1652
|
debugLog(debug, "processing", "state:early-complete", {
|
|
1645
1653
|
txHash,
|
|
1646
1654
|
event: eventForCurrentTx.type
|
|
1647
1655
|
});
|
|
1648
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1656
|
+
_optionalChain([onDepositComplete, 'optionalCall', _105 => _105(txHash, void 0, {
|
|
1649
1657
|
amount,
|
|
1650
1658
|
sourceChain,
|
|
1651
1659
|
sourceToken,
|
|
@@ -1654,7 +1662,7 @@ function ProcessingStep({
|
|
|
1654
1662
|
})]);
|
|
1655
1663
|
return;
|
|
1656
1664
|
}
|
|
1657
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1665
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _106 => _106.type]) === "bridge-failed") {
|
|
1658
1666
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
1659
1667
|
setState({
|
|
1660
1668
|
type: "failed",
|
|
@@ -1666,11 +1674,11 @@ function ProcessingStep({
|
|
|
1666
1674
|
message: formatted.message,
|
|
1667
1675
|
code: formatted.code
|
|
1668
1676
|
});
|
|
1669
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1677
|
+
_optionalChain([onDepositFailed, 'optionalCall', _107 => _107(txHash, formatted.message)]);
|
|
1670
1678
|
return;
|
|
1671
1679
|
}
|
|
1672
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1673
|
-
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"));
|
|
1674
1682
|
setState({
|
|
1675
1683
|
type: "failed",
|
|
1676
1684
|
message: errorMessage,
|
|
@@ -1680,7 +1688,7 @@ function ProcessingStep({
|
|
|
1680
1688
|
txHash,
|
|
1681
1689
|
message: errorMessage
|
|
1682
1690
|
});
|
|
1683
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1691
|
+
_optionalChain([onDepositFailed, 'optionalCall', _111 => _111(txHash, errorMessage)]);
|
|
1684
1692
|
return;
|
|
1685
1693
|
}
|
|
1686
1694
|
setState((previous) => ({
|
|
@@ -1744,7 +1752,7 @@ function ProcessingStep({
|
|
|
1744
1752
|
txHash,
|
|
1745
1753
|
timeoutMs: ESCALATED_DELAY_MS
|
|
1746
1754
|
});
|
|
1747
|
-
_optionalChain([onError, 'optionalCall',
|
|
1755
|
+
_optionalChain([onError, 'optionalCall', _112 => _112(message, "PROCESS_TIMEOUT")]);
|
|
1748
1756
|
}, ESCALATED_DELAY_MS);
|
|
1749
1757
|
return () => clearTimeout(timeoutId);
|
|
1750
1758
|
}, [debug, directTransfer, onError, state.type, txHash]);
|
|
@@ -1753,11 +1761,11 @@ function ProcessingStep({
|
|
|
1753
1761
|
const isProcessing = state.type === "processing";
|
|
1754
1762
|
const lastEvent = state.lastEvent;
|
|
1755
1763
|
const failureMessage = state.type === "failed" ? state.message : void 0;
|
|
1756
|
-
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess',
|
|
1764
|
+
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _113 => _113.type]) === "bridge-started";
|
|
1757
1765
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
1758
1766
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
1759
1767
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
1760
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
1768
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _114 => _114.data, 'optionalAccess', _115 => _115.destination, 'optionalAccess', _116 => _116.transactionHash]) || null;
|
|
1761
1769
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
1762
1770
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
1763
1771
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
@@ -1787,7 +1795,7 @@ function ProcessingStep({
|
|
|
1787
1795
|
const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
|
|
1788
1796
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
1789
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...`;
|
|
1790
|
-
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.";
|
|
1791
1799
|
const showAlert = !isFailed && (delayPhaseId !== void 0 || hasEscalatedDelay);
|
|
1792
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.";
|
|
1793
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;
|