@rhinestone/deposit-modal 0.20.0 → 0.20.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.
- package/README.md +3 -0
- package/dist/{BankOnrampStep-NPGXAA7U.cjs → BankOnrampStep-3SNUX6V2.cjs} +11 -11
- package/dist/{BankOnrampStep-JG32OCM2.mjs → BankOnrampStep-4D24HVHV.mjs} +4 -4
- package/dist/{DepositModalReown-ALVWADG7.cjs → DepositModalReown-7EHOJTFW.cjs} +16 -16
- package/dist/{DepositModalReown-3FGTPER6.mjs → DepositModalReown-SYQ2SCHC.mjs} +3 -3
- package/dist/WithdrawModal-LLJLEYXZ.cjs +12 -0
- package/dist/{WithdrawModal-LL4Z5WZP.mjs → WithdrawModal-LXDIT4UV.mjs} +3 -3
- package/dist/{chunk-BTEG2VNZ.cjs → chunk-CIVFT5KR.cjs} +58 -58
- package/dist/{chunk-EKFXUF5A.cjs → chunk-D3R3O4CY.cjs} +1 -1
- package/dist/{chunk-6CTJFR3T.mjs → chunk-EJDBIWNH.mjs} +1 -1
- package/dist/{chunk-247GJH57.mjs → chunk-FW7ZMXQS.mjs} +444 -477
- package/dist/{chunk-PYRXOP2Y.cjs → chunk-IPHKBBUV.cjs} +2 -2
- package/dist/{chunk-HP7S7AD6.mjs → chunk-IPKT3FU6.mjs} +1 -1
- package/dist/{chunk-5QUWEFD4.mjs → chunk-JPX4MEHV.mjs} +1 -1
- package/dist/{chunk-CXRH5MKO.cjs → chunk-KXSU24RU.cjs} +354 -275
- package/dist/{chunk-OPT5EW6L.cjs → chunk-LVMNNMOZ.cjs} +2 -2
- package/dist/{chunk-FMUSY563.cjs → chunk-O5OW4S7L.cjs} +3 -3
- package/dist/{chunk-32ERBFMO.mjs → chunk-OZPMRTW3.mjs} +93 -14
- package/dist/{chunk-Z4RBTNKX.cjs → chunk-PVFEZ3UG.cjs} +596 -629
- package/dist/{chunk-XBJCZYBX.mjs → chunk-YQCRXJIL.mjs} +1 -1
- package/dist/{chunk-B2LZQIGB.mjs → chunk-ZOJMB5TZ.mjs} +1 -1
- package/dist/compliance.cjs +4 -4
- package/dist/compliance.mjs +3 -3
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +14 -14
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/onramp.cjs +4 -4
- package/dist/onramp.mjs +3 -3
- package/dist/{types-CixUBhrM.d.cts → types-BEEMfNi2.d.cts} +4 -2
- package/dist/{types-BxSrazbq.d.ts → types-DQDUqzsZ.d.ts} +4 -2
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
- package/dist/WithdrawModal-5YWFJSYY.cjs +0 -12
|
@@ -58,6 +58,8 @@ import {
|
|
|
58
58
|
getExchangeLogo,
|
|
59
59
|
getExchangeLogoSrc,
|
|
60
60
|
getPublicClient,
|
|
61
|
+
hasReached,
|
|
62
|
+
hostedOrderStateFromSwapped,
|
|
61
63
|
isDepositEvent,
|
|
62
64
|
isDepositPolicyRefusal,
|
|
63
65
|
isDisplayStablecoinSymbol,
|
|
@@ -66,6 +68,7 @@ import {
|
|
|
66
68
|
isNativeAsset,
|
|
67
69
|
isNativeSol,
|
|
68
70
|
isSubmissionUncertain,
|
|
71
|
+
mergeHostedOrderState,
|
|
69
72
|
portfolioToAssets,
|
|
70
73
|
quoteFeeRow,
|
|
71
74
|
readDedupedAccountSetupResult,
|
|
@@ -94,7 +97,7 @@ import {
|
|
|
94
97
|
useTokenDisplay,
|
|
95
98
|
useTokenDisplays,
|
|
96
99
|
warnRemovedProps
|
|
97
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-OZPMRTW3.mjs";
|
|
98
101
|
import {
|
|
99
102
|
AppleIcon,
|
|
100
103
|
BankIcon,
|
|
@@ -170,20 +173,19 @@ import {
|
|
|
170
173
|
useEffect as useEffect15,
|
|
171
174
|
useRef as useRef11,
|
|
172
175
|
useState as useState15,
|
|
173
|
-
useCallback as
|
|
174
|
-
lazy as
|
|
176
|
+
useCallback as useCallback8,
|
|
177
|
+
lazy as lazy4,
|
|
175
178
|
Suspense as Suspense3
|
|
176
179
|
} from "react";
|
|
177
180
|
|
|
178
181
|
// src/DepositFlow.tsx
|
|
179
182
|
import {
|
|
180
183
|
useState as useState13,
|
|
181
|
-
useCallback as
|
|
184
|
+
useCallback as useCallback6,
|
|
182
185
|
useMemo as useMemo8,
|
|
183
186
|
useEffect as useEffect13,
|
|
184
187
|
useLayoutEffect as useLayoutEffect2,
|
|
185
188
|
useRef as useRef9,
|
|
186
|
-
lazy as lazy2,
|
|
187
189
|
Suspense as Suspense2
|
|
188
190
|
} from "react";
|
|
189
191
|
|
|
@@ -518,6 +520,7 @@ function ConnectStep({
|
|
|
518
520
|
onPrefetchFiatMethod,
|
|
519
521
|
recommendedMethod,
|
|
520
522
|
onSelectFundFromExchange,
|
|
523
|
+
fundFromExchangeLoading,
|
|
521
524
|
onRequestConnect,
|
|
522
525
|
onConnect,
|
|
523
526
|
onDisconnect,
|
|
@@ -598,7 +601,9 @@ function ConnectStep({
|
|
|
598
601
|
title: "Connect exchange",
|
|
599
602
|
subtitle: "Instant - No limit",
|
|
600
603
|
meta: EXCHANGE_META,
|
|
601
|
-
onClick: onSelectFundFromExchange
|
|
604
|
+
onClick: onSelectFundFromExchange,
|
|
605
|
+
disabled: fundFromExchangeLoading,
|
|
606
|
+
trailing: fundFromExchangeLoading ? SMALL_SPINNER : void 0
|
|
602
607
|
},
|
|
603
608
|
"connect-exchange"
|
|
604
609
|
)
|
|
@@ -3476,8 +3481,8 @@ function DepositAddressStep({
|
|
|
3476
3481
|
}
|
|
3477
3482
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
3478
3483
|
|
|
3479
|
-
// src/components/steps/
|
|
3480
|
-
import { useCallback as useCallback3 } from "react";
|
|
3484
|
+
// src/components/steps/RampOrderStep.tsx
|
|
3485
|
+
import { lazy as lazy2, useCallback as useCallback3 } from "react";
|
|
3481
3486
|
|
|
3482
3487
|
// src/core/swapped.ts
|
|
3483
3488
|
var SWAPPED_ORIGINS = [
|
|
@@ -3549,7 +3554,7 @@ function SwappedOrderTracker({
|
|
|
3549
3554
|
onRetry
|
|
3550
3555
|
}) {
|
|
3551
3556
|
const formattedAmount = formatTrackerAmount(amount);
|
|
3552
|
-
const title = terminal ? terminal.kind === "cancelled" ? "Order cancelled" : "Deposit failed" : formattedAmount ? `Depositing ${formattedAmount} ${currency}` : `Depositing ${currency}`;
|
|
3557
|
+
const title = terminal ? terminal.title ?? (terminal.kind === "cancelled" ? "Order cancelled" : "Deposit failed") : formattedAmount ? `Depositing ${formattedAmount} ${currency}` : `Depositing ${currency}`;
|
|
3553
3558
|
const labels = [
|
|
3554
3559
|
STEP_LABELS[0],
|
|
3555
3560
|
`${currency} received`,
|
|
@@ -3627,16 +3632,10 @@ var DEPOSIT_POLL_FAST_INTERVAL_MS = 500;
|
|
|
3627
3632
|
var IFRAME_LOAD_TIMEOUT_MS = 15e3;
|
|
3628
3633
|
var SWAPPED_SUCCESS_HANDOFF_DELAY_MS = 1400;
|
|
3629
3634
|
var SWAPPED_IFRAME_ORIGINS = new Set(SWAPPED_ORIGINS);
|
|
3630
|
-
var
|
|
3631
|
-
"
|
|
3632
|
-
"
|
|
3633
|
-
|
|
3634
|
-
var SWAPPED_STATUS_VALUES = /* @__PURE__ */ new Set([
|
|
3635
|
-
"payment_pending",
|
|
3636
|
-
"order_completed",
|
|
3637
|
-
"order_broadcasted",
|
|
3638
|
-
"order_cancelled"
|
|
3639
|
-
]);
|
|
3635
|
+
var OUTCOMES = {
|
|
3636
|
+
failed: { title: "Order failed", message: "Any charge will be refunded." },
|
|
3637
|
+
refunded: { title: "Order refunded", message: "Your payment was returned." }
|
|
3638
|
+
};
|
|
3640
3639
|
var SWAPPED_GO_BACK_KEY = "SWAPPED_GO_BACK";
|
|
3641
3640
|
var OPEN_FAILED_MESSAGE = "We could not open your browser.";
|
|
3642
3641
|
var OPEN_FAILED_CODE = "SWAPPED_BROWSER_UNAVAILABLE";
|
|
@@ -3682,19 +3681,20 @@ function parseSwappedIframeMessage(raw) {
|
|
|
3682
3681
|
const obj = data;
|
|
3683
3682
|
const inner = obj.data && typeof obj.data === "object" ? obj.data : obj;
|
|
3684
3683
|
const rawStatus = inner.order_status ?? inner.status ?? obj.status;
|
|
3685
|
-
if (typeof rawStatus !== "string" || !SWAPPED_STATUS_VALUES.has(rawStatus)) {
|
|
3686
|
-
return null;
|
|
3687
|
-
}
|
|
3688
3684
|
const asString2 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
3685
|
+
const state = typeof rawStatus === "string" ? hostedOrderStateFromSwapped(
|
|
3686
|
+
rawStatus,
|
|
3687
|
+
asString2(inner.transaction_id) ?? asString2(obj.transactionId)
|
|
3688
|
+
) : null;
|
|
3689
|
+
if (!state) return null;
|
|
3689
3690
|
return {
|
|
3690
|
-
|
|
3691
|
+
state,
|
|
3691
3692
|
orderId: asString2(inner.order_id) ?? asString2(obj.orderId),
|
|
3692
3693
|
externalCustomerId: asString2(inner.external_customer_id) ?? asString2(obj.external_customer_id) ?? asString2(inner.externalCustomerId) ?? asString2(obj.externalCustomerId),
|
|
3693
3694
|
orderCrypto: assetSymbol(
|
|
3694
3695
|
asString2(inner.order_crypto) ?? asString2(obj.orderCrypto)
|
|
3695
3696
|
),
|
|
3696
|
-
orderCryptoAmount: asString2(inner.order_crypto_amount) ?? asString2(obj.orderCryptoAmount)
|
|
3697
|
-
transactionId: asString2(inner.transaction_id) ?? asString2(obj.transactionId)
|
|
3697
|
+
orderCryptoAmount: asString2(inner.order_crypto_amount) ?? asString2(obj.orderCryptoAmount)
|
|
3698
3698
|
};
|
|
3699
3699
|
}
|
|
3700
3700
|
function SwappedProviderStep({
|
|
@@ -3705,7 +3705,7 @@ function SwappedProviderStep({
|
|
|
3705
3705
|
iframeTitle,
|
|
3706
3706
|
loadErrorCode,
|
|
3707
3707
|
loadErrorFallback,
|
|
3708
|
-
|
|
3708
|
+
cancelledMessage,
|
|
3709
3709
|
onSwappedComplete,
|
|
3710
3710
|
onSwappedFailed,
|
|
3711
3711
|
onClose,
|
|
@@ -3738,6 +3738,8 @@ function SwappedProviderStep({
|
|
|
3738
3738
|
const expectedExternalCustomerIdRef = useRef6(null);
|
|
3739
3739
|
const baselineDepositTxHashRef = useRef6(void 0);
|
|
3740
3740
|
const currentDepositTxHashRef = useRef6(null);
|
|
3741
|
+
const deliveryTxHashRef = useRef6(null);
|
|
3742
|
+
deliveryTxHashRef.current = orderState?.deliveryTxHash ?? null;
|
|
3741
3743
|
const fastDepositPollEnabledRef = useRef6(false);
|
|
3742
3744
|
const rescheduleDepositPollRef = useRef6(
|
|
3743
3745
|
null
|
|
@@ -3861,7 +3863,10 @@ function SwappedProviderStep({
|
|
|
3861
3863
|
if (cancelled) return;
|
|
3862
3864
|
const isCurrentOrder = res !== null && res.orderId === expectedOrderUuidRef.current;
|
|
3863
3865
|
if (isCurrentOrder) {
|
|
3864
|
-
setOrderState(
|
|
3866
|
+
setOrderState((prev) => ({
|
|
3867
|
+
...res,
|
|
3868
|
+
...mergeHostedOrderState(prev, res)
|
|
3869
|
+
}));
|
|
3865
3870
|
}
|
|
3866
3871
|
} catch {
|
|
3867
3872
|
}
|
|
@@ -3898,15 +3903,29 @@ function SwappedProviderStep({
|
|
|
3898
3903
|
async function pollDeposit() {
|
|
3899
3904
|
if (cancelled) return;
|
|
3900
3905
|
try {
|
|
3901
|
-
const
|
|
3902
|
-
if (
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3906
|
+
const deliveryTxHash = deliveryTxHashRef.current;
|
|
3907
|
+
if (deliveryTxHash) {
|
|
3908
|
+
const { lastEvent } = await service.fetchStatus(
|
|
3909
|
+
smartAccount,
|
|
3910
|
+
deliveryTxHash
|
|
3911
|
+
);
|
|
3912
|
+
if (cancelled) return;
|
|
3913
|
+
const txHash = isDepositEvent(lastEvent) ? getEventTxHash(lastEvent) : void 0;
|
|
3914
|
+
if (lastEvent && txHash && txRefsMatch(txHash, deliveryTxHash)) {
|
|
3915
|
+
currentDepositTxHashRef.current = txHash;
|
|
3916
|
+
setLatestEvent(lastEvent);
|
|
3917
|
+
}
|
|
3918
|
+
} else {
|
|
3919
|
+
const status = await service.fetchLatestStatus(smartAccount);
|
|
3920
|
+
if (cancelled) return;
|
|
3921
|
+
const event = status.lastEvent;
|
|
3922
|
+
const eventTxHash = isDepositEvent(event) ? getEventTxHash(event) ?? null : null;
|
|
3923
|
+
if (baselineDepositTxHashRef.current === void 0) {
|
|
3924
|
+
baselineDepositTxHashRef.current = eventTxHash;
|
|
3925
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !txRefsMatch(eventTxHash, baselineDepositTxHashRef.current))) {
|
|
3926
|
+
currentDepositTxHashRef.current = eventTxHash;
|
|
3927
|
+
setLatestEvent(event ?? null);
|
|
3928
|
+
}
|
|
3910
3929
|
}
|
|
3911
3930
|
} catch {
|
|
3912
3931
|
}
|
|
@@ -3929,8 +3948,7 @@ function SwappedProviderStep({
|
|
|
3929
3948
|
}, [service, smartAccount]);
|
|
3930
3949
|
useEffect8(() => {
|
|
3931
3950
|
if (fastDepositPollEnabledRef.current) return;
|
|
3932
|
-
|
|
3933
|
-
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
3951
|
+
if (!hasReached(orderState, "paid")) return;
|
|
3934
3952
|
fastDepositPollEnabledRef.current = true;
|
|
3935
3953
|
rescheduleDepositPollRef.current?.(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS);
|
|
3936
3954
|
}, [orderState]);
|
|
@@ -3954,10 +3972,9 @@ function SwappedProviderStep({
|
|
|
3954
3972
|
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
3955
3973
|
// is consistent regardless of which path set it.
|
|
3956
3974
|
orderId: expectedOrderUuidRef.current ?? prev?.orderId ?? ext,
|
|
3957
|
-
|
|
3975
|
+
...mergeHostedOrderState(prev, parsed.state),
|
|
3958
3976
|
orderCrypto: parsed.orderCrypto ?? prev?.orderCrypto ?? null,
|
|
3959
3977
|
orderCryptoAmount: parsed.orderCryptoAmount ?? prev?.orderCryptoAmount ?? null,
|
|
3960
|
-
transactionId: parsed.transactionId ?? prev?.transactionId ?? null,
|
|
3961
3978
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3962
3979
|
paidAmountUsd: prev?.paidAmountUsd ?? null,
|
|
3963
3980
|
paidAmountEur: prev?.paidAmountEur ?? null,
|
|
@@ -3969,13 +3986,13 @@ function SwappedProviderStep({
|
|
|
3969
3986
|
return () => window.removeEventListener("message", onMessage);
|
|
3970
3987
|
}, [openExternally]);
|
|
3971
3988
|
useEffect8(() => {
|
|
3972
|
-
const swappedProvesLive = orderState !== null &&
|
|
3989
|
+
const swappedProvesLive = orderState !== null && (variant !== "fiat" || hasReached(orderState, "paying") || orderState.outcome !== null);
|
|
3973
3990
|
if (phase === "provider" && (swappedProvesLive || latestEvent !== null)) {
|
|
3974
3991
|
setPhase("tracker");
|
|
3975
3992
|
}
|
|
3976
3993
|
}, [phase, orderState, latestEvent, variant]);
|
|
3977
3994
|
const stepStates = useMemo4(
|
|
3978
|
-
() => deriveStepStates(orderState
|
|
3995
|
+
() => deriveStepStates(orderState, latestEvent),
|
|
3979
3996
|
[orderState, latestEvent]
|
|
3980
3997
|
);
|
|
3981
3998
|
const terminalState = useMemo4(() => {
|
|
@@ -3985,15 +4002,15 @@ function SwappedProviderStep({
|
|
|
3985
4002
|
message: failureMessageForEvent(latestEvent ?? void 0)
|
|
3986
4003
|
};
|
|
3987
4004
|
}
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
return { kind: "cancelled", message:
|
|
4005
|
+
const outcome = orderState?.outcome;
|
|
4006
|
+
if (outcome) {
|
|
4007
|
+
return outcome === "cancelled" ? { kind: "cancelled", message: cancelledMessage } : { kind: "cancelled", ...OUTCOMES[outcome] };
|
|
3991
4008
|
}
|
|
3992
4009
|
return null;
|
|
3993
|
-
}, [latestEvent, orderState,
|
|
4010
|
+
}, [latestEvent, orderState, cancelledMessage]);
|
|
3994
4011
|
useEffect8(() => {
|
|
3995
|
-
if (orderState?.
|
|
3996
|
-
}, [onCancelled, orderState?.
|
|
4012
|
+
if (orderState?.outcome === "cancelled") onCancelled?.();
|
|
4013
|
+
}, [onCancelled, orderState?.outcome]);
|
|
3997
4014
|
useEffect8(() => {
|
|
3998
4015
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
3999
4016
|
const t = latestEvent?.type;
|
|
@@ -4143,15 +4160,14 @@ function SwappedProviderStep({
|
|
|
4143
4160
|
loadError && /* @__PURE__ */ jsx17(PoweredBy, {})
|
|
4144
4161
|
] });
|
|
4145
4162
|
}
|
|
4146
|
-
function deriveStepStates(
|
|
4163
|
+
function deriveStepStates(order, latestEvent) {
|
|
4147
4164
|
if (isFailedEvent(latestEvent ?? void 0)) {
|
|
4148
4165
|
return ["complete", "complete", "failed", "pending"];
|
|
4149
4166
|
}
|
|
4150
|
-
if (
|
|
4167
|
+
if (order?.outcome) {
|
|
4151
4168
|
return ["failed", "pending", "pending", "pending"];
|
|
4152
4169
|
}
|
|
4153
|
-
const
|
|
4154
|
-
const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
|
|
4170
|
+
const step2Complete = latestEvent !== null || hasReached(order, "sent");
|
|
4155
4171
|
const step3Complete = latestEvent?.type === "bridge-complete";
|
|
4156
4172
|
if (step3Complete) {
|
|
4157
4173
|
return ["complete", "complete", "complete", "complete"];
|
|
@@ -4159,65 +4175,70 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
4159
4175
|
if (step2Complete) {
|
|
4160
4176
|
return ["complete", "complete", "active", "pending"];
|
|
4161
4177
|
}
|
|
4162
|
-
if (
|
|
4178
|
+
if (hasReached(order, "paid")) {
|
|
4163
4179
|
return ["complete", "active", "pending", "pending"];
|
|
4164
4180
|
}
|
|
4165
4181
|
return ["active", "pending", "pending", "pending"];
|
|
4166
4182
|
}
|
|
4167
4183
|
SwappedProviderStep.displayName = "SwappedProviderStep";
|
|
4168
4184
|
|
|
4169
|
-
// src/components/steps/
|
|
4185
|
+
// src/components/steps/RampOrderStep.tsx
|
|
4170
4186
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4187
|
+
var BankOnrampStep = lazy2(async () => {
|
|
4188
|
+
const module = await import("./BankOnrampStep-4D24HVHV.mjs");
|
|
4189
|
+
return { default: module.BankOnrampStep };
|
|
4190
|
+
});
|
|
4191
|
+
var HOSTED = {
|
|
4192
|
+
fiat: {
|
|
4193
|
+
iframeTitle: "Buy crypto with Swapped",
|
|
4194
|
+
loadErrorCode: "SWAPPED_URL_FAILED",
|
|
4195
|
+
loadErrorFallback: "Failed to load on-ramp",
|
|
4196
|
+
cancelledMessage: "If you were charged, Swapped will refund within 5 business days."
|
|
4197
|
+
},
|
|
4198
|
+
exchange: {
|
|
4199
|
+
iframeTitle: "Fund from exchange via Swapped",
|
|
4200
|
+
loadErrorCode: "SWAPPED_CONNECT_URL_FAILED",
|
|
4201
|
+
loadErrorFallback: "Failed to load Connect",
|
|
4202
|
+
cancelledMessage: "If your exchange already debited the funds, Swapped will refund within 5 business days."
|
|
4178
4203
|
}
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
}
|
|
4204
|
+
};
|
|
4205
|
+
function RampOrderStep(props) {
|
|
4206
|
+
const { order, smartAccount } = props;
|
|
4207
|
+
if (order.flow === "funding_account") {
|
|
4208
|
+
return /* @__PURE__ */ jsx18(
|
|
4209
|
+
BankOnrampStep,
|
|
4210
|
+
{
|
|
4211
|
+
backendUrl: order.backendUrl,
|
|
4212
|
+
smartAccount,
|
|
4213
|
+
bankOnramp: order.bankOnramp,
|
|
4214
|
+
onJourney: order.onJourney,
|
|
4215
|
+
onGoBack: props.onGoBack,
|
|
4216
|
+
onError: props.onError,
|
|
4217
|
+
openExternally: props.openExternally,
|
|
4218
|
+
onUnavailable: order.onUnavailable
|
|
4219
|
+
},
|
|
4220
|
+
`${order.backendUrl}:${smartAccount}`
|
|
4221
|
+
);
|
|
4195
4222
|
}
|
|
4223
|
+
return /* @__PURE__ */ jsx18(HostedOrder, { ...props, order });
|
|
4196
4224
|
}
|
|
4197
|
-
function
|
|
4225
|
+
function HostedOrder({
|
|
4226
|
+
order,
|
|
4198
4227
|
smartAccount,
|
|
4199
4228
|
service,
|
|
4200
|
-
|
|
4201
|
-
methodSelectionSource,
|
|
4202
|
-
consumePrefetchedUrl,
|
|
4203
|
-
onSwappedComplete,
|
|
4204
|
-
onSwappedFailed,
|
|
4205
|
-
onClose,
|
|
4206
|
-
onGoBack,
|
|
4207
|
-
onError,
|
|
4208
|
-
onAttemptConsumed,
|
|
4209
|
-
onProviderHandoff,
|
|
4210
|
-
onRetry,
|
|
4211
|
-
onCancelled,
|
|
4212
|
-
onImmersiveChange,
|
|
4213
|
-
openExternally
|
|
4229
|
+
...callbacks
|
|
4214
4230
|
}) {
|
|
4231
|
+
const method = order.kind === "fiat" ? order.method : void 0;
|
|
4232
|
+
const source = order.kind === "fiat" ? order.methodSelectionSource : void 0;
|
|
4233
|
+
const consumePrefetched = order.kind === "fiat" ? order.consumePrefetchedUrl : void 0;
|
|
4234
|
+
const connection = order.kind === "exchange" ? order.connection : void 0;
|
|
4235
|
+
const loadPrepared = order.kind === "exchange" ? order.loadPreparedUrl : void 0;
|
|
4215
4236
|
const loadUrl = useCallback3(async () => {
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
);
|
|
4237
|
+
if (connection !== void 0) {
|
|
4238
|
+
if (loadPrepared) return loadPrepared();
|
|
4239
|
+
return service.getSwappedConnectUrl({ smartAccount, connection });
|
|
4240
|
+
}
|
|
4241
|
+
const prefetched = consumePrefetched?.(smartAccount, method, source);
|
|
4221
4242
|
if (prefetched) {
|
|
4222
4243
|
try {
|
|
4223
4244
|
const cached = await prefetched;
|
|
@@ -4227,136 +4248,41 @@ function FiatOnrampStep({
|
|
|
4227
4248
|
}
|
|
4228
4249
|
return service.getSwappedWidgetUrl({
|
|
4229
4250
|
smartAccount,
|
|
4230
|
-
method
|
|
4231
|
-
methodSelectionSource
|
|
4251
|
+
method,
|
|
4252
|
+
methodSelectionSource: source
|
|
4232
4253
|
});
|
|
4233
4254
|
}, [
|
|
4234
4255
|
service,
|
|
4235
4256
|
smartAccount,
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4257
|
+
method,
|
|
4258
|
+
source,
|
|
4259
|
+
consumePrefetched,
|
|
4260
|
+
connection,
|
|
4261
|
+
loadPrepared
|
|
4239
4262
|
]);
|
|
4240
4263
|
return /* @__PURE__ */ jsx18(
|
|
4241
4264
|
SwappedProviderStep,
|
|
4242
4265
|
{
|
|
4243
4266
|
smartAccount,
|
|
4244
4267
|
service,
|
|
4245
|
-
variant: "fiat",
|
|
4246
|
-
loadUrl,
|
|
4247
|
-
iframeTitle: "Buy crypto with Swapped",
|
|
4248
|
-
loadErrorCode: "SWAPPED_URL_FAILED",
|
|
4249
|
-
loadErrorFallback: "Failed to load on-ramp",
|
|
4250
|
-
bannerForStatus: fiatBannerForStatus,
|
|
4251
|
-
onSwappedComplete,
|
|
4252
|
-
onSwappedFailed,
|
|
4253
|
-
onClose,
|
|
4254
|
-
onGoBack,
|
|
4255
|
-
onError,
|
|
4256
|
-
onAttemptConsumed,
|
|
4257
|
-
onProviderHandoff,
|
|
4258
|
-
onRetry,
|
|
4259
|
-
onCancelled,
|
|
4260
|
-
onImmersiveChange,
|
|
4261
|
-
openExternally
|
|
4262
|
-
}
|
|
4263
|
-
);
|
|
4264
|
-
}
|
|
4265
|
-
FiatOnrampStep.displayName = "FiatOnrampStep";
|
|
4266
|
-
|
|
4267
|
-
// src/components/steps/ExchangeConnectStep.tsx
|
|
4268
|
-
import { useCallback as useCallback4 } from "react";
|
|
4269
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
4270
|
-
function connectBannerForStatus(status, context) {
|
|
4271
|
-
if (context.currencyMismatch) {
|
|
4272
|
-
return {
|
|
4273
|
-
level: "warning",
|
|
4274
|
-
title: "Currency mismatch",
|
|
4275
|
-
detail: "Funds may not bridge automatically. Contact support if your balance does not arrive."
|
|
4276
|
-
};
|
|
4277
|
-
}
|
|
4278
|
-
switch (status) {
|
|
4279
|
-
case "payment_pending":
|
|
4280
|
-
return { level: "info", title: "Waiting for exchange transfer\u2026" };
|
|
4281
|
-
case "order_completed":
|
|
4282
|
-
return {
|
|
4283
|
-
level: "success",
|
|
4284
|
-
title: "Exchange transfer received \u2014 sending crypto"
|
|
4285
|
-
};
|
|
4286
|
-
case "order_broadcasted":
|
|
4287
|
-
return {
|
|
4288
|
-
level: "success",
|
|
4289
|
-
title: "Crypto sent \u2014 confirming on-chain"
|
|
4290
|
-
};
|
|
4291
|
-
case "order_cancelled":
|
|
4292
|
-
return {
|
|
4293
|
-
level: "warning",
|
|
4294
|
-
title: "Order cancelled",
|
|
4295
|
-
detail: "If your exchange already debited the funds, Swapped will refund within 5 business days."
|
|
4296
|
-
};
|
|
4297
|
-
}
|
|
4298
|
-
}
|
|
4299
|
-
function ExchangeConnectStep({
|
|
4300
|
-
smartAccount,
|
|
4301
|
-
service,
|
|
4302
|
-
connection,
|
|
4303
|
-
loadUrl: loadPreparedUrl,
|
|
4304
|
-
onSwappedComplete,
|
|
4305
|
-
onSwappedFailed,
|
|
4306
|
-
onClose,
|
|
4307
|
-
onGoBack,
|
|
4308
|
-
onError,
|
|
4309
|
-
onAttemptConsumed,
|
|
4310
|
-
onProviderHandoff,
|
|
4311
|
-
onRetry,
|
|
4312
|
-
onCancelled,
|
|
4313
|
-
onImmersiveChange,
|
|
4314
|
-
openExternally
|
|
4315
|
-
}) {
|
|
4316
|
-
const loadUrl = useCallback4(async () => {
|
|
4317
|
-
if (loadPreparedUrl) return loadPreparedUrl();
|
|
4318
|
-
const res = await service.getSwappedConnectUrl({
|
|
4319
|
-
smartAccount,
|
|
4320
|
-
connection
|
|
4321
|
-
});
|
|
4322
|
-
return res;
|
|
4323
|
-
}, [loadPreparedUrl, service, smartAccount, connection]);
|
|
4324
|
-
return /* @__PURE__ */ jsx19(
|
|
4325
|
-
SwappedProviderStep,
|
|
4326
|
-
{
|
|
4327
|
-
smartAccount,
|
|
4328
|
-
service,
|
|
4329
|
-
variant: "connect",
|
|
4268
|
+
variant: order.kind === "fiat" ? "fiat" : "connect",
|
|
4330
4269
|
loadUrl,
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
loadErrorFallback: "Failed to load Connect",
|
|
4334
|
-
bannerForStatus: connectBannerForStatus,
|
|
4335
|
-
onSwappedComplete,
|
|
4336
|
-
onSwappedFailed,
|
|
4337
|
-
onClose,
|
|
4338
|
-
onGoBack,
|
|
4339
|
-
onError,
|
|
4340
|
-
onAttemptConsumed,
|
|
4341
|
-
onProviderHandoff,
|
|
4342
|
-
onRetry,
|
|
4343
|
-
onCancelled,
|
|
4344
|
-
onImmersiveChange,
|
|
4345
|
-
openExternally
|
|
4270
|
+
...HOSTED[order.kind],
|
|
4271
|
+
...callbacks
|
|
4346
4272
|
}
|
|
4347
4273
|
);
|
|
4348
4274
|
}
|
|
4349
|
-
|
|
4275
|
+
RampOrderStep.displayName = "RampOrderStep";
|
|
4350
4276
|
|
|
4351
4277
|
// src/components/steps/ExchangeSelectStep.tsx
|
|
4352
|
-
import { useCallback as
|
|
4353
|
-
import { jsx as
|
|
4278
|
+
import { useCallback as useCallback4, useEffect as useEffect9, useState as useState9 } from "react";
|
|
4279
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4354
4280
|
function ExchangeLogo({ exchange }) {
|
|
4355
4281
|
const [failed, setFailed] = useState9(false);
|
|
4356
4282
|
if (!exchange.logoUrl || failed) {
|
|
4357
|
-
return /* @__PURE__ */
|
|
4283
|
+
return /* @__PURE__ */ jsx19(BankIcon, {});
|
|
4358
4284
|
}
|
|
4359
|
-
return /* @__PURE__ */
|
|
4285
|
+
return /* @__PURE__ */ jsx19(
|
|
4360
4286
|
"img",
|
|
4361
4287
|
{
|
|
4362
4288
|
src: exchange.logoUrl,
|
|
@@ -4378,7 +4304,7 @@ function ExchangeSelectStep({
|
|
|
4378
4304
|
null
|
|
4379
4305
|
);
|
|
4380
4306
|
const [selectionNotice, setSelectionNotice] = useState9(null);
|
|
4381
|
-
const retry =
|
|
4307
|
+
const retry = useCallback4(() => {
|
|
4382
4308
|
setRetryToken((n) => n + 1);
|
|
4383
4309
|
}, []);
|
|
4384
4310
|
useEffect9(() => {
|
|
@@ -4401,7 +4327,7 @@ function ExchangeSelectStep({
|
|
|
4401
4327
|
cancelled = true;
|
|
4402
4328
|
};
|
|
4403
4329
|
}, [service, retryToken, onError]);
|
|
4404
|
-
const selectExchange =
|
|
4330
|
+
const selectExchange = useCallback4(
|
|
4405
4331
|
async (connection) => {
|
|
4406
4332
|
setSelectingConnection(connection);
|
|
4407
4333
|
setSelectionNotice(null);
|
|
@@ -4419,18 +4345,18 @@ function ExchangeSelectStep({
|
|
|
4419
4345
|
);
|
|
4420
4346
|
return /* @__PURE__ */ jsxs16("div", { className: "rs-screen rs-exchange-select", children: [
|
|
4421
4347
|
/* @__PURE__ */ jsxs16("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4422
|
-
/* @__PURE__ */
|
|
4348
|
+
/* @__PURE__ */ jsx19(
|
|
4423
4349
|
BodyHeader,
|
|
4424
4350
|
{
|
|
4425
|
-
icon: /* @__PURE__ */
|
|
4351
|
+
icon: /* @__PURE__ */ jsx19(UnplugIcon, {}),
|
|
4426
4352
|
title: "Connect exchange",
|
|
4427
4353
|
subtitle: "Select an exchange to connect"
|
|
4428
4354
|
}
|
|
4429
4355
|
),
|
|
4430
|
-
loading && /* @__PURE__ */
|
|
4356
|
+
loading && /* @__PURE__ */ jsx19("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ jsx19(Spinner, {}) }),
|
|
4431
4357
|
!loading && error && /* @__PURE__ */ jsxs16("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
4432
|
-
/* @__PURE__ */
|
|
4433
|
-
/* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
4359
|
+
/* @__PURE__ */ jsx19(
|
|
4434
4360
|
"button",
|
|
4435
4361
|
{
|
|
4436
4362
|
type: "button",
|
|
@@ -4441,8 +4367,8 @@ function ExchangeSelectStep({
|
|
|
4441
4367
|
)
|
|
4442
4368
|
] }),
|
|
4443
4369
|
!loading && !error && exchanges.length === 0 && /* @__PURE__ */ jsxs16("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
4444
|
-
/* @__PURE__ */
|
|
4445
|
-
/* @__PURE__ */
|
|
4370
|
+
/* @__PURE__ */ jsx19("div", { className: "rs-exchange-select-state-title", children: "No exchanges available" }),
|
|
4371
|
+
/* @__PURE__ */ jsx19(
|
|
4446
4372
|
"button",
|
|
4447
4373
|
{
|
|
4448
4374
|
type: "button",
|
|
@@ -4452,7 +4378,7 @@ function ExchangeSelectStep({
|
|
|
4452
4378
|
}
|
|
4453
4379
|
)
|
|
4454
4380
|
] }),
|
|
4455
|
-
!loading && !error && exchanges.length > 0 && /* @__PURE__ */
|
|
4381
|
+
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ jsx19("div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
4456
4382
|
const brand = getExchangeLogo(exchange.name, exchange.connection);
|
|
4457
4383
|
return /* @__PURE__ */ jsxs16(
|
|
4458
4384
|
"button",
|
|
@@ -4464,22 +4390,22 @@ function ExchangeSelectStep({
|
|
|
4464
4390
|
"aria-busy": selectingConnection === exchange.connection,
|
|
4465
4391
|
"aria-label": `Select ${exchange.name}`,
|
|
4466
4392
|
children: [
|
|
4467
|
-
/* @__PURE__ */
|
|
4393
|
+
/* @__PURE__ */ jsx19(
|
|
4468
4394
|
"span",
|
|
4469
4395
|
{
|
|
4470
4396
|
className: `rs-exchange-card-logo${brand ? " rs-exchange-card-logo--brand" : ""}`,
|
|
4471
|
-
children: brand ?? /* @__PURE__ */
|
|
4397
|
+
children: brand ?? /* @__PURE__ */ jsx19(ExchangeLogo, { exchange })
|
|
4472
4398
|
}
|
|
4473
4399
|
),
|
|
4474
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ jsx19("span", { className: "rs-exchange-card-name", children: exchange.name })
|
|
4475
4401
|
]
|
|
4476
4402
|
},
|
|
4477
4403
|
exchange.connection
|
|
4478
4404
|
);
|
|
4479
4405
|
}) })
|
|
4480
4406
|
] }),
|
|
4481
|
-
/* @__PURE__ */
|
|
4482
|
-
selectionNotice && /* @__PURE__ */
|
|
4407
|
+
/* @__PURE__ */ jsx19(PoweredBy, {}),
|
|
4408
|
+
selectionNotice && /* @__PURE__ */ jsx19("p", { className: "rs-exchange-select-fee-note", role: "status", children: selectionNotice })
|
|
4483
4409
|
] });
|
|
4484
4410
|
}
|
|
4485
4411
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
@@ -4487,7 +4413,7 @@ ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
|
4487
4413
|
// src/components/steps/SolanaTokenSelectStep.tsx
|
|
4488
4414
|
import { useState as useState10, useEffect as useEffect10, useMemo as useMemo5 } from "react";
|
|
4489
4415
|
import { formatUnits as formatUnits4 } from "viem";
|
|
4490
|
-
import { jsx as
|
|
4416
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4491
4417
|
function SolanaTokenSelectStep({
|
|
4492
4418
|
solanaAddress,
|
|
4493
4419
|
service,
|
|
@@ -4595,28 +4521,28 @@ function SolanaTokenSelectStep({
|
|
|
4595
4521
|
const chainName = getChainName("solana");
|
|
4596
4522
|
return /* @__PURE__ */ jsxs17("div", { className: "rs-screen", children: [
|
|
4597
4523
|
/* @__PURE__ */ jsxs17("div", { className: "rs-screen-body", children: [
|
|
4598
|
-
/* @__PURE__ */
|
|
4524
|
+
/* @__PURE__ */ jsx20(
|
|
4599
4525
|
BodyHeader,
|
|
4600
4526
|
{
|
|
4601
|
-
icon: /* @__PURE__ */
|
|
4527
|
+
icon: /* @__PURE__ */ jsx20(WalletIcon, {}),
|
|
4602
4528
|
title: "Your assets",
|
|
4603
4529
|
subtitle: "Select source assets to transfer"
|
|
4604
4530
|
}
|
|
4605
4531
|
),
|
|
4606
4532
|
loading && /* @__PURE__ */ jsxs17("div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
4607
|
-
/* @__PURE__ */
|
|
4608
|
-
/* @__PURE__ */
|
|
4533
|
+
/* @__PURE__ */ jsx20(Spinner, { className: "rs-text-tertiary" }),
|
|
4534
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
4609
4535
|
] }),
|
|
4610
|
-
error && /* @__PURE__ */
|
|
4536
|
+
error && /* @__PURE__ */ jsx20(Callout, { variant: "error", children: error }),
|
|
4611
4537
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ jsxs17("div", { className: "rs-empty-state", children: [
|
|
4612
|
-
/* @__PURE__ */
|
|
4613
|
-
/* @__PURE__ */
|
|
4538
|
+
/* @__PURE__ */ jsx20(WalletIcon, { className: "rs-empty-icon" }),
|
|
4539
|
+
/* @__PURE__ */ jsx20("div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
4614
4540
|
/* @__PURE__ */ jsxs17("div", { className: "rs-empty-address", children: [
|
|
4615
4541
|
solanaAddress.slice(0, 6),
|
|
4616
4542
|
"...",
|
|
4617
4543
|
solanaAddress.slice(-4)
|
|
4618
4544
|
] }),
|
|
4619
|
-
onDisconnect && /* @__PURE__ */
|
|
4545
|
+
onDisconnect && /* @__PURE__ */ jsx20(
|
|
4620
4546
|
"button",
|
|
4621
4547
|
{
|
|
4622
4548
|
type: "button",
|
|
@@ -4626,7 +4552,7 @@ function SolanaTokenSelectStep({
|
|
|
4626
4552
|
}
|
|
4627
4553
|
)
|
|
4628
4554
|
] }),
|
|
4629
|
-
!loading && !error && rows.length > 0 && /* @__PURE__ */
|
|
4555
|
+
!loading && !error && rows.length > 0 && /* @__PURE__ */ jsx20("div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
4630
4556
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
4631
4557
|
const tokenAmount = formatBalance(entry);
|
|
4632
4558
|
return /* @__PURE__ */ jsxs17(
|
|
@@ -4639,7 +4565,7 @@ function SolanaTokenSelectStep({
|
|
|
4639
4565
|
children: [
|
|
4640
4566
|
/* @__PURE__ */ jsxs17("div", { className: "rs-asset-info", children: [
|
|
4641
4567
|
/* @__PURE__ */ jsxs17("div", { className: "rs-asset-icon-wrapper", children: [
|
|
4642
|
-
/* @__PURE__ */
|
|
4568
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx20(
|
|
4643
4569
|
TokenIcon,
|
|
4644
4570
|
{
|
|
4645
4571
|
token: { chain: "solana", address: entry.token.mint },
|
|
@@ -4647,11 +4573,11 @@ function SolanaTokenSelectStep({
|
|
|
4647
4573
|
fallback: entry.token.symbol.slice(0, 4)
|
|
4648
4574
|
}
|
|
4649
4575
|
) }),
|
|
4650
|
-
chainIcon && /* @__PURE__ */
|
|
4576
|
+
chainIcon && /* @__PURE__ */ jsx20("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx20(CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
4651
4577
|
] }),
|
|
4652
4578
|
/* @__PURE__ */ jsxs17("div", { className: "rs-asset-text", children: [
|
|
4653
4579
|
/* @__PURE__ */ jsxs17("div", { className: "rs-asset-name-row", children: [
|
|
4654
|
-
/* @__PURE__ */
|
|
4580
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-asset-name", children: entry.token.symbol }),
|
|
4655
4581
|
/* @__PURE__ */ jsxs17("span", { className: "rs-asset-chain", children: [
|
|
4656
4582
|
"on ",
|
|
4657
4583
|
chainName
|
|
@@ -4664,13 +4590,13 @@ function SolanaTokenSelectStep({
|
|
|
4664
4590
|
] })
|
|
4665
4591
|
] })
|
|
4666
4592
|
] }),
|
|
4667
|
-
/* @__PURE__ */
|
|
4593
|
+
/* @__PURE__ */ jsx20("div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
4668
4594
|
]
|
|
4669
4595
|
},
|
|
4670
4596
|
entry.token.symbol
|
|
4671
4597
|
);
|
|
4672
4598
|
}) }),
|
|
4673
|
-
/* @__PURE__ */
|
|
4599
|
+
/* @__PURE__ */ jsx20(
|
|
4674
4600
|
Button,
|
|
4675
4601
|
{
|
|
4676
4602
|
onClick: () => selectedEntry && onContinue(
|
|
@@ -4684,14 +4610,14 @@ function SolanaTokenSelectStep({
|
|
|
4684
4610
|
}
|
|
4685
4611
|
)
|
|
4686
4612
|
] }),
|
|
4687
|
-
/* @__PURE__ */
|
|
4613
|
+
/* @__PURE__ */ jsx20(PoweredBy, {})
|
|
4688
4614
|
] });
|
|
4689
4615
|
}
|
|
4690
4616
|
|
|
4691
4617
|
// src/components/steps/SolanaAmountStep.tsx
|
|
4692
|
-
import { useCallback as
|
|
4618
|
+
import { useCallback as useCallback5, useEffect as useEffect11, useMemo as useMemo6, useRef as useRef7, useState as useState11 } from "react";
|
|
4693
4619
|
import { formatUnits as formatUnits5, parseUnits as parseUnits4 } from "viem";
|
|
4694
|
-
import { Fragment as Fragment5, jsx as
|
|
4620
|
+
import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4695
4621
|
var SOL_FEE_RESERVE_LAMPORTS = 1000000n;
|
|
4696
4622
|
var PRESETS2 = [
|
|
4697
4623
|
{ value: 25, label: "25%" },
|
|
@@ -4767,7 +4693,7 @@ function SolanaAmountStep({
|
|
|
4767
4693
|
return null;
|
|
4768
4694
|
}
|
|
4769
4695
|
}, [spendableBalance, token.decimals, tokenPriceUsd]);
|
|
4770
|
-
const computePresetAmount =
|
|
4696
|
+
const computePresetAmount = useCallback5(
|
|
4771
4697
|
(percentage) => {
|
|
4772
4698
|
try {
|
|
4773
4699
|
const spendableUnits = Number(
|
|
@@ -4899,10 +4825,10 @@ function SolanaAmountStep({
|
|
|
4899
4825
|
const continueDisabled = exceedsBalance || boundViolation !== null || numericAmount === 0 && !isBelowMin;
|
|
4900
4826
|
return /* @__PURE__ */ jsxs18("div", { className: "rs-screen", children: [
|
|
4901
4827
|
/* @__PURE__ */ jsxs18("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4902
|
-
/* @__PURE__ */
|
|
4828
|
+
/* @__PURE__ */ jsx21(BodyHeader, { icon: /* @__PURE__ */ jsx21(WalletIcon, {}), title: "Wallet deposit" }),
|
|
4903
4829
|
/* @__PURE__ */ jsxs18("div", { className: "rs-amount-section", children: [
|
|
4904
4830
|
/* @__PURE__ */ jsxs18("div", { className: "rs-amount-display", children: [
|
|
4905
|
-
/* @__PURE__ */
|
|
4831
|
+
/* @__PURE__ */ jsx21(
|
|
4906
4832
|
AnimatedAmountInput,
|
|
4907
4833
|
{
|
|
4908
4834
|
value: amount,
|
|
@@ -4929,7 +4855,7 @@ function SolanaAmountStep({
|
|
|
4929
4855
|
] })
|
|
4930
4856
|
] })
|
|
4931
4857
|
] }),
|
|
4932
|
-
/* @__PURE__ */
|
|
4858
|
+
/* @__PURE__ */ jsx21("div", { className: "rs-amount-presets", children: PRESETS2.map((preset) => /* @__PURE__ */ jsx21(
|
|
4933
4859
|
"button",
|
|
4934
4860
|
{
|
|
4935
4861
|
type: "button",
|
|
@@ -4942,13 +4868,13 @@ function SolanaAmountStep({
|
|
|
4942
4868
|
] }),
|
|
4943
4869
|
/* @__PURE__ */ jsxs18("div", { className: "rs-amount-details", children: [
|
|
4944
4870
|
/* @__PURE__ */ jsxs18("div", { className: "rs-amount-detail-row", children: [
|
|
4945
|
-
/* @__PURE__ */
|
|
4871
|
+
/* @__PURE__ */ jsx21("span", { children: "You send" }),
|
|
4946
4872
|
/* @__PURE__ */ jsxs18("span", { className: "rs-amount-detail-value", children: [
|
|
4947
4873
|
/* @__PURE__ */ jsxs18("span", { children: [
|
|
4948
4874
|
"Solana ",
|
|
4949
4875
|
token.symbol
|
|
4950
4876
|
] }),
|
|
4951
|
-
/* @__PURE__ */
|
|
4877
|
+
/* @__PURE__ */ jsx21("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx21(
|
|
4952
4878
|
TokenIcon,
|
|
4953
4879
|
{
|
|
4954
4880
|
token: { chain: "solana", address: token.mint },
|
|
@@ -4958,23 +4884,23 @@ function SolanaAmountStep({
|
|
|
4958
4884
|
] })
|
|
4959
4885
|
] }),
|
|
4960
4886
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ jsxs18("div", { className: "rs-amount-detail-row", children: [
|
|
4961
|
-
/* @__PURE__ */
|
|
4887
|
+
/* @__PURE__ */ jsx21("span", { children: "Receive" }),
|
|
4962
4888
|
/* @__PURE__ */ jsxs18("span", { className: "rs-amount-detail-value", children: [
|
|
4963
4889
|
/* @__PURE__ */ jsxs18("span", { children: [
|
|
4964
4890
|
targetChainName,
|
|
4965
4891
|
" ",
|
|
4966
4892
|
targetTokenSymbol
|
|
4967
4893
|
] }),
|
|
4968
|
-
/* @__PURE__ */
|
|
4894
|
+
/* @__PURE__ */ jsx21("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx21(TokenIcon, { token: targetToken, symbol: targetTokenSymbol }) })
|
|
4969
4895
|
] })
|
|
4970
4896
|
] }),
|
|
4971
4897
|
balanceAfterUsd !== null && /* @__PURE__ */ jsxs18("div", { className: "rs-amount-detail-row", children: [
|
|
4972
|
-
/* @__PURE__ */
|
|
4973
|
-
/* @__PURE__ */
|
|
4898
|
+
/* @__PURE__ */ jsx21("span", { children: "Balance after deposit" }),
|
|
4899
|
+
/* @__PURE__ */ jsx21("span", { className: "rs-amount-detail-value", children: currencyFormatter.format(balanceAfterUsd) })
|
|
4974
4900
|
] })
|
|
4975
4901
|
] }),
|
|
4976
|
-
error && /* @__PURE__ */
|
|
4977
|
-
/* @__PURE__ */
|
|
4902
|
+
error && /* @__PURE__ */ jsx21(Callout, { variant: "error", children: error }),
|
|
4903
|
+
/* @__PURE__ */ jsx21(
|
|
4978
4904
|
Button,
|
|
4979
4905
|
{
|
|
4980
4906
|
onClick: handleContinue,
|
|
@@ -4984,7 +4910,7 @@ function SolanaAmountStep({
|
|
|
4984
4910
|
}
|
|
4985
4911
|
)
|
|
4986
4912
|
] }),
|
|
4987
|
-
/* @__PURE__ */
|
|
4913
|
+
/* @__PURE__ */ jsx21(PoweredBy, {})
|
|
4988
4914
|
] });
|
|
4989
4915
|
}
|
|
4990
4916
|
|
|
@@ -5102,7 +5028,7 @@ async function sendSolanaTransaction(provider, _connection, transaction) {
|
|
|
5102
5028
|
}
|
|
5103
5029
|
|
|
5104
5030
|
// src/components/steps/SolanaConfirmStep.tsx
|
|
5105
|
-
import { jsx as
|
|
5031
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5106
5032
|
function SolanaConfirmStep({
|
|
5107
5033
|
smartAccount,
|
|
5108
5034
|
solanaAddress,
|
|
@@ -5255,8 +5181,8 @@ function SolanaConfirmStep({
|
|
|
5255
5181
|
};
|
|
5256
5182
|
return /* @__PURE__ */ jsxs19("div", { className: "rs-screen", children: [
|
|
5257
5183
|
/* @__PURE__ */ jsxs19("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5258
|
-
/* @__PURE__ */
|
|
5259
|
-
/* @__PURE__ */
|
|
5184
|
+
/* @__PURE__ */ jsx22(BodyHeader, { icon: /* @__PURE__ */ jsx22(WalletIcon, {}), title: "Review deposit" }),
|
|
5185
|
+
/* @__PURE__ */ jsx22(
|
|
5260
5186
|
ReviewDetails,
|
|
5261
5187
|
{
|
|
5262
5188
|
sourceChainName,
|
|
@@ -5273,8 +5199,8 @@ function SolanaConfirmStep({
|
|
|
5273
5199
|
fee: { display: "$0.04", struck: feeSponsored, tooltip: feeTooltip }
|
|
5274
5200
|
}
|
|
5275
5201
|
),
|
|
5276
|
-
error && /* @__PURE__ */
|
|
5277
|
-
/* @__PURE__ */
|
|
5202
|
+
error && /* @__PURE__ */ jsx22(Callout, { variant: "error", children: error }),
|
|
5203
|
+
/* @__PURE__ */ jsx22(
|
|
5278
5204
|
Button,
|
|
5279
5205
|
{
|
|
5280
5206
|
onClick: handleConfirm,
|
|
@@ -5286,12 +5212,12 @@ function SolanaConfirmStep({
|
|
|
5286
5212
|
}
|
|
5287
5213
|
)
|
|
5288
5214
|
] }),
|
|
5289
|
-
/* @__PURE__ */
|
|
5215
|
+
/* @__PURE__ */ jsx22(PoweredBy, {})
|
|
5290
5216
|
] });
|
|
5291
5217
|
}
|
|
5292
5218
|
|
|
5293
5219
|
// src/components/steps/DappImportAssetSelectStep.tsx
|
|
5294
|
-
import { jsx as
|
|
5220
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5295
5221
|
function DappImportAssetSelectStep({
|
|
5296
5222
|
sourceLabel,
|
|
5297
5223
|
assets,
|
|
@@ -5300,16 +5226,16 @@ function DappImportAssetSelectStep({
|
|
|
5300
5226
|
}) {
|
|
5301
5227
|
return /* @__PURE__ */ jsxs20("div", { className: "rs-screen", children: [
|
|
5302
5228
|
/* @__PURE__ */ jsxs20("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5303
|
-
/* @__PURE__ */
|
|
5229
|
+
/* @__PURE__ */ jsx23(
|
|
5304
5230
|
BodyHeader,
|
|
5305
5231
|
{
|
|
5306
|
-
icon: /* @__PURE__ */
|
|
5232
|
+
icon: /* @__PURE__ */ jsx23(WalletIcon, {}),
|
|
5307
5233
|
title: `Transfer from ${sourceLabel}`,
|
|
5308
5234
|
subtitle: "Pick the balance to import"
|
|
5309
5235
|
}
|
|
5310
5236
|
),
|
|
5311
|
-
incompleteSummary && /* @__PURE__ */
|
|
5312
|
-
/* @__PURE__ */
|
|
5237
|
+
incompleteSummary && /* @__PURE__ */ jsx23("div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
5238
|
+
/* @__PURE__ */ jsx23("div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
5313
5239
|
const tokenAmount = asset.balance ? tokenFormatter.format(
|
|
5314
5240
|
Number(asset.balance) / 10 ** asset.decimals
|
|
5315
5241
|
) : "0";
|
|
@@ -5326,7 +5252,7 @@ function DappImportAssetSelectStep({
|
|
|
5326
5252
|
children: [
|
|
5327
5253
|
/* @__PURE__ */ jsxs20("div", { className: "rs-asset-info", children: [
|
|
5328
5254
|
/* @__PURE__ */ jsxs20("div", { className: "rs-asset-icon-wrapper", children: [
|
|
5329
|
-
/* @__PURE__ */
|
|
5255
|
+
/* @__PURE__ */ jsx23("span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ jsx23(CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ jsx23(
|
|
5330
5256
|
TokenIcon,
|
|
5331
5257
|
{
|
|
5332
5258
|
token: { chain: asset.chainId, address: asset.token },
|
|
@@ -5334,7 +5260,7 @@ function DappImportAssetSelectStep({
|
|
|
5334
5260
|
fallback: asset.symbol.slice(0, 4)
|
|
5335
5261
|
}
|
|
5336
5262
|
) }),
|
|
5337
|
-
chainIcon ? /* @__PURE__ */
|
|
5263
|
+
chainIcon ? /* @__PURE__ */ jsx23("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx23(CdnIcon, { src: chainIcon, alt: getChainName(asset.chainId) }) }) : /* @__PURE__ */ jsx23(
|
|
5338
5264
|
"span",
|
|
5339
5265
|
{
|
|
5340
5266
|
className: "rs-asset-chain-badge",
|
|
@@ -5345,7 +5271,7 @@ function DappImportAssetSelectStep({
|
|
|
5345
5271
|
] }),
|
|
5346
5272
|
/* @__PURE__ */ jsxs20("div", { className: "rs-asset-text", children: [
|
|
5347
5273
|
/* @__PURE__ */ jsxs20("div", { className: "rs-asset-name-row", children: [
|
|
5348
|
-
/* @__PURE__ */
|
|
5274
|
+
/* @__PURE__ */ jsx23("span", { className: "rs-asset-name", children: asset.symbol }),
|
|
5349
5275
|
/* @__PURE__ */ jsxs20("span", { className: "rs-asset-chain", children: [
|
|
5350
5276
|
"on ",
|
|
5351
5277
|
asset.sourceLabel,
|
|
@@ -5359,20 +5285,20 @@ function DappImportAssetSelectStep({
|
|
|
5359
5285
|
] })
|
|
5360
5286
|
] })
|
|
5361
5287
|
] }),
|
|
5362
|
-
/* @__PURE__ */
|
|
5288
|
+
/* @__PURE__ */ jsx23("div", { className: "rs-asset-balance", children: balanceUsd })
|
|
5363
5289
|
]
|
|
5364
5290
|
},
|
|
5365
5291
|
asset.id
|
|
5366
5292
|
);
|
|
5367
5293
|
}) })
|
|
5368
5294
|
] }),
|
|
5369
|
-
/* @__PURE__ */
|
|
5295
|
+
/* @__PURE__ */ jsx23(PoweredBy, {})
|
|
5370
5296
|
] });
|
|
5371
5297
|
}
|
|
5372
5298
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
5373
5299
|
|
|
5374
5300
|
// src/components/steps/DappImportSelectStep.tsx
|
|
5375
|
-
import { jsx as
|
|
5301
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5376
5302
|
function describeRow(status, comingSoon) {
|
|
5377
5303
|
if (comingSoon) {
|
|
5378
5304
|
return { subtitle: "Coming soon", disabled: true, busy: false };
|
|
@@ -5410,28 +5336,28 @@ function DappImportSelectStep({
|
|
|
5410
5336
|
const brands = DAPP_IMPORT_CATALOG.filter((brand) => enabled.has(brand.id));
|
|
5411
5337
|
return /* @__PURE__ */ jsxs21("div", { className: "rs-screen", children: [
|
|
5412
5338
|
/* @__PURE__ */ jsxs21("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5413
|
-
/* @__PURE__ */
|
|
5339
|
+
/* @__PURE__ */ jsx24(
|
|
5414
5340
|
BodyHeader,
|
|
5415
5341
|
{
|
|
5416
|
-
icon: /* @__PURE__ */
|
|
5342
|
+
icon: /* @__PURE__ */ jsx24(MigrateAssetsIcon, {}),
|
|
5417
5343
|
title: "Migrate assets",
|
|
5418
5344
|
subtitle: "Select a position to migrate"
|
|
5419
5345
|
}
|
|
5420
5346
|
),
|
|
5421
|
-
/* @__PURE__ */
|
|
5347
|
+
/* @__PURE__ */ jsx24("div", { className: "rs-list", children: brands.map((brand) => {
|
|
5422
5348
|
const status = byId.get(brand.id);
|
|
5423
5349
|
const { subtitle, disabled, busy } = describeRow(
|
|
5424
5350
|
status,
|
|
5425
5351
|
Boolean(brand.comingSoon)
|
|
5426
5352
|
);
|
|
5427
|
-
return /* @__PURE__ */
|
|
5353
|
+
return /* @__PURE__ */ jsx24(
|
|
5428
5354
|
ListRow,
|
|
5429
5355
|
{
|
|
5430
5356
|
leadingMedia: brand.iconUrl,
|
|
5431
5357
|
title: brand.label,
|
|
5432
5358
|
subtitle,
|
|
5433
5359
|
disabled,
|
|
5434
|
-
trailing: busy ? /* @__PURE__ */
|
|
5360
|
+
trailing: busy ? /* @__PURE__ */ jsx24(Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
5435
5361
|
onClick: () => {
|
|
5436
5362
|
if (status === "needs-connect") {
|
|
5437
5363
|
onRequestConnect?.();
|
|
@@ -5444,13 +5370,13 @@ function DappImportSelectStep({
|
|
|
5444
5370
|
);
|
|
5445
5371
|
}) })
|
|
5446
5372
|
] }),
|
|
5447
|
-
/* @__PURE__ */
|
|
5373
|
+
/* @__PURE__ */ jsx24(PoweredBy, {})
|
|
5448
5374
|
] });
|
|
5449
5375
|
}
|
|
5450
5376
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
5451
5377
|
|
|
5452
5378
|
// src/components/steps/DappImportAssetSelectSkeleton.tsx
|
|
5453
|
-
import { jsx as
|
|
5379
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5454
5380
|
function DappImportAssetSelectSkeleton({
|
|
5455
5381
|
sourceLabel,
|
|
5456
5382
|
rowCount = 3,
|
|
@@ -5458,64 +5384,64 @@ function DappImportAssetSelectSkeleton({
|
|
|
5458
5384
|
onRetry
|
|
5459
5385
|
}) {
|
|
5460
5386
|
return /* @__PURE__ */ jsxs22("div", { className: "rs-screen", "aria-busy": error ? "false" : "true", children: [
|
|
5461
|
-
/* @__PURE__ */
|
|
5387
|
+
/* @__PURE__ */ jsx25("span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
5462
5388
|
/* @__PURE__ */ jsxs22("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5463
|
-
/* @__PURE__ */
|
|
5389
|
+
/* @__PURE__ */ jsx25(
|
|
5464
5390
|
BodyHeader,
|
|
5465
5391
|
{
|
|
5466
|
-
icon: /* @__PURE__ */
|
|
5392
|
+
icon: /* @__PURE__ */ jsx25(WalletIcon, {}),
|
|
5467
5393
|
title: `Transfer from ${sourceLabel}`,
|
|
5468
5394
|
subtitle: "Pick the balance to import"
|
|
5469
5395
|
}
|
|
5470
5396
|
),
|
|
5471
|
-
error ? /* @__PURE__ */
|
|
5472
|
-
/* @__PURE__ */
|
|
5473
|
-
/* @__PURE__ */
|
|
5474
|
-
] }) }) : /* @__PURE__ */
|
|
5397
|
+
error ? /* @__PURE__ */ jsx25("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsxs22("div", { className: "rs-loading-text", children: [
|
|
5398
|
+
/* @__PURE__ */ jsx25("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t load your balances" }),
|
|
5399
|
+
/* @__PURE__ */ jsx25("div", { className: "rs-loading-subtitle", children: "Check your connection and try again." })
|
|
5400
|
+
] }) }) : /* @__PURE__ */ jsx25("div", { className: "rs-asset-list", "aria-hidden": "true", children: Array.from({ length: rowCount }, (_, index) => /* @__PURE__ */ jsxs22(
|
|
5475
5401
|
"div",
|
|
5476
5402
|
{
|
|
5477
5403
|
className: "rs-asset-row rs-asset-row--skeleton",
|
|
5478
5404
|
children: [
|
|
5479
5405
|
/* @__PURE__ */ jsxs22("div", { className: "rs-asset-info", children: [
|
|
5480
5406
|
/* @__PURE__ */ jsxs22("div", { className: "rs-asset-icon-wrapper", children: [
|
|
5481
|
-
/* @__PURE__ */
|
|
5482
|
-
/* @__PURE__ */
|
|
5407
|
+
/* @__PURE__ */ jsx25("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx25("span", { className: "rs-skeleton rs-skeleton-fill" }) }),
|
|
5408
|
+
/* @__PURE__ */ jsx25("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx25("span", { className: "rs-skeleton rs-skeleton-fill" }) })
|
|
5483
5409
|
] }),
|
|
5484
5410
|
/* @__PURE__ */ jsxs22("div", { className: "rs-asset-text", children: [
|
|
5485
|
-
/* @__PURE__ */
|
|
5486
|
-
/* @__PURE__ */
|
|
5411
|
+
/* @__PURE__ */ jsx25("div", { className: "rs-asset-name-row", children: /* @__PURE__ */ jsx25("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--name" }) }),
|
|
5412
|
+
/* @__PURE__ */ jsx25("div", { className: "rs-asset-balance-small", children: /* @__PURE__ */ jsx25("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--balance" }) })
|
|
5487
5413
|
] })
|
|
5488
5414
|
] }),
|
|
5489
|
-
/* @__PURE__ */
|
|
5415
|
+
/* @__PURE__ */ jsx25("div", { className: "rs-asset-balance", children: /* @__PURE__ */ jsx25("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--usd" }) })
|
|
5490
5416
|
]
|
|
5491
5417
|
},
|
|
5492
5418
|
index
|
|
5493
5419
|
)) })
|
|
5494
5420
|
] }),
|
|
5495
|
-
error && onRetry && /* @__PURE__ */
|
|
5421
|
+
error && onRetry && /* @__PURE__ */ jsx25("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx25(
|
|
5496
5422
|
"button",
|
|
5497
5423
|
{
|
|
5498
5424
|
type: "button",
|
|
5499
5425
|
className: "rs-button rs-button--default rs-button--full-width",
|
|
5500
5426
|
onClick: onRetry,
|
|
5501
|
-
children: /* @__PURE__ */
|
|
5427
|
+
children: /* @__PURE__ */ jsx25("span", { children: "Try again" })
|
|
5502
5428
|
}
|
|
5503
5429
|
) }),
|
|
5504
|
-
/* @__PURE__ */
|
|
5430
|
+
/* @__PURE__ */ jsx25(PoweredBy, {})
|
|
5505
5431
|
] });
|
|
5506
5432
|
}
|
|
5507
5433
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
5508
5434
|
|
|
5509
5435
|
// src/core/fiat-methods.ts
|
|
5510
5436
|
var REGIONAL_METHODS_TIMEOUT_MS = 3e3;
|
|
5511
|
-
var
|
|
5437
|
+
var PRODUCT_METHODS = /* @__PURE__ */ new Set([
|
|
5512
5438
|
"creditcard",
|
|
5513
5439
|
"bank-transfer",
|
|
5514
5440
|
"apple-pay"
|
|
5515
5441
|
]);
|
|
5516
5442
|
function serverMethodToOption(m) {
|
|
5517
5443
|
const icon = m.method === "bank-transfer" ? "bank" : m.method === "apple-pay" ? "apple" : "card";
|
|
5518
|
-
const remoteIcon =
|
|
5444
|
+
const remoteIcon = PRODUCT_METHODS.has(m.method) ? {} : {
|
|
5519
5445
|
iconUrl: m.iconUrl ?? void 0,
|
|
5520
5446
|
iconUrlLight: m.iconUrlLight ?? void 0
|
|
5521
5447
|
};
|
|
@@ -5550,8 +5476,9 @@ function composeFiatMethods(regional, fallbackMethods) {
|
|
|
5550
5476
|
source: "fallback"
|
|
5551
5477
|
};
|
|
5552
5478
|
}
|
|
5553
|
-
|
|
5554
|
-
|
|
5479
|
+
const methods = dedupe(
|
|
5480
|
+
regional.methods.filter((m) => PRODUCT_METHODS.has(m.method) || m.badge === "Popular").map(serverMethodToOption)
|
|
5481
|
+
);
|
|
5555
5482
|
if (methods.length === 0) return { kind: "hidden" };
|
|
5556
5483
|
const recommendedMethod = regional.recommendedMethod && methods.some(({ method }) => method === regional.recommendedMethod) ? regional.recommendedMethod : methods[0].method;
|
|
5557
5484
|
return {
|
|
@@ -6127,7 +6054,7 @@ import {
|
|
|
6127
6054
|
useContext,
|
|
6128
6055
|
useMemo as useMemo7
|
|
6129
6056
|
} from "react";
|
|
6130
|
-
import { jsx as
|
|
6057
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
6131
6058
|
function fundingMethodForFlowMode(mode) {
|
|
6132
6059
|
switch (mode) {
|
|
6133
6060
|
case "wallet":
|
|
@@ -6188,7 +6115,15 @@ function analyticsStepForFlowStep(method, step) {
|
|
|
6188
6115
|
return "funding_method_home";
|
|
6189
6116
|
}
|
|
6190
6117
|
}
|
|
6118
|
+
var BANK_FAILURES = {
|
|
6119
|
+
BANK_ONRAMP_OPTIONS_FAILED: "bank_options_failed",
|
|
6120
|
+
BANK_ONRAMP_SETUP_FAILED: "bank_setup_failed",
|
|
6121
|
+
BANK_ONRAMP_DETAILS_FAILED: "bank_details_failed",
|
|
6122
|
+
BANK_ONRAMP_DETAILS_PENDING: "bank_details_pending"
|
|
6123
|
+
};
|
|
6191
6124
|
function failureReasonForCode(code, cause) {
|
|
6125
|
+
const bank = code ? BANK_FAILURES[code] : void 0;
|
|
6126
|
+
if (bank) return bank;
|
|
6192
6127
|
const normalized = `${code ?? ""} ${cause ?? ""}`.toLowerCase();
|
|
6193
6128
|
if (normalized.includes("uncertain")) return "submission_uncertain";
|
|
6194
6129
|
if (normalized.includes("reject") && (normalized.includes("sign") || normalized.includes("permit"))) {
|
|
@@ -6423,7 +6358,7 @@ function DepositAnalyticsControllerProvider({
|
|
|
6423
6358
|
[emit]
|
|
6424
6359
|
);
|
|
6425
6360
|
if (controllerRef) controllerRef.current = controller;
|
|
6426
|
-
return /* @__PURE__ */
|
|
6361
|
+
return /* @__PURE__ */ jsx26(DepositAnalyticsControllerContext.Provider, { value: controller, children });
|
|
6427
6362
|
}
|
|
6428
6363
|
function useDepositAnalyticsController() {
|
|
6429
6364
|
return useContext(DepositAnalyticsControllerContext) ?? noopController;
|
|
@@ -6505,7 +6440,8 @@ function createInitialState(overrides) {
|
|
|
6505
6440
|
},
|
|
6506
6441
|
fiat: {
|
|
6507
6442
|
selectedMethod: null,
|
|
6508
|
-
methodSelectionSource: null
|
|
6443
|
+
methodSelectionSource: null,
|
|
6444
|
+
selectedProvider: null
|
|
6509
6445
|
},
|
|
6510
6446
|
exchange: {
|
|
6511
6447
|
selectedConnection: null
|
|
@@ -6793,7 +6729,8 @@ function applyAction(state, action) {
|
|
|
6793
6729
|
fiat: {
|
|
6794
6730
|
...state.fiat,
|
|
6795
6731
|
selectedMethod: action.paymentMethod ?? null,
|
|
6796
|
-
methodSelectionSource: action.methodSelectionSource ?? null
|
|
6732
|
+
methodSelectionSource: action.methodSelectionSource ?? null,
|
|
6733
|
+
selectedProvider: action.provider ?? null
|
|
6797
6734
|
},
|
|
6798
6735
|
// Pin on ENTRY, not on submit: a Swapped order only reports a
|
|
6799
6736
|
// submission on terminal success, so between paying and that callback
|
|
@@ -7374,7 +7311,11 @@ function applyAction(state, action) {
|
|
|
7374
7311
|
byKey: {},
|
|
7375
7312
|
nextRequestId: state.portfolio.nextRequestId
|
|
7376
7313
|
},
|
|
7377
|
-
fiat: {
|
|
7314
|
+
fiat: {
|
|
7315
|
+
selectedMethod: null,
|
|
7316
|
+
methodSelectionSource: null,
|
|
7317
|
+
selectedProvider: null
|
|
7318
|
+
},
|
|
7378
7319
|
exchange: { selectedConnection: null }
|
|
7379
7320
|
};
|
|
7380
7321
|
}
|
|
@@ -7450,11 +7391,7 @@ function useDepositStore(selector) {
|
|
|
7450
7391
|
}
|
|
7451
7392
|
|
|
7452
7393
|
// src/DepositFlow.tsx
|
|
7453
|
-
import { Fragment as Fragment6, jsx as
|
|
7454
|
-
var BankOnrampStep = lazy2(async () => {
|
|
7455
|
-
const module = await import("./BankOnrampStep-JG32OCM2.mjs");
|
|
7456
|
-
return { default: module.BankOnrampStep };
|
|
7457
|
-
});
|
|
7394
|
+
import { Fragment as Fragment6, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
7458
7395
|
function swappedWidgetPrefetchKey(method, methodSelectionSource) {
|
|
7459
7396
|
return JSON.stringify([methodSelectionSource ?? null, method ?? null]);
|
|
7460
7397
|
}
|
|
@@ -7463,17 +7400,17 @@ function AccountPreparingSkeleton({
|
|
|
7463
7400
|
onRetry
|
|
7464
7401
|
}) {
|
|
7465
7402
|
return /* @__PURE__ */ jsxs23("div", { className: "rs-step", children: [
|
|
7466
|
-
/* @__PURE__ */
|
|
7467
|
-
/* @__PURE__ */
|
|
7468
|
-
/* @__PURE__ */
|
|
7469
|
-
] }) : /* @__PURE__ */
|
|
7470
|
-
errorMessage && onRetry && /* @__PURE__ */
|
|
7403
|
+
/* @__PURE__ */ jsx27("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: /* @__PURE__ */ jsx27("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx27("div", { className: "rs-loading-text", children: errorMessage ? /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
7404
|
+
/* @__PURE__ */ jsx27("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t prepare account" }),
|
|
7405
|
+
/* @__PURE__ */ jsx27("div", { className: "rs-loading-subtitle", children: errorMessage })
|
|
7406
|
+
] }) : /* @__PURE__ */ jsx27("div", { className: "rs-loading-title", children: "Preparing\u2026" }) }) }) }),
|
|
7407
|
+
errorMessage && onRetry && /* @__PURE__ */ jsx27("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx27(
|
|
7471
7408
|
"button",
|
|
7472
7409
|
{
|
|
7473
7410
|
type: "button",
|
|
7474
7411
|
className: "rs-button rs-button--default rs-button--full-width",
|
|
7475
7412
|
onClick: onRetry,
|
|
7476
|
-
children: /* @__PURE__ */
|
|
7413
|
+
children: /* @__PURE__ */ jsx27("span", { children: "Try again" })
|
|
7477
7414
|
}
|
|
7478
7415
|
) })
|
|
7479
7416
|
] });
|
|
@@ -7557,7 +7494,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
|
|
|
7557
7494
|
type: "fiat-onramp",
|
|
7558
7495
|
smartAccount: committedAccount,
|
|
7559
7496
|
paymentMethod: fiat.selectedMethod ?? void 0,
|
|
7560
|
-
methodSelectionSource: fiat.methodSelectionSource ?? void 0
|
|
7497
|
+
methodSelectionSource: fiat.methodSelectionSource ?? void 0,
|
|
7498
|
+
provider: fiat.selectedProvider ?? void 0
|
|
7561
7499
|
};
|
|
7562
7500
|
case "exchange-select":
|
|
7563
7501
|
return { type: "exchange-select" };
|
|
@@ -7769,13 +7707,13 @@ function DepositFlow({
|
|
|
7769
7707
|
const [totalBalanceUsd, setTotalBalanceUsd] = useState13(0);
|
|
7770
7708
|
const stableWalletSignerRef = useRef9(null);
|
|
7771
7709
|
const stableWalletSelectionKeyRef = useRef9(null);
|
|
7772
|
-
const logFlow =
|
|
7710
|
+
const logFlow = useCallback6(
|
|
7773
7711
|
(message, data) => {
|
|
7774
7712
|
debugLog(debug, "deposit-flow", message, data);
|
|
7775
7713
|
},
|
|
7776
7714
|
[debug]
|
|
7777
7715
|
);
|
|
7778
|
-
const logFlowError =
|
|
7716
|
+
const logFlowError = useCallback6(
|
|
7779
7717
|
(message, error, data) => {
|
|
7780
7718
|
debugError(debug, "deposit-flow", message, error, data);
|
|
7781
7719
|
},
|
|
@@ -8129,7 +8067,7 @@ function DepositFlow({
|
|
|
8129
8067
|
]
|
|
8130
8068
|
);
|
|
8131
8069
|
const step = effectiveStep;
|
|
8132
|
-
const handleBack =
|
|
8070
|
+
const handleBack = useCallback6(() => {
|
|
8133
8071
|
if ([
|
|
8134
8072
|
"deposit-address",
|
|
8135
8073
|
"select-asset",
|
|
@@ -8157,7 +8095,7 @@ function DepositFlow({
|
|
|
8157
8095
|
hasWalletOptions,
|
|
8158
8096
|
walletSession
|
|
8159
8097
|
]);
|
|
8160
|
-
const handleProviderBack =
|
|
8098
|
+
const handleProviderBack = useCallback6(() => {
|
|
8161
8099
|
analytics.abandon("provider_back");
|
|
8162
8100
|
analytics.resetAttempt(
|
|
8163
8101
|
flowMode === "exchange-connect" ? "exchange_connect" : null
|
|
@@ -8167,7 +8105,7 @@ function DepositFlow({
|
|
|
8167
8105
|
hasWalletOptions: hasWalletOptions || Boolean(walletSession)
|
|
8168
8106
|
});
|
|
8169
8107
|
}, [analytics, flowMode, storeApi, hasWalletOptions, walletSession]);
|
|
8170
|
-
const handleWalletDisconnect =
|
|
8108
|
+
const handleWalletDisconnect = useCallback6(() => {
|
|
8171
8109
|
analytics.abandon("wallet_disconnect");
|
|
8172
8110
|
analytics.resetAttempt();
|
|
8173
8111
|
onDisconnect?.();
|
|
@@ -8290,11 +8228,11 @@ function DepositFlow({
|
|
|
8290
8228
|
const isDappImportMode = flowMode === "dapp-import";
|
|
8291
8229
|
const isFiatOnrampMode = flowMode === "fiat-onramp";
|
|
8292
8230
|
const isExchangeConnectMode = flowMode === "exchange-connect";
|
|
8293
|
-
const handleSelectTransferCrypto =
|
|
8231
|
+
const handleSelectTransferCrypto = useCallback6(() => {
|
|
8294
8232
|
analytics.selectMethod("transfer", "user");
|
|
8295
8233
|
storeApi.dispatch({ type: "connect/transfer-crypto-selected" });
|
|
8296
8234
|
}, [analytics, storeApi]);
|
|
8297
|
-
const handleConfirmWallet =
|
|
8235
|
+
const handleConfirmWallet = useCallback6(
|
|
8298
8236
|
(walletId) => {
|
|
8299
8237
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
8300
8238
|
const mode = selectedOption?.kind === "solana" ? "solana-wallet" : "wallet";
|
|
@@ -8325,7 +8263,7 @@ function DepositFlow({
|
|
|
8325
8263
|
) ?? null : null,
|
|
8326
8264
|
[initialAssetMigration, enabledDappImportProviders]
|
|
8327
8265
|
);
|
|
8328
|
-
const handleSelectDappImport =
|
|
8266
|
+
const handleSelectDappImport = useCallback6(
|
|
8329
8267
|
(providerId) => {
|
|
8330
8268
|
const owner = dappImportOwner;
|
|
8331
8269
|
if (owner) {
|
|
@@ -8349,7 +8287,7 @@ function DepositFlow({
|
|
|
8349
8287
|
},
|
|
8350
8288
|
[analytics, storeApi, walletOptions, dappImportOwner]
|
|
8351
8289
|
);
|
|
8352
|
-
const handleDappImportAssetSelected =
|
|
8290
|
+
const handleDappImportAssetSelected = useCallback6(
|
|
8353
8291
|
(asset) => {
|
|
8354
8292
|
storeApi.dispatch({ type: "dapp-import/asset-selected", asset });
|
|
8355
8293
|
},
|
|
@@ -8569,7 +8507,7 @@ function DepositFlow({
|
|
|
8569
8507
|
analytics,
|
|
8570
8508
|
storeApi
|
|
8571
8509
|
]);
|
|
8572
|
-
const handleBootRetry =
|
|
8510
|
+
const handleBootRetry = useCallback6(() => {
|
|
8573
8511
|
analytics.retry("migration_availability_failed", "migration_boot_resolve");
|
|
8574
8512
|
const snapshot = storeApi.getState();
|
|
8575
8513
|
const providerId = snapshot.dappImport.activeProviderId;
|
|
@@ -8593,32 +8531,34 @@ function DepositFlow({
|
|
|
8593
8531
|
providerId
|
|
8594
8532
|
});
|
|
8595
8533
|
}, [analytics, storeApi, dappImportOwner]);
|
|
8596
|
-
const handleSelectFiatMethod =
|
|
8597
|
-
(paymentMethod, methodSelectionSource) => {
|
|
8534
|
+
const handleSelectFiatMethod = useCallback6(
|
|
8535
|
+
(paymentMethod, methodSelectionSource, provider = "swapped") => {
|
|
8598
8536
|
analytics.selectMethod("fiat_onramp", "user", {
|
|
8599
8537
|
payment_method: paymentMethod,
|
|
8600
|
-
source: methodSelectionSource
|
|
8538
|
+
source: methodSelectionSource,
|
|
8539
|
+
provider
|
|
8601
8540
|
});
|
|
8602
8541
|
storeApi.dispatch({
|
|
8603
8542
|
type: "connect/fiat-onramp-selected",
|
|
8604
8543
|
paymentMethod,
|
|
8605
|
-
methodSelectionSource
|
|
8544
|
+
methodSelectionSource,
|
|
8545
|
+
provider
|
|
8606
8546
|
});
|
|
8607
8547
|
},
|
|
8608
8548
|
[analytics, storeApi]
|
|
8609
8549
|
);
|
|
8610
|
-
const handleSelectExchange =
|
|
8550
|
+
const handleSelectExchange = useCallback6(() => {
|
|
8611
8551
|
analytics.selectMethod("exchange_connect", "user");
|
|
8612
8552
|
storeApi.dispatch({ type: "connect/exchange-selected" });
|
|
8613
8553
|
}, [analytics, storeApi]);
|
|
8614
8554
|
const swappedAnalyticsCorrelatorRef = useRef9(null);
|
|
8615
|
-
const handleSwappedAttemptConsumed =
|
|
8555
|
+
const handleSwappedAttemptConsumed = useCallback6(
|
|
8616
8556
|
(externalCustomerId) => {
|
|
8617
8557
|
swappedAnalyticsCorrelatorRef.current = externalCustomerId;
|
|
8618
8558
|
},
|
|
8619
8559
|
[]
|
|
8620
8560
|
);
|
|
8621
|
-
const handleSwappedProviderHandoff =
|
|
8561
|
+
const handleSwappedProviderHandoff = useCallback6(() => {
|
|
8622
8562
|
const externalCustomerId = swappedAnalyticsCorrelatorRef.current;
|
|
8623
8563
|
if (!externalCustomerId) return;
|
|
8624
8564
|
analytics.handoff(
|
|
@@ -8627,7 +8567,7 @@ function DepositFlow({
|
|
|
8627
8567
|
flowMode === "exchange-connect" ? "exchange_provider_handoff" : "fiat_provider_handoff"
|
|
8628
8568
|
);
|
|
8629
8569
|
}, [analytics, flowMode]);
|
|
8630
|
-
const handleSwappedRetry =
|
|
8570
|
+
const handleSwappedRetry = useCallback6(() => {
|
|
8631
8571
|
analytics.retry(
|
|
8632
8572
|
"swapped_mint_failed",
|
|
8633
8573
|
flowMode === "exchange-connect" ? "exchange_provider_mint" : "fiat_provider_mint"
|
|
@@ -8635,7 +8575,7 @@ function DepositFlow({
|
|
|
8635
8575
|
swappedAnalyticsCorrelatorRef.current = null;
|
|
8636
8576
|
}, [analytics, flowMode]);
|
|
8637
8577
|
const swappedConnectUrlRef = useRef9(/* @__PURE__ */ new Map());
|
|
8638
|
-
const handleSelectExchangeConnection =
|
|
8578
|
+
const handleSelectExchangeConnection = useCallback6(
|
|
8639
8579
|
async (connection) => {
|
|
8640
8580
|
if (setupSlice.status !== "ready" || !setupSlice.smartAccount) {
|
|
8641
8581
|
throw new Error("Deposit account is not ready");
|
|
@@ -8666,7 +8606,7 @@ function DepositFlow({
|
|
|
8666
8606
|
},
|
|
8667
8607
|
[analytics, service, setupSlice.status, setupSlice.smartAccount, storeApi]
|
|
8668
8608
|
);
|
|
8669
|
-
const loadSwappedConnectUrl =
|
|
8609
|
+
const loadSwappedConnectUrl = useCallback6(
|
|
8670
8610
|
async (smartAccount, connection) => {
|
|
8671
8611
|
const key = `${smartAccount.toLowerCase()}:${connection}`;
|
|
8672
8612
|
const entry = swappedConnectUrlRef.current.get(key);
|
|
@@ -8676,7 +8616,7 @@ function DepositFlow({
|
|
|
8676
8616
|
[service]
|
|
8677
8617
|
);
|
|
8678
8618
|
const swappedUrlPrefetchRef = useRef9(/* @__PURE__ */ new Map());
|
|
8679
|
-
const prefetchSwappedWidgetUrl =
|
|
8619
|
+
const prefetchSwappedWidgetUrl = useCallback6(
|
|
8680
8620
|
(smartAccount, method, methodSelectionSource) => {
|
|
8681
8621
|
const cache = swappedUrlPrefetchRef.current;
|
|
8682
8622
|
const key = swappedWidgetPrefetchKey(method, methodSelectionSource);
|
|
@@ -8698,7 +8638,7 @@ function DepositFlow({
|
|
|
8698
8638
|
},
|
|
8699
8639
|
[service, logFlow]
|
|
8700
8640
|
);
|
|
8701
|
-
const consumeSwappedWidgetUrlPrefetch =
|
|
8641
|
+
const consumeSwappedWidgetUrlPrefetch = useCallback6(
|
|
8702
8642
|
(smartAccount, method, methodSelectionSource) => {
|
|
8703
8643
|
const cache = swappedUrlPrefetchRef.current;
|
|
8704
8644
|
const key = swappedWidgetPrefetchKey(method, methodSelectionSource);
|
|
@@ -8710,7 +8650,7 @@ function DepositFlow({
|
|
|
8710
8650
|
},
|
|
8711
8651
|
[]
|
|
8712
8652
|
);
|
|
8713
|
-
const handlePrefetchFiatMethod =
|
|
8653
|
+
const handlePrefetchFiatMethod = useCallback6(
|
|
8714
8654
|
(method, methodSelectionSource) => {
|
|
8715
8655
|
if (!fiatEnabled) return;
|
|
8716
8656
|
if (setupSlice.status !== "ready" || !setupSlice.smartAccount) return;
|
|
@@ -8732,6 +8672,31 @@ function DepositFlow({
|
|
|
8732
8672
|
swappedConnectUrlRef.current.clear();
|
|
8733
8673
|
}, [setupSlice.smartAccount]);
|
|
8734
8674
|
const hasConfiguredFiatMethods = fiatMethods !== void 0;
|
|
8675
|
+
const [providers, setProviders] = useState13("loading");
|
|
8676
|
+
useEffect13(() => {
|
|
8677
|
+
if (!enableFiatOnramp && !bankOnrampEnabled && !enableExchangeConnect) {
|
|
8678
|
+
return;
|
|
8679
|
+
}
|
|
8680
|
+
let settled = false;
|
|
8681
|
+
const settle = (list) => {
|
|
8682
|
+
if (settled) return;
|
|
8683
|
+
settled = true;
|
|
8684
|
+
clearTimeout(timer);
|
|
8685
|
+
setProviders(list);
|
|
8686
|
+
};
|
|
8687
|
+
setProviders("loading");
|
|
8688
|
+
const timer = setTimeout(() => settle(null), REGIONAL_METHODS_TIMEOUT_MS);
|
|
8689
|
+
void service.getOnrampProviders().then(settle);
|
|
8690
|
+
return () => {
|
|
8691
|
+
settled = true;
|
|
8692
|
+
clearTimeout(timer);
|
|
8693
|
+
};
|
|
8694
|
+
}, [bankOnrampEnabled, enableExchangeConnect, enableFiatOnramp, service]);
|
|
8695
|
+
const providersLoading = providers === "loading";
|
|
8696
|
+
const offers = (provider, kind) => providers === null || providers !== "loading" && providers.some((p) => p.provider === provider && p.kinds.includes(kind));
|
|
8697
|
+
const swappedFiatOffered = offers("swapped", "fiat");
|
|
8698
|
+
const noahOffered = offers("noah", "fiat");
|
|
8699
|
+
const exchangeOffered = enableExchangeConnect && offers("swapped", "exchange");
|
|
8735
8700
|
const [regionalMethods, setRegionalMethods] = useState13({
|
|
8736
8701
|
status: "loading",
|
|
8737
8702
|
country: null,
|
|
@@ -8779,7 +8744,7 @@ function DepositFlow({
|
|
|
8779
8744
|
};
|
|
8780
8745
|
}, [analytics, enableFiatOnramp, hasConfiguredFiatMethods, service]);
|
|
8781
8746
|
const swappedCashDisplay = useMemo8(
|
|
8782
|
-
() => !enableFiatOnramp ? { kind: "hidden" } : hasConfiguredFiatMethods ? {
|
|
8747
|
+
() => !enableFiatOnramp || !swappedFiatOffered ? { kind: "hidden" } : hasConfiguredFiatMethods ? {
|
|
8783
8748
|
kind: "list",
|
|
8784
8749
|
methods: configuredFiatMethods,
|
|
8785
8750
|
recommendedMethod: configuredFiatMethods[0]?.method ?? "bank-transfer",
|
|
@@ -8790,25 +8755,30 @@ function DepositFlow({
|
|
|
8790
8755
|
configuredFiatMethods,
|
|
8791
8756
|
enableFiatOnramp,
|
|
8792
8757
|
hasConfiguredFiatMethods,
|
|
8793
|
-
regionalMethods
|
|
8758
|
+
regionalMethods,
|
|
8759
|
+
swappedFiatOffered
|
|
8794
8760
|
]
|
|
8795
8761
|
);
|
|
8796
8762
|
const swappedOffersBank = swappedCashDisplay.kind === "list" && swappedCashDisplay.methods.some(({ method }) => method === "bank-transfer");
|
|
8797
8763
|
const [bankOnrampUnavailable, setBankOnrampUnavailable] = useState13(false);
|
|
8798
|
-
const bankRowOffered = bankOnrampEnabled && !bankOnrampUnavailable;
|
|
8764
|
+
const bankRowOffered = bankOnrampEnabled && noahOffered && !bankOnrampUnavailable;
|
|
8799
8765
|
const swappedRefusesBank = hasConfiguredFiatMethods ? !configuredFiatMethods.some(({ method }) => method === "bank-transfer") : regionalMethods.status === "ready" && regionalMethods.country !== null && !regionalMethods.methods.some(({ method }) => method === "bank-transfer");
|
|
8800
|
-
const handleBankOnrampUnavailable =
|
|
8766
|
+
const handleBankOnrampUnavailable = useCallback6(() => {
|
|
8801
8767
|
setBankOnrampUnavailable(true);
|
|
8802
8768
|
if (swappedRefusesBank) handleProviderBack();
|
|
8803
8769
|
}, [handleProviderBack, swappedRefusesBank]);
|
|
8804
8770
|
const cashDisplay = useMemo8(() => {
|
|
8771
|
+
if (providersLoading && fiatEnabled) return { kind: "loading" };
|
|
8805
8772
|
const swappedDisplay = swappedCashDisplay;
|
|
8806
8773
|
if (!bankRowOffered || swappedDisplay.kind === "loading") {
|
|
8807
8774
|
return swappedDisplay;
|
|
8808
8775
|
}
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8776
|
+
const asNoah = (m) => m.method === "bank-transfer" ? { ...m, provider: "noah" } : m;
|
|
8777
|
+
if (swappedOffersBank && swappedDisplay.kind === "list") {
|
|
8778
|
+
return { ...swappedDisplay, methods: swappedDisplay.methods.map(asNoah) };
|
|
8779
|
+
}
|
|
8780
|
+
const bankTransfer = asNoah(
|
|
8781
|
+
FIAT_ONRAMP_METHODS.find(({ method }) => method === "bank-transfer")
|
|
8812
8782
|
);
|
|
8813
8783
|
return {
|
|
8814
8784
|
kind: "list",
|
|
@@ -8817,7 +8787,13 @@ function DepositFlow({
|
|
|
8817
8787
|
country: swappedDisplay.kind === "list" ? swappedDisplay.country : null,
|
|
8818
8788
|
source: swappedDisplay.kind === "list" ? swappedDisplay.source : "configured"
|
|
8819
8789
|
};
|
|
8820
|
-
}, [
|
|
8790
|
+
}, [
|
|
8791
|
+
bankRowOffered,
|
|
8792
|
+
fiatEnabled,
|
|
8793
|
+
providersLoading,
|
|
8794
|
+
swappedCashDisplay,
|
|
8795
|
+
swappedOffersBank
|
|
8796
|
+
]);
|
|
8821
8797
|
useEffect13(() => {
|
|
8822
8798
|
if (cashDisplay.kind === "hidden" && fiatEnabled) {
|
|
8823
8799
|
analytics.friction(
|
|
@@ -8832,22 +8808,25 @@ function DepositFlow({
|
|
|
8832
8808
|
}
|
|
8833
8809
|
}, [analytics, cashDisplay, fiatEnabled, hasConfiguredFiatMethods]);
|
|
8834
8810
|
const displayedFiatSource = cashDisplay.kind === "list" ? cashDisplay.source : void 0;
|
|
8835
|
-
const
|
|
8811
|
+
const providerOf = useCallback6(
|
|
8812
|
+
(method) => cashDisplay.kind === "list" && cashDisplay.methods.find((m) => m.method === method)?.provider || "swapped",
|
|
8813
|
+
[cashDisplay]
|
|
8814
|
+
);
|
|
8815
|
+
const handleSelectDisplayedFiatMethod = useCallback6(
|
|
8836
8816
|
(method) => {
|
|
8837
8817
|
if (!displayedFiatSource) return;
|
|
8838
|
-
handleSelectFiatMethod(method, displayedFiatSource);
|
|
8818
|
+
handleSelectFiatMethod(method, displayedFiatSource, providerOf(method));
|
|
8839
8819
|
},
|
|
8840
|
-
[displayedFiatSource, handleSelectFiatMethod]
|
|
8820
|
+
[displayedFiatSource, handleSelectFiatMethod, providerOf]
|
|
8841
8821
|
);
|
|
8842
|
-
const handlePrefetchDisplayedFiatMethod =
|
|
8822
|
+
const handlePrefetchDisplayedFiatMethod = useCallback6(
|
|
8843
8823
|
(method) => {
|
|
8844
|
-
if (!displayedFiatSource) return;
|
|
8845
|
-
if (bankRowOffered && method === "bank-transfer") return;
|
|
8824
|
+
if (!displayedFiatSource || providerOf(method) !== "swapped") return;
|
|
8846
8825
|
handlePrefetchFiatMethod(method, displayedFiatSource);
|
|
8847
8826
|
},
|
|
8848
|
-
[
|
|
8827
|
+
[displayedFiatSource, handlePrefetchFiatMethod, providerOf]
|
|
8849
8828
|
);
|
|
8850
|
-
const handleNewDeposit =
|
|
8829
|
+
const handleNewDeposit = useCallback6(() => {
|
|
8851
8830
|
analytics.completeStep();
|
|
8852
8831
|
analytics.resetAttempt();
|
|
8853
8832
|
onLifecycleRef.current?.({
|
|
@@ -8995,7 +8974,7 @@ function DepositFlow({
|
|
|
8995
8974
|
})();
|
|
8996
8975
|
});
|
|
8997
8976
|
}, [desiredPortfolios, service, storeApi, portfolioSlice.byKey]);
|
|
8998
|
-
const handleDepositAddressSubmitted =
|
|
8977
|
+
const handleDepositAddressSubmitted = useCallback6(
|
|
8999
8978
|
(data) => {
|
|
9000
8979
|
logFlow("deposit-address:detected", {
|
|
9001
8980
|
txHash: data.txHash,
|
|
@@ -9010,7 +8989,7 @@ function DepositFlow({
|
|
|
9010
8989
|
},
|
|
9011
8990
|
[analytics, logFlow, onLifecycleRef]
|
|
9012
8991
|
);
|
|
9013
|
-
const handleSolanaTokenContinue =
|
|
8992
|
+
const handleSolanaTokenContinue = useCallback6(
|
|
9014
8993
|
(token, balance, balanceUsd) => {
|
|
9015
8994
|
logFlow("solana:token:continue", { token: token.symbol });
|
|
9016
8995
|
storeApi.dispatch({
|
|
@@ -9023,7 +9002,7 @@ function DepositFlow({
|
|
|
9023
9002
|
},
|
|
9024
9003
|
[defaultAmount, logFlow, storeApi]
|
|
9025
9004
|
);
|
|
9026
|
-
const handleSolanaAmountContinue =
|
|
9005
|
+
const handleSolanaAmountContinue = useCallback6(
|
|
9027
9006
|
(token, sourceAmount, inputAmountUsd) => {
|
|
9028
9007
|
const targetTokenPriceUsd = isTargetStablecoin ? 1 : targetMarketPriceRef.current;
|
|
9029
9008
|
logFlow("solana:amount:continue", {
|
|
@@ -9043,7 +9022,7 @@ function DepositFlow({
|
|
|
9043
9022
|
},
|
|
9044
9023
|
[isTargetStablecoin, targetSymbol, logFlow, storeApi]
|
|
9045
9024
|
);
|
|
9046
|
-
const handleSolanaConfirmed =
|
|
9025
|
+
const handleSolanaConfirmed = useCallback6(
|
|
9047
9026
|
(txHash, amountUnits, routed) => {
|
|
9048
9027
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
9049
9028
|
const tokenAtSubmit = depositAtSubmit.selectedSolanaToken;
|
|
@@ -9084,7 +9063,7 @@ function DepositFlow({
|
|
|
9084
9063
|
},
|
|
9085
9064
|
[analytics, logFlow, onLifecycleRef, storeApi]
|
|
9086
9065
|
);
|
|
9087
|
-
const handleAssetContinue =
|
|
9066
|
+
const handleAssetContinue = useCallback6(
|
|
9088
9067
|
(asset) => {
|
|
9089
9068
|
analytics.completeStep("wallet_source_asset");
|
|
9090
9069
|
storeApi.dispatch({
|
|
@@ -9095,7 +9074,7 @@ function DepositFlow({
|
|
|
9095
9074
|
},
|
|
9096
9075
|
[analytics, defaultAmount, storeApi]
|
|
9097
9076
|
);
|
|
9098
|
-
const handleAmountContinue =
|
|
9077
|
+
const handleAmountContinue = useCallback6(
|
|
9099
9078
|
(amount, targetAmount, balance) => {
|
|
9100
9079
|
const entry = storeApi.getState().setup;
|
|
9101
9080
|
if (entry.status !== "ready") return;
|
|
@@ -9110,13 +9089,13 @@ function DepositFlow({
|
|
|
9110
9089
|
},
|
|
9111
9090
|
[isTargetStablecoin, storeApi, activeOwner]
|
|
9112
9091
|
);
|
|
9113
|
-
const handleQrReviewRequested =
|
|
9092
|
+
const handleQrReviewRequested = useCallback6(
|
|
9114
9093
|
(asset) => {
|
|
9115
9094
|
storeApi.dispatch({ type: "qr/review-requested", asset });
|
|
9116
9095
|
},
|
|
9117
9096
|
[storeApi]
|
|
9118
9097
|
);
|
|
9119
|
-
const handleQrAmountContinue =
|
|
9098
|
+
const handleQrAmountContinue = useCallback6(
|
|
9120
9099
|
(amount, targetAmount) => {
|
|
9121
9100
|
const targetTokenPriceUsd = isTargetStablecoin ? 1 : targetMarketPriceRef.current;
|
|
9122
9101
|
storeApi.dispatch({
|
|
@@ -9128,7 +9107,7 @@ function DepositFlow({
|
|
|
9128
9107
|
},
|
|
9129
9108
|
[isTargetStablecoin, storeApi]
|
|
9130
9109
|
);
|
|
9131
|
-
const handleDepositSubmitted =
|
|
9110
|
+
const handleDepositSubmitted = useCallback6(
|
|
9132
9111
|
(txHash, chainId, amount, token, quote, routed) => {
|
|
9133
9112
|
logFlow("evm:submitted", {
|
|
9134
9113
|
txHash,
|
|
@@ -9174,7 +9153,7 @@ function DepositFlow({
|
|
|
9174
9153
|
},
|
|
9175
9154
|
[analytics, flowMode, logFlow, storeApi]
|
|
9176
9155
|
);
|
|
9177
|
-
const handleSwappedComplete =
|
|
9156
|
+
const handleSwappedComplete = useCallback6(
|
|
9178
9157
|
(info) => {
|
|
9179
9158
|
logFlow("swapped:complete", {
|
|
9180
9159
|
txHash: info.txHash,
|
|
@@ -9231,7 +9210,7 @@ function DepositFlow({
|
|
|
9231
9210
|
},
|
|
9232
9211
|
[logFlow, onLifecycleRef, service, storeApi]
|
|
9233
9212
|
);
|
|
9234
|
-
const handleDepositSubmittedCallback =
|
|
9213
|
+
const handleDepositSubmittedCallback = useCallback6(
|
|
9235
9214
|
(txHash, sourceChain, amount) => {
|
|
9236
9215
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
9237
9216
|
onLifecycleRef.current?.({
|
|
@@ -9245,7 +9224,7 @@ function DepositFlow({
|
|
|
9245
9224
|
},
|
|
9246
9225
|
[onLifecycleRef, storeApi]
|
|
9247
9226
|
);
|
|
9248
|
-
const handleDepositComplete =
|
|
9227
|
+
const handleDepositComplete = useCallback6(
|
|
9249
9228
|
(txHash, destinationTxHash, context) => {
|
|
9250
9229
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
9251
9230
|
analytics.openStep(
|
|
@@ -9261,7 +9240,7 @@ function DepositFlow({
|
|
|
9261
9240
|
},
|
|
9262
9241
|
[analytics, analyticsMethod, logFlow, onLifecycleRef]
|
|
9263
9242
|
);
|
|
9264
|
-
const handleDepositFailed =
|
|
9243
|
+
const handleDepositFailed = useCallback6(
|
|
9265
9244
|
(txHash, error) => {
|
|
9266
9245
|
logFlowError("deposit:failed", error, { txHash });
|
|
9267
9246
|
analytics.openStep(
|
|
@@ -9273,7 +9252,7 @@ function DepositFlow({
|
|
|
9273
9252
|
},
|
|
9274
9253
|
[analytics, analyticsMethod, logFlowError, onLifecycleRef]
|
|
9275
9254
|
);
|
|
9276
|
-
const handleError =
|
|
9255
|
+
const handleError = useCallback6(
|
|
9277
9256
|
(message, code, cause) => {
|
|
9278
9257
|
logFlowError("flow:error", cause ?? message, { code });
|
|
9279
9258
|
if (code === "PROCESS_TIMEOUT") {
|
|
@@ -9295,7 +9274,7 @@ function DepositFlow({
|
|
|
9295
9274
|
},
|
|
9296
9275
|
[analytics, logFlowError, onErrorRef]
|
|
9297
9276
|
);
|
|
9298
|
-
const handleTotalBalanceComputed =
|
|
9277
|
+
const handleTotalBalanceComputed = useCallback6((total) => {
|
|
9299
9278
|
setTotalBalanceUsd(total);
|
|
9300
9279
|
}, []);
|
|
9301
9280
|
useEffect13(() => {
|
|
@@ -9348,12 +9327,12 @@ function DepositFlow({
|
|
|
9348
9327
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
9349
9328
|
const transferCryptoEntry = setupSlice;
|
|
9350
9329
|
const transferCryptoState = transferCryptoEntry.status === "ready" ? "ready" : transferCryptoEntry.status === "error" ? "error" : "loading";
|
|
9351
|
-
const handleRetrySetup =
|
|
9330
|
+
const handleRetrySetup = useCallback6(() => {
|
|
9352
9331
|
analytics.retry("account_setup_failed", "account_setup");
|
|
9353
9332
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
9354
9333
|
}, [analytics, storeApi]);
|
|
9355
9334
|
if (showConnectStep) {
|
|
9356
|
-
return /* @__PURE__ */
|
|
9335
|
+
return /* @__PURE__ */ jsx27("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx27(
|
|
9357
9336
|
ConnectStep,
|
|
9358
9337
|
{
|
|
9359
9338
|
title: payment ? "Pay" : void 0,
|
|
@@ -9379,7 +9358,8 @@ function DepositFlow({
|
|
|
9379
9358
|
recommendedMethod: cashDisplay.kind === "list" ? cashDisplay.recommendedMethod : void 0,
|
|
9380
9359
|
onSelectFiatMethod: cashDisplay.kind === "list" ? handleSelectDisplayedFiatMethod : void 0,
|
|
9381
9360
|
onPrefetchFiatMethod: cashDisplay.kind === "list" ? handlePrefetchDisplayedFiatMethod : void 0,
|
|
9382
|
-
onSelectFundFromExchange: enableExchangeConnect ? () => handleSelectExchange() : void 0,
|
|
9361
|
+
onSelectFundFromExchange: exchangeOffered || enableExchangeConnect && providersLoading ? () => handleSelectExchange() : void 0,
|
|
9362
|
+
fundFromExchangeLoading: enableExchangeConnect && providersLoading,
|
|
9383
9363
|
onRequestConnect: enableWallet ? onRequestConnect : void 0,
|
|
9384
9364
|
onConnect: enableWallet ? onConnect : void 0,
|
|
9385
9365
|
onDisconnect,
|
|
@@ -9412,14 +9392,14 @@ function DepositFlow({
|
|
|
9412
9392
|
}
|
|
9413
9393
|
if (isDepositAddressMode) {
|
|
9414
9394
|
return /* @__PURE__ */ jsxs23("div", { className: "rs-modal-body", children: [
|
|
9415
|
-
effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */
|
|
9395
|
+
effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */ jsx27(
|
|
9416
9396
|
AccountPreparingSkeleton,
|
|
9417
9397
|
{
|
|
9418
9398
|
errorMessage: activeEntry.message ?? void 0,
|
|
9419
9399
|
onRetry: () => handleRetrySetup()
|
|
9420
9400
|
}
|
|
9421
|
-
) : /* @__PURE__ */
|
|
9422
|
-
effectiveStep.type === "deposit-address" && /* @__PURE__ */
|
|
9401
|
+
) : /* @__PURE__ */ jsx27(DepositAddressSkeleton, { uiConfig })),
|
|
9402
|
+
effectiveStep.type === "deposit-address" && /* @__PURE__ */ jsx27(
|
|
9423
9403
|
DepositAddressStep,
|
|
9424
9404
|
{
|
|
9425
9405
|
payment,
|
|
@@ -9464,7 +9444,7 @@ function DepositFlow({
|
|
|
9464
9444
|
debug
|
|
9465
9445
|
}
|
|
9466
9446
|
),
|
|
9467
|
-
effectiveStep.type === "qr-amount" && /* @__PURE__ */
|
|
9447
|
+
effectiveStep.type === "qr-amount" && /* @__PURE__ */ jsx27(
|
|
9468
9448
|
AmountStep,
|
|
9469
9449
|
{
|
|
9470
9450
|
asset: effectiveStep.asset,
|
|
@@ -9480,7 +9460,7 @@ function DepositFlow({
|
|
|
9480
9460
|
onContinue: handleQrAmountContinue
|
|
9481
9461
|
}
|
|
9482
9462
|
),
|
|
9483
|
-
effectiveStep.type === "qr-review" && /* @__PURE__ */
|
|
9463
|
+
effectiveStep.type === "qr-review" && /* @__PURE__ */ jsx27(
|
|
9484
9464
|
QrReviewStep,
|
|
9485
9465
|
{
|
|
9486
9466
|
smartAccount: effectiveStep.smartAccount,
|
|
@@ -9496,30 +9476,21 @@ function DepositFlow({
|
|
|
9496
9476
|
)
|
|
9497
9477
|
] });
|
|
9498
9478
|
}
|
|
9479
|
+
const rampCallbacks = {
|
|
9480
|
+
service,
|
|
9481
|
+
onSwappedComplete: handleSwappedComplete,
|
|
9482
|
+
onSwappedFailed: handleDepositFailed,
|
|
9483
|
+
onClose: () => onClose?.(openExternally ? "native_dismiss_request" : "header_button"),
|
|
9484
|
+
onGoBack: handleProviderBack,
|
|
9485
|
+
onError: handleError,
|
|
9486
|
+
onAttemptConsumed: handleSwappedAttemptConsumed,
|
|
9487
|
+
onProviderHandoff: handleSwappedProviderHandoff,
|
|
9488
|
+
onRetry: handleSwappedRetry,
|
|
9489
|
+
onCancelled: () => analytics.outcome("cancelled"),
|
|
9490
|
+
onImmersiveChange: onSwappedImmersiveChange,
|
|
9491
|
+
openExternally
|
|
9492
|
+
};
|
|
9499
9493
|
if (isFiatOnrampMode) {
|
|
9500
|
-
const swappedStep = step.type === "fiat-onramp" ? /* @__PURE__ */ jsx28(
|
|
9501
|
-
FiatOnrampStep,
|
|
9502
|
-
{
|
|
9503
|
-
smartAccount: step.smartAccount,
|
|
9504
|
-
service,
|
|
9505
|
-
paymentMethod: step.paymentMethod,
|
|
9506
|
-
methodSelectionSource: step.methodSelectionSource,
|
|
9507
|
-
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
|
|
9508
|
-
onSwappedComplete: handleSwappedComplete,
|
|
9509
|
-
onSwappedFailed: handleDepositFailed,
|
|
9510
|
-
onClose: () => onClose?.(
|
|
9511
|
-
openExternally ? "native_dismiss_request" : "header_button"
|
|
9512
|
-
),
|
|
9513
|
-
onGoBack: handleProviderBack,
|
|
9514
|
-
onError: handleError,
|
|
9515
|
-
onAttemptConsumed: handleSwappedAttemptConsumed,
|
|
9516
|
-
onProviderHandoff: handleSwappedProviderHandoff,
|
|
9517
|
-
onRetry: handleSwappedRetry,
|
|
9518
|
-
onCancelled: () => analytics.outcome("cancelled"),
|
|
9519
|
-
onImmersiveChange: onSwappedImmersiveChange,
|
|
9520
|
-
openExternally
|
|
9521
|
-
}
|
|
9522
|
-
) : null;
|
|
9523
9494
|
return /* @__PURE__ */ jsxs23(
|
|
9524
9495
|
"div",
|
|
9525
9496
|
{
|
|
@@ -9527,29 +9498,34 @@ function DepositFlow({
|
|
|
9527
9498
|
"data-flow-mode": "fiat-onramp",
|
|
9528
9499
|
"data-step-type": step.type,
|
|
9529
9500
|
children: [
|
|
9530
|
-
step.type === "setup" && /* @__PURE__ */
|
|
9501
|
+
step.type === "setup" && /* @__PURE__ */ jsx27(
|
|
9531
9502
|
AccountPreparingSkeleton,
|
|
9532
9503
|
{
|
|
9533
9504
|
errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
|
|
9534
9505
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup() : void 0
|
|
9535
9506
|
}
|
|
9536
9507
|
),
|
|
9537
|
-
step.type === "fiat-onramp" &&
|
|
9538
|
-
|
|
9508
|
+
step.type === "fiat-onramp" && /* @__PURE__ */ jsx27(Suspense2, { fallback: /* @__PURE__ */ jsx27(AccountPreparingSkeleton, {}), children: /* @__PURE__ */ jsx27(
|
|
9509
|
+
RampOrderStep,
|
|
9539
9510
|
{
|
|
9540
|
-
|
|
9511
|
+
...rampCallbacks,
|
|
9541
9512
|
smartAccount: step.smartAccount,
|
|
9542
|
-
bankOnramp
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9513
|
+
order: step.provider === "noah" && bankRowOffered && bankOnramp ? {
|
|
9514
|
+
flow: "funding_account",
|
|
9515
|
+
backendUrl,
|
|
9516
|
+
bankOnramp,
|
|
9517
|
+
onJourney: onBankJourney,
|
|
9518
|
+
onUnavailable: handleBankOnrampUnavailable
|
|
9519
|
+
} : {
|
|
9520
|
+
flow: "hosted",
|
|
9521
|
+
kind: "fiat",
|
|
9522
|
+
method: step.paymentMethod,
|
|
9523
|
+
methodSelectionSource: step.methodSelectionSource,
|
|
9524
|
+
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch
|
|
9525
|
+
}
|
|
9526
|
+
}
|
|
9550
9527
|
) }),
|
|
9551
|
-
step.type === "
|
|
9552
|
-
step.type === "processing" && /* @__PURE__ */ jsx28(
|
|
9528
|
+
step.type === "processing" && /* @__PURE__ */ jsx27(
|
|
9553
9529
|
ProcessingStep,
|
|
9554
9530
|
{
|
|
9555
9531
|
flowLabel: payment ? "payment" : void 0,
|
|
@@ -9593,14 +9569,14 @@ function DepositFlow({
|
|
|
9593
9569
|
"data-flow-mode": "exchange-connect",
|
|
9594
9570
|
"data-step-type": step.type,
|
|
9595
9571
|
children: [
|
|
9596
|
-
step.type === "setup" && /* @__PURE__ */
|
|
9572
|
+
step.type === "setup" && /* @__PURE__ */ jsx27(
|
|
9597
9573
|
AccountPreparingSkeleton,
|
|
9598
9574
|
{
|
|
9599
9575
|
errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
|
|
9600
9576
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup() : void 0
|
|
9601
9577
|
}
|
|
9602
9578
|
),
|
|
9603
|
-
step.type === "exchange-select" && /* @__PURE__ */
|
|
9579
|
+
step.type === "exchange-select" && /* @__PURE__ */ jsx27(
|
|
9604
9580
|
ExchangeSelectStep,
|
|
9605
9581
|
{
|
|
9606
9582
|
service,
|
|
@@ -9608,29 +9584,20 @@ function DepositFlow({
|
|
|
9608
9584
|
onError: handleError
|
|
9609
9585
|
}
|
|
9610
9586
|
),
|
|
9611
|
-
step.type === "exchange-connect" && /* @__PURE__ */
|
|
9612
|
-
|
|
9587
|
+
step.type === "exchange-connect" && /* @__PURE__ */ jsx27(
|
|
9588
|
+
RampOrderStep,
|
|
9613
9589
|
{
|
|
9590
|
+
...rampCallbacks,
|
|
9614
9591
|
smartAccount: step.smartAccount,
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
openExternally ? "native_dismiss_request" : "header_button"
|
|
9622
|
-
),
|
|
9623
|
-
onGoBack: handleProviderBack,
|
|
9624
|
-
onError: handleError,
|
|
9625
|
-
onAttemptConsumed: handleSwappedAttemptConsumed,
|
|
9626
|
-
onProviderHandoff: handleSwappedProviderHandoff,
|
|
9627
|
-
onRetry: handleSwappedRetry,
|
|
9628
|
-
onCancelled: () => analytics.outcome("cancelled"),
|
|
9629
|
-
onImmersiveChange: onSwappedImmersiveChange,
|
|
9630
|
-
openExternally
|
|
9592
|
+
order: {
|
|
9593
|
+
flow: "hosted",
|
|
9594
|
+
kind: "exchange",
|
|
9595
|
+
connection: step.connection,
|
|
9596
|
+
loadPreparedUrl: () => loadSwappedConnectUrl(step.smartAccount, step.connection)
|
|
9597
|
+
}
|
|
9631
9598
|
}
|
|
9632
9599
|
),
|
|
9633
|
-
step.type === "processing" && /* @__PURE__ */
|
|
9600
|
+
step.type === "processing" && /* @__PURE__ */ jsx27(
|
|
9634
9601
|
ProcessingStep,
|
|
9635
9602
|
{
|
|
9636
9603
|
flowLabel: payment ? "payment" : void 0,
|
|
@@ -9670,14 +9637,14 @@ function DepositFlow({
|
|
|
9670
9637
|
const solanaAddr = walletSession?.solanaAddress;
|
|
9671
9638
|
const solanaProvider = walletSession?.solanaProvider;
|
|
9672
9639
|
return /* @__PURE__ */ jsxs23("div", { className: "rs-modal-body", children: [
|
|
9673
|
-
effectiveStep.type === "setup" && /* @__PURE__ */
|
|
9640
|
+
effectiveStep.type === "setup" && /* @__PURE__ */ jsx27(
|
|
9674
9641
|
AccountPreparingSkeleton,
|
|
9675
9642
|
{
|
|
9676
9643
|
errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
|
|
9677
9644
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup() : void 0
|
|
9678
9645
|
}
|
|
9679
9646
|
),
|
|
9680
|
-
effectiveStep.type === "solana-token-select" && solanaAddr && /* @__PURE__ */
|
|
9647
|
+
effectiveStep.type === "solana-token-select" && solanaAddr && /* @__PURE__ */ jsx27(
|
|
9681
9648
|
SolanaTokenSelectStep,
|
|
9682
9649
|
{
|
|
9683
9650
|
solanaAddress: solanaAddr,
|
|
@@ -9688,7 +9655,7 @@ function DepositFlow({
|
|
|
9688
9655
|
debug
|
|
9689
9656
|
}
|
|
9690
9657
|
),
|
|
9691
|
-
effectiveStep.type === "solana-amount" && /* @__PURE__ */
|
|
9658
|
+
effectiveStep.type === "solana-amount" && /* @__PURE__ */ jsx27(
|
|
9692
9659
|
SolanaAmountStep,
|
|
9693
9660
|
{
|
|
9694
9661
|
token: effectiveStep.token,
|
|
@@ -9705,7 +9672,7 @@ function DepositFlow({
|
|
|
9705
9672
|
debug
|
|
9706
9673
|
}
|
|
9707
9674
|
),
|
|
9708
|
-
effectiveStep.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */
|
|
9675
|
+
effectiveStep.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */ jsx27(
|
|
9709
9676
|
SolanaConfirmStep,
|
|
9710
9677
|
{
|
|
9711
9678
|
smartAccount: effectiveStep.smartAccount,
|
|
@@ -9729,14 +9696,14 @@ function DepositFlow({
|
|
|
9729
9696
|
}
|
|
9730
9697
|
) : effectiveStep.type === "solana-confirm" ? /* @__PURE__ */ jsxs23("div", { className: "rs-step", children: [
|
|
9731
9698
|
/* @__PURE__ */ jsxs23("div", { className: "rs-loading-state", children: [
|
|
9732
|
-
/* @__PURE__ */
|
|
9699
|
+
/* @__PURE__ */ jsx27("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ jsx27(
|
|
9733
9700
|
"svg",
|
|
9734
9701
|
{
|
|
9735
9702
|
viewBox: "0 0 24 24",
|
|
9736
9703
|
fill: "none",
|
|
9737
9704
|
stroke: "currentColor",
|
|
9738
9705
|
strokeWidth: "2",
|
|
9739
|
-
children: /* @__PURE__ */
|
|
9706
|
+
children: /* @__PURE__ */ jsx27(
|
|
9740
9707
|
"path",
|
|
9741
9708
|
{
|
|
9742
9709
|
strokeLinecap: "round",
|
|
@@ -9747,21 +9714,21 @@ function DepositFlow({
|
|
|
9747
9714
|
}
|
|
9748
9715
|
) }),
|
|
9749
9716
|
/* @__PURE__ */ jsxs23("div", { className: "rs-loading-text", children: [
|
|
9750
|
-
/* @__PURE__ */
|
|
9751
|
-
/* @__PURE__ */
|
|
9717
|
+
/* @__PURE__ */ jsx27("div", { className: "rs-loading-title rs-text-error", children: "Wallet disconnected" }),
|
|
9718
|
+
/* @__PURE__ */ jsx27("div", { className: "rs-loading-subtitle", children: "Please reconnect your Solana wallet to continue." })
|
|
9752
9719
|
] })
|
|
9753
9720
|
] }),
|
|
9754
|
-
/* @__PURE__ */
|
|
9721
|
+
/* @__PURE__ */ jsx27("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx27(
|
|
9755
9722
|
"button",
|
|
9756
9723
|
{
|
|
9757
9724
|
type: "button",
|
|
9758
9725
|
className: "rs-button rs-button--default rs-button--full-width",
|
|
9759
9726
|
onClick: handleBack,
|
|
9760
|
-
children: /* @__PURE__ */
|
|
9727
|
+
children: /* @__PURE__ */ jsx27("span", { children: "Go Back" })
|
|
9761
9728
|
}
|
|
9762
9729
|
) })
|
|
9763
9730
|
] }) : null,
|
|
9764
|
-
effectiveStep.type === "processing" && /* @__PURE__ */
|
|
9731
|
+
effectiveStep.type === "processing" && /* @__PURE__ */ jsx27(
|
|
9765
9732
|
ProcessingStep,
|
|
9766
9733
|
{
|
|
9767
9734
|
flowLabel: payment ? "payment" : void 0,
|
|
@@ -9793,13 +9760,13 @@ function DepositFlow({
|
|
|
9793
9760
|
] });
|
|
9794
9761
|
}
|
|
9795
9762
|
if (isDappImportMode && effectiveStep.type === "dapp-import-resolving") {
|
|
9796
|
-
return /* @__PURE__ */
|
|
9763
|
+
return /* @__PURE__ */ jsx27(
|
|
9797
9764
|
"div",
|
|
9798
9765
|
{
|
|
9799
9766
|
className: "rs-modal-body",
|
|
9800
9767
|
"data-flow-mode": "dapp-import",
|
|
9801
9768
|
"data-step-type": effectiveStep.type,
|
|
9802
|
-
children: /* @__PURE__ */
|
|
9769
|
+
children: /* @__PURE__ */ jsx27(
|
|
9803
9770
|
DappImportAssetSelectSkeleton,
|
|
9804
9771
|
{
|
|
9805
9772
|
sourceLabel: activeDappImportProvider?.sourceLabel ?? "",
|
|
@@ -9811,13 +9778,13 @@ function DepositFlow({
|
|
|
9811
9778
|
);
|
|
9812
9779
|
}
|
|
9813
9780
|
if (effectiveStep.type === "dapp-import-select") {
|
|
9814
|
-
return /* @__PURE__ */
|
|
9781
|
+
return /* @__PURE__ */ jsx27(
|
|
9815
9782
|
"div",
|
|
9816
9783
|
{
|
|
9817
9784
|
className: "rs-modal-body",
|
|
9818
9785
|
"data-flow-mode": "dapp-import",
|
|
9819
9786
|
"data-step-type": effectiveStep.type,
|
|
9820
|
-
children: /* @__PURE__ */
|
|
9787
|
+
children: /* @__PURE__ */ jsx27(
|
|
9821
9788
|
DappImportSelectStep,
|
|
9822
9789
|
{
|
|
9823
9790
|
enabledIds: enabledAssetMigrationIds,
|
|
@@ -9844,7 +9811,7 @@ function DepositFlow({
|
|
|
9844
9811
|
);
|
|
9845
9812
|
}
|
|
9846
9813
|
if (!signerContext?.walletClient || !signerContext?.publicClient) {
|
|
9847
|
-
return /* @__PURE__ */
|
|
9814
|
+
return /* @__PURE__ */ jsx27("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx27("div", { className: "rs-step", children: /* @__PURE__ */ jsx27("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx27("div", { className: "rs-loading-text", children: /* @__PURE__ */ jsx27("div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
|
|
9848
9815
|
}
|
|
9849
9816
|
const ownerAddress = signerContext.ownerAddress;
|
|
9850
9817
|
const ownerChainId = signerContext.walletClient?.chain?.id ?? signerContext.publicClient.chain?.id ?? setupChainId;
|
|
@@ -9855,14 +9822,14 @@ function DepositFlow({
|
|
|
9855
9822
|
return getPublicClient(chainId, rpcUrls);
|
|
9856
9823
|
};
|
|
9857
9824
|
return /* @__PURE__ */ jsxs23("div", { className: "rs-modal-body", children: [
|
|
9858
|
-
effectiveStep.type === "setup" && /* @__PURE__ */
|
|
9825
|
+
effectiveStep.type === "setup" && /* @__PURE__ */ jsx27(
|
|
9859
9826
|
AccountPreparingSkeleton,
|
|
9860
9827
|
{
|
|
9861
9828
|
errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
|
|
9862
9829
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup() : void 0
|
|
9863
9830
|
}
|
|
9864
9831
|
),
|
|
9865
|
-
effectiveStep.type === "select-asset" && /* @__PURE__ */
|
|
9832
|
+
effectiveStep.type === "select-asset" && /* @__PURE__ */ jsx27(
|
|
9866
9833
|
AssetSelectStep,
|
|
9867
9834
|
{
|
|
9868
9835
|
address: ownerAddress,
|
|
@@ -9875,7 +9842,7 @@ function DepositFlow({
|
|
|
9875
9842
|
onDisconnect: onDisconnect ? handleWalletDisconnect : void 0
|
|
9876
9843
|
}
|
|
9877
9844
|
),
|
|
9878
|
-
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */
|
|
9845
|
+
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ jsx27(
|
|
9879
9846
|
DappImportAssetSelectStep,
|
|
9880
9847
|
{
|
|
9881
9848
|
sourceLabel: activeDappImportAvailability.assets[0]?.sourceLabel ?? activeDappImportProvider.sourceLabel,
|
|
@@ -9884,7 +9851,7 @@ function DepositFlow({
|
|
|
9884
9851
|
onSelect: handleDappImportAssetSelected
|
|
9885
9852
|
}
|
|
9886
9853
|
),
|
|
9887
|
-
effectiveStep.type === "amount" && /* @__PURE__ */
|
|
9854
|
+
effectiveStep.type === "amount" && /* @__PURE__ */ jsx27(
|
|
9888
9855
|
AmountStep,
|
|
9889
9856
|
{
|
|
9890
9857
|
walletClient: signerContext.walletClient,
|
|
@@ -9908,7 +9875,7 @@ function DepositFlow({
|
|
|
9908
9875
|
}
|
|
9909
9876
|
}
|
|
9910
9877
|
),
|
|
9911
|
-
effectiveStep.type === "confirm" && /* @__PURE__ */
|
|
9878
|
+
effectiveStep.type === "confirm" && /* @__PURE__ */ jsx27(
|
|
9912
9879
|
ConfirmStep,
|
|
9913
9880
|
{
|
|
9914
9881
|
walletClient: signerContext.walletClient,
|
|
@@ -9959,7 +9926,7 @@ function DepositFlow({
|
|
|
9959
9926
|
onError: handleError
|
|
9960
9927
|
}
|
|
9961
9928
|
),
|
|
9962
|
-
effectiveStep.type === "processing" && /* @__PURE__ */
|
|
9929
|
+
effectiveStep.type === "processing" && /* @__PURE__ */ jsx27(
|
|
9963
9930
|
ProcessingStep,
|
|
9964
9931
|
{
|
|
9965
9932
|
flowLabel: payment ? "payment" : void 0,
|
|
@@ -9998,7 +9965,7 @@ function DepositFlow({
|
|
|
9998
9965
|
}
|
|
9999
9966
|
|
|
10000
9967
|
// src/components/history/useBankHistory.ts
|
|
10001
|
-
import { useCallback as
|
|
9968
|
+
import { useCallback as useCallback7, useEffect as useEffect14, useRef as useRef10, useState as useState14 } from "react";
|
|
10002
9969
|
function useBankHistory(source, open, panelOpen) {
|
|
10003
9970
|
const [orders, setOrders] = useState14([]);
|
|
10004
9971
|
const [unread, setUnread] = useState14(false);
|
|
@@ -10012,7 +9979,7 @@ function useBankHistory(source, open, panelOpen) {
|
|
|
10012
9979
|
const paged = useRef10(false);
|
|
10013
9980
|
const panel = useRef10(panelOpen);
|
|
10014
9981
|
panel.current = panelOpen;
|
|
10015
|
-
const load =
|
|
9982
|
+
const load = useCallback7(
|
|
10016
9983
|
async (next) => {
|
|
10017
9984
|
if (!source || !open || busy.current || document.visibilityState === "hidden")
|
|
10018
9985
|
return;
|
|
@@ -10102,10 +10069,10 @@ function useBankHistory(source, open, panelOpen) {
|
|
|
10102
10069
|
}
|
|
10103
10070
|
|
|
10104
10071
|
// src/DepositModal.tsx
|
|
10105
|
-
import { jsx as
|
|
10106
|
-
var ReownDepositInner =
|
|
10072
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
10073
|
+
var ReownDepositInner = lazy4(async () => {
|
|
10107
10074
|
await loadReownDependencies();
|
|
10108
|
-
const module = await import("./DepositModalReown-
|
|
10075
|
+
const module = await import("./DepositModalReown-SYQ2SCHC.mjs");
|
|
10109
10076
|
return { default: module.DepositModalReown };
|
|
10110
10077
|
});
|
|
10111
10078
|
function buildDepositAnalyticsSessionProperties({
|
|
@@ -10168,7 +10135,7 @@ function DepositModal(props) {
|
|
|
10168
10135
|
const needsReown = !!props.reownAppId;
|
|
10169
10136
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
10170
10137
|
if (needsReown) {
|
|
10171
|
-
return /* @__PURE__ */
|
|
10138
|
+
return /* @__PURE__ */ jsx28(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx28(
|
|
10172
10139
|
ReownDepositInner,
|
|
10173
10140
|
{
|
|
10174
10141
|
...props,
|
|
@@ -10176,7 +10143,7 @@ function DepositModal(props) {
|
|
|
10176
10143
|
}
|
|
10177
10144
|
) });
|
|
10178
10145
|
}
|
|
10179
|
-
return /* @__PURE__ */
|
|
10146
|
+
return /* @__PURE__ */ jsx28(
|
|
10180
10147
|
DepositModalInner,
|
|
10181
10148
|
{
|
|
10182
10149
|
...props,
|
|
@@ -10244,7 +10211,7 @@ function DepositModalInner({
|
|
|
10244
10211
|
const bankScope = `${backendUrl}:${recipient}:${typeof targetChainProp === "string" ? targetChainProp : getChainId(targetChainProp)}:${targetToken}`;
|
|
10245
10212
|
const [bankSession, setBankSession] = useState15(null);
|
|
10246
10213
|
const [bankJourneyVisible, setBankJourneyVisible] = useState15(false);
|
|
10247
|
-
const onBankJourney =
|
|
10214
|
+
const onBankJourney = useCallback8((journey) => {
|
|
10248
10215
|
setBankJourneyVisible(Boolean(journey));
|
|
10249
10216
|
if (journey)
|
|
10250
10217
|
setBankSession(
|
|
@@ -10361,7 +10328,7 @@ function DepositModalInner({
|
|
|
10361
10328
|
recoverySubmitting,
|
|
10362
10329
|
onUiStateRef
|
|
10363
10330
|
]);
|
|
10364
|
-
const handleStepChange =
|
|
10331
|
+
const handleStepChange = useCallback8(
|
|
10365
10332
|
(onBack, screen) => {
|
|
10366
10333
|
setBackHandler(() => onBack);
|
|
10367
10334
|
if (screen) setCurrentScreen(screen);
|
|
@@ -10369,7 +10336,7 @@ function DepositModalInner({
|
|
|
10369
10336
|
[]
|
|
10370
10337
|
);
|
|
10371
10338
|
const onLifecycleRef = useLatestRef(onLifecycle);
|
|
10372
|
-
const handleLifecycle =
|
|
10339
|
+
const handleLifecycle = useCallback8(
|
|
10373
10340
|
(event) => {
|
|
10374
10341
|
onLifecycleRef.current?.(event);
|
|
10375
10342
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
@@ -10381,7 +10348,7 @@ function DepositModalInner({
|
|
|
10381
10348
|
},
|
|
10382
10349
|
[onLifecycleRef, markHistoryStale, invalidateHistory]
|
|
10383
10350
|
);
|
|
10384
|
-
const closeWithSource =
|
|
10351
|
+
const closeWithSource = useCallback8(
|
|
10385
10352
|
(source) => {
|
|
10386
10353
|
if (recoverySubmitting) return;
|
|
10387
10354
|
const analytics = analyticsControllerRef.current;
|
|
@@ -10391,7 +10358,7 @@ function DepositModalInner({
|
|
|
10391
10358
|
},
|
|
10392
10359
|
[onClose, recoverySubmitting]
|
|
10393
10360
|
);
|
|
10394
|
-
const handleModalDismiss =
|
|
10361
|
+
const handleModalDismiss = useCallback8(
|
|
10395
10362
|
(reason) => {
|
|
10396
10363
|
closeWithSource(
|
|
10397
10364
|
reason === "escape" ? "escape" : reason === "overlay" ? "overlay" : "header_button"
|
|
@@ -10447,7 +10414,7 @@ function DepositModalInner({
|
|
|
10447
10414
|
const canGoBack = backHandler !== void 0;
|
|
10448
10415
|
const hideHeaderChrome = swappedImmersive;
|
|
10449
10416
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
10450
|
-
return /* @__PURE__ */
|
|
10417
|
+
return /* @__PURE__ */ jsx28(RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ jsx28(ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ jsx28(AssetMetadataProvider, { service, children: /* @__PURE__ */ jsx28(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx28(
|
|
10451
10418
|
Modal,
|
|
10452
10419
|
{
|
|
10453
10420
|
isOpen,
|
|
@@ -10456,7 +10423,7 @@ function DepositModalInner({
|
|
|
10456
10423
|
inline,
|
|
10457
10424
|
closeOnOverlayClick,
|
|
10458
10425
|
ariaLabel: "Deposit",
|
|
10459
|
-
children: /* @__PURE__ */
|
|
10426
|
+
children: /* @__PURE__ */ jsx28(
|
|
10460
10427
|
AnalyticsSession,
|
|
10461
10428
|
{
|
|
10462
10429
|
modal: "deposit",
|
|
@@ -10466,24 +10433,24 @@ function DepositModalInner({
|
|
|
10466
10433
|
enableIngest: enableAnalyticsIngest,
|
|
10467
10434
|
ingestUrl: analyticsIngestUrl,
|
|
10468
10435
|
sessionIdRef: analyticsSessionIdRef,
|
|
10469
|
-
children: /* @__PURE__ */
|
|
10436
|
+
children: /* @__PURE__ */ jsx28(
|
|
10470
10437
|
DepositAnalyticsControllerProvider,
|
|
10471
10438
|
{
|
|
10472
10439
|
controllerRef: analyticsControllerRef,
|
|
10473
10440
|
children: /* @__PURE__ */ jsxs24("div", { ref: modalRef, className: modalClassName, children: [
|
|
10474
10441
|
!hideHeaderChrome && /* @__PURE__ */ jsxs24("div", { className: "rs-modal-header--redesigned", children: [
|
|
10475
|
-
/* @__PURE__ */
|
|
10442
|
+
/* @__PURE__ */ jsx28("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ jsx28(
|
|
10476
10443
|
"button",
|
|
10477
10444
|
{
|
|
10478
10445
|
type: "button",
|
|
10479
10446
|
className: "rs-modal-header-back",
|
|
10480
10447
|
"aria-label": "Go back",
|
|
10481
10448
|
onClick: backHandler,
|
|
10482
|
-
children: /* @__PURE__ */
|
|
10449
|
+
children: /* @__PURE__ */ jsx28(ChevronLeftIcon, {})
|
|
10483
10450
|
}
|
|
10484
10451
|
) }),
|
|
10485
10452
|
/* @__PURE__ */ jsxs24("div", { className: "rs-modal-header-nav-right", children: [
|
|
10486
|
-
historyButtonVisible && /* @__PURE__ */
|
|
10453
|
+
historyButtonVisible && /* @__PURE__ */ jsx28(
|
|
10487
10454
|
HistoryEntryButton,
|
|
10488
10455
|
{
|
|
10489
10456
|
badge: bankJourneyVisible ? null : history.badge,
|
|
@@ -10492,19 +10459,19 @@ function DepositModalInner({
|
|
|
10492
10459
|
disabled: !recipient
|
|
10493
10460
|
}
|
|
10494
10461
|
),
|
|
10495
|
-
/* @__PURE__ */
|
|
10462
|
+
/* @__PURE__ */ jsx28(
|
|
10496
10463
|
"button",
|
|
10497
10464
|
{
|
|
10498
10465
|
type: "button",
|
|
10499
10466
|
onClick: () => closeWithSource("header_button"),
|
|
10500
10467
|
className: "rs-modal-close",
|
|
10501
10468
|
"aria-label": "Close",
|
|
10502
|
-
children: /* @__PURE__ */
|
|
10469
|
+
children: /* @__PURE__ */ jsx28(CloseIcon, {})
|
|
10503
10470
|
}
|
|
10504
10471
|
)
|
|
10505
10472
|
] })
|
|
10506
10473
|
] }),
|
|
10507
|
-
/* @__PURE__ */
|
|
10474
|
+
/* @__PURE__ */ jsx28(
|
|
10508
10475
|
DepositFlow,
|
|
10509
10476
|
{
|
|
10510
10477
|
walletClientProp,
|
|
@@ -10552,7 +10519,7 @@ function DepositModalInner({
|
|
|
10552
10519
|
debug
|
|
10553
10520
|
}
|
|
10554
10521
|
),
|
|
10555
|
-
history.isPanelOpen && /* @__PURE__ */
|
|
10522
|
+
history.isPanelOpen && /* @__PURE__ */ jsx28(
|
|
10556
10523
|
HistoryOverlay,
|
|
10557
10524
|
{
|
|
10558
10525
|
controller: history,
|