@rhinestone/deposit-modal 0.1.62 → 0.1.63

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.
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunk6UBIFHRVcjs = require('./chunk-6UBIFHRV.cjs');
3
+ var _chunkN3BZTUSJcjs = require('./chunk-N3BZTUSJ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
8
- require('./chunk-MVFMDKAS.cjs');
8
+ require('./chunk-5SR5N75I.cjs');
9
9
  require('./chunk-R6U6BHCV.cjs');
10
10
 
11
11
  // src/DepositModalReown.tsx
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
32
32
  reown.disconnect();
33
33
  }, [reown.disconnect]);
34
34
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
35
- _chunk6UBIFHRVcjs.DepositModalInner,
35
+ _chunkN3BZTUSJcjs.DepositModalInner,
36
36
  {
37
37
  ...props,
38
38
  reownWallet: reownWithSolana,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  DepositModalInner
3
- } from "./chunk-QME5ZAI6.mjs";
3
+ } from "./chunk-XVCPUB6K.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-MBURQ26S.mjs";
8
- import "./chunk-NDTY5AUU.mjs";
8
+ import "./chunk-TDTBAZNO.mjs";
9
9
  import "./chunk-CIXHTOO3.mjs";
10
10
 
11
11
  // src/DepositModalReown.tsx
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  WithdrawModalInner
3
- } from "./chunk-7YERRXZ4.mjs";
3
+ } from "./chunk-2IFX6ZEE.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-MBURQ26S.mjs";
8
- import "./chunk-NDTY5AUU.mjs";
8
+ import "./chunk-TDTBAZNO.mjs";
9
9
  import "./chunk-CIXHTOO3.mjs";
10
10
 
11
11
  // src/WithdrawModalReown.tsx
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkMKU7VETPcjs = require('./chunk-MKU7VETP.cjs');
3
+ var _chunkOFGBTU45cjs = require('./chunk-OFGBTU45.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
8
- require('./chunk-MVFMDKAS.cjs');
8
+ require('./chunk-5SR5N75I.cjs');
9
9
  require('./chunk-R6U6BHCV.cjs');
10
10
 
11
11
  // src/WithdrawModalReown.tsx
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
20
20
  reown.disconnect();
21
21
  }, [reown.disconnect]);
22
22
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23
- _chunkMKU7VETPcjs.WithdrawModalInner,
23
+ _chunkOFGBTU45cjs.WithdrawModalInner,
24
24
  {
25
25
  ...props,
26
26
  reownWallet: reown,
@@ -21,7 +21,7 @@ import {
21
21
  saveSessionOwnerToStorage,
22
22
  toEvmCaip2,
23
23
  useLatestRef
24
- } from "./chunk-NDTY5AUU.mjs";
24
+ } from "./chunk-TDTBAZNO.mjs";
25
25
  import {
26
26
  DEFAULT_BACKEND_URL,
27
27
  DEFAULT_SIGNER_ADDRESS,
@@ -1491,7 +1491,7 @@ function WithdrawFlow({
1491
1491
  // src/WithdrawModal.tsx
1492
1492
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1493
1493
  var ReownWithdrawInner = lazy(
1494
- () => import("./WithdrawModalReown-DRSOFZLI.mjs").then((m) => ({
1494
+ () => import("./WithdrawModalReown-2BW5CM3A.mjs").then((m) => ({
1495
1495
  default: m.WithdrawModalReown
1496
1496
  }))
1497
1497
  );
@@ -1358,10 +1358,14 @@ function getEventTxHash(event) {
1358
1358
  const source = isRecord(_optionalChain([event, 'access', _69 => _69.data, 'optionalAccess', _70 => _70.source])) ? event.data.source : void 0;
1359
1359
  return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _71 => _71.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _72 => _72.transactionHash]))));
1360
1360
  }
1361
+ if (event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
1362
+ const deposit = isRecord(_optionalChain([event, 'access', _73 => _73.data, 'optionalAccess', _74 => _74.deposit])) ? event.data.deposit : void 0;
1363
+ return asString(_optionalChain([deposit, 'optionalAccess', _75 => _75.transactionHash]));
1364
+ }
1361
1365
  return void 0;
1362
1366
  }
