@rhinestone/deposit-modal 0.6.0 → 0.6.1

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.
@@ -2346,12 +2346,12 @@ function rankCryptoRows(descriptors) {
2346
2346
  return descriptors.map((descriptor, index) => ({ descriptor, index })).sort((a, b) => {
2347
2347
  const first = a.descriptor;
2348
2348
  const second = b.descriptor;
2349
- if (first.isBalanceSource !== second.isBalanceSource) {
2350
- return first.isBalanceSource ? -1 : 1;
2351
- }
2352
- if (!first.isBalanceSource) return a.index - b.index;
2353
- if (first.resolved !== second.resolved) return first.resolved ? -1 : 1;
2354
- if (first.resolved && first.balanceUsd !== second.balanceUsd) {
2349
+ const firstHasFunds = first.isBalanceSource && first.resolved && first.balanceUsd > 0;
2350
+ const secondHasFunds = second.isBalanceSource && second.resolved && second.balanceUsd > 0;
2351
+ const firstTier = firstHasFunds ? 0 : first.isBalanceSource ? 2 : 1;
2352
+ const secondTier = secondHasFunds ? 0 : second.isBalanceSource ? 2 : 1;
2353
+ if (firstTier !== secondTier) return firstTier - secondTier;
2354
+ if (firstTier === 0 && first.balanceUsd !== second.balanceUsd) {
2355
2355
  return second.balanceUsd - first.balanceUsd;
2356
2356
  }
2357
2357
  return a.index - b.index;
@@ -3382,6 +3382,59 @@ function getCurrentPhaseId(state, phaseTimings) {
3382
3382
  if (_optionalChain([state, 'access', _127 => _127.lastEvent, 'optionalAccess', _128 => _128.type]) === "deposit-received") return "received";
3383
3383
  return "confirming";
3384
3384
  }
3385
+ function getCompletionDestinationTxHash(event) {
3386
+ const eventData = _optionalChain([event, 'optionalAccess', _129 => _129.data]);
3387
+ const swapTxHash = _optionalChain([eventData, 'optionalAccess', _130 => _130.swap, 'optionalAccess', _131 => _131.transactionHash]);
3388
+ const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _132 => _132.destination, 'optionalAccess', _133 => _133.transactionHash]);
3389
+ return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
3390
+ }
3391
+ function getTerminalProcessingOutcome(event) {
3392
+ if (_optionalChain([event, 'optionalAccess', _134 => _134.type]) === "post-bridge-swap-complete") {
3393
+ return {
3394
+ type: "complete",
3395
+ destinationTxHash: getCompletionDestinationTxHash(event)
3396
+ };
3397
+ }
3398
+ if (_optionalChain([event, 'optionalAccess', _135 => _135.type]) === "post-bridge-swap-failed") {
3399
+ return {
3400
+ type: "failed",
3401
+ message: formatBridgeFailedMessage(event).message
3402
+ };
3403
+ }
3404
+ if (_optionalChain([event, 'optionalAccess', _136 => _136.type]) === "bridge-complete") {
3405
+ return {
3406
+ type: "complete",
3407
+ destinationTxHash: getCompletionDestinationTxHash(event)
3408
+ };
3409
+ }
3410
+ if (_optionalChain([event, 'optionalAccess', _137 => _137.type]) === "bridge-failed") {
3411
+ return {
3412
+ type: "failed",
3413
+ message: formatBridgeFailedMessage(event).message
3414
+ };
3415
+ }
3416
+ if (_optionalChain([event, 'optionalAccess', _138 => _138.type]) === "error") {
3417
+ return {
3418
+ type: "failed",
3419
+ message: _nullishCoalesce(_optionalChain([event, 'access', _139 => _139.data, 'optionalAccess', _140 => _140.message]), () => ( "Unknown error"))
3420
+ };
3421
+ }
3422
+ return null;
3423
+ }
3424
+ function getInitialProcessingState(event, txHash) {
3425
+ if (!event || !isEventForTx(event, txHash)) return null;
3426
+ const terminal = getTerminalProcessingOutcome(event);
3427
+ if (_optionalChain([terminal, 'optionalAccess', _141 => _141.type]) === "complete") {
3428
+ return { type: "complete", lastEvent: event };
3429
+ }
3430
+ if (_optionalChain([terminal, 'optionalAccess', _142 => _142.type]) === "failed") {
3431
+ return { type: "failed", message: terminal.message, lastEvent: event };
3432
+ }
3433
+ if (isDepositEvent(event)) {
3434
+ return { type: "processing", lastEvent: event };
3435
+ }
3436
+ return null;
3437
+ }
3385
3438
  function ProcessingStep({
3386
3439
  smartAccount,
3387
3440
  solanaDepositAddress,
@@ -3395,6 +3448,7 @@ function ProcessingStep({
3395
3448
  amountUsd,
3396
3449
  service,
3397
3450
  directTransfer,
3451
+ initialEvent,
3398
3452
  flowLabel = "deposit",
3399
3453
  debug,
3400
3454
  targetToken,
@@ -3427,9 +3481,21 @@ function ProcessingStep({
3427
3481
  const onDepositCompleteRef = useLatestRef(onDepositComplete);
3428
3482
  const onDepositFailedRef = useLatestRef(onDepositFailed);
3429
3483
  const onErrorRef = useLatestRef(onError);
3430
- const [state, setState] = _react.useState.call(void 0,
3431
- directTransfer ? { type: "complete" } : { type: "processing" }
3432
- );
3484
+ const initialTerminalEventRef = _react.useRef.call(void 0, null);
3485
+ const [state, setState] = _react.useState.call(void 0, () => {
3486
+ if (directTransfer) return { type: "complete" };
3487
+ const initial = getInitialProcessingState(
3488
+ initialEvent,
3489
+ txHash
3490
+ );
3491
+ if (initial) {
3492
+ if (initial.type !== "processing") {
3493
+ initialTerminalEventRef.current = _nullishCoalesce(initial.lastEvent, () => ( null));
3494
+ }
3495
+ return initial;
3496
+ }
3497
+ return { type: "processing" };
3498
+ });
3433
3499
  const [elapsedSeconds, setElapsedSeconds] = _react.useState.call(void 0, 0);
3434
3500
  const [phaseTimings, setPhaseTimings] = _react.useState.call(void 0, () => {
3435
3501
  const saved = loadPhaseTimings(txHash);
@@ -3463,7 +3529,7 @@ function ProcessingStep({
3463
3529
  flowLabel
3464
3530
  });
3465
3531
  const context = processingContextRef.current;
3466
- _optionalChain([onDepositCompleteRef, 'access', _129 => _129.current, 'optionalCall', _130 => _130(txHash, void 0, {
3532
+ _optionalChain([onDepositCompleteRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144(txHash, void 0, {
3467
3533
  amount: context.amount,
3468
3534
  sourceChain: context.sourceChain,
3469
3535
  sourceToken: context.sourceToken,
@@ -3481,6 +3547,43 @@ function ProcessingStep({
3481
3547
  txHash,
3482
3548
  updatePhaseTimings
3483
3549
  ]);
3550
+ _react.useEffect.call(void 0, () => {
3551
+ const event = initialTerminalEventRef.current;
3552
+ if (!event) return;
3553
+ initialTerminalEventRef.current = null;
3554
+ const outcome = getTerminalProcessingOutcome(event);
3555
+ if (!outcome) return;
3556
+ if (outcome.type === "complete") {
3557
+ const context = processingContextRef.current;
3558
+ debugLog(debug, "processing", "initial-event:complete", {
3559
+ txHash,
3560
+ destinationTxHash: outcome.destinationTxHash,
3561
+ event: event.type
3562
+ });
3563
+ _optionalChain([onDepositCompleteRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146(txHash, outcome.destinationTxHash, {
3564
+ amount: context.amount,
3565
+ sourceChain: context.sourceChain,
3566
+ sourceToken: context.sourceToken,
3567
+ sourceDecimals: context.sourceDecimals,
3568
+ amountUsd: context.amountUsd,
3569
+ targetChain: context.targetChain,
3570
+ targetToken: context.targetToken
3571
+ })]);
3572
+ return;
3573
+ }
3574
+ debugLog(debug, "processing", "initial-event:failed", {
3575
+ txHash,
3576
+ message: outcome.message,
3577
+ event: event.type
3578
+ });
3579
+ _optionalChain([onDepositFailedRef, 'access', _147 => _147.current, 'optionalCall', _148 => _148(txHash, outcome.message)]);
3580
+ }, [
3581
+ debug,
3582
+ onDepositCompleteRef,
3583
+ onDepositFailedRef,
3584
+ processingContextRef,
3585
+ txHash
3586
+ ]);
3484
3587
  _react.useEffect.call(void 0, () => {
3485
3588
  if (directTransfer || state.type !== "processing") return;
3486
3589
  const updateElapsed = () => {
@@ -3505,7 +3608,7 @@ function ProcessingStep({
3505
3608
  updatePhaseTimings(
3506
3609
  (previous) => syncPhaseTimings(previous, state.lastEvent)
3507
3610
  );
3508
- }, [_optionalChain([state, 'access', _131 => _131.lastEvent, 'optionalAccess', _132 => _132.time]), _optionalChain([state, 'access', _133 => _133.lastEvent, 'optionalAccess', _134 => _134.type]), updatePhaseTimings]);
3611
+ }, [_optionalChain([state, 'access', _149 => _149.lastEvent, 'optionalAccess', _150 => _150.time]), _optionalChain([state, 'access', _151 => _151.lastEvent, 'optionalAccess', _152 => _152.type]), updatePhaseTimings]);
3509
3612
  const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
3510
3613
  _react.useEffect.call(void 0, () => {
3511
3614
  let cancelled = false;
@@ -3513,7 +3616,7 @@ function ProcessingStep({
3513
3616
  if (cancelled || !res) return;
3514
3617
  if (res.transactionId != null) {
3515
3618
  if (res.transactionId.toLowerCase() !== txHash.toLowerCase()) return;
3516
- } else if (!isSwappedOrder || _optionalChain([swappedContext, 'optionalAccess', _135 => _135.variant]) === "connect") {
3619
+ } else if (!isSwappedOrder || _optionalChain([swappedContext, 'optionalAccess', _153 => _153.variant]) === "connect") {
3517
3620
  return;
3518
3621
  }
3519
3622
  setSwappedFiatContext({
@@ -3529,7 +3632,7 @@ function ProcessingStep({
3529
3632
  return () => {
3530
3633
  cancelled = true;
3531
3634
  };
3532
- }, [service, smartAccount, txHash, isSwappedOrder, _optionalChain([swappedContext, 'optionalAccess', _136 => _136.variant])]);
3635
+ }, [service, smartAccount, txHash, isSwappedOrder, _optionalChain([swappedContext, 'optionalAccess', _154 => _154.variant])]);
3533
3636
  _react.useEffect.call(void 0, () => {
3534
3637
  if (directTransfer) return;
3535
3638
  if (state.type !== "processing") {
@@ -3554,20 +3657,20 @@ function ProcessingStep({
3554
3657
  debugLog(debug, "processing", "poll:event", {
3555
3658
  type: lastEvent2.type,
3556
3659
  matchesTx: eventMatchesTx,
3557
- intentId: _optionalChain([eventData, 'optionalAccess', _137 => _137.intentId])
3660
+ intentId: _optionalChain([eventData, 'optionalAccess', _155 => _155.intentId])
3558
3661
  });
3559
3662
  }
3560
3663
  if (!isMounted) return;
3561
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _138 => _138.type]) === "bridge-complete") {
3664
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _156 => _156.type]) === "bridge-complete") {
3562
3665
  setState({ type: "complete", lastEvent: eventForCurrentTx });
3563
- const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _139 => _139.data, 'optionalAccess', _140 => _140.destination, 'optionalAccess', _141 => _141.transactionHash]);
3666
+ const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _157 => _157.data, 'optionalAccess', _158 => _158.destination, 'optionalAccess', _159 => _159.transactionHash]);
3564
3667
  debugLog(debug, "processing", "state:complete", {
3565
3668
  txHash,
3566
3669
  destinationTxHash: destinationTxHash2,
3567
3670
  event: eventForCurrentTx.type
3568
3671
  });
3569
3672
  const context = processingContextRef.current;
3570
- _optionalChain([onDepositCompleteRef, 'access', _142 => _142.current, 'optionalCall', _143 => _143(txHash, destinationTxHash2, {
3673
+ _optionalChain([onDepositCompleteRef, 'access', _160 => _160.current, 'optionalCall', _161 => _161(txHash, destinationTxHash2, {
3571
3674
  amount: context.amount,
3572
3675
  sourceChain: context.sourceChain,
3573
3676
  sourceToken: context.sourceToken,
@@ -3578,7 +3681,7 @@ function ProcessingStep({
3578
3681
  })]);
3579
3682
  return;
3580
3683
  }
3581
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _144 => _144.type]) === "bridge-failed") {
3684
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _162 => _162.type]) === "bridge-failed") {
3582
3685
  const formatted = formatBridgeFailedMessage(eventForCurrentTx);
3583
3686
  setState({
3584
3687
  type: "failed",
@@ -3590,11 +3693,11 @@ function ProcessingStep({
3590
3693
  message: formatted.message,
3591
3694
  code: formatted.code
3592
3695
  });
3593
- _optionalChain([onDepositFailedRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146(txHash, formatted.message)]);
3696
+ _optionalChain([onDepositFailedRef, 'access', _163 => _163.current, 'optionalCall', _164 => _164(txHash, formatted.message)]);
3594
3697
  return;
3595
3698
  }
3596
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _147 => _147.type]) === "error") {
3597
- const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _148 => _148.data, 'optionalAccess', _149 => _149.message]), () => ( "Unknown error"));
3699
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _165 => _165.type]) === "error") {
3700
+ const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _166 => _166.data, 'optionalAccess', _167 => _167.message]), () => ( "Unknown error"));
3598
3701
  setState({
3599
3702
  type: "failed",
3600
3703
  message: errorMessage,
@@ -3604,7 +3707,7 @@ function ProcessingStep({
3604
3707
  txHash,
3605
3708
  message: errorMessage
3606
3709
  });
3607
- _optionalChain([onDepositFailedRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151(txHash, errorMessage)]);
3710
+ _optionalChain([onDepositFailedRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169(txHash, errorMessage)]);
3608
3711
  return;
3609
3712
  }
3610
3713
  setState((previous) => ({
@@ -3665,7 +3768,7 @@ function ProcessingStep({
3665
3768
  txHash,
3666
3769
  timeoutMs: ESCALATED_DELAY_MS
3667
3770
  });
3668
- _optionalChain([onErrorRef, 'access', _152 => _152.current, 'optionalCall', _153 => _153(message, "PROCESS_TIMEOUT")]);
3771
+ _optionalChain([onErrorRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171(message, "PROCESS_TIMEOUT")]);
3669
3772
  }, ESCALATED_DELAY_MS);
3670
3773
  return () => clearTimeout(timeoutId);
3671
3774
  }, [debug, directTransfer, onErrorRef, state.type, txHash]);
@@ -3677,7 +3780,7 @@ function ProcessingStep({
3677
3780
  const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
3678
3781
  const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
3679
3782
  const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
3680
- const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _154 => _154.data, 'optionalAccess', _155 => _155.destination, 'optionalAccess', _156 => _156.transactionHash]) || null;
3783
+ const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _172 => _172.data, 'optionalAccess', _173 => _173.destination, 'optionalAccess', _174 => _174.transactionHash]) || null;
3681
3784
  const sourceDetails = getEventSourceDetails(lastEvent);
3682
3785
  const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
3683
3786
  const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
@@ -3755,8 +3858,8 @@ function ProcessingStep({
3755
3858
  const sourceChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, displaySourceChain);
3756
3859
  const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
3757
3860
  const timerText = formatTimer(elapsedSeconds);
3758
- const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _157 => _157.feeSponsored]), () => ( false));
3759
- const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _158 => _158.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3861
+ const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _175 => _175.feeSponsored]), () => ( false));
3862
+ const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _176 => _176.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3760
3863
  const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
3761
3864
  const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
3762
3865
  const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
@@ -3767,16 +3870,16 @@ function ProcessingStep({
3767
3870
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-body-header-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-body-header-title", children: stateTitle }) })
3768
3871
  ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}), title: stateTitle });
3769
3872
  if (isComplete && isSwappedOrder) {
3770
- const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _159 => _159.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _160 => _160.paymentMethod]))), () => ( null));
3873
+ const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _177 => _177.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _178 => _178.paymentMethod]))), () => ( null));
3771
3874
  const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