1363
1367
  function getEventSourceDetails(event) {
1364
- if (!_optionalChain([event, 'optionalAccess', _73 => _73.type]) || !isRecord(event.data)) return {};
1368
+ if (!_optionalChain([event, 'optionalAccess', _76 => _76.type]) || !isRecord(event.data)) return {};
1365
1369
  if (event.type === "deposit-received") {
1366
1370
  return {
1367
1371
  chainId: asNumber(event.data.chain),
@@ -1371,17 +1375,17 @@ function getEventSourceDetails(event) {
1371
1375
  }
1372
1376
  const source = isRecord(event.data.source) ? event.data.source : void 0;
1373
1377
  const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
1374
- if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
1378
+ 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") {
1375
1379
  return {
1376
- chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _74 => _74.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _75 => _75.chain])))),
1377
- amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _76 => _76.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _77 => _77.amount])))),
1378
- token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _78 => _78.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _79 => _79.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _80 => _80.token]))))
1380
+ chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _77 => _77.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _78 => _78.chain])))),
1381
+ amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _79 => _79.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _80 => _80.amount])))),
1382
+ token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _81 => _81.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _82 => _82.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _83 => _83.token]))))
1379
1383
  };
1380
1384
  }
1381
1385
  return {};
1382
1386
  }
1383
1387
  function isDepositEvent(event) {
1384
- 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";
1388
+ return _optionalChain([event, 'optionalAccess', _84 => _84.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _85 => _85.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _86 => _86.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _87 => _87.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _88 => _88.type]) === "post-bridge-swap-complete" || _optionalChain([event, 'optionalAccess', _89 => _89.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _90 => _90.type]) === "error";
1385
1389
  }
1386
1390
  function isHexString(value) {
1387
1391
  return value.startsWith("0x") || value.startsWith("0X");
@@ -1436,7 +1440,7 @@ function isEventForTx(event, txHash) {
1436
1440
  return txRefsMatch(eventTxHash, txHash);
1437
1441
  }
1438
1442
  function formatBridgeFailedMessage(event) {
1439
- const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _86 => _86.data]), () => ( {}));
1443
+ const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _91 => _91.data]), () => ( {}));
1440
1444
  const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
1441
1445
  const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
1442
1446
  function toUserFacingFailure(raw) {
@@ -1468,16 +1472,16 @@ function formatBridgeFailedMessage(event) {
1468
1472
  return { message: "Bridge failed" };
1469
1473
  }
1470
1474
  function parseWebhookTimestamp(event) {
1471
- if (typeof _optionalChain([event, 'optionalAccess', _87 => _87.time]) !== "string") return void 0;
1475
+ if (typeof _optionalChain([event, 'optionalAccess', _92 => _92.time]) !== "string") return void 0;
1472
1476
  const timestamp = Date.parse(event.time);
1473
1477
  return Number.isFinite(timestamp) ? timestamp : void 0;
1474
1478
  }
1475
1479
  function syncPhaseTimings(previous, event) {
1476
- if (!_optionalChain([event, 'optionalAccess', _88 => _88.type])) return previous;
1480
+ if (!_optionalChain([event, 'optionalAccess', _93 => _93.type])) return previous;
1477
1481
  const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
1478
- 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;
1479
- const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
1480
- const setCompleted = event.type === "bridge-complete" && previous.completedAt === void 0;
1482
+ 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;
1483
+ const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "post-bridge-swap-complete") && previous.bridgingAt === void 0;
1484
+ const setCompleted = (event.type === "bridge-complete" || event.type === "post-bridge-swap-complete") && previous.completedAt === void 0;
1481
1485
  if (!setReceived && !setBridging && !setCompleted) return previous;
1482
1486
  return {
1483
1487
  ...previous,
@@ -1514,8 +1518,9 @@ function getCurrentPhaseId(state, phaseTimings, isEarlyComplete) {
1514
1518
  if (state.type === "complete") {
1515
1519
  return void 0;
1516
1520
  }
1517
- if (_optionalChain([state, 'access', _89 => _89.lastEvent, 'optionalAccess', _90 => _90.type]) === "bridge-started") return "bridging";
1518
- if (_optionalChain([state, 'access', _91 => _91.lastEvent, 'optionalAccess', _92 => _92.type]) === "deposit-received") return "received";
1521
+ if (_optionalChain([state, 'access', _94 => _94.lastEvent, 'optionalAccess', _95 => _95.type]) === "bridge-started" || _optionalChain([state, 'access', _96 => _96.lastEvent, 'optionalAccess', _97 => _97.type]) === "bridge-complete")
1522
+ return "bridging";
1523
+ if (_optionalChain([state, 'access', _98 => _98.lastEvent, 'optionalAccess', _99 => _99.type]) === "deposit-received") return "received";
1519
1524
  return "confirming";
1520
1525
  }
1521
1526
  function ProcessingStep({
@@ -1528,6 +1533,7 @@ function ProcessingStep({
1528
1533
  sourceSymbol: providedSourceSymbol,
1529
1534
  sourceDecimals: providedSourceDecimals,
1530
1535
  waitForFinalTx,
1536
+ hasPostBridgeActions,
1531
1537
  service,
1532
1538
  directTransfer,
1533
1539
  flowLabel = "deposit",
@@ -1568,7 +1574,7 @@ function ProcessingStep({
1568
1574
  txHash,
1569
1575
  flowLabel
1570
1576
  });
1571
- _optionalChain([onDepositComplete, 'optionalCall', _93 => _93(txHash, void 0, {
1577
+ _optionalChain([onDepositComplete, 'optionalCall', _100 => _100(txHash, void 0, {
1572
1578
  amount,
1573
1579
  sourceChain,
1574
1580
  sourceToken,
@@ -1609,7 +1615,7 @@ function ProcessingStep({
1609
1615
  _react.useEffect.call(void 0, () => {
1610
1616
  if (!state.lastEvent) return;
1611
1617
  setPhaseTimings((previous) => syncPhaseTimings(previous, state.lastEvent));
1612
- }, [_optionalChain([state, 'access', _94 => _94.lastEvent, 'optionalAccess', _95 => _95.time]), _optionalChain([state, 'access', _96 => _96.lastEvent, 'optionalAccess', _97 => _97.type])]);
1618
+ }, [_optionalChain([state, 'access', _101 => _101.lastEvent, 'optionalAccess', _102 => _102.time]), _optionalChain([state, 'access', _103 => _103.lastEvent, 'optionalAccess', _104 => _104.type])]);
1613
1619
  _react.useEffect.call(void 0, () => {
1614
1620
  savePhaseTimings(txHash, phaseTimings);
1615
1621
  }, [txHash, phaseTimings]);
@@ -1636,19 +1642,52 @@ function ProcessingStep({
1636
1642
  debugLog(debug, "processing", "poll:event", {
1637
1643
  type: lastEvent2.type,
1638
1644
  matchesTx: eventMatchesTx,
1639
- intentId: _optionalChain([eventData, 'optionalAccess', _98 => _98.intentId])
1645
+ intentId: _optionalChain([eventData, 'optionalAccess', _105 => _105.intentId])
1640
1646
  });
1641
1647
  }
1642
1648
  if (!isMounted) return;
1643
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _99 => _99.type]) === "bridge-complete") {
1649
+ const awaitingPostBridgeSwap = waitForFinalTx && hasPostBridgeActions;
1650
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _106 => _106.type]) === "post-bridge-swap-complete") {
1644
1651
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1645
- const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _100 => _100.data, 'optionalAccess', _101 => _101.destination, 'optionalAccess', _102 => _102.transactionHash]);
1652
+ const swapTxHash = _optionalChain([eventForCurrentTx, 'access', _107 => _107.data, 'optionalAccess', _108 => _108.swap, 'optionalAccess', _109 => _109.transactionHash]);
1653
+ debugLog(debug, "processing", "state:complete", {
1654
+ txHash,
1655
+ destinationTxHash: swapTxHash,
1656
+ event: eventForCurrentTx.type
1657
+ });
1658
+ _optionalChain([onDepositComplete, 'optionalCall', _110 => _110(txHash, swapTxHash, {
1659
+ amount,
1660
+ sourceChain,
1661
+ sourceToken,
1662
+ targetChain,
1663
+ targetToken
1664
+ })]);
1665
+ return;
1666
+ }
1667
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _111 => _111.type]) === "post-bridge-swap-failed") {
1668
+ const formatted = formatBridgeFailedMessage(eventForCurrentTx);
1669
+ setState({
1670
+ type: "failed",
1671
+ message: formatted.message,
1672
+ lastEvent: eventForCurrentTx
1673
+ });
1674
+ debugLog(debug, "processing", "state:failed", {
1675
+ txHash,
1676
+ message: formatted.message,
1677
+ code: formatted.code
1678
+ });
1679
+ _optionalChain([onDepositFailed, 'optionalCall', _112 => _112(txHash, formatted.message)]);
1680
+ return;
1681
+ }
1682
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _113 => _113.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
1683
+ setState({ type: "complete", lastEvent: eventForCurrentTx });
1684
+ const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _114 => _114.data, 'optionalAccess', _115 => _115.destination, 'optionalAccess', _116 => _116.transactionHash]);
1646
1685
  debugLog(debug, "processing", "state:complete", {
1647
1686
  txHash,
1648
1687
  destinationTxHash: destinationTxHash2,
1649
1688
  event: eventForCurrentTx.type
1650
1689
  });
1651
- _optionalChain([onDepositComplete, 'optionalCall', _103 => _103(txHash, destinationTxHash2, {
1690
+ _optionalChain([onDepositComplete, 'optionalCall', _117 => _117(txHash, destinationTxHash2, {
1652
1691
  amount,
1653
1692
  sourceChain,
1654
1693
  sourceToken,
@@ -1657,13 +1696,13 @@ function ProcessingStep({
1657
1696
  })]);
1658
1697
  return;
1659
1698
  }
1660
- if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _104 => _104.type]) === "bridge-started") {
1699
+ if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _118 => _118.type]) === "bridge-started") {
1661
1700
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1662
1701
  debugLog(debug, "processing", "state:early-complete", {
1663
1702
  txHash,
1664
1703
  event: eventForCurrentTx.type
1665
1704
  });
1666
- _optionalChain([onDepositComplete, 'optionalCall', _105 => _105(txHash, void 0, {
1705
+ _optionalChain([onDepositComplete, 'optionalCall', _119 => _119(txHash, void 0, {
1667
1706
  amount,
1668
1707
  sourceChain,
1669
1708
  sourceToken,
@@ -1672,7 +1711,7 @@ function ProcessingStep({
1672
1711
  })]);
1673
1712
  return;
1674
1713
  }
1675
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _106 => _106.type]) === "bridge-failed") {
1714
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _120 => _120.type]) === "bridge-failed") {
1676
1715
  const formatted = formatBridgeFailedMessage(eventForCurrentTx);
1677
1716
  setState({
1678
1717
  type: "failed",
@@ -1684,11 +1723,11 @@ function ProcessingStep({
1684
1723
  message: formatted.message,
1685
1724
  code: formatted.code
1686
1725
  });
1687
- _optionalChain([onDepositFailed, 'optionalCall', _107 => _107(txHash, formatted.message)]);
1726
+ _optionalChain([onDepositFailed, 'optionalCall', _121 => _121(txHash, formatted.message)]);
1688
1727
  return;
1689
1728
  }
1690
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _108 => _108.type]) === "error") {
1691
- const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _109 => _109.data, 'optionalAccess', _110 => _110.message]), () => ( "Unknown error"));
1729
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _122 => _122.type]) === "error") {
1730
+ const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _123 => _123.data, 'optionalAccess', _124 => _124.message]), () => ( "Unknown error"));
1692
1731
  setState({
1693
1732
  type: "failed",
1694
1733
  message: errorMessage,
@@ -1698,7 +1737,7 @@ function ProcessingStep({
1698
1737
  txHash,
1699
1738
  message: errorMessage
1700
1739
  });
1701
- _optionalChain([onDepositFailed, 'optionalCall', _111 => _111(txHash, errorMessage)]);
1740
+ _optionalChain([onDepositFailed, 'optionalCall', _125 => _125(txHash, errorMessage)]);
1702
1741
  return;
1703
1742
  }
1704
1743
  setState((previous) => ({
@@ -1739,6 +1778,7 @@ function ProcessingStep({
1739
1778
  amount,
1740
1779
  debug,
1741
1780
  directTransfer,
1781
+ hasPostBridgeActions,
1742
1782
  onDepositComplete,
1743
1783
  onDepositFailed,
1744
1784
  service,
@@ -1762,7 +1802,7 @@ function ProcessingStep({
1762
1802
  txHash,
1763
1803
  timeoutMs: ESCALATED_DELAY_MS
1764
1804
  });
1765
- _optionalChain([onError, 'optionalCall', _112 => _112(message, "PROCESS_TIMEOUT")]);
1805
+ _optionalChain([onError, 'optionalCall', _126 => _126(message, "PROCESS_TIMEOUT")]);
1766
1806
  }, ESCALATED_DELAY_MS);
1767
1807
  return () => clearTimeout(timeoutId);
1768
1808
  }, [debug, directTransfer, onError, state.type, txHash]);
@@ -1771,16 +1811,19 @@ function ProcessingStep({
1771
1811
  const isProcessing = state.type === "processing";
1772
1812
  const lastEvent = state.lastEvent;
1773
1813
  const failureMessage = state.type === "failed" ? state.message : void 0;
1774
- const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _113 => _113.type]) === "bridge-started";
1814
+ const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _127 => _127.type]) === "bridge-started";
1775
1815
  const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