3772
- const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _161 => _161.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
3875
+ const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _179 => _179.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
3773
3876
  _nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
3774
3877
  effectivePaymentMethod
3775
3878
  ) : null;
3776
- const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _162 => _162.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
3777
- const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _163 => _163.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
3879
+ const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _180 => _180.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
3880
+ const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _181 => _181.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
3778
3881
  const depositedAmount = receiveDisplay;
3779
- const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _164 => _164.onrampFeeUsd]), () => ( null));
3882
+ const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _182 => _182.onrampFeeUsd]), () => ( null));
3780
3883
  const networkFeeUsd = quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
3781
3884
  const feeRows = [];
3782
3885
  if (onrampFeeUsd != null) {
@@ -3853,7 +3956,7 @@ function ProcessingStep({
3853
3956
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
3854
3957
  ] }),
3855
3958
  isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3856
- _optionalChain([swappedFiatContext, 'optionalAccess', _165 => _165.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
3959
+ _optionalChain([swappedFiatContext, 'optionalAccess', _183 => _183.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
3857
3960
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
3858
3961
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
3859
3962
  "$",
@@ -3865,7 +3968,7 @@ function ProcessingStep({
3865
3968
  ] })
3866
3969
  ] })
3867
3970
  ] }),
3868
- _optionalChain([swappedFiatContext, 'optionalAccess', _166 => _166.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
3971
+ _optionalChain([swappedFiatContext, 'optionalAccess', _184 => _184.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
3869
3972
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
3870
3973
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
3871
3974
  "$",
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkZDYV536Qcjs = require('./chunk-ZDYV536Q.cjs');
4
+ var _chunkVPWWFWZTcjs = require('./chunk-VPWWFWZT.cjs');
5
5
 
6
6
 
7
7
 
@@ -76,14 +76,14 @@ function buildTransports(rpcUrls) {
76
76
  const transports = {};
77
77
  for (const network of EVM_NETWORKS) {
78
78
  const id = Number(network.id);
79
- transports[id] = _viem.http.call(void 0, _chunkZDYV536Qcjs.rpcUrlFor.call(void 0, rpcUrls, id));
79
+ transports[id] = _viem.http.call(void 0, _chunkVPWWFWZTcjs.rpcUrlFor.call(void 0, rpcUrls, id));
80
80
  }
81
81
  return transports;
82
82
  }
83
83
  function getEvmRpcFingerprint(rpcUrls) {
84
84
  return EVM_NETWORKS.map((network) => {
85
85
  const id = Number(network.id);
86
- return `${id}=${_nullishCoalesce(_chunkZDYV536Qcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
86
+ return `${id}=${_nullishCoalesce(_chunkVPWWFWZTcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
87
87
  }).join("|");
88
88
  }
89
89
  var cachedAdapter = null;
@@ -177,7 +177,7 @@ function useReownWallet() {
177
177
  await switchChainAsync({ chainId });
178
178
  }
179
179
  } catch (err) {
180
- if (_chunkZDYV536Qcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
180
+ if (_chunkVPWWFWZTcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
181
181
  throw new Error(
182
182
  `Switch to ${_chunkABVRVW3Pcjs.getChainName.call(void 0, chainId)} in your wallet to continue`
183
183
  );
package/dist/deposit.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk7LVI3VALcjs = require('./chunk-7LVI3VAL.cjs');
3
+ var _chunkIZPUHIINcjs = require('./chunk-IZPUHIIN.cjs');
4
4
  require('./chunk-NRNJAQUA.cjs');
5
- require('./chunk-ZDYV536Q.cjs');
5
+ require('./chunk-VPWWFWZT.cjs');
6
6
  require('./chunk-UEKPBRBY.cjs');
7
7
  require('./chunk-ABVRVW3P.cjs');
8
8
 
9
9
 
10
- exports.DepositModal = _chunk7LVI3VALcjs.DepositModal;
10
+ exports.DepositModal = _chunkIZPUHIINcjs.DepositModal;
package/dist/deposit.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  DepositModal
3
- } from "./chunk-NSAODZSS.mjs";
3
+ } from "./chunk-TCLBFO3S.mjs";
4
4
  import "./chunk-FJWLC4AM.mjs";
5
- import "./chunk-GQDVHMOT.mjs";
5
+ import "./chunk-GBOCV2LQ.mjs";
6
6
  import "./chunk-F7P4MV72.mjs";
7
7
  import "./chunk-WJX3TJFK.mjs";
8
8
  export {
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk7LVI3VALcjs = require('./chunk-7LVI3VAL.cjs');
3
+ var _chunkIZPUHIINcjs = require('./chunk-IZPUHIIN.cjs');
4
4
  require('./chunk-NRNJAQUA.cjs');
5
5
 
6
6
 
7
- var _chunkDASS33PJcjs = require('./chunk-DASS33PJ.cjs');
8
- require('./chunk-ZDYV536Q.cjs');
7
+ var _chunkSITLCMTIcjs = require('./chunk-SITLCMTI.cjs');
8
+ require('./chunk-VPWWFWZT.cjs');
9
9
  require('./chunk-UEKPBRBY.cjs');
10
10
 
11
11
 
@@ -85,4 +85,4 @@ async function disconnectWallet() {
85
85
 
86
86
 
87
87
 
88
- exports.CHAIN_BY_ID = _chunkABVRVW3Pcjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkABVRVW3Pcjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunk7LVI3VALcjs.DepositModal; exports.HYPERCORE_CHAIN_ID = _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID; exports.HYPERCORE_USDC_ADDRESS = _chunkABVRVW3Pcjs.HYPERCORE_USDC_ADDRESS; exports.NATIVE_TOKEN_ADDRESS = _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkABVRVW3Pcjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkABVRVW3Pcjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunkDASS33PJcjs.WithdrawModal; exports.chainRegistry = _chunkABVRVW3Pcjs.chainRegistry; exports.disconnectWallet = disconnectWallet; exports.findChainIdForToken = _chunkABVRVW3Pcjs.findChainIdForToken; exports.getChainBadge = _chunkABVRVW3Pcjs.getChainBadge; exports.getChainIcon = _chunkABVRVW3Pcjs.getChainIcon; exports.getChainId = _chunkABVRVW3Pcjs.getChainId; exports.getChainName = _chunkABVRVW3Pcjs.getChainName; exports.getChainObject = _chunkABVRVW3Pcjs.getChainObject; exports.getExplorerName = _chunkABVRVW3Pcjs.getExplorerName; exports.getExplorerTxUrl = _chunkABVRVW3Pcjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkABVRVW3Pcjs.getExplorerUrl; exports.getSupportedChainIds = _chunkABVRVW3Pcjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkABVRVW3Pcjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkABVRVW3Pcjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunkABVRVW3Pcjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunkABVRVW3Pcjs.getTokenAddress; exports.getTokenDecimals = _chunkABVRVW3Pcjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon; exports.getTokenSymbol = _chunkABVRVW3Pcjs.getTokenSymbol; exports.getUsdcAddress = _chunkABVRVW3Pcjs.getUsdcAddress; exports.getUsdcDecimals = _chunkABVRVW3Pcjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkABVRVW3Pcjs.isSupportedTokenAddressForChain;
88
+ exports.CHAIN_BY_ID = _chunkABVRVW3Pcjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkABVRVW3Pcjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkIZPUHIINcjs.DepositModal; exports.HYPERCORE_CHAIN_ID = _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID; exports.HYPERCORE_USDC_ADDRESS = _chunkABVRVW3Pcjs.HYPERCORE_USDC_ADDRESS; exports.NATIVE_TOKEN_ADDRESS = _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkABVRVW3Pcjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkABVRVW3Pcjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunkSITLCMTIcjs.WithdrawModal; exports.chainRegistry = _chunkABVRVW3Pcjs.chainRegistry; exports.disconnectWallet = disconnectWallet; exports.findChainIdForToken = _chunkABVRVW3Pcjs.findChainIdForToken; exports.getChainBadge = _chunkABVRVW3Pcjs.getChainBadge; exports.getChainIcon = _chunkABVRVW3Pcjs.getChainIcon; exports.getChainId = _chunkABVRVW3Pcjs.getChainId; exports.getChainName = _chunkABVRVW3Pcjs.getChainName; exports.getChainObject = _chunkABVRVW3Pcjs.getChainObject; exports.getExplorerName = _chunkABVRVW3Pcjs.getExplorerName; exports.getExplorerTxUrl = _chunkABVRVW3Pcjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkABVRVW3Pcjs.getExplorerUrl; exports.getSupportedChainIds = _chunkABVRVW3Pcjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkABVRVW3Pcjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkABVRVW3Pcjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunkABVRVW3Pcjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunkABVRVW3Pcjs.getTokenAddress; exports.getTokenDecimals = _chunkABVRVW3Pcjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon; exports.getTokenSymbol = _chunkABVRVW3Pcjs.getTokenSymbol; exports.getUsdcAddress = _chunkABVRVW3Pcjs.getUsdcAddress; exports.getUsdcDecimals = _chunkABVRVW3Pcjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkABVRVW3Pcjs.isSupportedTokenAddressForChain;
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  DepositModal
3
- } from "./chunk-NSAODZSS.mjs";
3
+ } from "./chunk-TCLBFO3S.mjs";
4
4
  import "./chunk-FJWLC4AM.mjs";
5
5
  import {
6
6
  WithdrawModal
7
- } from "./chunk-3JVGI7FC.mjs";
8
- import "./chunk-GQDVHMOT.mjs";
7
+ } from "./chunk-N73D3WN4.mjs";
8
+ import "./chunk-GBOCV2LQ.mjs";
9
9
  import "./chunk-F7P4MV72.mjs";
10
10
  import {
11
11
  CHAIN_BY_ID,
package/dist/styles.css CHANGED
@@ -4980,21 +4980,27 @@
4980
4980
  color: var(--rs-muted);
4981
4981
  }
4982
4982
 
4983
- /* Iframe wrap sized to Swapped's documented dimensions 400×586 for the
4984
- fiat on-ramp, 445×585 for Connect (overrides below). Centered horizontally
4985
- inside the modal so the step body can have header padding. */
4983
+ /* The iframe phase owns the whole modal width. Normal screens keep the
4984
+ 16px body inset, but Swapped now provides its own in-iframe back chrome so
4985
+ the embedded sheet should not look like a padded card inside our modal. */
4986
+ .rs-modal-body[data-flow-mode="fiat-onramp"]:has(.rs-fiat-onramp),
4987
+ .rs-modal-body[data-flow-mode="exchange-connect"]:has(.rs-fiat-onramp) {
4988
+ padding-inline: 0;
4989
+ }
4990
+
4991
+ /* Iframe wrap sized to Swapped's documented heights. Width deliberately spans
4992
+ the full modal body in the iframe phase; the modal itself controls the
4993
+ product-specific width below. */
4986
4994
  .rs-fiat-onramp-iframe-wrap {
4987
4995
  position: relative;
4988
4996
  width: 100%;
4989
- max-width: 400px;
4990
4997
  min-height: 586px;
4991
- margin: 0 auto;
4992
- border-radius: var(--rs-radius);
4998
+ margin: 0;
4999
+ border-radius: 0;
4993
5000
  overflow: hidden;
4994
5001
  }
4995
5002
 
4996
5003
  .rs-fiat-onramp[data-variant="connect"] .rs-fiat-onramp-iframe-wrap {
4997
- max-width: 445px;
4998
5004
  min-height: 585px;
4999
5005
  }
5000
5006
 
@@ -5211,22 +5217,14 @@
5211
5217
  /* =============================================================================
5212
5218
  Modal sizing for the Swapped iframe step
5213
5219
  =============================================================================
5214
- Modal stays at the default 400px width for the fiat variant (matches
5215
- Swapped's 400×586 iframe edge-to-edge). Connect needs 445px because its
5216
- iframe is 445×585. Height grows with the Rhinestone chrome (header
5217
- icon/title/subtitle + iframe + PoweredBy); cap to viewport so smaller
5218
- laptops get a scrollable modal-body instead of overflowing the screen. */
5219
-
5220
- /* Connect's iframe is 445×585 (vs fiat's 400×586). To preserve the same
5221
- 12px horizontal padding as ConnectStep while still giving Swapped's
5222
- Connect iframe its documented width, widen the modal by 24px (12 each
5223
- side) → 469px. Applied from the moment the user enters exchange-connect
5224
- mode (`data-flow-mode` on rs-modal-body) — not just the iframe step —
5225
- so the modal width is stable across SetupStep → SwappedIframeStep.
5226
- Fiat keeps the default 400px modal; its iframe renders at 376px
5227
- content-width, matching the visual width of ConnectStep's list rows. */
5220
+ Fiat keeps the default modal width. Connect uses Swapped's wider documented
5221
+ iframe width and applies it from the moment the user enters exchange-connect
5222
+ mode (`data-flow-mode` on rs-modal-body), so the modal width is stable
5223
+ across SetupStep SwappedIframeStep. Height grows with the Rhinestone
5224
+ chrome (header + iframe + PoweredBy); cap to viewport so smaller laptops get
5225
+ a scrollable modal-body instead of overflowing the screen. */
5228
5226
  .rs-modal-content:has(.rs-modal-body[data-flow-mode="exchange-connect"]) {
5229
- max-width: 469px;
5227
+ max-width: 445px;
5230
5228
  }
5231
5229
 
5232
5230
  .rs-modal-content:has(.rs-modal-body[data-flow-mode="fiat-onramp"]),
package/dist/withdraw.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDASS33PJcjs = require('./chunk-DASS33PJ.cjs');
4
- require('./chunk-ZDYV536Q.cjs');
3
+ var _chunkSITLCMTIcjs = require('./chunk-SITLCMTI.cjs');
4
+ require('./chunk-VPWWFWZT.cjs');
5
5
  require('./chunk-UEKPBRBY.cjs');
6
6
  require('./chunk-ABVRVW3P.cjs');
7
7
 
8
8
 
9
- exports.WithdrawModal = _chunkDASS33PJcjs.WithdrawModal;
9
+ exports.WithdrawModal = _chunkSITLCMTIcjs.WithdrawModal;
package/dist/withdraw.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  WithdrawModal
3
- } from "./chunk-3JVGI7FC.mjs";
4
- import "./chunk-GQDVHMOT.mjs";
3
+ } from "./chunk-N73D3WN4.mjs";
4
+ import "./chunk-GBOCV2LQ.mjs";
5
5
  import "./chunk-F7P4MV72.mjs";
6
6
  import "./chunk-WJX3TJFK.mjs";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/deposit-modal",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "React modal component for Rhinestone cross-chain deposits",
5
5
  "author": "Rhinestone <dev@rhinestone.wtf>",
6
6
  "bugs": {