1776
1816
  const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
1777
1817
  const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
1778
- const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _114 => _114.data, 'optionalAccess', _115 => _115.destination, 'optionalAccess', _116 => _116.transactionHash]) || null;
1818
+ const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess', _128 => _128.type]) === "post-bridge-swap-complete" || _optionalChain([lastEvent, 'optionalAccess', _129 => _129.type]) === "post-bridge-swap-failed";
1819
+ const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _130 => _130.data, 'optionalAccess', _131 => _131.swap, 'optionalAccess', _132 => _132.transactionHash]) || null : _optionalChain([lastEvent, 'optionalAccess', _133 => _133.data, 'optionalAccess', _134 => _134.destination, 'optionalAccess', _135 => _135.transactionHash]) || null;
1820
+ const bridgeTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _136 => _136.data, 'optionalAccess', _137 => _137.bridge, 'optionalAccess', _138 => _138.transactionHash]) || null : null;
1779
1821
  const sourceDetails = getEventSourceDetails(lastEvent);
1780
1822
  const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
1781
1823
  const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
1782
1824
  const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
1783
1825
  const sourceExplorerUrl = _chunkR6U6BHCVcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
1826
+ const bridgeExplorerUrl = bridgeTxHash ? _chunkR6U6BHCVcjs.getExplorerTxUrl.call(void 0, targetChain, bridgeTxHash) : null;
1784
1827
  const destExplorerUrl = destinationTxHash ? _chunkR6U6BHCVcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1785
1828
  const isEvmSourceToken = /^0x[a-fA-F0-9]{40}$/.test(displaySourceToken);
1786
1829
  const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ? _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceSymbol, () => ( "Token"));
@@ -1805,7 +1848,7 @@ function ProcessingStep({
1805
1848
  const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
1806
1849
  const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
1807
1850
  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...`;
1808
- 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.";
1851
+ 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', _139 => _139.lastEvent, 'optionalAccess', _140 => _140.type]) === "deposit-received" ? "Transfer received. Preparing bridge execution." : _optionalChain([state, 'access', _141 => _141.lastEvent, 'optionalAccess', _142 => _142.type]) === "bridge-started" ? `Bridge started. Sending funds to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain)}.` : "Filling your transaction on the blockchain.";
1809
1852
  const showAlert = !isFailed && (delayPhaseId !== void 0 || hasEscalatedDelay);
1810
1853
  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.";
1811
1854
  const fillStatus = isComplete ? "Successful" : isFailed ? "Failed" : "Processing";
@@ -2011,8 +2054,25 @@ function ProcessingStep({
2011
2054
  }
2012
2055
  ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(txHash) }) })
2013
2056
  ] }),
2057
+ bridgeTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
2058
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Bridge tx" }),
2059
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children: bridgeExplorerUrl ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2060
+ "a",
2061
+ {
2062
+ href: bridgeExplorerUrl,
2063
+ target: "_blank",
2064
+ rel: "noopener noreferrer",
2065
+ className: "rs-card-external-link",
2066
+ style: { gap: 4, fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 },
2067
+ children: [
2068
+ truncateHash(bridgeTxHash),
2069
+ txLinkIcon
2070
+ ]
2071
+ }
2072
+ ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(bridgeTxHash) }) })
2073
+ ] }),
2014
2074
  destinationTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
2015
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Destination tx" }),
2075
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: bridgeTxHash ? "Swap tx" : "Destination tx" }),
2016
2076
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children: destExplorerUrl ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2017
2077
  "a",
2018
2078
  {