@funkit/connect-rn 9.1.1 → 9.1.2
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/CHANGELOG.md +22 -0
- package/README.md +5 -3
- package/dist/{chunk-RPYWTS42.js → chunk-2C2OETEM.js} +49 -33
- package/dist/chunk-2C2OETEM.js.map +7 -0
- package/dist/{chunk-OBY3O4LU.js → chunk-ESQLFNOK.js} +2 -1
- package/dist/chunk-ESQLFNOK.js.map +7 -0
- package/dist/{chunk-5Y2EMQYX.js → chunk-OJN7XVWC.js} +2 -2
- package/dist/clients/lighter.js +1 -1
- package/dist/clients/nado.js +2 -2
- package/dist/index.js +1055 -534
- package/dist/index.js.map +4 -4
- package/dist/preview.js +44 -1
- package/dist/preview.js.map +2 -2
- package/dist/src/components/AmountDisplay.d.ts +2 -2
- package/dist/src/components/AmountDisplay.d.ts.map +1 -1
- package/dist/src/components/PasteAddressPanel.d.ts +16 -0
- package/dist/src/components/PasteAddressPanel.d.ts.map +1 -0
- package/dist/src/components/WalletAddressInput.d.ts +23 -10
- package/dist/src/components/WalletAddressInput.d.ts.map +1 -1
- package/dist/src/components/WithdrawSourceCard.d.ts +13 -2
- package/dist/src/components/WithdrawSourceCard.d.ts.map +1 -1
- package/dist/src/fiat/kycOptionRows.d.ts +1 -4
- package/dist/src/fiat/kycOptionRows.d.ts.map +1 -1
- package/dist/src/fiat/providers/adapter.d.ts +2 -1
- package/dist/src/fiat/providers/adapter.d.ts.map +1 -1
- package/dist/src/fiat/providers/moonpay/moonpay.d.ts.map +1 -1
- package/dist/src/fiat/providers/stripe/stripeLinkWarmup.d.ts +29 -0
- package/dist/src/fiat/providers/stripe/stripeLinkWarmup.d.ts.map +1 -0
- package/dist/src/fiat/providers/stripe/stripePayment.d.ts +1 -1
- package/dist/src/fiat/providers/stripe/stripePayment.d.ts.map +1 -1
- package/dist/src/fiat/providers/stripe/useStripeOnrampClient.d.ts.map +1 -1
- package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
- package/dist/src/flow/FiatDepositAmountStep.d.ts.map +1 -1
- package/dist/src/icons/FigmaSystemIcons.d.ts +1 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -1
- package/dist/src/icons/HandTapIcon.d.ts +4 -0
- package/dist/src/icons/HandTapIcon.d.ts.map +1 -0
- package/dist/src/preview/flowPreview.d.ts +3 -0
- package/dist/src/preview/flowPreview.d.ts.map +1 -1
- package/dist/src/preview/scenarioCatalog.d.ts +15 -1
- package/dist/src/preview/scenarioCatalog.d.ts.map +1 -1
- package/dist/src/preview/scenarios.d.ts.map +1 -1
- package/dist/src/screens/WithdrawAddressScreen.d.ts +6 -1
- package/dist/src/screens/WithdrawAddressScreen.d.ts.map +1 -1
- package/dist/src/screens/WithdrawAmountScreen.d.ts +6 -1
- package/dist/src/screens/WithdrawAmountScreen.d.ts.map +1 -1
- package/dist/src/screens/WithdrawCryptoSteps.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useLockedTokenAmount.d.ts +2 -0
- package/dist/src/transfer/hooks/useLockedTokenAmount.d.ts.map +1 -1
- package/dist/src/transfer/lockedTokenAmount.d.ts +13 -0
- package/dist/src/transfer/lockedTokenAmount.d.ts.map +1 -1
- package/dist/src/utils/formatAmount.d.ts +4 -3
- package/dist/src/utils/formatAmount.d.ts.map +1 -1
- package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts +1 -0
- package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts.map +1 -1
- package/dist/src/withdrawal/useWithdrawalSourceTokenBalance.d.ts +11 -2
- package/dist/src/withdrawal/useWithdrawalSourceTokenBalance.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-OBY3O4LU.js.map +0 -7
- package/dist/chunk-RPYWTS42.js.map +0 -7
- /package/dist/{chunk-5Y2EMQYX.js.map → chunk-OJN7XVWC.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -26,14 +26,14 @@ import {
|
|
|
26
26
|
useSeed,
|
|
27
27
|
useSeededState,
|
|
28
28
|
withoutLabelledCurrency
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ESQLFNOK.js";
|
|
30
30
|
import {
|
|
31
31
|
refreshUserIpInfo,
|
|
32
32
|
useDynamicConfig,
|
|
33
33
|
useIsStablecoin,
|
|
34
34
|
useSourceTokenUsdPrice,
|
|
35
35
|
useUserIpInfo
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-OJN7XVWC.js";
|
|
37
37
|
import {
|
|
38
38
|
FunkitI18nProvider,
|
|
39
39
|
FunkitIdentityProvider,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
resolveFunkitIdentity,
|
|
45
45
|
useFunkitIdentity,
|
|
46
46
|
useFunkitTranslation
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-2C2OETEM.js";
|
|
48
48
|
import {
|
|
49
49
|
logger
|
|
50
50
|
} from "./chunk-ZE77GVDW.js";
|
|
@@ -606,7 +606,7 @@ function useFunkitThemePair() {
|
|
|
606
606
|
|
|
607
607
|
// src/providers/FunkitProvider.tsx
|
|
608
608
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
609
|
-
import { useEffect as
|
|
609
|
+
import { useEffect as useEffect95, useMemo as useMemo44, useRef as useRef69 } from "react";
|
|
610
610
|
import { SafeAreaProvider as SafeAreaProvider2 } from "react-native-safe-area-context";
|
|
611
611
|
|
|
612
612
|
// src/branding/BrandingContext.tsx
|
|
@@ -629,20 +629,20 @@ function useFunkitBranding() {
|
|
|
629
629
|
import {
|
|
630
630
|
forgetRouteLimits as forgetRouteLimits2,
|
|
631
631
|
randomUuid,
|
|
632
|
-
useFeatureGate as
|
|
632
|
+
useFeatureGate as useFeatureGate6
|
|
633
633
|
} from "@funkit/connect-core";
|
|
634
634
|
import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
635
635
|
import {
|
|
636
636
|
createContext as createContext14,
|
|
637
637
|
useCallback as useCallback38,
|
|
638
638
|
useContext as useContext16,
|
|
639
|
-
useEffect as
|
|
639
|
+
useEffect as useEffect93,
|
|
640
640
|
useLayoutEffect as useLayoutEffect5,
|
|
641
641
|
useMemo as useMemo42,
|
|
642
642
|
useRef as useRef67,
|
|
643
643
|
useState as useState74
|
|
644
644
|
} from "react";
|
|
645
|
-
import { View as
|
|
645
|
+
import { View as View39 } from "react-native";
|
|
646
646
|
|
|
647
647
|
// src/transfer/clipboard.ts
|
|
648
648
|
async function writeClipboard(write, value) {
|
|
@@ -844,7 +844,7 @@ import { BottomSheetModal as BottomSheetModal4, BottomSheetView as BottomSheetVi
|
|
|
844
844
|
import { useStatsigClient as useStatsigClient2 } from "@statsig/react-bindings";
|
|
845
845
|
import {
|
|
846
846
|
useCallback as useCallback28,
|
|
847
|
-
useEffect as
|
|
847
|
+
useEffect as useEffect80,
|
|
848
848
|
useMemo as useMemo34,
|
|
849
849
|
useRef as useRef55,
|
|
850
850
|
useState as useState61
|
|
@@ -1375,6 +1375,10 @@ var SUCCESS_CHECK_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="n
|
|
|
1375
1375
|
var CHEVRON_DOWN_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.46967 5.71967C3.76256 5.42678 4.23744 5.42678 4.53033 5.71967L8 9.18934L11.4697 5.71967C11.7626 5.42678 12.2374 5.42678 12.5303 5.71967C12.8232 6.01256 12.8232 6.48744 12.5303 6.78033L8.53033 10.7803C8.23744 11.0732 7.76256 11.0732 7.46967 10.7803L3.46967 6.78033C3.17678 6.48744 3.17678 6.01256 3.46967 5.71967Z" fill="currentColor"/></svg>';
|
|
1376
1376
|
var SWAP_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g transform="translate(1 14) rotate(-90)"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.21967 0.21967C8.51256 -0.0732233 8.98744 -0.0732233 9.28033 0.21967L11.947 2.88634C12.2399 3.17923 12.2399 3.6541 11.947 3.947L9.28033 6.61366C8.98744 6.90656 8.51256 6.90656 8.21967 6.61366C7.92678 6.32077 7.92678 5.8459 8.21967 5.553L9.60601 4.16667H0.75C0.335786 4.16667 0 3.83088 0 3.41667C0 3.00245 0.335786 2.66667 0.75 2.66667H9.60601L8.21967 1.28033C7.92678 0.987437 7.92678 0.512563 8.21967 0.21967ZM3.947 6.88634C4.23989 7.17923 4.23989 7.6541 3.947 7.947L2.56066 9.33333H11.4167C11.8309 9.33333 12.1667 9.66912 12.1667 10.0833C12.1667 10.4975 11.8309 10.8333 11.4167 10.8333H2.56066L3.947 12.2197C4.23989 12.5126 4.23989 12.9874 3.947 13.2803C3.6541 13.5732 3.17923 13.5732 2.88634 13.2803L0.21967 10.6137C-0.0732233 10.3208 -0.0732233 9.8459 0.21967 9.553L2.88634 6.88634C3.17923 6.59344 3.6541 6.59344 3.947 6.88634Z" fill="currentColor"/></g></svg>';
|
|
1377
1377
|
var CHECK_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.8047 4.19526C14.0651 4.45561 14.0651 4.87772 13.8047 5.13807L6.80474 12.1381C6.54439 12.3984 6.12228 12.3984 5.86193 12.1381L2.5286 8.80474C2.26825 8.54439 2.26825 8.12228 2.5286 7.86193C2.78895 7.60158 3.21106 7.60158 3.4714 7.86193L6.33333 10.7239L12.8619 4.19526C13.1223 3.93491 13.5444 3.93491 13.8047 4.19526Z" fill="currentColor"/></svg>';
|
|
1378
|
+
var CLEAR_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.8047 5.13807C12.0651 4.87772 12.0651 4.45561 11.8047 4.19526C11.5444 3.93491 11.1223 3.93491 10.8619 4.19526L8 7.05719L5.13807 4.19526C4.87772 3.93491 4.45561 3.93491 4.19526 4.19526C3.93491 4.45561 3.93491 4.87772 4.19526 5.13807L7.05719 8L4.19526 10.8619C3.93491 11.1223 3.93491 11.5444 4.19526 11.8047C4.45561 12.0651 4.87772 12.0651 5.13807 11.8047L8 8.94281L10.8619 11.8047C11.1223 12.0651 11.5444 12.0651 11.8047 11.8047C12.0651 11.5444 12.0651 11.1223 11.8047 10.8619L8.94281 8L11.8047 5.13807Z" fill="currentColor"/></svg>';
|
|
1379
|
+
function FigmaClearIcon({ size = 16, color: color2 }) {
|
|
1380
|
+
return renderIcon(CLEAR_SVG, size, useIconColor(color2));
|
|
1381
|
+
}
|
|
1378
1382
|
function FigmaCloseIcon({ size = 20, color: color2 }) {
|
|
1379
1383
|
return renderIcon(CLOSE_SVG, size, useIconColor(color2));
|
|
1380
1384
|
}
|
|
@@ -5526,6 +5530,23 @@ function quoteScaledLockedTokenAmount({
|
|
|
5526
5530
|
return void 0;
|
|
5527
5531
|
}
|
|
5528
5532
|
}
|
|
5533
|
+
function isFeelessSameAssetQuote(from, to, sentBaseUnit, quotedBaseUnit) {
|
|
5534
|
+
const sent = parsePositiveBigInt(sentBaseUnit);
|
|
5535
|
+
const quoted = parsePositiveBigInt(quotedBaseUnit);
|
|
5536
|
+
if (sent === void 0 || quoted === void 0) {
|
|
5537
|
+
return false;
|
|
5538
|
+
}
|
|
5539
|
+
if (String(from.chainId) === String(to.chainId) && from.address.toLowerCase() === to.address.toLowerCase()) {
|
|
5540
|
+
return quoted >= sent;
|
|
5541
|
+
}
|
|
5542
|
+
const { decimals: fd = -1 } = from;
|
|
5543
|
+
const { decimals: td = -1 } = to;
|
|
5544
|
+
const decimalsKnown = [fd, td].every((d) => Number.isInteger(d) && d >= 0);
|
|
5545
|
+
if (!decimalsKnown || !from.symbol || from.symbol.toUpperCase() !== to.symbol?.toUpperCase()) {
|
|
5546
|
+
return false;
|
|
5547
|
+
}
|
|
5548
|
+
return quoted * 10n ** BigInt(fd) >= sent * 10n ** BigInt(td);
|
|
5549
|
+
}
|
|
5529
5550
|
|
|
5530
5551
|
// src/transfer/hooks/useFiatExchangeRates.ts
|
|
5531
5552
|
import { getFiatExchangeRates } from "@funkit/api-base";
|
|
@@ -5653,6 +5674,7 @@ function useLockedTokenAmount(initialAmount, token, enabled, quoteContext) {
|
|
|
5653
5674
|
}
|
|
5654
5675
|
const bounded = quoteSignal(signal, QUOTE_TIMEOUT_MS);
|
|
5655
5676
|
try {
|
|
5677
|
+
const fromAmountBaseUnit = parseUnits2(estimate, token.decimals);
|
|
5656
5678
|
const quoted = await getCheckoutQuoteV2({
|
|
5657
5679
|
apiKey: route.apiKey,
|
|
5658
5680
|
logger,
|
|
@@ -5660,7 +5682,7 @@ function useLockedTokenAmount(initialAmount, token, enabled, quoteContext) {
|
|
|
5660
5682
|
routing: true,
|
|
5661
5683
|
fromChainId: String(token.chainId),
|
|
5662
5684
|
fromTokenAddress: token.address,
|
|
5663
|
-
fromAmountBaseUnit
|
|
5685
|
+
fromAmountBaseUnit,
|
|
5664
5686
|
toChainId: route.target.chainId,
|
|
5665
5687
|
toTokenAddress: route.target.tokenAddress,
|
|
5666
5688
|
userAddress: route.depositAddress,
|
|
@@ -5668,6 +5690,7 @@ function useLockedTokenAmount(initialAmount, token, enabled, quoteContext) {
|
|
|
5668
5690
|
});
|
|
5669
5691
|
return {
|
|
5670
5692
|
fromAmount: estimate,
|
|
5693
|
+
fromAmountBaseUnit: fromAmountBaseUnit.toString(),
|
|
5671
5694
|
toAmountBaseUnit: quoted.toAmountBaseUnit
|
|
5672
5695
|
};
|
|
5673
5696
|
} catch (error) {
|
|
@@ -5690,11 +5713,18 @@ function useLockedTokenAmount(initialAmount, token, enabled, quoteContext) {
|
|
|
5690
5713
|
refetchInterval: QUOTE_REFETCH_INTERVAL_MS,
|
|
5691
5714
|
retry: false
|
|
5692
5715
|
});
|
|
5716
|
+
const bufferSkipped = !!route && !!token && isFeelessSameAssetQuote(
|
|
5717
|
+
token,
|
|
5718
|
+
{ ...route.target, address: route.target.tokenAddress },
|
|
5719
|
+
quote.data?.fromAmountBaseUnit,
|
|
5720
|
+
quote.data?.toAmountBaseUnit
|
|
5721
|
+
);
|
|
5722
|
+
const quotedBufferBps = bufferSkipped ? 0 : bufferBps;
|
|
5693
5723
|
const scaled = route && quote.data ? quoteScaledLockedTokenAmount({
|
|
5694
5724
|
estimate: quote.data.fromAmount,
|
|
5695
5725
|
quotedToAmountBaseUnit: quote.data.toAmountBaseUnit,
|
|
5696
5726
|
capBaseUnit: route.capBaseUnit,
|
|
5697
|
-
bufferBps,
|
|
5727
|
+
bufferBps: quotedBufferBps,
|
|
5698
5728
|
decimals
|
|
5699
5729
|
}) : void 0;
|
|
5700
5730
|
const capped = !!quoteContext?.capBaseUnit;
|
|
@@ -5734,7 +5764,8 @@ function useLockedTokenAmount(initialAmount, token, enabled, quoteContext) {
|
|
|
5734
5764
|
estimate: quote.data.fromAmount,
|
|
5735
5765
|
quotedToAmountBaseUnit: quote.data.toAmountBaseUnit,
|
|
5736
5766
|
capBaseUnit: route?.capBaseUnit,
|
|
5737
|
-
bufferBps,
|
|
5767
|
+
bufferBps: quotedBufferBps,
|
|
5768
|
+
bufferSkipped,
|
|
5738
5769
|
amount: scaled
|
|
5739
5770
|
});
|
|
5740
5771
|
return;
|
|
@@ -10587,7 +10618,7 @@ import {
|
|
|
10587
10618
|
Fragment as Fragment15,
|
|
10588
10619
|
memo as memo6,
|
|
10589
10620
|
useCallback as useCallback26,
|
|
10590
|
-
useEffect as
|
|
10621
|
+
useEffect as useEffect77,
|
|
10591
10622
|
useLayoutEffect as useLayoutEffect4,
|
|
10592
10623
|
useMemo as useMemo32,
|
|
10593
10624
|
useRef as useRef53,
|
|
@@ -12854,6 +12885,7 @@ function connectionFailure(context, status, reason) {
|
|
|
12854
12885
|
logger.warn("connect-rn:fiat:moonpay_auth_failed", { status, reason });
|
|
12855
12886
|
context.onFailed(status, reason);
|
|
12856
12887
|
}
|
|
12888
|
+
var CONNECTION_REUSE_MS = 2 * 6e4;
|
|
12857
12889
|
var MoonPaySessionContext = createContext11(
|
|
12858
12890
|
void 0
|
|
12859
12891
|
);
|
|
@@ -12892,13 +12924,33 @@ function MoonPaySessionProvider({ children }) {
|
|
|
12892
12924
|
},
|
|
12893
12925
|
[initialize]
|
|
12894
12926
|
);
|
|
12927
|
+
const lastConnection = useRef23(
|
|
12928
|
+
void 0
|
|
12929
|
+
);
|
|
12895
12930
|
const markActive = useCallback19(
|
|
12896
|
-
(sessionToken, attemptId) => {
|
|
12931
|
+
(sessionToken, attemptId, customerId, checkedAt = Date.now()) => {
|
|
12897
12932
|
connected.current = true;
|
|
12898
12933
|
active.current = attemptId === void 0 ? void 0 : { sessionToken, attemptId };
|
|
12934
|
+
lastConnection.current = { customerId, at: checkedAt };
|
|
12899
12935
|
},
|
|
12900
12936
|
[]
|
|
12901
12937
|
);
|
|
12938
|
+
const reusableConnection = useCallback19(() => {
|
|
12939
|
+
const last = lastConnection.current;
|
|
12940
|
+
if (last === void 0 || !connected.current) {
|
|
12941
|
+
return void 0;
|
|
12942
|
+
}
|
|
12943
|
+
const ageMs = Date.now() - last.at;
|
|
12944
|
+
if (ageMs >= CONNECTION_REUSE_MS) {
|
|
12945
|
+
return void 0;
|
|
12946
|
+
}
|
|
12947
|
+
const credentials = routingClient.current.getCredentials();
|
|
12948
|
+
return credentials.ok && credentials.value.accessToken.length > 0 ? { customerId: last.customerId, ageMs, checkedAt: last.at } : void 0;
|
|
12949
|
+
}, []);
|
|
12950
|
+
const forgetConnection = useCallback19(() => {
|
|
12951
|
+
lastConnection.current = void 0;
|
|
12952
|
+
active.current = void 0;
|
|
12953
|
+
}, []);
|
|
12902
12954
|
const canReuse = useCallback19(
|
|
12903
12955
|
(attemptId) => attemptId !== void 0 && active.current?.attemptId === attemptId && active.current.sessionToken === bound,
|
|
12904
12956
|
[bound]
|
|
@@ -12911,12 +12963,23 @@ function MoonPaySessionProvider({ children }) {
|
|
|
12911
12963
|
bound,
|
|
12912
12964
|
bind,
|
|
12913
12965
|
markActive,
|
|
12966
|
+
reusableConnection,
|
|
12967
|
+
forgetConnection,
|
|
12914
12968
|
canReuse,
|
|
12915
12969
|
invalidate,
|
|
12916
12970
|
handoff,
|
|
12917
12971
|
setHandoff
|
|
12918
12972
|
}),
|
|
12919
|
-
[
|
|
12973
|
+
[
|
|
12974
|
+
bound,
|
|
12975
|
+
bind,
|
|
12976
|
+
markActive,
|
|
12977
|
+
reusableConnection,
|
|
12978
|
+
forgetConnection,
|
|
12979
|
+
canReuse,
|
|
12980
|
+
invalidate,
|
|
12981
|
+
handoff
|
|
12982
|
+
]
|
|
12920
12983
|
);
|
|
12921
12984
|
return /* @__PURE__ */ jsx72(MoonPayRoutingInputsContext.Provider, { value: getRoutingInputs, children: /* @__PURE__ */ jsx72(MoonPaySessionContext.Provider, { value: session, children }) });
|
|
12922
12985
|
}
|
|
@@ -12935,7 +12998,10 @@ function BoundMoonPaySession({
|
|
|
12935
12998
|
sessionToken,
|
|
12936
12999
|
children
|
|
12937
13000
|
}) {
|
|
12938
|
-
const
|
|
13001
|
+
const [reusing] = useState28(
|
|
13002
|
+
() => session.bound !== void 0 && session.bound !== sessionToken && session.reusableConnection() !== void 0
|
|
13003
|
+
);
|
|
13004
|
+
const bound = reusing || session.bound === sessionToken;
|
|
12939
13005
|
useEffect37(() => {
|
|
12940
13006
|
if (!bound) {
|
|
12941
13007
|
session.bind(sessionToken);
|
|
@@ -13121,7 +13187,8 @@ function MoonPayAuthSurface({
|
|
|
13121
13187
|
});
|
|
13122
13188
|
session?.markActive(
|
|
13123
13189
|
params.sessionToken,
|
|
13124
|
-
context.readinessTiming?.attemptId
|
|
13190
|
+
context.readinessTiming?.attemptId,
|
|
13191
|
+
connection.customer.id
|
|
13125
13192
|
);
|
|
13126
13193
|
onActive?.();
|
|
13127
13194
|
context.report({
|
|
@@ -13138,6 +13205,51 @@ function MoonPayAuthSurface({
|
|
|
13138
13205
|
session
|
|
13139
13206
|
]
|
|
13140
13207
|
);
|
|
13208
|
+
const [reused] = useState28(
|
|
13209
|
+
() => session !== void 0 && session.bound !== void 0 && session.bound !== params.sessionToken ? session.reusableConnection() : void 0
|
|
13210
|
+
);
|
|
13211
|
+
const reportedReuse = useRef23(false);
|
|
13212
|
+
useEffect37(() => {
|
|
13213
|
+
if (reused === void 0 || session === void 0 || reportedReuse.current) {
|
|
13214
|
+
return;
|
|
13215
|
+
}
|
|
13216
|
+
reportedReuse.current = true;
|
|
13217
|
+
const credentials = client.getCredentials();
|
|
13218
|
+
if (!credentials.ok) {
|
|
13219
|
+
connectionFailure(
|
|
13220
|
+
context,
|
|
13221
|
+
"credentials_unavailable",
|
|
13222
|
+
credentials.error.message
|
|
13223
|
+
);
|
|
13224
|
+
return;
|
|
13225
|
+
}
|
|
13226
|
+
logger.info("connect-rn:fiat:moonpay_connection_reused", {
|
|
13227
|
+
environment: params.environment,
|
|
13228
|
+
customerId: reused.customerId,
|
|
13229
|
+
ageMs: reused.ageMs
|
|
13230
|
+
});
|
|
13231
|
+
session.markActive(
|
|
13232
|
+
session.bound ?? params.sessionToken,
|
|
13233
|
+
context.readinessTiming?.attemptId,
|
|
13234
|
+
reused.customerId,
|
|
13235
|
+
reused.checkedAt
|
|
13236
|
+
);
|
|
13237
|
+
onActive?.();
|
|
13238
|
+
void Promise.resolve(
|
|
13239
|
+
context.report({
|
|
13240
|
+
moonPayCustomerId: reused.customerId,
|
|
13241
|
+
moonPayAccessToken: credentials.value.accessToken
|
|
13242
|
+
})
|
|
13243
|
+
).then((accepted) => {
|
|
13244
|
+
if (accepted === false) {
|
|
13245
|
+
logger.warn("connect-rn:fiat:moonpay_reused_connection_refused", {
|
|
13246
|
+
environment: params.environment,
|
|
13247
|
+
ageMs: reused.ageMs
|
|
13248
|
+
});
|
|
13249
|
+
session.forgetConnection();
|
|
13250
|
+
}
|
|
13251
|
+
});
|
|
13252
|
+
}, [client, context, onActive, params, reused, session]);
|
|
13141
13253
|
const onConnection = useCallback19(
|
|
13142
13254
|
(event) => {
|
|
13143
13255
|
if (event.kind === "error") {
|
|
@@ -13212,6 +13324,9 @@ function MoonPayAuthSurface({
|
|
|
13212
13324
|
},
|
|
13213
13325
|
[context, reportActive]
|
|
13214
13326
|
);
|
|
13327
|
+
if (reused !== void 0) {
|
|
13328
|
+
return null;
|
|
13329
|
+
}
|
|
13215
13330
|
if (mode === "check") {
|
|
13216
13331
|
return /* @__PURE__ */ jsx72(View13, { style: styles36.button, children: /* @__PURE__ */ jsx72(
|
|
13217
13332
|
MoonPayConnectionCheck,
|
|
@@ -16226,10 +16341,77 @@ function useEffectEventLike(callback) {
|
|
|
16226
16341
|
}
|
|
16227
16342
|
|
|
16228
16343
|
// src/fiat/providers/stripe/stripeCheckout.tsx
|
|
16229
|
-
import { useEffect as
|
|
16344
|
+
import { useEffect as useEffect49, useRef as useRef34 } from "react";
|
|
16345
|
+
|
|
16346
|
+
// src/fiat/providers/stripe/stripePayment.tsx
|
|
16347
|
+
import { useEffect as useEffect48, useRef as useRef33 } from "react";
|
|
16348
|
+
|
|
16349
|
+
// src/fiat/providers/stripe/stripeLinkWarmup.ts
|
|
16350
|
+
import { useEffect as useEffect47 } from "react";
|
|
16351
|
+
var sessions = /* @__PURE__ */ new WeakMap();
|
|
16352
|
+
function startSession(stripe, clientSecret, freshUntilMs, source) {
|
|
16353
|
+
logger.info("connect-rn:fiat:stripe_payment_stage_started", {
|
|
16354
|
+
stage: "seamless_signin",
|
|
16355
|
+
source
|
|
16356
|
+
});
|
|
16357
|
+
const signedIn = redeemStripeSeamlessSignIn(stripe, clientSecret).then(
|
|
16358
|
+
(authenticated) => {
|
|
16359
|
+
logger.info("connect-rn:fiat:stripe_payment_stage_completed", {
|
|
16360
|
+
stage: "seamless_signin",
|
|
16361
|
+
source,
|
|
16362
|
+
authenticated
|
|
16363
|
+
});
|
|
16364
|
+
return authenticated;
|
|
16365
|
+
}
|
|
16366
|
+
);
|
|
16367
|
+
const session = {
|
|
16368
|
+
clientSecret,
|
|
16369
|
+
freshUntilMs,
|
|
16370
|
+
signedIn,
|
|
16371
|
+
registered: /* @__PURE__ */ new Set()
|
|
16372
|
+
};
|
|
16373
|
+
sessions.set(stripe, session);
|
|
16374
|
+
return session;
|
|
16375
|
+
}
|
|
16376
|
+
function warmStripeLink(stripe, token, now = Date.now()) {
|
|
16377
|
+
if (sessions.get(stripe)?.clientSecret === token.clientSecret) {
|
|
16378
|
+
return;
|
|
16379
|
+
}
|
|
16380
|
+
const expiresAtMs = Date.parse(token.expiresAt);
|
|
16381
|
+
if (!Number.isFinite(expiresAtMs) || expiresAtMs <= now) {
|
|
16382
|
+
return;
|
|
16383
|
+
}
|
|
16384
|
+
startSession(stripe, token.clientSecret, expiresAtMs, "warmup");
|
|
16385
|
+
}
|
|
16386
|
+
function useStripeLinkWarmup(stripe, token) {
|
|
16387
|
+
const clientSecret = token?.clientSecret;
|
|
16388
|
+
const expiresAt = token?.expiresAt;
|
|
16389
|
+
useEffect47(() => {
|
|
16390
|
+
if (stripe !== void 0 && clientSecret !== void 0 && expiresAt !== void 0) {
|
|
16391
|
+
warmStripeLink(stripe, { clientSecret, expiresAt });
|
|
16392
|
+
}
|
|
16393
|
+
}, [stripe, clientSecret, expiresAt]);
|
|
16394
|
+
}
|
|
16395
|
+
async function reusableLinkSession(stripe, now = Date.now) {
|
|
16396
|
+
const warm = sessions.get(stripe);
|
|
16397
|
+
if (warm === void 0 || !await warm.signedIn || now() >= warm.freshUntilMs) {
|
|
16398
|
+
return void 0;
|
|
16399
|
+
}
|
|
16400
|
+
logger.info("connect-rn:fiat:stripe_payment_stage_completed", {
|
|
16401
|
+
stage: "seamless_signin",
|
|
16402
|
+
source: "reused"
|
|
16403
|
+
});
|
|
16404
|
+
return warm;
|
|
16405
|
+
}
|
|
16406
|
+
async function signInForTap(stripe, clientSecret, freshUntilMs) {
|
|
16407
|
+
const session = startSession(stripe, clientSecret, freshUntilMs ?? 0, "tap");
|
|
16408
|
+
return await session.signedIn ? session : void 0;
|
|
16409
|
+
}
|
|
16410
|
+
function walletKey(walletAddress, network) {
|
|
16411
|
+
return `${network}:${walletAddress}`;
|
|
16412
|
+
}
|
|
16230
16413
|
|
|
16231
16414
|
// src/fiat/providers/stripe/stripePayment.tsx
|
|
16232
|
-
import { useEffect as useEffect47, useRef as useRef33 } from "react";
|
|
16233
16415
|
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
16234
16416
|
function matchStripePayParams(surface) {
|
|
16235
16417
|
const params = readSurfaceParams(surface, "PAY_SHEET", "STRIPE");
|
|
@@ -16262,17 +16444,19 @@ function stripePaymentAdapter(stripe, response) {
|
|
|
16262
16444
|
return void 0;
|
|
16263
16445
|
}
|
|
16264
16446
|
const seamlessClientSecret = stripeSeamlessClientSecret(response);
|
|
16447
|
+
const seamlessExpiresAtMs = stripeSeamlessExpiresAtMs(response);
|
|
16265
16448
|
return {
|
|
16266
16449
|
control: "HANDOFF",
|
|
16267
16450
|
// A reopen rides the Link session this credential woke; once it lapses, only a new quote
|
|
16268
16451
|
// reaches sign-in again.
|
|
16269
|
-
reopenableUntil:
|
|
16452
|
+
reopenableUntil: seamlessExpiresAtMs,
|
|
16270
16453
|
render: (context) => /* @__PURE__ */ jsx87(
|
|
16271
16454
|
StripeApplePaySurface,
|
|
16272
16455
|
{
|
|
16273
16456
|
stripe,
|
|
16274
16457
|
params,
|
|
16275
16458
|
seamlessClientSecret,
|
|
16459
|
+
seamlessExpiresAtMs,
|
|
16276
16460
|
context
|
|
16277
16461
|
}
|
|
16278
16462
|
)
|
|
@@ -16283,24 +16467,30 @@ function StripeApplePaySurface({
|
|
|
16283
16467
|
stripe,
|
|
16284
16468
|
params,
|
|
16285
16469
|
seamlessClientSecret,
|
|
16470
|
+
seamlessExpiresAtMs,
|
|
16286
16471
|
context
|
|
16287
16472
|
}) {
|
|
16288
16473
|
const mounted = useRef33(true);
|
|
16289
16474
|
const started = useRef33(false);
|
|
16290
16475
|
const contextRef = useRef33(context);
|
|
16291
16476
|
contextRef.current = context;
|
|
16292
|
-
|
|
16477
|
+
useEffect48(() => {
|
|
16293
16478
|
mounted.current = true;
|
|
16294
16479
|
return () => {
|
|
16295
16480
|
mounted.current = false;
|
|
16296
16481
|
};
|
|
16297
16482
|
}, []);
|
|
16298
|
-
|
|
16483
|
+
useEffect48(() => {
|
|
16299
16484
|
if (started.current) {
|
|
16300
16485
|
return;
|
|
16301
16486
|
}
|
|
16302
16487
|
started.current = true;
|
|
16303
|
-
void collectApplePay(
|
|
16488
|
+
void collectApplePay(
|
|
16489
|
+
stripe,
|
|
16490
|
+
params,
|
|
16491
|
+
seamlessClientSecret,
|
|
16492
|
+
seamlessExpiresAtMs
|
|
16493
|
+
).then((token) => {
|
|
16304
16494
|
if (mounted.current) {
|
|
16305
16495
|
contextRef.current.report(stripePaymentReport(token));
|
|
16306
16496
|
contextRef.current.onProcessing?.();
|
|
@@ -16321,7 +16511,7 @@ function StripeApplePaySurface({
|
|
|
16321
16511
|
contextRef.current.onFailed(code);
|
|
16322
16512
|
}
|
|
16323
16513
|
});
|
|
16324
|
-
}, [params, seamlessClientSecret, stripe]);
|
|
16514
|
+
}, [params, seamlessClientSecret, seamlessExpiresAtMs, stripe]);
|
|
16325
16515
|
return null;
|
|
16326
16516
|
}
|
|
16327
16517
|
function stripePaymentReport(token) {
|
|
@@ -16357,7 +16547,15 @@ function stageFailure(stage, error) {
|
|
|
16357
16547
|
const failure2 = new Error(`${stage}:${stripePaymentErrorCode(error)}`);
|
|
16358
16548
|
return Object.assign(failure2, { cause: error });
|
|
16359
16549
|
}
|
|
16360
|
-
async function
|
|
16550
|
+
async function registerWallet(stripe, params) {
|
|
16551
|
+
const registered = await stripe.registerWalletAddress(params.walletAddress, params.destinationNetwork).catch((error) => {
|
|
16552
|
+
throw stageFailure("register_wallet", error);
|
|
16553
|
+
});
|
|
16554
|
+
if (registered.error !== void 0) {
|
|
16555
|
+
throw stageFailure("register_wallet", registered.error);
|
|
16556
|
+
}
|
|
16557
|
+
}
|
|
16558
|
+
async function collectApplePay(stripe, params, seamlessClientSecret, seamlessExpiresAtMs) {
|
|
16361
16559
|
logger.info("connect-rn:fiat:stripe_payment_stage_started", {
|
|
16362
16560
|
stage: "apple_pay_preflight"
|
|
16363
16561
|
});
|
|
@@ -16367,32 +16565,40 @@ async function collectApplePay(stripe, params, seamlessClientSecret) {
|
|
|
16367
16565
|
logger.info("connect-rn:fiat:stripe_payment_stage_completed", {
|
|
16368
16566
|
stage: "apple_pay_preflight"
|
|
16369
16567
|
});
|
|
16370
|
-
|
|
16568
|
+
const reused = await reusableLinkSession(stripe);
|
|
16569
|
+
let session = reused ?? (seamlessClientSecret === void 0 ? void 0 : await signInForTap(stripe, seamlessClientSecret, seamlessExpiresAtMs));
|
|
16570
|
+
const wallet = walletKey(params.walletAddress, params.destinationNetwork);
|
|
16571
|
+
if (session?.registered.has(wallet) === true) {
|
|
16572
|
+
logger.info("connect-rn:fiat:stripe_payment_stage_completed", {
|
|
16573
|
+
stage: "register_wallet",
|
|
16574
|
+
source: "reused"
|
|
16575
|
+
});
|
|
16576
|
+
} else {
|
|
16371
16577
|
logger.info("connect-rn:fiat:stripe_payment_stage_started", {
|
|
16372
|
-
stage: "
|
|
16578
|
+
stage: "register_wallet",
|
|
16579
|
+
network: params.destinationNetwork
|
|
16373
16580
|
});
|
|
16374
|
-
|
|
16375
|
-
stripe,
|
|
16376
|
-
|
|
16377
|
-
|
|
16581
|
+
try {
|
|
16582
|
+
await registerWallet(stripe, params);
|
|
16583
|
+
} catch (error) {
|
|
16584
|
+
if (reused === void 0 || seamlessClientSecret === void 0 || seamlessClientSecret === reused.clientSecret) {
|
|
16585
|
+
throw error;
|
|
16586
|
+
}
|
|
16587
|
+
logger.warn("connect-rn:fiat:stripe_reused_signin_lapsed", {
|
|
16588
|
+
error: error instanceof Error ? error.message : String(error)
|
|
16589
|
+
});
|
|
16590
|
+
session = await signInForTap(
|
|
16591
|
+
stripe,
|
|
16592
|
+
seamlessClientSecret,
|
|
16593
|
+
seamlessExpiresAtMs
|
|
16594
|
+
);
|
|
16595
|
+
await registerWallet(stripe, params);
|
|
16596
|
+
}
|
|
16597
|
+
session?.registered.add(wallet);
|
|
16378
16598
|
logger.info("connect-rn:fiat:stripe_payment_stage_completed", {
|
|
16379
|
-
stage: "
|
|
16380
|
-
authenticated
|
|
16599
|
+
stage: "register_wallet"
|
|
16381
16600
|
});
|
|
16382
16601
|
}
|
|
16383
|
-
logger.info("connect-rn:fiat:stripe_payment_stage_started", {
|
|
16384
|
-
stage: "register_wallet",
|
|
16385
|
-
network: params.destinationNetwork
|
|
16386
|
-
});
|
|
16387
|
-
const wallet = await stripe.registerWalletAddress(params.walletAddress, params.destinationNetwork).catch((error) => {
|
|
16388
|
-
throw stageFailure("register_wallet", error);
|
|
16389
|
-
});
|
|
16390
|
-
if (wallet.error !== void 0) {
|
|
16391
|
-
throw stageFailure("register_wallet", wallet.error);
|
|
16392
|
-
}
|
|
16393
|
-
logger.info("connect-rn:fiat:stripe_payment_stage_completed", {
|
|
16394
|
-
stage: "register_wallet"
|
|
16395
|
-
});
|
|
16396
16602
|
const payment = {
|
|
16397
16603
|
applePay: {
|
|
16398
16604
|
merchantCountryCode: params.merchantCountryCode,
|
|
@@ -16490,13 +16696,13 @@ function StripeCheckoutSurface({
|
|
|
16490
16696
|
const started = useRef34(false);
|
|
16491
16697
|
const contextRef = useRef34(context);
|
|
16492
16698
|
contextRef.current = context;
|
|
16493
|
-
|
|
16699
|
+
useEffect49(() => {
|
|
16494
16700
|
mounted.current = true;
|
|
16495
16701
|
return () => {
|
|
16496
16702
|
mounted.current = false;
|
|
16497
16703
|
};
|
|
16498
16704
|
}, []);
|
|
16499
|
-
|
|
16705
|
+
useEffect49(() => {
|
|
16500
16706
|
if (started.current) {
|
|
16501
16707
|
return;
|
|
16502
16708
|
}
|
|
@@ -16564,7 +16770,7 @@ async function performStripeCheckout(stripe, params, requestClientSecret) {
|
|
|
16564
16770
|
}
|
|
16565
16771
|
|
|
16566
16772
|
// src/fiat/providers/stripe/stripeApplePayReady.tsx
|
|
16567
|
-
import { useEffect as
|
|
16773
|
+
import { useEffect as useEffect50, useMemo as useMemo25 } from "react";
|
|
16568
16774
|
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
16569
16775
|
function useStripeApplePayReadyButton(Button, onReady) {
|
|
16570
16776
|
return useMemo25(
|
|
@@ -16575,7 +16781,7 @@ function useStripeApplePayReadyButton(Button, onReady) {
|
|
|
16575
16781
|
function withReadyReport(Button, onReady) {
|
|
16576
16782
|
return function StripeApplePayReadyButton(props) {
|
|
16577
16783
|
const enabled = props.disabled !== true;
|
|
16578
|
-
|
|
16784
|
+
useEffect50(() => {
|
|
16579
16785
|
if (enabled) {
|
|
16580
16786
|
onReady();
|
|
16581
16787
|
}
|
|
@@ -17071,7 +17277,7 @@ function digitsOf(value) {
|
|
|
17071
17277
|
}
|
|
17072
17278
|
|
|
17073
17279
|
// src/fiat/useContactAutoSubmit.ts
|
|
17074
|
-
import { useEffect as
|
|
17280
|
+
import { useEffect as useEffect51 } from "react";
|
|
17075
17281
|
function useContactAutoSubmit({
|
|
17076
17282
|
fields,
|
|
17077
17283
|
insertedEdits,
|
|
@@ -17081,7 +17287,7 @@ function useContactAutoSubmit({
|
|
|
17081
17287
|
isSubmitting,
|
|
17082
17288
|
onSubmit
|
|
17083
17289
|
}) {
|
|
17084
|
-
|
|
17290
|
+
useEffect51(() => {
|
|
17085
17291
|
if (insertedEdits === 0 || !isPhoneOnly(fields)) {
|
|
17086
17292
|
return;
|
|
17087
17293
|
}
|
|
@@ -17097,11 +17303,11 @@ function isPhoneOnly(fields) {
|
|
|
17097
17303
|
}
|
|
17098
17304
|
|
|
17099
17305
|
// src/fiat/useContactEligibility.ts
|
|
17100
|
-
import { useEffect as
|
|
17306
|
+
import { useEffect as useEffect52, useState as useState35 } from "react";
|
|
17101
17307
|
var CONTACT_VALIDATION_DELAY = 200;
|
|
17102
17308
|
function useContactEligibility(complete, draft) {
|
|
17103
17309
|
const [validatedDraft, setValidatedDraft] = useState35(draft);
|
|
17104
|
-
|
|
17310
|
+
useEffect52(() => {
|
|
17105
17311
|
if (!complete) {
|
|
17106
17312
|
return;
|
|
17107
17313
|
}
|
|
@@ -17115,7 +17321,7 @@ function useContactEligibility(complete, draft) {
|
|
|
17115
17321
|
}
|
|
17116
17322
|
|
|
17117
17323
|
// src/fiat/FiatContactScreen.tsx
|
|
17118
|
-
import { useEffect as
|
|
17324
|
+
import { useEffect as useEffect54, useRef as useRef37, useState as useState40 } from "react";
|
|
17119
17325
|
import {
|
|
17120
17326
|
Animated as Animated21,
|
|
17121
17327
|
Keyboard as Keyboard5,
|
|
@@ -17582,7 +17788,7 @@ import {
|
|
|
17582
17788
|
import {
|
|
17583
17789
|
memo as memo5,
|
|
17584
17790
|
useCallback as useCallback22,
|
|
17585
|
-
useEffect as
|
|
17791
|
+
useEffect as useEffect53,
|
|
17586
17792
|
useMemo as useMemo27,
|
|
17587
17793
|
useRef as useRef36,
|
|
17588
17794
|
useState as useState38
|
|
@@ -18141,7 +18347,7 @@ function FiatSearchList({
|
|
|
18141
18347
|
const [reading, setReading] = useState38();
|
|
18142
18348
|
const scrubbed = useRef36(void 0);
|
|
18143
18349
|
const frame = useRef36(void 0);
|
|
18144
|
-
|
|
18350
|
+
useEffect53(
|
|
18145
18351
|
() => () => {
|
|
18146
18352
|
if (frame.current !== void 0) {
|
|
18147
18353
|
cancelAnimationFrame(frame.current);
|
|
@@ -18202,7 +18408,7 @@ function FiatSearchList({
|
|
|
18202
18408
|
);
|
|
18203
18409
|
const motion = useV2DrawerMotion();
|
|
18204
18410
|
const restingOn = useSharedValue14(insets.bottom);
|
|
18205
|
-
|
|
18411
|
+
useEffect53(() => {
|
|
18206
18412
|
restingOn.value = withSpring6(
|
|
18207
18413
|
Math.max(keyboardHeight, insets.bottom),
|
|
18208
18414
|
motion
|
|
@@ -18783,12 +18989,12 @@ function FiatContactContent({
|
|
|
18783
18989
|
const keyboardHeight = keyboard.height;
|
|
18784
18990
|
const [attempted, setAttempted] = useState40(false);
|
|
18785
18991
|
const [editedAfterError, setEditedAfterError] = useState40(false);
|
|
18786
|
-
|
|
18992
|
+
useEffect54(() => setEditedAfterError(false), [errorMessage, isSubmitting]);
|
|
18787
18993
|
const shownError = editedAfterError ? void 0 : errorMessage;
|
|
18788
18994
|
const [refusedContact, setRefusedContact] = useState40();
|
|
18789
18995
|
const inputs = useRef37({});
|
|
18790
18996
|
const awaitingAnswer = useRef37(false);
|
|
18791
|
-
|
|
18997
|
+
useEffect54(() => {
|
|
18792
18998
|
if (isSubmitting) {
|
|
18793
18999
|
awaitingAnswer.current = true;
|
|
18794
19000
|
Keyboard5.dismiss();
|
|
@@ -18821,7 +19027,7 @@ function FiatContactContent({
|
|
|
18821
19027
|
])
|
|
18822
19028
|
);
|
|
18823
19029
|
const submittedKey = JSON.stringify(submittedValues);
|
|
18824
|
-
|
|
19030
|
+
useEffect54(() => {
|
|
18825
19031
|
if (errorMessage !== void 0 && requiresContactChange) {
|
|
18826
19032
|
setRefusedContact(submittedKey);
|
|
18827
19033
|
}
|
|
@@ -18859,7 +19065,7 @@ function FiatContactContent({
|
|
|
18859
19065
|
};
|
|
18860
19066
|
const fallback2 = defaultCountry ?? defaultRegion;
|
|
18861
19067
|
const lastFallback = useRef37(fallback2);
|
|
18862
|
-
|
|
19068
|
+
useEffect54(() => {
|
|
18863
19069
|
const previous = defaultPhoneCountry(lastFallback.current);
|
|
18864
19070
|
lastFallback.current = fallback2;
|
|
18865
19071
|
for (const field of fields) {
|
|
@@ -19154,7 +19360,7 @@ function isAdditionalKycForm(form) {
|
|
|
19154
19360
|
var isBirthDate = (field) => field.id === "DATE_OF_BIRTH";
|
|
19155
19361
|
|
|
19156
19362
|
// src/fiat/FiatIdentityStep.tsx
|
|
19157
|
-
import { useEffect as
|
|
19363
|
+
import { useEffect as useEffect62, useMemo as useMemo30, useState as useState48 } from "react";
|
|
19158
19364
|
|
|
19159
19365
|
// src/fiat/subdivisions.ts
|
|
19160
19366
|
import { country } from "iso-3166-2";
|
|
@@ -19182,7 +19388,7 @@ function keepsRegion(region, alpha2) {
|
|
|
19182
19388
|
|
|
19183
19389
|
// src/fiat/FiatFormScreen.tsx
|
|
19184
19390
|
import { useForm, useSelector } from "@tanstack/react-form";
|
|
19185
|
-
import { useEffect as
|
|
19391
|
+
import { useEffect as useEffect61, useMemo as useMemo29, useRef as useRef42, useState as useState47 } from "react";
|
|
19186
19392
|
import {
|
|
19187
19393
|
Animated as Animated26,
|
|
19188
19394
|
Keyboard as Keyboard7,
|
|
@@ -19531,7 +19737,7 @@ var styles50 = StyleSheet52.create({
|
|
|
19531
19737
|
});
|
|
19532
19738
|
|
|
19533
19739
|
// src/fiat/FiatKycPhoneField.tsx
|
|
19534
|
-
import { useEffect as
|
|
19740
|
+
import { useEffect as useEffect55, useState as useState41 } from "react";
|
|
19535
19741
|
import { Fragment as Fragment10, jsx as jsx101, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
19536
19742
|
function FiatKycPhoneField({
|
|
19537
19743
|
value,
|
|
@@ -19547,7 +19753,7 @@ function FiatKycPhoneField({
|
|
|
19547
19753
|
const [country2, setCountry] = useState41(initial2.country);
|
|
19548
19754
|
const [national, setNational] = useState41(initial2.national);
|
|
19549
19755
|
const countrySheet = useCountrySheet();
|
|
19550
|
-
|
|
19756
|
+
useEffect55(() => {
|
|
19551
19757
|
const normalized = toE1642(initial2.country, initial2.national);
|
|
19552
19758
|
if (normalized !== value) {
|
|
19553
19759
|
onChangeValue(normalized);
|
|
@@ -19615,7 +19821,7 @@ function countryFor(value, defaultCountry) {
|
|
|
19615
19821
|
}
|
|
19616
19822
|
|
|
19617
19823
|
// src/fiat/FiatBirthDateField.tsx
|
|
19618
|
-
import { useEffect as
|
|
19824
|
+
import { useEffect as useEffect56, useState as useState42 } from "react";
|
|
19619
19825
|
import { View as View26 } from "react-native";
|
|
19620
19826
|
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
19621
19827
|
function FiatBirthDateField({
|
|
@@ -19631,7 +19837,7 @@ function FiatBirthDateField({
|
|
|
19631
19837
|
const [initialDate] = useState42(
|
|
19632
19838
|
() => new Date(range.maximumDate.getFullYear() - 18, 0, 1)
|
|
19633
19839
|
);
|
|
19634
|
-
|
|
19840
|
+
useEffect56(() => {
|
|
19635
19841
|
if (editable && value === "") {
|
|
19636
19842
|
onChange(toCalendarDate(initialDate));
|
|
19637
19843
|
}
|
|
@@ -19676,7 +19882,7 @@ function FiatBirthDateField({
|
|
|
19676
19882
|
}
|
|
19677
19883
|
|
|
19678
19884
|
// src/fiat/FiatSsnField.tsx
|
|
19679
|
-
import { useEffect as
|
|
19885
|
+
import { useEffect as useEffect57, useRef as useRef39, useState as useState43 } from "react";
|
|
19680
19886
|
import { Platform as Platform6, TextInput as TextInput4, View as View27 } from "react-native";
|
|
19681
19887
|
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
19682
19888
|
var keyboardType = Platform6.OS === "ios" ? "ascii-capable-number-pad" : "number-pad";
|
|
@@ -19709,7 +19915,7 @@ function FiatSsnField({
|
|
|
19709
19915
|
const [parts, setParts] = useState43(
|
|
19710
19916
|
() => length === 4 ? [value] : split(value)
|
|
19711
19917
|
);
|
|
19712
|
-
|
|
19918
|
+
useEffect57(() => {
|
|
19713
19919
|
if (parts.join("") !== value) {
|
|
19714
19920
|
setParts(length === 4 ? [value] : split(value));
|
|
19715
19921
|
}
|
|
@@ -20089,11 +20295,11 @@ function kycFieldValidators(field, ssnDigits, choices) {
|
|
|
20089
20295
|
}
|
|
20090
20296
|
|
|
20091
20297
|
// src/fiat/FiatUnsupportedStep.tsx
|
|
20092
|
-
import { useEffect as
|
|
20298
|
+
import { useEffect as useEffect58 } from "react";
|
|
20093
20299
|
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
20094
20300
|
var noop3 = () => void 0;
|
|
20095
20301
|
function useUnsupportedStepLog({ reason, details: details2 }) {
|
|
20096
|
-
|
|
20302
|
+
useEffect58(() => {
|
|
20097
20303
|
logger.error(
|
|
20098
20304
|
"connect-rn:fiat:unsupported_step",
|
|
20099
20305
|
new Error(`Unsupported fiat step: ${reason}`),
|
|
@@ -20153,7 +20359,7 @@ function ssnLength(field, country2) {
|
|
|
20153
20359
|
}
|
|
20154
20360
|
|
|
20155
20361
|
// src/fiat/nativeDatePicker.ts
|
|
20156
|
-
import { useEffect as
|
|
20362
|
+
import { useEffect as useEffect59, useState as useState44 } from "react";
|
|
20157
20363
|
import { Platform as Platform7 } from "react-native";
|
|
20158
20364
|
var loading2;
|
|
20159
20365
|
function useNativeDatePicker() {
|
|
@@ -20163,7 +20369,7 @@ function useNativeDatePicker() {
|
|
|
20163
20369
|
// warning anywhere but iOS and Android.
|
|
20164
20370
|
DRAWS_A_PICKER ? void 0 : null
|
|
20165
20371
|
);
|
|
20166
|
-
|
|
20372
|
+
useEffect59(() => {
|
|
20167
20373
|
if (!DRAWS_A_PICKER) {
|
|
20168
20374
|
return;
|
|
20169
20375
|
}
|
|
@@ -20638,16 +20844,16 @@ var asksResidence = (page) => page.rows.some(
|
|
|
20638
20844
|
);
|
|
20639
20845
|
|
|
20640
20846
|
// src/fiat/useDatePickerDock.ts
|
|
20641
|
-
import { useEffect as
|
|
20847
|
+
import { useEffect as useEffect60, useRef as useRef40, useState as useState46 } from "react";
|
|
20642
20848
|
import { Animated as Animated24, Easing as Easing8 } from "react-native";
|
|
20643
20849
|
function useDatePickerDock(page, step) {
|
|
20644
20850
|
const picker = useNativeDatePicker();
|
|
20645
20851
|
const [isOpen, setIsOpen] = useState46(false);
|
|
20646
20852
|
const slide = useRef40(new Animated24.Value(0)).current;
|
|
20647
|
-
|
|
20853
|
+
useEffect60(() => {
|
|
20648
20854
|
setIsOpen(false);
|
|
20649
20855
|
}, [step]);
|
|
20650
|
-
|
|
20856
|
+
useEffect60(() => {
|
|
20651
20857
|
Animated24.timing(slide, {
|
|
20652
20858
|
toValue: isOpen ? 1 : 0,
|
|
20653
20859
|
duration: KEYBOARD_SLIDE_MS,
|
|
@@ -20938,7 +21144,7 @@ function FiatFormContent({
|
|
|
20938
21144
|
void kyc.handleSubmit();
|
|
20939
21145
|
}
|
|
20940
21146
|
};
|
|
20941
|
-
|
|
21147
|
+
useEffect61(() => {
|
|
20942
21148
|
if (isSubmitting) {
|
|
20943
21149
|
Keyboard7.dismiss();
|
|
20944
21150
|
}
|
|
@@ -20950,7 +21156,7 @@ function FiatFormContent({
|
|
|
20950
21156
|
return jumpedTo.current === step ? attempts - 1 : attempts;
|
|
20951
21157
|
}, [step]);
|
|
20952
21158
|
const attempted = submissionAttempts > attemptsAtEntry || refusedPages.current.has(step);
|
|
20953
|
-
|
|
21159
|
+
useEffect61(() => {
|
|
20954
21160
|
jumpedTo.current = void 0;
|
|
20955
21161
|
void kyc.validate("change");
|
|
20956
21162
|
}, [step]);
|
|
@@ -20963,7 +21169,7 @@ function FiatFormContent({
|
|
|
20963
21169
|
kyc.store,
|
|
20964
21170
|
(state) => dateFieldId === void 0 ? "" : stringValue(state.values[dateFieldId])
|
|
20965
21171
|
);
|
|
20966
|
-
|
|
21172
|
+
useEffect61(() => {
|
|
20967
21173
|
if (onPrefill === void 0) {
|
|
20968
21174
|
return;
|
|
20969
21175
|
}
|
|
@@ -21692,7 +21898,7 @@ function IdentityRound({
|
|
|
21692
21898
|
"consent"
|
|
21693
21899
|
);
|
|
21694
21900
|
const additionalInformation = isAdditionalKycForm(props.form);
|
|
21695
|
-
|
|
21901
|
+
useEffect62(() => {
|
|
21696
21902
|
logger.info("connect-rn:fiat:kyc_round_classified", {
|
|
21697
21903
|
formId: props.form.formId,
|
|
21698
21904
|
additionalInformation,
|
|
@@ -21764,7 +21970,7 @@ function useAskedFields(props, isCorrection) {
|
|
|
21764
21970
|
|
|
21765
21971
|
// src/fiat/FiatOtpScreen.tsx
|
|
21766
21972
|
import { parsePhoneNumberFromString as parsePhoneNumberFromString3 } from "libphonenumber-js/min";
|
|
21767
|
-
import { useEffect as
|
|
21973
|
+
import { useEffect as useEffect65, useRef as useRef44, useState as useState50 } from "react";
|
|
21768
21974
|
import {
|
|
21769
21975
|
Animated as Animated27,
|
|
21770
21976
|
Pressable as Pressable29,
|
|
@@ -21793,7 +21999,7 @@ function KycVerifiedIcon() {
|
|
|
21793
21999
|
}
|
|
21794
22000
|
|
|
21795
22001
|
// src/fiat/useOtpAutoSubmit.ts
|
|
21796
|
-
import { useEffect as
|
|
22002
|
+
import { useEffect as useEffect63, useRef as useRef43 } from "react";
|
|
21797
22003
|
function resolveCodeEdit(previous, next, length) {
|
|
21798
22004
|
const digits = next.replace(/\D/g, "");
|
|
21799
22005
|
const appended = digits.startsWith(previous) ? digits.slice(previous.length) : "";
|
|
@@ -21821,7 +22027,7 @@ function useOtpAutoSubmit({
|
|
|
21821
22027
|
onSubmit
|
|
21822
22028
|
}) {
|
|
21823
22029
|
const lastSubmitted = useRef43(void 0);
|
|
21824
|
-
|
|
22030
|
+
useEffect63(() => {
|
|
21825
22031
|
if (code.length !== length) {
|
|
21826
22032
|
lastSubmitted.current = void 0;
|
|
21827
22033
|
return;
|
|
@@ -21836,7 +22042,7 @@ function useOtpAutoSubmit({
|
|
|
21836
22042
|
}
|
|
21837
22043
|
|
|
21838
22044
|
// src/fiat/useResendCooldown.ts
|
|
21839
|
-
import { useEffect as
|
|
22045
|
+
import { useEffect as useEffect64, useState as useState49 } from "react";
|
|
21840
22046
|
var RESEND_COOLDOWN_SECONDS = 60;
|
|
21841
22047
|
function useResendCooldown({
|
|
21842
22048
|
errorMessage
|
|
@@ -21845,7 +22051,7 @@ function useResendCooldown({
|
|
|
21845
22051
|
const [landed, setLanded] = useState49(false);
|
|
21846
22052
|
const [until, setUntil] = useState49();
|
|
21847
22053
|
const [now, setNow] = useState49(Date.now);
|
|
21848
|
-
|
|
22054
|
+
useEffect64(() => {
|
|
21849
22055
|
if (!landed) {
|
|
21850
22056
|
return;
|
|
21851
22057
|
}
|
|
@@ -21857,7 +22063,7 @@ function useResendCooldown({
|
|
|
21857
22063
|
setUntil(sentAt + RESEND_COOLDOWN_SECONDS * 1e3);
|
|
21858
22064
|
}
|
|
21859
22065
|
}, [landed, errorMessage]);
|
|
21860
|
-
|
|
22066
|
+
useEffect64(() => {
|
|
21861
22067
|
if (until === void 0) {
|
|
21862
22068
|
return;
|
|
21863
22069
|
}
|
|
@@ -21895,7 +22101,7 @@ var OTP_CODE_LENGTH = 6;
|
|
|
21895
22101
|
function FiatOtpScreen(props) {
|
|
21896
22102
|
const [code, setCode] = useState50("");
|
|
21897
22103
|
const wasSubmitting = useRef44(false);
|
|
21898
|
-
|
|
22104
|
+
useEffect65(() => {
|
|
21899
22105
|
const settled = wasSubmitting.current && !props.isSubmitting;
|
|
21900
22106
|
wasSubmitting.current = props.isSubmitting;
|
|
21901
22107
|
if (settled && props.errorMessage !== void 0) {
|
|
@@ -21950,13 +22156,13 @@ function FiatOtpContent({
|
|
|
21950
22156
|
isSubmitting: locked,
|
|
21951
22157
|
onSubmit
|
|
21952
22158
|
});
|
|
21953
|
-
|
|
22159
|
+
useEffect65(() => {
|
|
21954
22160
|
if (!isSubmitting && errorMessage !== void 0) {
|
|
21955
22161
|
haptic("error");
|
|
21956
22162
|
}
|
|
21957
22163
|
}, [errorMessage, isSubmitting, haptic]);
|
|
21958
22164
|
const resending = useRef44(false);
|
|
21959
|
-
|
|
22165
|
+
useEffect65(() => {
|
|
21960
22166
|
if (!resending.current || isSubmitting) {
|
|
21961
22167
|
return;
|
|
21962
22168
|
}
|
|
@@ -22253,25 +22459,25 @@ var HEADING_TAGS = {
|
|
|
22253
22459
|
};
|
|
22254
22460
|
|
|
22255
22461
|
// src/fiat/useOtpReceipt.ts
|
|
22256
|
-
import { useEffect as
|
|
22462
|
+
import { useEffect as useEffect66, useState as useState51 } from "react";
|
|
22257
22463
|
function useOtpReceipt(flow) {
|
|
22258
22464
|
const [submission, setSubmission] = useState51();
|
|
22259
22465
|
const state = flow.stepResponse?.state;
|
|
22260
22466
|
const advanced = state?.kind === "QUOTE" && state.error === void 0 || state?.kind === "KYC" || state?.kind === "PAYMENT" || state?.kind === "ORDER" || state?.kind === "SESSION_AUTH" && submission !== void 0 && state.channel === "SMS_OTP" !== submission.props.isSms;
|
|
22261
22467
|
const accepted = submission !== void 0 && advanced && flow.phase !== "EXITED" && flow.phase !== "RETRYABLE";
|
|
22262
|
-
|
|
22468
|
+
useEffect66(() => {
|
|
22263
22469
|
if (!accepted) {
|
|
22264
22470
|
return;
|
|
22265
22471
|
}
|
|
22266
22472
|
const timer = setTimeout(() => setSubmission(void 0), 500);
|
|
22267
22473
|
return () => clearTimeout(timer);
|
|
22268
22474
|
}, [accepted]);
|
|
22269
|
-
|
|
22475
|
+
useEffect66(() => {
|
|
22270
22476
|
if (flow.phase === "EXITED" || flow.phase === "RETRYABLE") {
|
|
22271
22477
|
setSubmission(void 0);
|
|
22272
22478
|
}
|
|
22273
22479
|
}, [flow.phase]);
|
|
22274
|
-
|
|
22480
|
+
useEffect66(() => {
|
|
22275
22481
|
if (state?.kind === "SESSION_AUTH" && state.error !== void 0) {
|
|
22276
22482
|
setSubmission(void 0);
|
|
22277
22483
|
}
|
|
@@ -22287,7 +22493,7 @@ function useOtpReceipt(flow) {
|
|
|
22287
22493
|
}
|
|
22288
22494
|
|
|
22289
22495
|
// src/fiat/useKycCaptureRound.ts
|
|
22290
|
-
import { useEffect as
|
|
22496
|
+
import { useEffect as useEffect67, useRef as useRef45, useState as useState52 } from "react";
|
|
22291
22497
|
function useKycCaptureRound(flow) {
|
|
22292
22498
|
const [round, setRound] = useState52(0);
|
|
22293
22499
|
const [reissuedBy, setReissuedBy] = useState52();
|
|
@@ -22296,7 +22502,7 @@ function useKycCaptureRound(flow) {
|
|
|
22296
22502
|
const seededReissue = useSeed(SEED.fiatCaptureReissued) === true;
|
|
22297
22503
|
const stepResponse = flow.stepResponse;
|
|
22298
22504
|
const screen2 = flow.page.screen;
|
|
22299
|
-
|
|
22505
|
+
useEffect67(() => {
|
|
22300
22506
|
if (!reported.current || stepResponse === void 0) {
|
|
22301
22507
|
return;
|
|
22302
22508
|
}
|
|
@@ -22422,7 +22628,7 @@ import {
|
|
|
22422
22628
|
sharingConsentOf,
|
|
22423
22629
|
useEffectEvent as useEffectEvent5
|
|
22424
22630
|
} from "@funkit/connect-core";
|
|
22425
|
-
import { useEffect as
|
|
22631
|
+
import { useEffect as useEffect68, useRef as useRef46 } from "react";
|
|
22426
22632
|
function useSharingConsent(flow) {
|
|
22427
22633
|
const { t } = useFunkitTranslation();
|
|
22428
22634
|
const onPage = flow.page.screen === "KYC_SHARING_CONSENT";
|
|
@@ -22436,7 +22642,7 @@ function useSharingConsent(flow) {
|
|
|
22436
22642
|
version
|
|
22437
22643
|
});
|
|
22438
22644
|
});
|
|
22439
|
-
|
|
22645
|
+
useEffect68(() => {
|
|
22440
22646
|
if (onPage) {
|
|
22441
22647
|
announceShown();
|
|
22442
22648
|
}
|
|
@@ -22448,13 +22654,13 @@ function useSharingConsent(flow) {
|
|
|
22448
22654
|
});
|
|
22449
22655
|
showKycUnavailableAlert(t, { reason: "network" });
|
|
22450
22656
|
});
|
|
22451
|
-
|
|
22657
|
+
useEffect68(() => {
|
|
22452
22658
|
if (isRetry) {
|
|
22453
22659
|
announceFailure();
|
|
22454
22660
|
}
|
|
22455
22661
|
}, [isRetry]);
|
|
22456
22662
|
const tapped = useRef46(false);
|
|
22457
|
-
|
|
22663
|
+
useEffect68(() => {
|
|
22458
22664
|
if (!flow.isInFlight) {
|
|
22459
22665
|
tapped.current = false;
|
|
22460
22666
|
}
|
|
@@ -22995,14 +23201,11 @@ var GLYPH_HEIGHT = {
|
|
|
22995
23201
|
};
|
|
22996
23202
|
|
|
22997
23203
|
// src/fiat/kycOptionRows.ts
|
|
22998
|
-
var SHOW_DEPOSIT_MAX_ROUTE = false;
|
|
22999
23204
|
function kycOptionRows({
|
|
23000
23205
|
outcome,
|
|
23001
|
-
depositMax,
|
|
23002
23206
|
t,
|
|
23003
23207
|
onRecheck,
|
|
23004
23208
|
onRedo,
|
|
23005
|
-
onDepositMax,
|
|
23006
23209
|
onSupport,
|
|
23007
23210
|
onClose
|
|
23008
23211
|
}) {
|
|
@@ -23031,15 +23234,6 @@ function kycOptionRows({
|
|
|
23031
23234
|
onPress: onRedo
|
|
23032
23235
|
});
|
|
23033
23236
|
}
|
|
23034
|
-
if (SHOW_DEPOSIT_MAX_ROUTE) {
|
|
23035
|
-
rows2.push({
|
|
23036
|
-
title: t("fiat.kycOptionMaxTitle"),
|
|
23037
|
-
detail: depositMax === void 0 ? t("fiat.kycOptionMaxDetailUnknown") : t("fiat.kycOptionMaxDetail", { max: depositMax }),
|
|
23038
|
-
action: go,
|
|
23039
|
-
detailWidth: 200,
|
|
23040
|
-
onPress: onDepositMax
|
|
23041
|
-
});
|
|
23042
|
-
}
|
|
23043
23237
|
if (rows2.length === 0) {
|
|
23044
23238
|
rows2.push({
|
|
23045
23239
|
title: t("fiat.kycOptionCloseTitle"),
|
|
@@ -23104,7 +23298,7 @@ function MoonPayHandoffCard({
|
|
|
23104
23298
|
import { StyleSheet as StyleSheet67 } from "react-native";
|
|
23105
23299
|
|
|
23106
23300
|
// src/components/StateSwap.tsx
|
|
23107
|
-
import { useEffect as
|
|
23301
|
+
import { useEffect as useEffect69, useRef as useRef47, useState as useState53 } from "react";
|
|
23108
23302
|
import Animated28, {
|
|
23109
23303
|
useAnimatedStyle as useAnimatedStyle17,
|
|
23110
23304
|
useReducedMotion as useReducedMotion10,
|
|
@@ -23127,7 +23321,7 @@ function StateSwap({
|
|
|
23127
23321
|
const opacity = useSharedValue17(1);
|
|
23128
23322
|
const offset = useSharedValue17(0);
|
|
23129
23323
|
const entered = useRef47(shownKey);
|
|
23130
|
-
|
|
23324
|
+
useEffect69(() => {
|
|
23131
23325
|
if (reduceMotion) {
|
|
23132
23326
|
opacity.value = 1;
|
|
23133
23327
|
offset.value = 0;
|
|
@@ -23278,7 +23472,7 @@ function useReceiptTitles() {
|
|
|
23278
23472
|
|
|
23279
23473
|
// src/fiat/useKycCompletion.ts
|
|
23280
23474
|
import { selectKycOutcome } from "@funkit/connect-core";
|
|
23281
|
-
import { useEffect as
|
|
23475
|
+
import { useEffect as useEffect70, useRef as useRef48, useState as useState54 } from "react";
|
|
23282
23476
|
var HOLD_MS = 4e3;
|
|
23283
23477
|
function useKycCompletion(flow) {
|
|
23284
23478
|
const onForm = flow.page.screen === "KYC_FORM";
|
|
@@ -23300,7 +23494,7 @@ function useKycCompletion(flow) {
|
|
|
23300
23494
|
}
|
|
23301
23495
|
function useKycCompletionHold() {
|
|
23302
23496
|
const [isHeld, setIsHeld] = useState54(true);
|
|
23303
|
-
|
|
23497
|
+
useEffect70(() => {
|
|
23304
23498
|
const timer = setTimeout(() => setIsHeld(false), HOLD_MS);
|
|
23305
23499
|
return () => clearTimeout(timer);
|
|
23306
23500
|
}, []);
|
|
@@ -23475,7 +23669,7 @@ import {
|
|
|
23475
23669
|
enteredStep as enteredStep2,
|
|
23476
23670
|
submittableTransition as submittableTransition4
|
|
23477
23671
|
} from "@funkit/connect-core";
|
|
23478
|
-
import { useEffect as
|
|
23672
|
+
import { useEffect as useEffect71, useRef as useRef49 } from "react";
|
|
23479
23673
|
var SESSION_ENDPOINT = "POST /fiat/session";
|
|
23480
23674
|
var asksOnlyForTerms = (transition) => Object.values(transition.inputs ?? {}).every(
|
|
23481
23675
|
(input) => input.type === "TERMS_ACCEPTANCE"
|
|
@@ -23513,7 +23707,7 @@ function useFiatCheckoutPreparation({
|
|
|
23513
23707
|
const enteredRef = entered?.transitions.find((item) => item.mode === "SUBMIT")?.params?.quoteRef;
|
|
23514
23708
|
const heldRef = quoteRef ?? transitionQuoteRef(transition) ?? (typeof enteredRef === "string" ? enteredRef : void 0);
|
|
23515
23709
|
const attemptKey = endpoint === void 0 || heldRef === void 0 ? void 0 : `${provider}:${heldRef}:${endpoint}`;
|
|
23516
|
-
|
|
23710
|
+
useEffect71(() => {
|
|
23517
23711
|
if (!ready || attemptKey === void 0 || attempted.current.has(attemptKey)) {
|
|
23518
23712
|
return;
|
|
23519
23713
|
}
|
|
@@ -23834,7 +24028,7 @@ function collectedValues(collected) {
|
|
|
23834
24028
|
|
|
23835
24029
|
// src/fiat/usePaymentFailureAnswer.ts
|
|
23836
24030
|
import { useEffectEvent as useEffectEvent6 } from "@funkit/connect-core";
|
|
23837
|
-
import { useEffect as
|
|
24031
|
+
import { useEffect as useEffect72, useRef as useRef50, useState as useState55 } from "react";
|
|
23838
24032
|
|
|
23839
24033
|
// src/fiat/providers/coinbase/coinbaseCardRefusal.ts
|
|
23840
24034
|
var CARD_REFUSALS = /* @__PURE__ */ new Set([
|
|
@@ -24056,7 +24250,7 @@ function usePaymentFailureAnswer({
|
|
|
24056
24250
|
}
|
|
24057
24251
|
onRequote();
|
|
24058
24252
|
});
|
|
24059
|
-
|
|
24253
|
+
useEffect72(() => {
|
|
24060
24254
|
if (sheet3.nestedScreen === null) {
|
|
24061
24255
|
resolve2();
|
|
24062
24256
|
}
|
|
@@ -24072,11 +24266,11 @@ function usePaymentFailureAnswer({
|
|
|
24072
24266
|
}
|
|
24073
24267
|
|
|
24074
24268
|
// src/fiat/useReplayableFailure.ts
|
|
24075
|
-
import { useEffect as
|
|
24269
|
+
import { useEffect as useEffect73, useState as useState56 } from "react";
|
|
24076
24270
|
function useReplayableFailure(flow) {
|
|
24077
24271
|
const isRetryable = flow.phase === "RETRYABLE";
|
|
24078
24272
|
const [failedWith, setFailedWith] = useState56();
|
|
24079
|
-
|
|
24273
|
+
useEffect73(() => {
|
|
24080
24274
|
setFailedWith(isRetryable ? flow.collected : void 0);
|
|
24081
24275
|
}, [isRetryable]);
|
|
24082
24276
|
return isRetryable && failedWith === flow.collected;
|
|
@@ -24143,7 +24337,7 @@ function isServableReroute(entry) {
|
|
|
24143
24337
|
|
|
24144
24338
|
// src/fiat/useStaleQuoteRecovery.ts
|
|
24145
24339
|
import { isStaleQuoteFailure as isStaleQuoteFailure2 } from "@funkit/connect-core";
|
|
24146
|
-
import { useEffect as
|
|
24340
|
+
import { useEffect as useEffect74, useState as useState57 } from "react";
|
|
24147
24341
|
function useStaleQuoteRecovery(flow, quote, {
|
|
24148
24342
|
hold = false
|
|
24149
24343
|
} = {}) {
|
|
@@ -24153,7 +24347,7 @@ function useStaleQuoteRecovery(flow, quote, {
|
|
|
24153
24347
|
const isEntryDeadRef = !hold && flow.stepResponse === void 0 && flow.phase === "RETRYABLE" && isStaleQuoteFailure2(flow.submitError);
|
|
24154
24348
|
const quoteRef = quote.quote?.quoteRef;
|
|
24155
24349
|
const { retryQuote, submitQuote, isQuoteFresh, quoteError } = quote;
|
|
24156
|
-
|
|
24350
|
+
useEffect74(() => {
|
|
24157
24351
|
if (!isEntryDeadRef || !isArmed || deadQuoteRef !== void 0) {
|
|
24158
24352
|
return;
|
|
24159
24353
|
}
|
|
@@ -24163,12 +24357,12 @@ function useStaleQuoteRecovery(flow, quote, {
|
|
|
24163
24357
|
setDeadQuoteRef(quoteRef ?? "");
|
|
24164
24358
|
retryQuote();
|
|
24165
24359
|
}, [isEntryDeadRef, isArmed, quoteRef, deadQuoteRef, retryQuote]);
|
|
24166
|
-
|
|
24360
|
+
useEffect74(() => {
|
|
24167
24361
|
if (deadQuoteRef !== void 0 && !isQuoteFresh) {
|
|
24168
24362
|
setHasQuoteMoved(true);
|
|
24169
24363
|
}
|
|
24170
24364
|
}, [deadQuoteRef, isQuoteFresh]);
|
|
24171
|
-
|
|
24365
|
+
useEffect74(() => {
|
|
24172
24366
|
if (deadQuoteRef === void 0) {
|
|
24173
24367
|
return;
|
|
24174
24368
|
}
|
|
@@ -24371,11 +24565,11 @@ function FiatPendingOrderScreen({
|
|
|
24371
24565
|
}
|
|
24372
24566
|
|
|
24373
24567
|
// src/fiat/FiatErrorScreen.tsx
|
|
24374
|
-
import { useEffect as
|
|
24568
|
+
import { useEffect as useEffect75, useRef as useRef51 } from "react";
|
|
24375
24569
|
import { jsx as jsx138 } from "react/jsx-runtime";
|
|
24376
24570
|
function useErrorScreenLog(log) {
|
|
24377
24571
|
const loggedReason = useRef51(void 0);
|
|
24378
|
-
|
|
24572
|
+
useEffect75(() => {
|
|
24379
24573
|
if (log === void 0) {
|
|
24380
24574
|
return;
|
|
24381
24575
|
}
|
|
@@ -24657,7 +24851,7 @@ function useIdentityAssertion({
|
|
|
24657
24851
|
}
|
|
24658
24852
|
|
|
24659
24853
|
// src/fiat/depositOutcome.ts
|
|
24660
|
-
import { useEffect as
|
|
24854
|
+
import { useEffect as useEffect76, useMemo as useMemo31, useRef as useRef52 } from "react";
|
|
24661
24855
|
var ORDERED_SCREENS = /* @__PURE__ */ new Set([
|
|
24662
24856
|
"ORDER_REVIEW",
|
|
24663
24857
|
"ORDER_PENDING",
|
|
@@ -24722,7 +24916,7 @@ function useDepositOutcomeReporter({
|
|
|
24722
24916
|
});
|
|
24723
24917
|
latest.current.callbacks.onDepositError?.(error);
|
|
24724
24918
|
}
|
|
24725
|
-
|
|
24919
|
+
useEffect76(() => {
|
|
24726
24920
|
const generation = effectGeneration.current + 1;
|
|
24727
24921
|
effectGeneration.current = generation;
|
|
24728
24922
|
return () => {
|
|
@@ -24753,7 +24947,7 @@ function useDepositOutcomeReporter({
|
|
|
24753
24947
|
function useDepositOutcome(flow, reporter, t) {
|
|
24754
24948
|
const { screen: screen2, identity } = flow.page;
|
|
24755
24949
|
const state = flow.stepResponse?.state;
|
|
24756
|
-
|
|
24950
|
+
useEffect76(() => {
|
|
24757
24951
|
if (ORDERED_SCREENS.has(screen2)) {
|
|
24758
24952
|
reporter.ordered();
|
|
24759
24953
|
}
|
|
@@ -25178,7 +25372,7 @@ function useSessionAuthLogs(flow, stripeOnramp) {
|
|
|
25178
25372
|
channel
|
|
25179
25373
|
});
|
|
25180
25374
|
});
|
|
25181
|
-
|
|
25375
|
+
useEffect77(() => {
|
|
25182
25376
|
if (renderer4 !== void 0) {
|
|
25183
25377
|
announceRenderer(renderer4);
|
|
25184
25378
|
}
|
|
@@ -25199,7 +25393,7 @@ function useSessionAuthLogs(flow, stripeOnramp) {
|
|
|
25199
25393
|
}
|
|
25200
25394
|
logger.warn("connect-rn:fiat:otp_rejected", details2);
|
|
25201
25395
|
});
|
|
25202
|
-
|
|
25396
|
+
useEffect77(() => {
|
|
25203
25397
|
if (rejection !== void 0) {
|
|
25204
25398
|
announceRejection(rejection);
|
|
25205
25399
|
}
|
|
@@ -25279,7 +25473,7 @@ function FiatDepositAmountStep({
|
|
|
25279
25473
|
const [coinbaseRouted, setCoinbaseRouted] = useState59(false);
|
|
25280
25474
|
const sessionExit = useSharedValue18(1);
|
|
25281
25475
|
const hasTurned = useRef53(false);
|
|
25282
|
-
|
|
25476
|
+
useEffect77(() => {
|
|
25283
25477
|
if (entryScreen === null) {
|
|
25284
25478
|
hasTurned.current = true;
|
|
25285
25479
|
}
|
|
@@ -25420,7 +25614,7 @@ function useContact(flow) {
|
|
|
25420
25614
|
const contactRateLimited = contactRecovery === "rate-limited";
|
|
25421
25615
|
const contactFailure = contactRound !== void 0 && contactRecovery === "change";
|
|
25422
25616
|
const isContactStepOver = contactRateLimited && contactRound?.openedOn !== flow.stepResponse || contactRound !== void 0 && flow.stepResponse !== contactRound.openedOn && !contactFailure && !phoneReverify;
|
|
25423
|
-
|
|
25617
|
+
useEffect77(() => {
|
|
25424
25618
|
if (isContactStepOver) {
|
|
25425
25619
|
setContactRound(void 0);
|
|
25426
25620
|
}
|
|
@@ -25455,7 +25649,7 @@ function useKycRejection(flow) {
|
|
|
25455
25649
|
}
|
|
25456
25650
|
logger.info("connect-rn:fiat:kyc_rejected_restricted", details2);
|
|
25457
25651
|
});
|
|
25458
|
-
|
|
25652
|
+
useEffect77(() => {
|
|
25459
25653
|
announceRejection();
|
|
25460
25654
|
}, [rejectedState]);
|
|
25461
25655
|
return {
|
|
@@ -25501,7 +25695,7 @@ function useRegionCurrency() {
|
|
|
25501
25695
|
countryCode: userIpInfo?.alpha2,
|
|
25502
25696
|
logger
|
|
25503
25697
|
});
|
|
25504
|
-
|
|
25698
|
+
useEffect77(() => {
|
|
25505
25699
|
if (!isRegionCurrencyFailed) {
|
|
25506
25700
|
return;
|
|
25507
25701
|
}
|
|
@@ -25534,7 +25728,7 @@ function useRoutingOverrides(fiat, skippedPaymentProviders, triedKycProviders) {
|
|
|
25534
25728
|
undrawable,
|
|
25535
25729
|
current: fiat.unstable_routingOverrides
|
|
25536
25730
|
}) : void 0;
|
|
25537
|
-
|
|
25731
|
+
useEffect77(() => {
|
|
25538
25732
|
if (undrawable.length > 0) {
|
|
25539
25733
|
logger.info("connect-rn:fiat:providers_undrawable", {
|
|
25540
25734
|
providers: undrawable
|
|
@@ -25550,7 +25744,7 @@ function useRoutingOverrides(fiat, skippedPaymentProviders, triedKycProviders) {
|
|
|
25550
25744
|
function useRetryNotice(flow) {
|
|
25551
25745
|
const { t } = useFunkitTranslation();
|
|
25552
25746
|
const [isRetrying, setIsRetrying] = useState59(false);
|
|
25553
|
-
|
|
25747
|
+
useEffect77(() => {
|
|
25554
25748
|
if (!flow.isInFlight) {
|
|
25555
25749
|
setIsRetrying(false);
|
|
25556
25750
|
}
|
|
@@ -25587,7 +25781,7 @@ function useCapturedPayment(flow, quoteState, failSurface) {
|
|
|
25587
25781
|
[flow]
|
|
25588
25782
|
);
|
|
25589
25783
|
const answeredBeforePayment = capturedPayment && flow.stepResponse !== void 0 && flow.stepResponse.state.kind !== "PAYMENT" && flow.stepResponse.state.kind !== "ORDER";
|
|
25590
|
-
|
|
25784
|
+
useEffect77(() => {
|
|
25591
25785
|
if (answeredBeforePayment) {
|
|
25592
25786
|
setCapturedPayment(false);
|
|
25593
25787
|
}
|
|
@@ -25627,7 +25821,7 @@ function captureSurfaceOf(flow, stripeCaptureAdapters) {
|
|
|
25627
25821
|
};
|
|
25628
25822
|
}
|
|
25629
25823
|
function useUnsupportedScreenLogs(flow, captureSurface, captureModel) {
|
|
25630
|
-
|
|
25824
|
+
useEffect77(() => {
|
|
25631
25825
|
if (captureSurface === void 0 || captureModel !== void 0) {
|
|
25632
25826
|
return;
|
|
25633
25827
|
}
|
|
@@ -25639,7 +25833,7 @@ function useUnsupportedScreenLogs(flow, captureSurface, captureModel) {
|
|
|
25639
25833
|
const unsupportedScreen = UNDRAWN_SCREENS.has(flow.page.screen) ? flow.page.screen : void 0;
|
|
25640
25834
|
const pageIdentity = flow.page.identity;
|
|
25641
25835
|
const unsupportedState = flow.stepResponse?.state;
|
|
25642
|
-
|
|
25836
|
+
useEffect77(() => {
|
|
25643
25837
|
if (unsupportedScreen === void 0) {
|
|
25644
25838
|
return;
|
|
25645
25839
|
}
|
|
@@ -25670,7 +25864,7 @@ function useStripeAuthClosing(onBackToEntry) {
|
|
|
25670
25864
|
};
|
|
25671
25865
|
}
|
|
25672
25866
|
function useApplePayTerminal(readinessTiming, provider, resetFlow) {
|
|
25673
|
-
|
|
25867
|
+
useEffect77(() => {
|
|
25674
25868
|
if (readinessTiming !== void 0 && !readinessTiming.selectionReported) {
|
|
25675
25869
|
readinessTiming.selectionReported = true;
|
|
25676
25870
|
logger.info("connect-rn:fiat:apple_pay_quote_selected", {
|
|
@@ -25702,7 +25896,7 @@ function useApplePayTerminal(readinessTiming, provider, resetFlow) {
|
|
|
25702
25896
|
reportApplePayTerminal("superseded");
|
|
25703
25897
|
resetFlow();
|
|
25704
25898
|
};
|
|
25705
|
-
|
|
25899
|
+
useEffect77(() => {
|
|
25706
25900
|
const previous = previouslySelected.current;
|
|
25707
25901
|
if (previous !== void 0 && (previous.timing !== readinessTiming || previous.provider !== provider)) {
|
|
25708
25902
|
terminateAttempt(previous, "superseded");
|
|
@@ -25755,6 +25949,7 @@ function useApplePayStages(flow, provider, readinessTiming, setVerifiedQuote) {
|
|
|
25755
25949
|
});
|
|
25756
25950
|
}
|
|
25757
25951
|
}
|
|
25952
|
+
return status === "succeeded";
|
|
25758
25953
|
};
|
|
25759
25954
|
return {
|
|
25760
25955
|
submitApplePayTransition
|
|
@@ -25776,7 +25971,7 @@ function useApplePayInteractive(provider, readinessTiming, reportApplePayTermina
|
|
|
25776
25971
|
...provider === "COINBASE" ? coinbaseWarmupFields() : void 0
|
|
25777
25972
|
});
|
|
25778
25973
|
}, [provider, readinessTiming]);
|
|
25779
|
-
|
|
25974
|
+
useEffect77(() => {
|
|
25780
25975
|
if (readinessTiming === void 0) {
|
|
25781
25976
|
return;
|
|
25782
25977
|
}
|
|
@@ -25809,7 +26004,7 @@ function useRouteLimitReset(flow, quoteState, refusal, onBackToEntry) {
|
|
|
25809
26004
|
const queryClient = useQueryClient();
|
|
25810
26005
|
const inKyc = flow.stepResponse?.state.kind === "KYC";
|
|
25811
26006
|
const wasInKyc = useRef53(false);
|
|
25812
|
-
|
|
26007
|
+
useEffect77(() => {
|
|
25813
26008
|
if (inKyc) {
|
|
25814
26009
|
wasInKyc.current = true;
|
|
25815
26010
|
return;
|
|
@@ -25835,7 +26030,7 @@ function useRouteLimitReset(flow, quoteState, refusal, onBackToEntry) {
|
|
|
25835
26030
|
quoteState.dropQuote();
|
|
25836
26031
|
onBackToEntry();
|
|
25837
26032
|
});
|
|
25838
|
-
|
|
26033
|
+
useEffect77(() => {
|
|
25839
26034
|
if (inAuth) {
|
|
25840
26035
|
wasInAuth.current = true;
|
|
25841
26036
|
return;
|
|
@@ -25935,7 +26130,7 @@ function useBlockedState(flow, fiat, quoteState, alertScheme) {
|
|
|
25935
26130
|
quoteState.dropQuote();
|
|
25936
26131
|
}
|
|
25937
26132
|
});
|
|
25938
|
-
|
|
26133
|
+
useEffect77(() => {
|
|
25939
26134
|
announceBlocked();
|
|
25940
26135
|
}, [blockedState]);
|
|
25941
26136
|
return {
|
|
@@ -25949,7 +26144,7 @@ function useKycFormError(flow) {
|
|
|
25949
26144
|
const formError = flow.stepResponse?.state.kind === "KYC" && flow.stepResponse.state.phase === "INPUT_REQUIRED" ? flow.stepResponse.state.error : void 0;
|
|
25950
26145
|
const [roundError, setRoundError] = useState59();
|
|
25951
26146
|
const wasInRound = useRef53(false);
|
|
25952
|
-
|
|
26147
|
+
useEffect77(() => {
|
|
25953
26148
|
setRoundError(wasInRound.current ? formError : void 0);
|
|
25954
26149
|
wasInRound.current = flow.page.screen === "KYC_FORM" || flow.page.screen === "KYC_VERIFYING";
|
|
25955
26150
|
}, [flow.stepResponse]);
|
|
@@ -26006,31 +26201,16 @@ function useKycRejectionRequote(resolvedStep, provider, triedKycProviders, onKyc
|
|
|
26006
26201
|
});
|
|
26007
26202
|
onKycRetry(rejected);
|
|
26008
26203
|
});
|
|
26009
|
-
|
|
26204
|
+
useEffect77(() => {
|
|
26010
26205
|
if (rejectedProvider !== void 0 && retryIssuedFor.current !== rejectedProvider) {
|
|
26011
26206
|
retryIssuedFor.current = rejectedProvider;
|
|
26012
26207
|
retryAfterKycRejection(rejectedProvider);
|
|
26013
26208
|
}
|
|
26014
26209
|
}, [rejectedProvider]);
|
|
26015
26210
|
}
|
|
26016
|
-
function useKnownCeiling(quoteState) {
|
|
26017
|
-
const [knownCeiling, setKnownCeiling] = useState59();
|
|
26018
|
-
const quotedCurrency = quoteState.quote?.fiat.currency;
|
|
26019
|
-
const quotedCeiling = quoteState.limits?.max;
|
|
26020
|
-
useEffect76(() => {
|
|
26021
|
-
const max = Number(quotedCeiling);
|
|
26022
|
-
if (quotedCurrency === void 0 || !Number.isFinite(max) || max <= 0) {
|
|
26023
|
-
return;
|
|
26024
|
-
}
|
|
26025
|
-
setKnownCeiling({ max, currency: quotedCurrency });
|
|
26026
|
-
}, [quotedCeiling, quotedCurrency]);
|
|
26027
|
-
return {
|
|
26028
|
-
knownCeiling
|
|
26029
|
-
};
|
|
26030
|
-
}
|
|
26031
26211
|
function useUnfamiliarContactLog(contactFields) {
|
|
26032
26212
|
const unfamiliarContactNames = contactFields.map((field) => field.name).filter(isUnfamiliarContactName).join(",");
|
|
26033
|
-
|
|
26213
|
+
useEffect77(() => {
|
|
26034
26214
|
if (unfamiliarContactNames === "") {
|
|
26035
26215
|
return;
|
|
26036
26216
|
}
|
|
@@ -26041,7 +26221,7 @@ function useUnfamiliarContactLog(contactFields) {
|
|
|
26041
26221
|
}
|
|
26042
26222
|
function useHeldSlot(liveSlot) {
|
|
26043
26223
|
const [heldSlot, setHeldSlot] = useState59();
|
|
26044
|
-
|
|
26224
|
+
useEffect77(() => {
|
|
26045
26225
|
if (liveSlot !== void 0) {
|
|
26046
26226
|
setHeldSlot(liveSlot);
|
|
26047
26227
|
}
|
|
@@ -26052,7 +26232,7 @@ function useHeldSlot(liveSlot) {
|
|
|
26052
26232
|
}
|
|
26053
26233
|
function useNoRouteLog(fiat, quoteState) {
|
|
26054
26234
|
const noRoute = quoteState.noRoute;
|
|
26055
|
-
|
|
26235
|
+
useEffect77(() => {
|
|
26056
26236
|
if (noRoute === void 0) {
|
|
26057
26237
|
return;
|
|
26058
26238
|
}
|
|
@@ -26068,7 +26248,7 @@ function useNoRouteLog(fiat, quoteState) {
|
|
|
26068
26248
|
}
|
|
26069
26249
|
function useHeldStepLog(flow, isHeldForTap, provider, pageIdentity) {
|
|
26070
26250
|
const heldScreen = isHeldForTap ? flow.page.screen : void 0;
|
|
26071
|
-
|
|
26251
|
+
useEffect77(() => {
|
|
26072
26252
|
if (heldScreen === void 0) {
|
|
26073
26253
|
return;
|
|
26074
26254
|
}
|
|
@@ -26085,7 +26265,7 @@ function useHandoffBanner(flow, isHandedOff, triedKycProviders, bannerTop) {
|
|
|
26085
26265
|
);
|
|
26086
26266
|
const isOnEntry = flow.page.screen === "AMOUNT_ENTRY" || flow.page.screen === "QUOTE_REVIEW";
|
|
26087
26267
|
const dismissHandoff = handoffDismissal.dismiss;
|
|
26088
|
-
|
|
26268
|
+
useEffect77(() => {
|
|
26089
26269
|
if (isHandedOff && !isOnEntry) {
|
|
26090
26270
|
dismissHandoff();
|
|
26091
26271
|
}
|
|
@@ -26295,6 +26475,10 @@ function useFiatFlowScreen({
|
|
|
26295
26475
|
// session just verified against the current one would be orphaned by it.
|
|
26296
26476
|
enabled: flow.stepResponse === void 0
|
|
26297
26477
|
});
|
|
26478
|
+
useStripeLinkWarmup(
|
|
26479
|
+
stripeOnramp,
|
|
26480
|
+
quoteState.provider === "STRIPE" ? quoteState.providerAuthToken : void 0
|
|
26481
|
+
);
|
|
26298
26482
|
const {
|
|
26299
26483
|
orderFailure,
|
|
26300
26484
|
failedPayment,
|
|
@@ -26337,7 +26521,7 @@ function useFiatFlowScreen({
|
|
|
26337
26521
|
});
|
|
26338
26522
|
onBackToEntry();
|
|
26339
26523
|
});
|
|
26340
|
-
|
|
26524
|
+
useEffect77(() => {
|
|
26341
26525
|
if (flowQuoteExpired) {
|
|
26342
26526
|
recoverExpiredFlowQuote();
|
|
26343
26527
|
}
|
|
@@ -26353,7 +26537,7 @@ function useFiatFlowScreen({
|
|
|
26353
26537
|
quoteState.dropQuote();
|
|
26354
26538
|
onBackToEntry();
|
|
26355
26539
|
});
|
|
26356
|
-
|
|
26540
|
+
useEffect77(() => {
|
|
26357
26541
|
if (roundOutlivedItsQuote) {
|
|
26358
26542
|
giveUpOutlivedRound();
|
|
26359
26543
|
}
|
|
@@ -26389,7 +26573,7 @@ function useFiatFlowScreen({
|
|
|
26389
26573
|
error: flow.submitError instanceof Error ? flow.submitError.message : String(flow.submitError)
|
|
26390
26574
|
})
|
|
26391
26575
|
);
|
|
26392
|
-
|
|
26576
|
+
useEffect77(() => {
|
|
26393
26577
|
if (orderFailedAfterCapture) {
|
|
26394
26578
|
announceOrderFailedAfterCapture();
|
|
26395
26579
|
}
|
|
@@ -26459,7 +26643,7 @@ function useFiatFlowScreen({
|
|
|
26459
26643
|
onRequote: startOver,
|
|
26460
26644
|
onChangeMethod: pressPaymentMethod
|
|
26461
26645
|
});
|
|
26462
|
-
|
|
26646
|
+
useEffect77(() => {
|
|
26463
26647
|
if (kycNetworkFailure) {
|
|
26464
26648
|
announceKycFailure("network");
|
|
26465
26649
|
} else if (kycProviderFailure) {
|
|
@@ -26496,7 +26680,7 @@ function useFiatFlowScreen({
|
|
|
26496
26680
|
});
|
|
26497
26681
|
onKycRetry("STRIPE");
|
|
26498
26682
|
});
|
|
26499
|
-
|
|
26683
|
+
useEffect77(() => {
|
|
26500
26684
|
if (surfaceFailure !== void 0 && isStripeKycTerminal(surfaceFailure, flow)) {
|
|
26501
26685
|
failOverFromCapture(surfaceFailure);
|
|
26502
26686
|
} else if (surfaceFailure !== void 0 && flow.page.screen === "KYC_CAPTURE" && surfaceFailure.code !== STRIPE_KYC_CANCELLED) {
|
|
@@ -26518,7 +26702,7 @@ function useFiatFlowScreen({
|
|
|
26518
26702
|
contactFailure,
|
|
26519
26703
|
phoneReverify
|
|
26520
26704
|
} = useContact(flow);
|
|
26521
|
-
|
|
26705
|
+
useEffect77(() => {
|
|
26522
26706
|
if (refusal !== void 0 && !flowQuoteExpired && !contactFailure && !phoneReverify && !overLimitSilenced) {
|
|
26523
26707
|
announceRefusal(refusal);
|
|
26524
26708
|
}
|
|
@@ -26651,7 +26835,7 @@ function useFiatFlowScreen({
|
|
|
26651
26835
|
quoteRef: selectedQuoteRef
|
|
26652
26836
|
})
|
|
26653
26837
|
);
|
|
26654
|
-
|
|
26838
|
+
useEffect77(() => {
|
|
26655
26839
|
if (surfaceFailure !== void 0) {
|
|
26656
26840
|
logSurfaceFailure(surfaceFailure);
|
|
26657
26841
|
}
|
|
@@ -26673,7 +26857,7 @@ function useFiatFlowScreen({
|
|
|
26673
26857
|
})
|
|
26674
26858
|
);
|
|
26675
26859
|
});
|
|
26676
|
-
|
|
26860
|
+
useEffect77(() => {
|
|
26677
26861
|
reportShownFailure();
|
|
26678
26862
|
}, [surfaceFailure, orderFailure, isRetryablePhase]);
|
|
26679
26863
|
const { reportApplePayTerminal, onBackToEntry } = useApplePayTerminal(
|
|
@@ -26702,13 +26886,13 @@ function useFiatFlowScreen({
|
|
|
26702
26886
|
quoteCurrency
|
|
26703
26887
|
]);
|
|
26704
26888
|
const [lastPayableContext, setLastPayableContext] = useState59();
|
|
26705
|
-
|
|
26889
|
+
useEffect77(() => {
|
|
26706
26890
|
if (isEntryReady && entryCta.kind === "PAY") {
|
|
26707
26891
|
setLastPayableContext(payableContext);
|
|
26708
26892
|
}
|
|
26709
26893
|
}, [isEntryReady, entryCta.kind, payableContext]);
|
|
26710
26894
|
const isKycThreshold = identityDetour && (refusal?.code === "LIMITS_EXCEEDED_UPGRADEABLE" || lastPayableContext === payableContext);
|
|
26711
|
-
|
|
26895
|
+
useEffect77(() => {
|
|
26712
26896
|
if (!identityDetour) {
|
|
26713
26897
|
return;
|
|
26714
26898
|
}
|
|
@@ -26748,7 +26932,7 @@ function useFiatFlowScreen({
|
|
|
26748
26932
|
}
|
|
26749
26933
|
setContactRound(round);
|
|
26750
26934
|
});
|
|
26751
|
-
|
|
26935
|
+
useEffect77(() => {
|
|
26752
26936
|
if (phoneReverify) {
|
|
26753
26937
|
rebuildPhoneRound();
|
|
26754
26938
|
}
|
|
@@ -26789,7 +26973,7 @@ function useFiatFlowScreen({
|
|
|
26789
26973
|
flow.setField(accept.name, acceptedTerms2(accept, /* @__PURE__ */ new Date()));
|
|
26790
26974
|
setIsAccepting(true);
|
|
26791
26975
|
};
|
|
26792
|
-
|
|
26976
|
+
useEffect77(() => {
|
|
26793
26977
|
if (!isAccepting) {
|
|
26794
26978
|
return;
|
|
26795
26979
|
}
|
|
@@ -26833,7 +27017,7 @@ function useFiatFlowScreen({
|
|
|
26833
27017
|
});
|
|
26834
27018
|
quoteState.submitQuote();
|
|
26835
27019
|
});
|
|
26836
|
-
|
|
27020
|
+
useEffect77(() => {
|
|
26837
27021
|
if (flow.stepResponse !== void 0) {
|
|
26838
27022
|
enteredCheck.current = false;
|
|
26839
27023
|
return;
|
|
@@ -26846,7 +27030,7 @@ function useFiatFlowScreen({
|
|
|
26846
27030
|
const [kycOnHold, setKycOnHold] = useState59(kycRecheck === "hold");
|
|
26847
27031
|
const isHoldVerdict = resolvedStep?.state.kind === "KYC" && resolvedStep.state.phase === "NO_ACTION_REQUIRED" && resolvedStep.state.reason === "ON_HOLD";
|
|
26848
27032
|
const payable = isEntryReady && isPayableEntry(entryCta, flowStep);
|
|
26849
|
-
|
|
27033
|
+
useEffect77(() => {
|
|
26850
27034
|
const resolved = kycResolution?.outcome;
|
|
26851
27035
|
if (resolved !== void 0) {
|
|
26852
27036
|
setResolvedKyc(resolved);
|
|
@@ -26859,7 +27043,7 @@ function useFiatFlowScreen({
|
|
|
26859
27043
|
setResolvedKyc((shown) => endedKycWait(shown, kycOnHold));
|
|
26860
27044
|
setKycOnHold(false);
|
|
26861
27045
|
}, [kycResolution?.outcome, isHoldVerdict, payable, kycOnHold]);
|
|
26862
|
-
|
|
27046
|
+
useEffect77(() => {
|
|
26863
27047
|
if (isOrdered) {
|
|
26864
27048
|
setResolvedKyc(void 0);
|
|
26865
27049
|
}
|
|
@@ -26923,26 +27107,22 @@ function useFiatFlowScreen({
|
|
|
26923
27107
|
outcome.submitted(orderId, method);
|
|
26924
27108
|
}
|
|
26925
27109
|
});
|
|
26926
|
-
|
|
27110
|
+
useEffect77(() => {
|
|
26927
27111
|
if (deliveryConfirmed) {
|
|
26928
27112
|
settleDeposit();
|
|
26929
27113
|
}
|
|
26930
27114
|
}, [deliveryConfirmed]);
|
|
26931
|
-
const { knownCeiling } = useKnownCeiling(quoteState);
|
|
26932
|
-
const limitCurrency = shownQuote?.fiat.currency ?? (resolvedStep?.state.kind === "KYC" ? resolvedStep.state.quote?.fiat.currency : void 0);
|
|
26933
27115
|
const refusedMax = Number(quoteState.maximum?.amount);
|
|
26934
27116
|
const refusedCeiling = quoteState.maximum !== void 0 && Number.isFinite(refusedMax) && refusedMax > 0 ? { max: refusedMax, currency: quoteState.maximum.currency } : void 0;
|
|
26935
27117
|
const flowQuote = flow.stepResponse?.state.kind === "QUOTE" && flow.stepResponse.state.error !== void 0 ? flow.stepResponse.state : void 0;
|
|
26936
27118
|
const flowMax = Number(flowQuote?.limits?.max);
|
|
26937
27119
|
const flowCurrency = flowQuote?.quote?.fiat.currency;
|
|
26938
27120
|
const flowCeiling = flowCurrency !== void 0 && Number.isFinite(flowMax) && flowMax > 0 ? { max: flowMax, currency: flowCurrency } : void 0;
|
|
26939
|
-
const ceiling = refusedCeiling ?? flowCeiling ?? (knownCeiling?.currency === limitCurrency ? knownCeiling : void 0);
|
|
26940
|
-
const limitUsd = ceiling === void 0 ? void 0 : String(ceiling.max);
|
|
26941
27121
|
const fieldCeiling = refusedCeiling ?? flowCeiling;
|
|
26942
27122
|
const fieldLimitUsd = fieldCeiling === void 0 ? void 0 : String(fieldCeiling.max);
|
|
26943
27123
|
const amountCurrency = quoteCurrency ?? DEFAULT_FIAT_CURRENCY2;
|
|
26944
27124
|
const minLimitUsd = quotedMinimum(quoteState.routeMinimum, quoteCurrency);
|
|
26945
|
-
|
|
27125
|
+
useEffect77(() => {
|
|
26946
27126
|
if (minLimitUsd === void 0) {
|
|
26947
27127
|
return;
|
|
26948
27128
|
}
|
|
@@ -26953,12 +27133,11 @@ function useFiatFlowScreen({
|
|
|
26953
27133
|
paymentMethod: fiat.paymentMethod
|
|
26954
27134
|
});
|
|
26955
27135
|
}, [minLimitUsd]);
|
|
26956
|
-
const depositMax = ceiling === void 0 ? void 0 : formatFiat(ceiling.max, ceiling.currency);
|
|
26957
27136
|
const kycCompletion = useKycCompletion(flow);
|
|
26958
27137
|
useRouteLimitReset(flow, quoteState, refusal, onBackToEntry);
|
|
26959
27138
|
const railCopy = resolveDepositRailCopy(config, fiat.paymentMethod, t);
|
|
26960
27139
|
const seededMatch = useSeed(SEED.fiatDepositMatch);
|
|
26961
|
-
const matchTerms =
|
|
27140
|
+
const matchTerms = config.experimental_depositMatch ?? seededMatch;
|
|
26962
27141
|
const matchLine = matchTerms === void 0 ? void 0 : depositMatchLine(
|
|
26963
27142
|
amount,
|
|
26964
27143
|
quoteCurrency,
|
|
@@ -26968,6 +27147,7 @@ function useFiatFlowScreen({
|
|
|
26968
27147
|
t
|
|
26969
27148
|
);
|
|
26970
27149
|
const depositMatch = matchTerms !== void 0 && matchLine !== void 0;
|
|
27150
|
+
const canOpenFeeDetails = !depositMatch || shownFeeQuote !== void 0 || feeSubsidy !== void 0;
|
|
26971
27151
|
const feeLine = matchLine ?? quoteFee(shownFeeQuote, amount, t, feeSubsidy);
|
|
26972
27152
|
const quotedLabel = isEntryReady ? entryCtaLabel(entryCta, t, railCopy.submitLabel) : railCopy.submitLabel;
|
|
26973
27153
|
const contactFields = isEntryReady ? sessionContactFields(entryCta) : [];
|
|
@@ -27001,7 +27181,6 @@ function useFiatFlowScreen({
|
|
|
27001
27181
|
});
|
|
27002
27182
|
const kycRoutes = kycOptionRows({
|
|
27003
27183
|
outcome: shownKycOutcome,
|
|
27004
|
-
depositMax,
|
|
27005
27184
|
t,
|
|
27006
27185
|
onRecheck: shownKycOutcome === "pending" || shownKycOutcome === "soft" && kycOnHold ? () => {
|
|
27007
27186
|
setOnKycOptions(false);
|
|
@@ -27025,17 +27204,6 @@ function useFiatFlowScreen({
|
|
|
27025
27204
|
setKycSubmission((n) => n + 1);
|
|
27026
27205
|
redoRoute();
|
|
27027
27206
|
},
|
|
27028
|
-
onDepositMax: () => {
|
|
27029
|
-
setOnKycOptions(false);
|
|
27030
|
-
logger.info("connect-rn:fiat:kyc_route_taken", {
|
|
27031
|
-
route: "deposit_max",
|
|
27032
|
-
outcome: shownKycOutcome,
|
|
27033
|
-
currency: ceiling?.currency
|
|
27034
|
-
});
|
|
27035
|
-
if (limitUsd !== void 0) {
|
|
27036
|
-
changeAmount(limitUsd);
|
|
27037
|
-
}
|
|
27038
|
-
},
|
|
27039
27207
|
onSupport: () => {
|
|
27040
27208
|
logger.info("connect-rn:fiat:kyc_route_taken", {
|
|
27041
27209
|
route: "support",
|
|
@@ -27053,7 +27221,6 @@ function useFiatFlowScreen({
|
|
|
27053
27221
|
});
|
|
27054
27222
|
const captureRetryRoutes = kycOptionRows({
|
|
27055
27223
|
outcome: "soft",
|
|
27056
|
-
depositMax,
|
|
27057
27224
|
t,
|
|
27058
27225
|
onRedo: () => {
|
|
27059
27226
|
logger.info("connect-rn:fiat:kyc_route_taken", {
|
|
@@ -27063,16 +27230,6 @@ function useFiatFlowScreen({
|
|
|
27063
27230
|
});
|
|
27064
27231
|
kycCaptureRound.retry();
|
|
27065
27232
|
},
|
|
27066
|
-
onDepositMax: () => {
|
|
27067
|
-
logger.info("connect-rn:fiat:kyc_route_taken", {
|
|
27068
|
-
route: "deposit_max",
|
|
27069
|
-
outcome: "soft",
|
|
27070
|
-
currency: ceiling?.currency
|
|
27071
|
-
});
|
|
27072
|
-
if (limitUsd !== void 0) {
|
|
27073
|
-
changeAmount(limitUsd);
|
|
27074
|
-
}
|
|
27075
|
-
},
|
|
27076
27233
|
onSupport: openKycSupport,
|
|
27077
27234
|
onClose: close
|
|
27078
27235
|
}) ?? [];
|
|
@@ -27102,7 +27259,7 @@ function useFiatFlowScreen({
|
|
|
27102
27259
|
const isRoundEntry = enteredStep3(entryCta) !== void 0;
|
|
27103
27260
|
const canSubmitQuote = isEntryReady && !flow.isInFlight && (isRoundEntry || identityAssertion !== void 0 || depositAddress !== void 0) && shouldRenderCta(entryCta);
|
|
27104
27261
|
const depositAddressUnavailable = depositAddressError !== void 0 && !isRoundEntry && depositAddress === void 0;
|
|
27105
|
-
|
|
27262
|
+
useEffect77(() => {
|
|
27106
27263
|
if (!depositAddressUnavailable) {
|
|
27107
27264
|
return;
|
|
27108
27265
|
}
|
|
@@ -27137,7 +27294,7 @@ function useFiatFlowScreen({
|
|
|
27137
27294
|
{ untilReplaced: true }
|
|
27138
27295
|
)
|
|
27139
27296
|
);
|
|
27140
|
-
|
|
27297
|
+
useEffect77(() => {
|
|
27141
27298
|
if (!announcesProcessing) {
|
|
27142
27299
|
return;
|
|
27143
27300
|
}
|
|
@@ -27285,9 +27442,8 @@ function useFiatFlowScreen({
|
|
|
27285
27442
|
},
|
|
27286
27443
|
onFeeQuote: recordProviderFeeQuote,
|
|
27287
27444
|
onPaymentDisclosures: paymentDisclosures.record,
|
|
27288
|
-
|
|
27289
|
-
|
|
27290
|
-
}
|
|
27445
|
+
// MoonPay's sign-in needs to know: a refused reuse of its held credentials re-checks next round.
|
|
27446
|
+
report: (result) => submitApplePayTransition(transition, result)
|
|
27291
27447
|
})
|
|
27292
27448
|
}
|
|
27293
27449
|
);
|
|
@@ -27498,8 +27654,7 @@ function useFiatFlowScreen({
|
|
|
27498
27654
|
if (kycRoutes !== void 0) {
|
|
27499
27655
|
logger.info("connect-rn:fiat:kyc_options_opened", {
|
|
27500
27656
|
outcome: resolvedKyc,
|
|
27501
|
-
routes: kycRoutes.map((row2) => row2.title)
|
|
27502
|
-
hasCeiling: ceiling !== void 0
|
|
27657
|
+
routes: kycRoutes.map((row2) => row2.title)
|
|
27503
27658
|
});
|
|
27504
27659
|
setOnKycOptions(true);
|
|
27505
27660
|
return;
|
|
@@ -27588,7 +27743,7 @@ function useFiatFlowScreen({
|
|
|
27588
27743
|
feeHighlight: feeLine?.highlight,
|
|
27589
27744
|
feeStruck: feeLine?.struck,
|
|
27590
27745
|
feePending: isActionPending,
|
|
27591
|
-
onPressFee: openFeeDetails,
|
|
27746
|
+
onPressFee: canOpenFeeDetails ? openFeeDetails : void 0,
|
|
27592
27747
|
feeAccessibilityLabel: matchLine?.fee ?? t("feeDetails.title"),
|
|
27593
27748
|
methodBadge: railCopy.methodBadge,
|
|
27594
27749
|
paymentMethodPickerProps,
|
|
@@ -28601,7 +28756,7 @@ function usePreviewEntryPress(canPress, press) {
|
|
|
28601
28756
|
const seeded = useSeed(SEED.fiatPressEntry) === true;
|
|
28602
28757
|
const pressed = useRef53(false);
|
|
28603
28758
|
const pressNow = useEffectEvent8(press);
|
|
28604
|
-
|
|
28759
|
+
useEffect77(() => {
|
|
28605
28760
|
if (seeded && canPress && !pressed.current) {
|
|
28606
28761
|
pressed.current = true;
|
|
28607
28762
|
pressNow();
|
|
@@ -28612,7 +28767,7 @@ function usePreviewSubmit(flow, seededStep) {
|
|
|
28612
28767
|
const ctaId = useSeed(SEED.fiatSubmitOnOpen);
|
|
28613
28768
|
const submitted = useRef53(false);
|
|
28614
28769
|
const cta = flow.stepResponse === seededStep && seededStep !== void 0 ? flow.ctas.find((transition) => transition.id === ctaId) : void 0;
|
|
28615
|
-
|
|
28770
|
+
useEffect77(() => {
|
|
28616
28771
|
if (cta !== void 0 && !submitted.current) {
|
|
28617
28772
|
submitted.current = true;
|
|
28618
28773
|
void flow.submit(cta);
|
|
@@ -28621,7 +28776,7 @@ function usePreviewSubmit(flow, seededStep) {
|
|
|
28621
28776
|
}
|
|
28622
28777
|
|
|
28623
28778
|
// src/flow/FiatRegionBlockedStep.tsx
|
|
28624
|
-
import { useEffect as
|
|
28779
|
+
import { useEffect as useEffect78, useRef as useRef54 } from "react";
|
|
28625
28780
|
import { useEffectEvent as useEffectEvent9 } from "@funkit/connect-core";
|
|
28626
28781
|
import { jsx as jsx144 } from "react/jsx-runtime";
|
|
28627
28782
|
function FiatRegionBlockedStep({
|
|
@@ -28641,7 +28796,7 @@ function FiatRegionBlockedStep({
|
|
|
28641
28796
|
flowError("blocked", t("fiat.regionUnsupportedTitle"))
|
|
28642
28797
|
);
|
|
28643
28798
|
});
|
|
28644
|
-
|
|
28799
|
+
useEffect78(() => {
|
|
28645
28800
|
report();
|
|
28646
28801
|
}, []);
|
|
28647
28802
|
return /* @__PURE__ */ jsx144(FiatRegionUnsupportedScreen, { onClose });
|
|
@@ -28761,7 +28916,7 @@ import {
|
|
|
28761
28916
|
createContext as createContext12,
|
|
28762
28917
|
useCallback as useCallback27,
|
|
28763
28918
|
useContext as useContext14,
|
|
28764
|
-
useEffect as
|
|
28919
|
+
useEffect as useEffect79,
|
|
28765
28920
|
useMemo as useMemo33,
|
|
28766
28921
|
useState as useState60
|
|
28767
28922
|
} from "react";
|
|
@@ -28795,7 +28950,7 @@ var StoredChainContext = createContext12(void 0);
|
|
|
28795
28950
|
var StoredChainProvider = StoredChainContext.Provider;
|
|
28796
28951
|
function useStoredChainState(userId) {
|
|
28797
28952
|
const [read, setRead] = useState60();
|
|
28798
|
-
|
|
28953
|
+
useEffect79(() => {
|
|
28799
28954
|
if (userId === void 0) {
|
|
28800
28955
|
return;
|
|
28801
28956
|
}
|
|
@@ -28988,9 +29143,17 @@ function FlowContent({
|
|
|
28988
29143
|
if (!active || !isAddress(active.targetAsset)) {
|
|
28989
29144
|
return void 0;
|
|
28990
29145
|
}
|
|
28991
|
-
|
|
28992
|
-
|
|
28993
|
-
|
|
29146
|
+
const curated = fetched.tokens.find(
|
|
29147
|
+
(t2) => String(t2.chainId) === active.targetChain && depositAddressesEqual(t2.address, active.targetAsset)
|
|
29148
|
+
);
|
|
29149
|
+
return {
|
|
29150
|
+
chainId: active.targetChain,
|
|
29151
|
+
tokenAddress: active.targetAsset,
|
|
29152
|
+
symbol: curated?.symbol,
|
|
29153
|
+
decimals: curated?.decimals
|
|
29154
|
+
};
|
|
29155
|
+
}, [targetAsset.activeCheckoutConfig, fetched.tokens]);
|
|
29156
|
+
useEffect80(() => {
|
|
28994
29157
|
if (current === "transfer" && (allChains.length > 0 && !selectedChain || locked && !activeSourceToken && !isAssetListLoading)) {
|
|
28995
29158
|
nav.back();
|
|
28996
29159
|
}
|
|
@@ -29032,7 +29195,7 @@ function FlowContent({
|
|
|
29032
29195
|
const [draftSource, setDraftSource] = useState61();
|
|
29033
29196
|
const draftConfirmed = useRef55(false);
|
|
29034
29197
|
const onTransfer = current === "transfer";
|
|
29035
|
-
|
|
29198
|
+
useEffect80(() => {
|
|
29036
29199
|
if (onTransfer) {
|
|
29037
29200
|
setDraftSource(void 0);
|
|
29038
29201
|
}
|
|
@@ -29104,7 +29267,7 @@ function FlowContent({
|
|
|
29104
29267
|
const canRouteSkip = skipAddMoney && current === "addMoney" && !isRoutingSkip && !isGeoblocked;
|
|
29105
29268
|
const hasRoutedSkip = useRef55(false);
|
|
29106
29269
|
const hasRememberedChain = !locked && !!selectedChain;
|
|
29107
|
-
|
|
29270
|
+
useEffect80(() => {
|
|
29108
29271
|
if (!canRouteSkip || hasRoutedSkip.current) {
|
|
29109
29272
|
return;
|
|
29110
29273
|
}
|
|
@@ -29531,7 +29694,7 @@ function useRememberedChain(userId) {
|
|
|
29531
29694
|
const previewChainId = useSeed(SEED.depositChainId);
|
|
29532
29695
|
const stored = useStoredChain(userId);
|
|
29533
29696
|
const [picked, setPicked] = useState61(previewChainId);
|
|
29534
|
-
|
|
29697
|
+
useEffect80(() => {
|
|
29535
29698
|
setPicked(previewChainId);
|
|
29536
29699
|
}, [userId, previewChainId]);
|
|
29537
29700
|
const { remember } = stored;
|
|
@@ -29614,14 +29777,14 @@ function warn(name, error) {
|
|
|
29614
29777
|
|
|
29615
29778
|
// src/flow/DepositPreload.tsx
|
|
29616
29779
|
import { useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
29617
|
-
import { useEffect as
|
|
29780
|
+
import { useEffect as useEffect81 } from "react";
|
|
29618
29781
|
import { AppState as AppState2 } from "react-native";
|
|
29619
29782
|
var LOCATION_REFRESH_MS = 5 * 6e4;
|
|
29620
29783
|
function DepositPreload() {
|
|
29621
29784
|
useUserIpInfo();
|
|
29622
29785
|
useSupportedTokens();
|
|
29623
29786
|
const queryClient = useQueryClient2();
|
|
29624
|
-
|
|
29787
|
+
useEffect81(() => {
|
|
29625
29788
|
let timer;
|
|
29626
29789
|
const start = () => {
|
|
29627
29790
|
timer ??= setInterval(
|
|
@@ -29658,7 +29821,7 @@ function opensOnCryptoWithdrawal(config) {
|
|
|
29658
29821
|
}
|
|
29659
29822
|
|
|
29660
29823
|
// src/flow/useCopiedToast.tsx
|
|
29661
|
-
import { useCallback as useCallback29, useEffect as
|
|
29824
|
+
import { useCallback as useCallback29, useEffect as useEffect82, useRef as useRef56, useState as useState62 } from "react";
|
|
29662
29825
|
import { StyleSheet as StyleSheet73, View as View34 } from "react-native";
|
|
29663
29826
|
import { useSafeAreaInsets as useSafeAreaInsets26 } from "react-native-safe-area-context";
|
|
29664
29827
|
|
|
@@ -29763,7 +29926,7 @@ function useCopiedToast() {
|
|
|
29763
29926
|
);
|
|
29764
29927
|
}, TOAST_VISIBLE_MS);
|
|
29765
29928
|
}, []);
|
|
29766
|
-
|
|
29929
|
+
useEffect82(() => () => clearToast(), [clearToast]);
|
|
29767
29930
|
const toast = toastMounted ? /* @__PURE__ */ jsx149(
|
|
29768
29931
|
View34,
|
|
29769
29932
|
{
|
|
@@ -29776,7 +29939,7 @@ function useCopiedToast() {
|
|
|
29776
29939
|
}
|
|
29777
29940
|
|
|
29778
29941
|
// src/flow/useDepositReceivedToast.tsx
|
|
29779
|
-
import { useCallback as useCallback30, useEffect as
|
|
29942
|
+
import { useCallback as useCallback30, useEffect as useEffect83, useRef as useRef57, useState as useState63 } from "react";
|
|
29780
29943
|
import { StyleSheet as StyleSheet75, View as View36 } from "react-native";
|
|
29781
29944
|
import { useSafeAreaInsets as useSafeAreaInsets27 } from "react-native-safe-area-context";
|
|
29782
29945
|
|
|
@@ -29934,7 +30097,7 @@ function useDepositReceivedToast() {
|
|
|
29934
30097
|
},
|
|
29935
30098
|
[hide]
|
|
29936
30099
|
);
|
|
29937
|
-
|
|
30100
|
+
useEffect83(() => () => clearDepositToast(), [clearDepositToast]);
|
|
29938
30101
|
const depositToast = card2 === void 0 ? null : /* @__PURE__ */ jsx151(
|
|
29939
30102
|
View36,
|
|
29940
30103
|
{
|
|
@@ -29966,7 +30129,7 @@ var styles71 = StyleSheet75.create({
|
|
|
29966
30129
|
// src/flow/useFlowTransitions.ts
|
|
29967
30130
|
import {
|
|
29968
30131
|
useCallback as useCallback31,
|
|
29969
|
-
useEffect as
|
|
30132
|
+
useEffect as useEffect84,
|
|
29970
30133
|
useMemo as useMemo35,
|
|
29971
30134
|
useRef as useRef58,
|
|
29972
30135
|
useState as useState64
|
|
@@ -29990,7 +30153,7 @@ function useFlowTransitions({
|
|
|
29990
30153
|
current.resolve(done);
|
|
29991
30154
|
}
|
|
29992
30155
|
}, []);
|
|
29993
|
-
|
|
30156
|
+
useEffect84(() => {
|
|
29994
30157
|
restIndex.current = void 0;
|
|
29995
30158
|
settle("any", false);
|
|
29996
30159
|
}, [session, settle]);
|
|
@@ -30168,7 +30331,7 @@ import { useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
|
30168
30331
|
import { useCallback as useCallback36, useState as useState72 } from "react";
|
|
30169
30332
|
|
|
30170
30333
|
// src/screens/WithdrawCryptoComplete.tsx
|
|
30171
|
-
import { useEffect as
|
|
30334
|
+
import { useEffect as useEffect86, useRef as useRef60 } from "react";
|
|
30172
30335
|
|
|
30173
30336
|
// src/withdrawal/useDepositAddressWithdrawalStatus.ts
|
|
30174
30337
|
import {
|
|
@@ -30176,7 +30339,7 @@ import {
|
|
|
30176
30339
|
resolveOnChainCompletionTxHash,
|
|
30177
30340
|
useDirectExecutionForDepositAddress
|
|
30178
30341
|
} from "@funkit/connect-core";
|
|
30179
|
-
import { useEffect as
|
|
30342
|
+
import { useEffect as useEffect85, useState as useState65 } from "react";
|
|
30180
30343
|
|
|
30181
30344
|
// src/withdrawal/useWithdrawalStatus.ts
|
|
30182
30345
|
import {
|
|
@@ -30282,7 +30445,7 @@ function useDepositAddressWithdrawalStatus(depositAddress, pollIntervalMs = DEFA
|
|
|
30282
30445
|
latestStep,
|
|
30283
30446
|
getCompletionTxInfo(latestStep).txHash
|
|
30284
30447
|
) : void 0;
|
|
30285
|
-
|
|
30448
|
+
useEffect85(() => {
|
|
30286
30449
|
if (isCompleted || arrivalStatus.isFailed) {
|
|
30287
30450
|
setHasSettled(true);
|
|
30288
30451
|
}
|
|
@@ -30602,7 +30765,7 @@ function WithdrawCryptoComplete({
|
|
|
30602
30765
|
const { isCompleted, isFailed, isRefunded } = isVenueSubmitted ? byDepositAddress : byTransaction;
|
|
30603
30766
|
const txHash = isVenueSubmitted ? byDepositAddress.txHash : depositAddressOrHash.txHash;
|
|
30604
30767
|
const notifiedRef = useRef60(false);
|
|
30605
|
-
|
|
30768
|
+
useEffect86(() => {
|
|
30606
30769
|
if (notifiedRef.current) {
|
|
30607
30770
|
return;
|
|
30608
30771
|
}
|
|
@@ -30618,7 +30781,7 @@ function WithdrawCryptoComplete({
|
|
|
30618
30781
|
});
|
|
30619
30782
|
}
|
|
30620
30783
|
}, [isCompleted, isFailed, isRefunded, callbacks, txHash]);
|
|
30621
|
-
|
|
30784
|
+
useEffect86(
|
|
30622
30785
|
() => () => {
|
|
30623
30786
|
if (notifiedRef.current) {
|
|
30624
30787
|
return;
|
|
@@ -30671,7 +30834,7 @@ function resolveStatus({
|
|
|
30671
30834
|
|
|
30672
30835
|
// src/screens/WithdrawCryptoSteps.tsx
|
|
30673
30836
|
import { BottomSheetModal as BottomSheetModal5, BottomSheetView as BottomSheetView5 } from "@gorhom/bottom-sheet";
|
|
30674
|
-
import { useFeatureGate as
|
|
30837
|
+
import { useFeatureGate as useFeatureGate5 } from "@funkit/connect-core";
|
|
30675
30838
|
import { useState as useState71 } from "react";
|
|
30676
30839
|
import { useSafeAreaInsets as useSafeAreaInsets33 } from "react-native-safe-area-context";
|
|
30677
30840
|
|
|
@@ -31093,7 +31256,7 @@ function useWithdrawalAmountInput({
|
|
|
31093
31256
|
|
|
31094
31257
|
// src/withdrawal/useWithdrawalFiatPrice.ts
|
|
31095
31258
|
import { getExchangeRate } from "@funkit/connect-core";
|
|
31096
|
-
import { useEffect as
|
|
31259
|
+
import { useEffect as useEffect87 } from "react";
|
|
31097
31260
|
function useWithdrawalFiatPrice({
|
|
31098
31261
|
sourceUsdPrice,
|
|
31099
31262
|
currency = "USD"
|
|
@@ -31103,7 +31266,7 @@ function useWithdrawalFiatPrice({
|
|
|
31103
31266
|
const { data, error, errorUpdatedAt } = useFiatExchangeRates(enabled, {
|
|
31104
31267
|
recoverAutomatically: true
|
|
31105
31268
|
});
|
|
31106
|
-
|
|
31269
|
+
useEffect87(() => {
|
|
31107
31270
|
if (enabled && error) {
|
|
31108
31271
|
logger.warn("connect-rn:withdrawal:display_rate_unavailable", {
|
|
31109
31272
|
currency
|
|
@@ -31119,7 +31282,7 @@ function useWithdrawalFiatPrice({
|
|
|
31119
31282
|
}
|
|
31120
31283
|
|
|
31121
31284
|
// src/withdrawal/useWithdrawalMaximum.ts
|
|
31122
|
-
import { useEffect as
|
|
31285
|
+
import { useEffect as useEffect88, useRef as useRef61 } from "react";
|
|
31123
31286
|
|
|
31124
31287
|
// src/withdrawal/maxWithdrawAmount.ts
|
|
31125
31288
|
import {
|
|
@@ -31285,7 +31448,7 @@ function useWithdrawalMaximum({
|
|
|
31285
31448
|
});
|
|
31286
31449
|
const warningReason = maximumUnavailableReason !== "exchange-rates-loading" ? maximumUnavailableReason : void 0;
|
|
31287
31450
|
const warnedKeysRef = useRef61(/* @__PURE__ */ new Set());
|
|
31288
|
-
|
|
31451
|
+
useEffect88(() => {
|
|
31289
31452
|
if (!warningReason) {
|
|
31290
31453
|
return;
|
|
31291
31454
|
}
|
|
@@ -31434,7 +31597,7 @@ function useWithdrawalRisk(address, chainId) {
|
|
|
31434
31597
|
|
|
31435
31598
|
// src/withdrawal/useWithdrawalSourceTokenBalance.ts
|
|
31436
31599
|
import { resolveWithdrawalSourceTokenBalance } from "@funkit/connect-core";
|
|
31437
|
-
import { useEffect as
|
|
31600
|
+
import { useEffect as useEffect89, useRef as useRef62, useState as useState68 } from "react";
|
|
31438
31601
|
var tokenKey = ({ sourceToken }) => `${sourceToken.chainId}:${sourceToken.address}`;
|
|
31439
31602
|
function useWithdrawalSourceTokenBalance(callback, params) {
|
|
31440
31603
|
const key = tokenKey(params);
|
|
@@ -31443,7 +31606,7 @@ function useWithdrawalSourceTokenBalance(callback, params) {
|
|
|
31443
31606
|
const generation = useRef62(0);
|
|
31444
31607
|
const asyncCallbacks = useRef62(/* @__PURE__ */ new WeakSet());
|
|
31445
31608
|
const mounted = useRef62(true);
|
|
31446
|
-
|
|
31609
|
+
useEffect89(() => {
|
|
31447
31610
|
mounted.current = true;
|
|
31448
31611
|
return () => {
|
|
31449
31612
|
mounted.current = false;
|
|
@@ -31453,39 +31616,32 @@ function useWithdrawalSourceTokenBalance(callback, params) {
|
|
|
31453
31616
|
const requestGeneration = generation.current + 1;
|
|
31454
31617
|
generation.current = requestGeneration;
|
|
31455
31618
|
pending.current = { key: forKey, generation: requestGeneration };
|
|
31456
|
-
void promise.then(validate, (
|
|
31457
|
-
logger.warn("withdrawal:sourceTokenBalanceThrew", {
|
|
31458
|
-
error: error instanceof Error ? error.message : String(error)
|
|
31459
|
-
});
|
|
31460
|
-
return "0";
|
|
31461
|
-
}).then((value) => {
|
|
31619
|
+
void promise.then(validate, failedRead).then((result) => {
|
|
31462
31620
|
if (pending.current?.generation !== requestGeneration) {
|
|
31463
31621
|
return;
|
|
31464
31622
|
}
|
|
31465
31623
|
pending.current = void 0;
|
|
31466
31624
|
if (mounted.current) {
|
|
31467
|
-
setSettled({ key: forKey,
|
|
31625
|
+
setSettled({ key: forKey, ...result });
|
|
31468
31626
|
}
|
|
31469
31627
|
});
|
|
31470
31628
|
};
|
|
31471
31629
|
const isAsync = callback !== void 0 && asyncCallbacks.current.has(callback);
|
|
31472
|
-
let read;
|
|
31630
|
+
let read = { value: "0", error: void 0 };
|
|
31473
31631
|
if (callback !== void 0 && !isAsync) {
|
|
31474
|
-
|
|
31475
|
-
(
|
|
31476
|
-
|
|
31477
|
-
if (!isThenable(raw)) {
|
|
31478
|
-
return raw;
|
|
31479
|
-
}
|
|
31632
|
+
try {
|
|
31633
|
+
const raw = callback(params);
|
|
31634
|
+
if (isThenable(raw)) {
|
|
31480
31635
|
asyncCallbacks.current.add(callback);
|
|
31481
31636
|
settle(key, raw);
|
|
31482
|
-
|
|
31483
|
-
|
|
31484
|
-
|
|
31485
|
-
|
|
31486
|
-
|
|
31637
|
+
} else {
|
|
31638
|
+
read = validate(raw);
|
|
31639
|
+
}
|
|
31640
|
+
} catch (reason) {
|
|
31641
|
+
read = failedRead(reason);
|
|
31642
|
+
}
|
|
31487
31643
|
}
|
|
31488
|
-
|
|
31644
|
+
useEffect89(() => {
|
|
31489
31645
|
if (callback === void 0 || !asyncCallbacks.current.has(callback)) {
|
|
31490
31646
|
return;
|
|
31491
31647
|
}
|
|
@@ -31498,18 +31654,30 @@ function useWithdrawalSourceTokenBalance(callback, params) {
|
|
|
31498
31654
|
);
|
|
31499
31655
|
}, [callback, key, params, settled?.key]);
|
|
31500
31656
|
if (callback === void 0) {
|
|
31501
|
-
return void 0;
|
|
31657
|
+
return { value: void 0, isLoading: false, error: void 0 };
|
|
31502
31658
|
}
|
|
31503
|
-
if (
|
|
31504
|
-
|
|
31659
|
+
if (asyncCallbacks.current.has(callback)) {
|
|
31660
|
+
if (settled?.key === key) {
|
|
31661
|
+
return { value: settled.value, isLoading: false, error: settled.error };
|
|
31662
|
+
}
|
|
31663
|
+
return { value: "0", isLoading: true, error: void 0 };
|
|
31505
31664
|
}
|
|
31506
|
-
return read;
|
|
31665
|
+
return { ...read, isLoading: false };
|
|
31507
31666
|
}
|
|
31508
31667
|
function isThenable(value) {
|
|
31509
31668
|
return typeof value === "object" && value !== null && typeof value.then === "function";
|
|
31510
31669
|
}
|
|
31511
31670
|
function validate(raw) {
|
|
31512
|
-
|
|
31671
|
+
const value = resolveWithdrawalSourceTokenBalance(() => raw, void 0, logger) ?? "0";
|
|
31672
|
+
const error = value === String(raw) ? void 0 : new Error("Invalid withdrawal source token balance");
|
|
31673
|
+
return { value, error };
|
|
31674
|
+
}
|
|
31675
|
+
function failedRead(reason) {
|
|
31676
|
+
const error = reason instanceof Error ? reason : new Error(String(reason));
|
|
31677
|
+
logger.warn("withdrawal:sourceTokenBalanceThrew", {
|
|
31678
|
+
error: error.message
|
|
31679
|
+
});
|
|
31680
|
+
return { value: "0", error };
|
|
31513
31681
|
}
|
|
31514
31682
|
|
|
31515
31683
|
// src/withdrawal/useCryptoWithdrawalForm.ts
|
|
@@ -31536,7 +31704,11 @@ function useCryptoWithdrawalForm({
|
|
|
31536
31704
|
const sourceToken = sourceOption.token;
|
|
31537
31705
|
const sourceTokenParams = useMemo37(() => ({ sourceToken }), [sourceToken]);
|
|
31538
31706
|
const sourceLabel = sourceOption.label ?? sourceToken.symbol;
|
|
31539
|
-
const
|
|
31707
|
+
const {
|
|
31708
|
+
value: balance,
|
|
31709
|
+
isLoading: isBalanceLoading,
|
|
31710
|
+
error: balanceError
|
|
31711
|
+
} = useWithdrawalSourceTokenBalance(
|
|
31540
31712
|
config.withdrawalSourceTokenBalance,
|
|
31541
31713
|
sourceTokenParams
|
|
31542
31714
|
);
|
|
@@ -31592,6 +31764,7 @@ function useCryptoWithdrawalForm({
|
|
|
31592
31764
|
sourceUsdPrice,
|
|
31593
31765
|
currency: config.displayCurrency
|
|
31594
31766
|
});
|
|
31767
|
+
const balanceFiat = balance && !isBalanceLoading && !balanceError && sourceFiatPrice !== void 0 ? Number(balance) * sourceFiatPrice : void 0;
|
|
31595
31768
|
const amountInput = useWithdrawalAmountInput({
|
|
31596
31769
|
amount,
|
|
31597
31770
|
setAmount,
|
|
@@ -31649,6 +31822,7 @@ function useCryptoWithdrawalForm({
|
|
|
31649
31822
|
sourceLabel,
|
|
31650
31823
|
sourceDecimals,
|
|
31651
31824
|
balance,
|
|
31825
|
+
balanceFiat,
|
|
31652
31826
|
maxAmount,
|
|
31653
31827
|
retryMaximum,
|
|
31654
31828
|
isMaximumLoading,
|
|
@@ -31785,15 +31959,15 @@ function resolveAmountErrorText({
|
|
|
31785
31959
|
}
|
|
31786
31960
|
function formatMinimumFiat(minUsd, displayCurrency, usdToDisplayRate) {
|
|
31787
31961
|
if (displayCurrency === "USD" || usdToDisplayRate === void 0) {
|
|
31788
|
-
return
|
|
31962
|
+
return formatFiatWhole(minUsd, "USD");
|
|
31789
31963
|
}
|
|
31790
31964
|
const cents = Math.ceil(Number((minUsd * usdToDisplayRate * 100).toFixed(6)));
|
|
31791
|
-
return
|
|
31965
|
+
return formatFiatWhole(cents / 100, displayCurrency);
|
|
31792
31966
|
}
|
|
31793
31967
|
|
|
31794
31968
|
// src/withdrawal/useCryptoWithdrawalSubmit.ts
|
|
31795
31969
|
import { useEffectEvent as useEffectEvent10 } from "@funkit/connect-core";
|
|
31796
|
-
import { useEffect as
|
|
31970
|
+
import { useEffect as useEffect90, useRef as useRef64 } from "react";
|
|
31797
31971
|
|
|
31798
31972
|
// src/utils/executionErrorMessage.ts
|
|
31799
31973
|
var MAX_ERROR_DETAIL_CHARS = 160;
|
|
@@ -31995,7 +32169,7 @@ function useCryptoWithdrawalSubmit({
|
|
|
31995
32169
|
tokenLabel: void 0
|
|
31996
32170
|
});
|
|
31997
32171
|
const onSubmittedEvent = useEffectEvent10(onSubmitted);
|
|
31998
|
-
|
|
32172
|
+
useEffect90(() => {
|
|
31999
32173
|
if (submission.status !== "submitted" || handedOffRef.current) {
|
|
32000
32174
|
return;
|
|
32001
32175
|
}
|
|
@@ -32281,22 +32455,111 @@ var styles75 = StyleSheet79.create({
|
|
|
32281
32455
|
import {
|
|
32282
32456
|
ActivityIndicator as ActivityIndicator3,
|
|
32283
32457
|
Keyboard as Keyboard8,
|
|
32284
|
-
StyleSheet as
|
|
32458
|
+
StyleSheet as StyleSheet82,
|
|
32285
32459
|
useWindowDimensions as useWindowDimensions14
|
|
32286
32460
|
} from "react-native";
|
|
32287
|
-
import
|
|
32461
|
+
import Animated34, {
|
|
32288
32462
|
Easing as Easing12,
|
|
32289
32463
|
Keyframe as Keyframe8,
|
|
32290
32464
|
LinearTransition as LinearTransition3
|
|
32291
32465
|
} from "react-native-reanimated";
|
|
32292
32466
|
import { useSafeAreaInsets as useSafeAreaInsets31 } from "react-native-safe-area-context";
|
|
32293
32467
|
|
|
32294
|
-
// src/components/
|
|
32468
|
+
// src/components/PasteAddressPanel.tsx
|
|
32469
|
+
import { Pressable as Pressable35, StyleSheet as StyleSheet80 } from "react-native";
|
|
32470
|
+
import Animated33 from "react-native-reanimated";
|
|
32471
|
+
|
|
32472
|
+
// src/icons/HandTapIcon.tsx
|
|
32473
|
+
import { SvgXml as SvgXml20 } from "react-native-svg";
|
|
32295
32474
|
import { jsx as jsx159 } from "react/jsx-runtime";
|
|
32475
|
+
var HAND_TAP_PATH = "M15.625 0C18.5 0 21.1146 0.708333 23.4688 2.125C25.8438 3.52083 27.7292 5.40625 29.125 7.78125C30.5208 10.1354 31.2188 12.75 31.2188 15.625C31.2188 15.8125 31.2188 15.9792 31.2188 16.125C31.2188 16.2708 31.2083 16.4062 31.1875 16.5312C31.1458 17.0729 30.9062 17.5104 30.4688 17.8438C30.0521 18.1562 29.6042 18.3125 29.125 18.3125C28.625 18.3125 28.1667 18.1562 27.75 17.8438C27.3542 17.5104 27.1458 16.9896 27.125 16.2812C27.125 16.1354 27.125 16.0104 27.125 15.9062C27.125 15.8021 27.125 15.7083 27.125 15.625C27.125 13.5 26.6042 11.5729 25.5625 9.84375C24.5417 8.09375 23.1562 6.69792 21.4062 5.65625C19.6771 4.61458 17.75 4.09375 15.625 4.09375C13.5 4.09375 11.5625 4.61458 9.8125 5.65625C8.0625 6.69792 6.66667 8.09375 5.625 9.84375C4.60417 11.5729 4.09375 13.5 4.09375 15.625C4.09375 17.0208 4.32292 18.3542 4.78125 19.625C5.26042 20.875 5.91667 22 6.75 23C7.1875 23.5208 7.36458 24.0417 7.28125 24.5625C7.21875 25.0833 6.98958 25.5208 6.59375 25.875C6.19792 26.2083 5.73958 26.375 5.21875 26.375C4.92708 26.375 4.625 26.3021 4.3125 26.1562C4.02083 26.0104 3.73958 25.7812 3.46875 25.4688C2.38542 24.1146 1.53125 22.6042 0.90625 20.9375C0.302083 19.25 0 17.4792 0 15.625C0 13.4583 0.40625 11.4375 1.21875 9.5625C2.03125 7.66667 3.14583 6.01042 4.5625 4.59375C6 3.15625 7.66667 2.03125 9.5625 1.21875C11.4583 0.40625 13.4792 0 15.625 0ZM44.875 68.6562C39.6875 70.5521 34.7917 70.7604 30.1875 69.2812C25.5833 67.8229 21.2917 64.6875 17.3125 59.875L6.84375 47.2188C6.51042 46.8021 6.1875 46.3333 5.875 45.8125C5.58333 45.2917 5.36458 44.8021 5.21875 44.3438C4.61458 42.7396 4.6875 41.3021 5.4375 40.0312C6.20833 38.7604 7.3125 37.875 8.75 37.375C9.79167 37 10.8333 36.9583 11.875 37.25C12.9167 37.5208 13.8958 38.1458 14.8125 39.125L18.4688 43.0938C18.5729 43.2188 18.6771 43.2604 18.7812 43.2188C18.9271 43.1562 18.9792 43.0417 18.9375 42.875L10 18.375C9.33333 16.5208 9.35417 14.8333 10.0625 13.3125C10.7708 11.7708 12 10.6771 13.75 10.0312C15.4792 9.40625 17.1042 9.45833 18.625 10.1875C20.1458 10.9167 21.25 12.2083 21.9375 14.0625L25.4688 23.8125C26.1354 23.3542 26.7917 23 27.4375 22.75C28.7292 22.2917 29.9583 22.2396 31.125 22.5938C32.2917 22.9271 33.2708 23.6146 34.0625 24.6562C34.8542 24.0521 35.6667 23.6042 36.5 23.3125C37.7292 22.8542 38.8854 22.7812 39.9688 23.0938C41.0521 23.3854 41.9583 24.0104 42.6875 24.9688C45.4167 24.0104 47.8854 24.1979 50.0938 25.5312C52.3021 26.8646 54.0208 29.2292 55.25 32.625L57.5938 39.0312C59.2604 43.6146 59.8229 47.875 59.2812 51.8125C58.7604 55.7292 57.2604 59.1458 54.7812 62.0625C52.3229 64.9583 49.0208 67.1562 44.875 68.6562ZM43.5625 64.5625C47.0208 63.2917 49.7292 61.4792 51.6875 59.125C53.6667 56.7708 54.8229 53.9792 55.1562 50.75C55.5104 47.5 54.9688 43.9062 53.5312 39.9688L51.5938 34.625C50.7188 32.2917 49.6979 30.6146 48.5312 29.5938C47.3646 28.5521 46.125 28.2708 44.8125 28.75L46.0312 32.125C46.2188 32.6667 46.1875 33.1771 45.9375 33.6562C45.7083 34.1146 45.3542 34.4271 44.875 34.5938C44.375 34.7812 43.8646 34.7812 43.3438 34.5938C42.8438 34.4062 42.5 34.0417 42.3125 33.5L40.6562 28.9062C40.3646 28.1354 39.9271 27.6042 39.3438 27.3125C38.7604 27 38.1042 26.9792 37.375 27.25C36.75 27.5 36.2188 27.8438 35.7812 28.2812L37.7812 33.875C37.9896 34.3958 37.9688 34.8958 37.7188 35.375C37.4688 35.8333 37.0938 36.1562 36.5938 36.3438C36.1146 36.5104 35.6146 36.5 35.0938 36.3125C34.5938 36.1042 34.25 35.7292 34.0625 35.1875L31.5625 28.375C31.2917 27.6042 30.8646 27.0729 30.2812 26.7812C29.6979 26.4896 29.0521 26.4792 28.3438 26.75C28.0312 26.8333 27.7292 26.9792 27.4375 27.1875C27.1667 27.375 26.9167 27.5625 26.6875 27.75L29.5625 35.5625C29.75 36.0833 29.7188 36.5833 29.4688 37.0625C29.2396 37.5417 28.875 37.8646 28.375 38.0312C27.875 38.2396 27.375 38.2396 26.875 38.0312C26.375 37.8229 26.0312 37.4583 25.8438 36.9375L17.9062 15.2188C17.6979 14.5729 17.3333 14.125 16.8125 13.875C16.2917 13.625 15.7292 13.6042 15.125 13.8125C14.5208 14.0417 14.0938 14.4271 13.8438 14.9688C13.5938 15.5104 13.5833 16.0833 13.8125 16.6875L24.9062 47.125C25.1562 47.8125 25.1562 48.4479 24.9062 49.0312C24.6771 49.5938 24.2604 49.9896 23.6562 50.2188C23.1146 50.4062 22.5729 50.4479 22.0312 50.3438C21.4896 50.2188 20.9167 49.8438 20.3125 49.2188L13.0938 41.75C12.2604 40.8542 11.4062 40.5729 10.5312 40.9062C9.92708 41.1146 9.51042 41.4688 9.28125 41.9688C9.07292 42.4688 9.0625 42.9792 9.25 43.5C9.41667 43.9375 9.66667 44.3438 10 44.7188L20.4375 57.3125C24.0625 61.6875 27.7917 64.3646 31.625 65.3438C35.4792 66.3229 39.4583 66.0625 43.5625 64.5625Z";
|
|
32476
|
+
var WIDTH = 61;
|
|
32477
|
+
var HEIGHT = 72;
|
|
32478
|
+
function HandTapIcon({ color: color2 }) {
|
|
32479
|
+
const xml = `<svg width="${WIDTH}" height="${HEIGHT}" viewBox="0 0 ${WIDTH} ${HEIGHT}" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="${HAND_TAP_PATH}" fill="${color2}"/></svg>`;
|
|
32480
|
+
return /* @__PURE__ */ jsx159(SvgXml20, { xml, width: WIDTH, height: HEIGHT });
|
|
32481
|
+
}
|
|
32482
|
+
|
|
32483
|
+
// src/components/PasteAddressPanel.tsx
|
|
32484
|
+
import { jsx as jsx160, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
32485
|
+
var PRESSED_SCALE2 = 0.99;
|
|
32486
|
+
function PasteAddressPanel({
|
|
32487
|
+
onPaste,
|
|
32488
|
+
isPasting = false
|
|
32489
|
+
}) {
|
|
32490
|
+
const { t } = useFunkitTranslation();
|
|
32491
|
+
const theme = useTheme();
|
|
32492
|
+
const { pressStyle, onPressIn, onPressOut } = usePressScale({
|
|
32493
|
+
scale: PRESSED_SCALE2,
|
|
32494
|
+
haptics: true
|
|
32495
|
+
});
|
|
32496
|
+
const title = t("withdrawAddress.pasteTitle");
|
|
32497
|
+
const color2 = theme.background.button.primary.default;
|
|
32498
|
+
return /* @__PURE__ */ jsx160(
|
|
32499
|
+
Pressable35,
|
|
32500
|
+
{
|
|
32501
|
+
onPress: onPaste,
|
|
32502
|
+
onPressIn,
|
|
32503
|
+
onPressOut,
|
|
32504
|
+
disabled: isPasting,
|
|
32505
|
+
accessibilityRole: "button",
|
|
32506
|
+
accessibilityLabel: title,
|
|
32507
|
+
accessibilityHint: t("withdrawAddress.pasteSubtitle"),
|
|
32508
|
+
accessibilityState: { disabled: isPasting, busy: isPasting },
|
|
32509
|
+
style: [styles76.root, styles76.minSize],
|
|
32510
|
+
children: /* @__PURE__ */ jsx160(Animated33.View, { style: [styles76.root, pressStyle], children: /* @__PURE__ */ jsxs69(
|
|
32511
|
+
Box,
|
|
32512
|
+
{
|
|
32513
|
+
borderRadius: "element",
|
|
32514
|
+
style: [
|
|
32515
|
+
styles76.panel,
|
|
32516
|
+
{ backgroundColor: withAlpha(color2, PANEL_TINT_ALPHA) }
|
|
32517
|
+
],
|
|
32518
|
+
children: [
|
|
32519
|
+
/* @__PURE__ */ jsx160(HandTapIcon, { color: color2 }),
|
|
32520
|
+
/* @__PURE__ */ jsxs69(Box, { style: styles76.copy, children: [
|
|
32521
|
+
/* @__PURE__ */ jsx160(Text, { variant: "bodyMedium", style: [styles76.text, { color: color2 }], children: title }),
|
|
32522
|
+
/* @__PURE__ */ jsx160(
|
|
32523
|
+
Text,
|
|
32524
|
+
{
|
|
32525
|
+
variant: "detail",
|
|
32526
|
+
style: [styles76.text, styles76.subtitle, { color: color2 }],
|
|
32527
|
+
children: t("withdrawAddress.pasteSubtitle")
|
|
32528
|
+
}
|
|
32529
|
+
)
|
|
32530
|
+
] })
|
|
32531
|
+
]
|
|
32532
|
+
}
|
|
32533
|
+
) })
|
|
32534
|
+
}
|
|
32535
|
+
);
|
|
32536
|
+
}
|
|
32537
|
+
var PANEL_TINT_ALPHA = 0.05;
|
|
32538
|
+
var PANEL_MIN_HEIGHT = 96;
|
|
32539
|
+
var styles76 = StyleSheet80.create({
|
|
32540
|
+
root: { flex: 1 },
|
|
32541
|
+
// On the Pressable: Yoga gives a flex item no minimum from its content, so it
|
|
32542
|
+
// is the item the band shrinks that has to hold the floor.
|
|
32543
|
+
minSize: { minHeight: PANEL_MIN_HEIGHT },
|
|
32544
|
+
panel: {
|
|
32545
|
+
flex: 1,
|
|
32546
|
+
overflow: "hidden",
|
|
32547
|
+
alignItems: "center",
|
|
32548
|
+
justifyContent: "center",
|
|
32549
|
+
paddingHorizontal: 80,
|
|
32550
|
+
gap: 24
|
|
32551
|
+
},
|
|
32552
|
+
copy: { alignItems: "center", gap: 12 },
|
|
32553
|
+
text: { textAlign: "center" },
|
|
32554
|
+
subtitle: { opacity: 0.7 }
|
|
32555
|
+
});
|
|
32556
|
+
|
|
32557
|
+
// src/components/ReceiveAsRow.tsx
|
|
32558
|
+
import { jsx as jsx161 } from "react/jsx-runtime";
|
|
32296
32559
|
function ReceiveAsRow({ destinationToken, onPress }) {
|
|
32297
32560
|
const { t } = useFunkitTranslation();
|
|
32298
32561
|
const label = t("withdrawCrypto.receiveAs");
|
|
32299
|
-
return /* @__PURE__ */
|
|
32562
|
+
return /* @__PURE__ */ jsx161(
|
|
32300
32563
|
SelectedChainRow,
|
|
32301
32564
|
{
|
|
32302
32565
|
label,
|
|
@@ -32314,10 +32577,21 @@ function ReceiveAsRow({ destinationToken, onPress }) {
|
|
|
32314
32577
|
|
|
32315
32578
|
// src/components/WalletAddressInput.tsx
|
|
32316
32579
|
import { BottomSheetTextInput as BottomSheetTextInput3 } from "@gorhom/bottom-sheet";
|
|
32317
|
-
import { StyleSheet as
|
|
32318
|
-
import {
|
|
32580
|
+
import { Pressable as Pressable36, StyleSheet as StyleSheet81, View as View38 } from "react-native";
|
|
32581
|
+
import Svg3, { Defs as Defs3, LinearGradient as LinearGradient3, Rect as Rect3, Stop as Stop3 } from "react-native-svg";
|
|
32582
|
+
import { jsx as jsx162, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
32319
32583
|
var STATUS_ICON_SIZE = 16;
|
|
32320
|
-
|
|
32584
|
+
var CLEAR_BUTTON_SIZE = 24;
|
|
32585
|
+
var FADE_WIDTH = 20;
|
|
32586
|
+
var FIELD_LEADING_INSET = 16;
|
|
32587
|
+
var TAIL_TEXT_WIDTH = 2e3;
|
|
32588
|
+
function WalletAddressInput(props) {
|
|
32589
|
+
if (props.pasteAction === "panel") {
|
|
32590
|
+
return /* @__PURE__ */ jsx162(PanelWalletAddressInput, { ...props });
|
|
32591
|
+
}
|
|
32592
|
+
return /* @__PURE__ */ jsx162(PillsWalletAddressInput, { ...props });
|
|
32593
|
+
}
|
|
32594
|
+
function PillsWalletAddressInput({
|
|
32321
32595
|
value,
|
|
32322
32596
|
onChangeText,
|
|
32323
32597
|
isAddress: isAddress2,
|
|
@@ -32331,55 +32605,26 @@ function WalletAddressInput({
|
|
|
32331
32605
|
const theme = useTheme();
|
|
32332
32606
|
const label = t("withdrawCrypto.addressPlaceholder");
|
|
32333
32607
|
const isEmpty = value === "";
|
|
32334
|
-
|
|
32335
|
-
|
|
32336
|
-
/* @__PURE__ */ jsxs69(
|
|
32608
|
+
return /* @__PURE__ */ jsxs70(Box, { style: styles77.root, children: [
|
|
32609
|
+
/* @__PURE__ */ jsxs70(
|
|
32337
32610
|
Box,
|
|
32338
32611
|
{
|
|
32339
32612
|
flexDirection: "row",
|
|
32340
32613
|
alignItems: "center",
|
|
32341
32614
|
justifyContent: "space-between",
|
|
32342
|
-
style:
|
|
32615
|
+
style: styles77.header,
|
|
32343
32616
|
children: [
|
|
32344
|
-
/* @__PURE__ */
|
|
32345
|
-
|
|
32346
|
-
{
|
|
32347
|
-
variant: "detail",
|
|
32348
|
-
weight: "medium",
|
|
32349
|
-
numberOfLines: 1,
|
|
32350
|
-
style: [styles76.label, { color: theme.content.elements.secondary }],
|
|
32351
|
-
children: label
|
|
32352
|
-
}
|
|
32353
|
-
),
|
|
32354
|
-
isAddress2 === void 0 ? null : /* @__PURE__ */ jsxs69(Box, { flexDirection: "row", alignItems: "center", style: styles76.status, children: [
|
|
32355
|
-
isAddress2 ? /* @__PURE__ */ jsx160(FigmaSuccessCheckIcon, { size: STATUS_ICON_SIZE }) : /* @__PURE__ */ jsx160(
|
|
32356
|
-
FigmaAlertCircleIcon,
|
|
32357
|
-
{
|
|
32358
|
-
size: STATUS_ICON_SIZE,
|
|
32359
|
-
color: theme.content.elements.error
|
|
32360
|
-
}
|
|
32361
|
-
),
|
|
32362
|
-
/* @__PURE__ */ jsx160(
|
|
32363
|
-
Text,
|
|
32364
|
-
{
|
|
32365
|
-
variant: "detail",
|
|
32366
|
-
weight: "medium",
|
|
32367
|
-
style: {
|
|
32368
|
-
color: isAddress2 ? theme.content.elements.success : theme.content.elements.error
|
|
32369
|
-
},
|
|
32370
|
-
children: isAddress2 ? t("withdrawAddress.detected") : t("withdrawAddress.notFound")
|
|
32371
|
-
}
|
|
32372
|
-
)
|
|
32373
|
-
] })
|
|
32617
|
+
/* @__PURE__ */ jsx162(FieldLabel, { label }),
|
|
32618
|
+
/* @__PURE__ */ jsx162(AddressVerdict, { isAddress: isAddress2 })
|
|
32374
32619
|
]
|
|
32375
32620
|
}
|
|
32376
32621
|
),
|
|
32377
|
-
/* @__PURE__ */
|
|
32622
|
+
/* @__PURE__ */ jsx162(
|
|
32378
32623
|
Box,
|
|
32379
32624
|
{
|
|
32380
32625
|
borderRadius: "element",
|
|
32381
32626
|
style: [
|
|
32382
|
-
|
|
32627
|
+
styles77.field,
|
|
32383
32628
|
{
|
|
32384
32629
|
height: theme.sizes.buttonLg,
|
|
32385
32630
|
borderColor: theme.border.elements.default.color,
|
|
@@ -32387,28 +32632,18 @@ function WalletAddressInput({
|
|
|
32387
32632
|
backgroundColor: theme.background.modal
|
|
32388
32633
|
}
|
|
32389
32634
|
],
|
|
32390
|
-
children: /* @__PURE__ */
|
|
32391
|
-
|
|
32635
|
+
children: /* @__PURE__ */ jsx162(
|
|
32636
|
+
AddressTextInput,
|
|
32392
32637
|
{
|
|
32638
|
+
label,
|
|
32393
32639
|
value,
|
|
32394
|
-
onChangeText
|
|
32395
|
-
placeholder: label,
|
|
32396
|
-
placeholderTextColor: theme.content.elements.secondary,
|
|
32397
|
-
accessibilityLabel: label,
|
|
32398
|
-
autoCapitalize: "none",
|
|
32399
|
-
autoCorrect: false,
|
|
32400
|
-
spellCheck: false,
|
|
32401
|
-
style: [
|
|
32402
|
-
styles76.input,
|
|
32403
|
-
theme.textVariants.bodyMedium,
|
|
32404
|
-
{ color: theme.content.elements.primary }
|
|
32405
|
-
]
|
|
32640
|
+
onChangeText
|
|
32406
32641
|
}
|
|
32407
32642
|
)
|
|
32408
32643
|
}
|
|
32409
32644
|
),
|
|
32410
|
-
/* @__PURE__ */
|
|
32411
|
-
/* @__PURE__ */
|
|
32645
|
+
/* @__PURE__ */ jsxs70(Box, { flexDirection: "row", style: styles77.buttonRow, children: [
|
|
32646
|
+
/* @__PURE__ */ jsx162(Box, { style: styles77.button, children: /* @__PURE__ */ jsx162(
|
|
32412
32647
|
PillButton,
|
|
32413
32648
|
{
|
|
32414
32649
|
label: t("withdrawAddress.paste"),
|
|
@@ -32418,7 +32653,7 @@ function WalletAddressInput({
|
|
|
32418
32653
|
disabled: isPasting
|
|
32419
32654
|
}
|
|
32420
32655
|
) }),
|
|
32421
|
-
/* @__PURE__ */
|
|
32656
|
+
/* @__PURE__ */ jsx162(Box, { style: styles77.button, children: isEmpty ? onUseConnected ? /* @__PURE__ */ jsx162(
|
|
32422
32657
|
PillButton,
|
|
32423
32658
|
{
|
|
32424
32659
|
label: t("withdrawAddress.useConnected"),
|
|
@@ -32426,7 +32661,7 @@ function WalletAddressInput({
|
|
|
32426
32661
|
variant: "secondary",
|
|
32427
32662
|
onPress: onUseConnected
|
|
32428
32663
|
}
|
|
32429
|
-
) : null : /* @__PURE__ */
|
|
32664
|
+
) : null : /* @__PURE__ */ jsx162(
|
|
32430
32665
|
PillButton,
|
|
32431
32666
|
{
|
|
32432
32667
|
label: t("withdrawAddress.clear"),
|
|
@@ -32436,27 +32671,258 @@ function WalletAddressInput({
|
|
|
32436
32671
|
}
|
|
32437
32672
|
) })
|
|
32438
32673
|
] }),
|
|
32439
|
-
|
|
32674
|
+
/* @__PURE__ */ jsx162(HelperText, { errorText: errorText2, warningText })
|
|
32675
|
+
] });
|
|
32676
|
+
}
|
|
32677
|
+
function PanelWalletAddressInput({
|
|
32678
|
+
value,
|
|
32679
|
+
onChangeText,
|
|
32680
|
+
isAddress: isAddress2,
|
|
32681
|
+
errorText: errorText2,
|
|
32682
|
+
warningText
|
|
32683
|
+
}) {
|
|
32684
|
+
const { t } = useFunkitTranslation();
|
|
32685
|
+
const theme = useTheme();
|
|
32686
|
+
const [isFocused, setIsFocused] = useSeededState(
|
|
32687
|
+
SEED.withdrawalAddressFocused,
|
|
32688
|
+
false
|
|
32689
|
+
);
|
|
32690
|
+
const label = t("withdrawCrypto.addressPlaceholder");
|
|
32691
|
+
const isEmpty = value === "";
|
|
32692
|
+
const showsTail = !isEmpty && !isFocused;
|
|
32693
|
+
return /* @__PURE__ */ jsxs70(Box, { style: styles77.root, children: [
|
|
32694
|
+
isEmpty ? null : /* @__PURE__ */ jsxs70(
|
|
32695
|
+
Box,
|
|
32696
|
+
{
|
|
32697
|
+
flexDirection: "row",
|
|
32698
|
+
alignItems: "center",
|
|
32699
|
+
justifyContent: "space-between",
|
|
32700
|
+
style: styles77.header,
|
|
32701
|
+
children: [
|
|
32702
|
+
/* @__PURE__ */ jsx162(FieldLabel, { label }),
|
|
32703
|
+
/* @__PURE__ */ jsx162(AddressVerdict, { isAddress: isAddress2 })
|
|
32704
|
+
]
|
|
32705
|
+
}
|
|
32706
|
+
),
|
|
32707
|
+
/* @__PURE__ */ jsxs70(
|
|
32708
|
+
Box,
|
|
32709
|
+
{
|
|
32710
|
+
flexDirection: "row",
|
|
32711
|
+
alignItems: "center",
|
|
32712
|
+
borderRadius: "element",
|
|
32713
|
+
style: [
|
|
32714
|
+
styles77.field,
|
|
32715
|
+
styles77.panelField,
|
|
32716
|
+
{
|
|
32717
|
+
height: theme.sizes.buttonLg,
|
|
32718
|
+
borderColor: theme.border.elements.default.color,
|
|
32719
|
+
borderWidth: theme.border.elements.default.weight,
|
|
32720
|
+
backgroundColor: theme.background.modal
|
|
32721
|
+
}
|
|
32722
|
+
],
|
|
32723
|
+
children: [
|
|
32724
|
+
/* @__PURE__ */ jsxs70(View38, { style: styles77.inputSlot, children: [
|
|
32725
|
+
/* @__PURE__ */ jsx162(
|
|
32726
|
+
AddressTextInput,
|
|
32727
|
+
{
|
|
32728
|
+
label,
|
|
32729
|
+
value,
|
|
32730
|
+
onChangeText,
|
|
32731
|
+
onFocus: () => setIsFocused(true),
|
|
32732
|
+
onBlur: () => setIsFocused(false),
|
|
32733
|
+
hideText: showsTail
|
|
32734
|
+
}
|
|
32735
|
+
),
|
|
32736
|
+
showsTail ? /* @__PURE__ */ jsx162(AddressTail, { value }) : null
|
|
32737
|
+
] }),
|
|
32738
|
+
isEmpty ? null : /* @__PURE__ */ jsx162(
|
|
32739
|
+
Pressable36,
|
|
32740
|
+
{
|
|
32741
|
+
onPress: () => onChangeText(""),
|
|
32742
|
+
accessibilityRole: "button",
|
|
32743
|
+
accessibilityLabel: t("withdrawAddress.clear"),
|
|
32744
|
+
hitSlop: 8,
|
|
32745
|
+
style: [
|
|
32746
|
+
styles77.clearButton,
|
|
32747
|
+
{ backgroundColor: theme.background.button.secondary.default }
|
|
32748
|
+
],
|
|
32749
|
+
children: /* @__PURE__ */ jsx162(FigmaClearIcon, { color: theme.content.button.secondary.default })
|
|
32750
|
+
}
|
|
32751
|
+
)
|
|
32752
|
+
]
|
|
32753
|
+
}
|
|
32754
|
+
),
|
|
32755
|
+
/* @__PURE__ */ jsx162(HelperText, { errorText: errorText2, warningText })
|
|
32756
|
+
] });
|
|
32757
|
+
}
|
|
32758
|
+
function FieldLabel({ label }) {
|
|
32759
|
+
const theme = useTheme();
|
|
32760
|
+
return /* @__PURE__ */ jsx162(
|
|
32761
|
+
Text,
|
|
32762
|
+
{
|
|
32763
|
+
variant: "detail",
|
|
32764
|
+
weight: "medium",
|
|
32765
|
+
numberOfLines: 1,
|
|
32766
|
+
style: [styles77.label, { color: theme.content.elements.secondary }],
|
|
32767
|
+
children: label
|
|
32768
|
+
}
|
|
32769
|
+
);
|
|
32770
|
+
}
|
|
32771
|
+
function AddressVerdict({ isAddress: isAddress2 }) {
|
|
32772
|
+
const { t } = useFunkitTranslation();
|
|
32773
|
+
const theme = useTheme();
|
|
32774
|
+
if (isAddress2 === void 0) {
|
|
32775
|
+
return null;
|
|
32776
|
+
}
|
|
32777
|
+
return /* @__PURE__ */ jsxs70(Box, { flexDirection: "row", alignItems: "center", style: styles77.status, children: [
|
|
32778
|
+
isAddress2 ? /* @__PURE__ */ jsx162(FigmaSuccessCheckIcon, { size: STATUS_ICON_SIZE }) : /* @__PURE__ */ jsx162(
|
|
32779
|
+
FigmaAlertCircleIcon,
|
|
32780
|
+
{
|
|
32781
|
+
size: STATUS_ICON_SIZE,
|
|
32782
|
+
color: theme.content.elements.error
|
|
32783
|
+
}
|
|
32784
|
+
),
|
|
32785
|
+
/* @__PURE__ */ jsx162(
|
|
32440
32786
|
Text,
|
|
32441
32787
|
{
|
|
32442
32788
|
variant: "detail",
|
|
32789
|
+
weight: "medium",
|
|
32443
32790
|
style: {
|
|
32444
|
-
color:
|
|
32791
|
+
color: isAddress2 ? theme.content.elements.success : theme.content.elements.error
|
|
32445
32792
|
},
|
|
32446
|
-
children:
|
|
32793
|
+
children: isAddress2 ? t("withdrawAddress.detected") : t("withdrawAddress.notFound")
|
|
32447
32794
|
}
|
|
32448
|
-
)
|
|
32795
|
+
)
|
|
32449
32796
|
] });
|
|
32450
32797
|
}
|
|
32451
|
-
|
|
32798
|
+
function AddressTextInput({
|
|
32799
|
+
label,
|
|
32800
|
+
value,
|
|
32801
|
+
onChangeText,
|
|
32802
|
+
onFocus,
|
|
32803
|
+
onBlur,
|
|
32804
|
+
hideText = false
|
|
32805
|
+
}) {
|
|
32806
|
+
const theme = useTheme();
|
|
32807
|
+
return /* @__PURE__ */ jsx162(
|
|
32808
|
+
BottomSheetTextInput3,
|
|
32809
|
+
{
|
|
32810
|
+
value,
|
|
32811
|
+
onChangeText,
|
|
32812
|
+
onFocus,
|
|
32813
|
+
onBlur,
|
|
32814
|
+
placeholder: label,
|
|
32815
|
+
placeholderTextColor: theme.content.elements.secondary,
|
|
32816
|
+
accessibilityLabel: label,
|
|
32817
|
+
autoCapitalize: "none",
|
|
32818
|
+
autoCorrect: false,
|
|
32819
|
+
spellCheck: false,
|
|
32820
|
+
style: [
|
|
32821
|
+
styles77.input,
|
|
32822
|
+
theme.textVariants.bodyMedium,
|
|
32823
|
+
{
|
|
32824
|
+
color: hideText ? "transparent" : theme.content.elements.primary
|
|
32825
|
+
}
|
|
32826
|
+
]
|
|
32827
|
+
}
|
|
32828
|
+
);
|
|
32829
|
+
}
|
|
32830
|
+
function AddressTail({ value }) {
|
|
32831
|
+
const theme = useTheme();
|
|
32832
|
+
return /* @__PURE__ */ jsxs70(
|
|
32833
|
+
View38,
|
|
32834
|
+
{
|
|
32835
|
+
pointerEvents: "none",
|
|
32836
|
+
accessibilityElementsHidden: true,
|
|
32837
|
+
importantForAccessibility: "no-hide-descendants",
|
|
32838
|
+
style: styles77.tail,
|
|
32839
|
+
children: [
|
|
32840
|
+
/* @__PURE__ */ jsx162(
|
|
32841
|
+
Text,
|
|
32842
|
+
{
|
|
32843
|
+
variant: "bodyMedium",
|
|
32844
|
+
style: [styles77.tailText, { color: theme.content.elements.primary }],
|
|
32845
|
+
children: value
|
|
32846
|
+
}
|
|
32847
|
+
),
|
|
32848
|
+
/* @__PURE__ */ jsx162(View38, { style: styles77.fade, children: /* @__PURE__ */ jsxs70(Svg3, { width: "100%", height: "100%", children: [
|
|
32849
|
+
/* @__PURE__ */ jsx162(Defs3, { children: /* @__PURE__ */ jsxs70(LinearGradient3, { id: "address-tail-fade", x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
32850
|
+
/* @__PURE__ */ jsx162(Stop3, { offset: "0", stopColor: theme.background.modal }),
|
|
32851
|
+
/* @__PURE__ */ jsx162(
|
|
32852
|
+
Stop3,
|
|
32853
|
+
{
|
|
32854
|
+
offset: "1",
|
|
32855
|
+
stopColor: theme.background.modal,
|
|
32856
|
+
stopOpacity: 0
|
|
32857
|
+
}
|
|
32858
|
+
)
|
|
32859
|
+
] }) }),
|
|
32860
|
+
/* @__PURE__ */ jsx162(Rect3, { width: "100%", height: "100%", fill: "url(#address-tail-fade)" })
|
|
32861
|
+
] }) })
|
|
32862
|
+
]
|
|
32863
|
+
}
|
|
32864
|
+
);
|
|
32865
|
+
}
|
|
32866
|
+
function HelperText({
|
|
32867
|
+
errorText: errorText2,
|
|
32868
|
+
warningText
|
|
32869
|
+
}) {
|
|
32870
|
+
const theme = useTheme();
|
|
32871
|
+
const helperText = errorText2 ?? warningText;
|
|
32872
|
+
if (!helperText) {
|
|
32873
|
+
return null;
|
|
32874
|
+
}
|
|
32875
|
+
return /* @__PURE__ */ jsx162(
|
|
32876
|
+
Text,
|
|
32877
|
+
{
|
|
32878
|
+
variant: "detail",
|
|
32879
|
+
style: {
|
|
32880
|
+
color: errorText2 ? theme.content.elements.error : theme.content.elements.warning
|
|
32881
|
+
},
|
|
32882
|
+
children: helperText
|
|
32883
|
+
}
|
|
32884
|
+
);
|
|
32885
|
+
}
|
|
32886
|
+
var styles77 = StyleSheet81.create({
|
|
32452
32887
|
root: { gap: 8 },
|
|
32453
32888
|
header: { gap: 8 },
|
|
32454
32889
|
label: { flexShrink: 1 },
|
|
32455
32890
|
status: { gap: 4 },
|
|
32456
32891
|
// The design's own asymmetry: the text is inset 16 and the (unused) trailing
|
|
32457
32892
|
// slot 8, so the field's own padding is what centres the single line.
|
|
32458
|
-
field: {
|
|
32893
|
+
field: {
|
|
32894
|
+
paddingLeft: FIELD_LEADING_INSET,
|
|
32895
|
+
paddingRight: 8,
|
|
32896
|
+
justifyContent: "center"
|
|
32897
|
+
},
|
|
32898
|
+
// Here the trailing slot holds the clear, inset as far as the text is.
|
|
32899
|
+
panelField: { paddingRight: 16, gap: 16, overflow: "hidden" },
|
|
32459
32900
|
input: { padding: 0 },
|
|
32901
|
+
inputSlot: { flex: 1, justifyContent: "center" },
|
|
32902
|
+
// Out over the field's leading inset, so the address runs to the border and
|
|
32903
|
+
// fades there, as the design draws it.
|
|
32904
|
+
tail: {
|
|
32905
|
+
position: "absolute",
|
|
32906
|
+
top: 0,
|
|
32907
|
+
right: 0,
|
|
32908
|
+
bottom: 0,
|
|
32909
|
+
left: -FIELD_LEADING_INSET,
|
|
32910
|
+
justifyContent: "center",
|
|
32911
|
+
alignItems: "flex-end",
|
|
32912
|
+
overflow: "hidden"
|
|
32913
|
+
},
|
|
32914
|
+
// Android measures text to its parent's width and cuts it at the end, so the
|
|
32915
|
+
// line gets a box wider than any address instead: right-aligned in it, the
|
|
32916
|
+
// end hugs the field and the start overflows left, where the tail clips it.
|
|
32917
|
+
tailText: { width: TAIL_TEXT_WIDTH, textAlign: "right" },
|
|
32918
|
+
fade: { position: "absolute", left: 0, top: 0, bottom: 0, width: FADE_WIDTH },
|
|
32919
|
+
clearButton: {
|
|
32920
|
+
width: CLEAR_BUTTON_SIZE,
|
|
32921
|
+
height: CLEAR_BUTTON_SIZE,
|
|
32922
|
+
borderRadius: CLEAR_BUTTON_SIZE / 2,
|
|
32923
|
+
alignItems: "center",
|
|
32924
|
+
justifyContent: "center"
|
|
32925
|
+
},
|
|
32460
32926
|
buttonRow: { gap: 10 },
|
|
32461
32927
|
// Both halves keep their width whether or not the second one has a button, so
|
|
32462
32928
|
// Paste doesn't stretch across the row when it stands alone.
|
|
@@ -32464,8 +32930,8 @@ var styles76 = StyleSheet80.create({
|
|
|
32464
32930
|
});
|
|
32465
32931
|
|
|
32466
32932
|
// src/screens/WithdrawAddressScreen.tsx
|
|
32467
|
-
import { jsx as
|
|
32468
|
-
var AnimatedBox7 =
|
|
32933
|
+
import { jsx as jsx163, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
32934
|
+
var AnimatedBox7 = Animated34.createAnimatedComponent(Box);
|
|
32469
32935
|
var SUBMIT_TRANSITION_DURATION = 380;
|
|
32470
32936
|
var SUBMIT_TRANSITION_EASING = Easing12.bezier(0.16, 1, 0.3, 1);
|
|
32471
32937
|
var SUBMIT_TRAVEL = 24;
|
|
@@ -32487,6 +32953,7 @@ function WithdrawAddressScreen({
|
|
|
32487
32953
|
isAddress: isAddress2,
|
|
32488
32954
|
onPaste,
|
|
32489
32955
|
isPasting,
|
|
32956
|
+
pastePanel = false,
|
|
32490
32957
|
onUseConnected,
|
|
32491
32958
|
errorText: errorText2,
|
|
32492
32959
|
warningText,
|
|
@@ -32512,15 +32979,17 @@ function WithdrawAddressScreen({
|
|
|
32512
32979
|
const height = useFullHeightStep(windowHeight);
|
|
32513
32980
|
const insets = useSafeAreaInsets31();
|
|
32514
32981
|
const keyboardHeight = useKeyboardHeight(true);
|
|
32982
|
+
const bottomClearance = keyboardHeight > 0 && !isSubmitting ? keyboardHeight + FOOTER_KEYBOARD_GAP : footerBottomMargin(insets.bottom);
|
|
32515
32983
|
const shouldEditAmount = !!amountErrorText && !!onEditAmount && !isSubmitting;
|
|
32516
32984
|
const footerErrorText = executionErrorText ?? amountErrorText ?? quoteErrorText;
|
|
32517
|
-
|
|
32985
|
+
const showsPastePanel = pastePanel && recipient === "" && !shouldEditAmount;
|
|
32986
|
+
let buttonLabel = t("withdrawAddress.withdraw");
|
|
32518
32987
|
if (isSubmitting) {
|
|
32519
32988
|
buttonLabel = t("withdrawAddress.withdrawing");
|
|
32520
32989
|
} else if (shouldEditAmount) {
|
|
32521
32990
|
buttonLabel = t("withdrawCrypto.editAmount");
|
|
32522
32991
|
}
|
|
32523
|
-
return /* @__PURE__ */
|
|
32992
|
+
return /* @__PURE__ */ jsxs71(
|
|
32524
32993
|
Box,
|
|
32525
32994
|
{
|
|
32526
32995
|
style: {
|
|
@@ -32529,16 +32998,26 @@ function WithdrawAddressScreen({
|
|
|
32529
32998
|
backgroundColor: theme.background.modal
|
|
32530
32999
|
},
|
|
32531
33000
|
children: [
|
|
32532
|
-
isSubmitting ? null : /* @__PURE__ */
|
|
32533
|
-
isSubmitting ? null : /* @__PURE__ */
|
|
32534
|
-
/* @__PURE__ */
|
|
33001
|
+
isSubmitting ? null : /* @__PURE__ */ jsx163(AnimatedBox7, { exiting: FADE_SLIDE_UP_EXITING, children: /* @__PURE__ */ jsx163(TopBar, { title, onBack, onClose }) }),
|
|
33002
|
+
isSubmitting ? null : /* @__PURE__ */ jsxs71(AnimatedBox7, { exiting: FADE_SLIDE_UP_EXITING, style: styles78.body, children: [
|
|
33003
|
+
/* @__PURE__ */ jsx163(
|
|
32535
33004
|
ReceiveAsRow,
|
|
32536
33005
|
{
|
|
32537
33006
|
destinationToken,
|
|
32538
33007
|
onPress: onPressReceive
|
|
32539
33008
|
}
|
|
32540
33009
|
),
|
|
32541
|
-
/* @__PURE__ */
|
|
33010
|
+
pastePanel ? /* @__PURE__ */ jsx163(
|
|
33011
|
+
WalletAddressInput,
|
|
33012
|
+
{
|
|
33013
|
+
pasteAction: "panel",
|
|
33014
|
+
value: recipient,
|
|
33015
|
+
onChangeText: onChangeRecipient,
|
|
33016
|
+
isAddress: isAddress2,
|
|
33017
|
+
errorText: errorText2,
|
|
33018
|
+
warningText
|
|
33019
|
+
}
|
|
33020
|
+
) : /* @__PURE__ */ jsx163(
|
|
32542
33021
|
WalletAddressInput,
|
|
32543
33022
|
{
|
|
32544
33023
|
value: recipient,
|
|
@@ -32552,54 +33031,52 @@ function WithdrawAddressScreen({
|
|
|
32552
33031
|
}
|
|
32553
33032
|
)
|
|
32554
33033
|
] }),
|
|
32555
|
-
/* @__PURE__ */
|
|
33034
|
+
/* @__PURE__ */ jsxs71(
|
|
32556
33035
|
AnimatedBox7,
|
|
32557
33036
|
{
|
|
32558
33037
|
layout: SUBMIT_TRANSITION,
|
|
32559
33038
|
flex: 1,
|
|
32560
|
-
justifyContent: "center",
|
|
32561
|
-
style:
|
|
32562
|
-
|
|
32563
|
-
|
|
32564
|
-
|
|
32565
|
-
|
|
32566
|
-
|
|
32567
|
-
|
|
32568
|
-
|
|
32569
|
-
|
|
32570
|
-
|
|
33039
|
+
justifyContent: showsPastePanel ? "flex-start" : "center",
|
|
33040
|
+
style: [
|
|
33041
|
+
styles78.summary,
|
|
33042
|
+
showsPastePanel ? { paddingTop: PASTE_PANEL_GAP, paddingBottom: bottomClearance } : null
|
|
33043
|
+
],
|
|
33044
|
+
children: [
|
|
33045
|
+
showsPastePanel ? /* @__PURE__ */ jsx163(PasteAddressPanel, { onPaste, isPasting }) : null,
|
|
33046
|
+
isAddress2 && !shouldEditAmount ? /* @__PURE__ */ jsx163(AnimatedBox7, { layout: SUBMIT_TRANSITION, children: /* @__PURE__ */ jsx163(
|
|
33047
|
+
ReceiveAmountSummary,
|
|
33048
|
+
{
|
|
33049
|
+
label: t("withdrawAddress.youllReceive"),
|
|
33050
|
+
usdLabel,
|
|
33051
|
+
tokenLabel,
|
|
33052
|
+
onPressBreakdown: usdLabel ? onPressBreakdown : void 0
|
|
33053
|
+
}
|
|
33054
|
+
) }) : null
|
|
33055
|
+
]
|
|
32571
33056
|
}
|
|
32572
33057
|
),
|
|
32573
|
-
recipient === "" && !shouldEditAmount ? null : /* @__PURE__ */
|
|
33058
|
+
recipient === "" && !shouldEditAmount ? null : /* @__PURE__ */ jsxs71(
|
|
32574
33059
|
AnimatedBox7,
|
|
32575
33060
|
{
|
|
32576
33061
|
layout: SUBMIT_TRANSITION,
|
|
32577
|
-
style: [
|
|
32578
|
-
styles77.footer,
|
|
32579
|
-
{
|
|
32580
|
-
// Withdrawing drops the keyboard, so stop clearing it in the same
|
|
32581
|
-
// commit that frees the space above: waiting for the hide event
|
|
32582
|
-
// would relayout the column a second time, mid-transition.
|
|
32583
|
-
marginBottom: keyboardHeight > 0 && !isSubmitting ? keyboardHeight + FOOTER_KEYBOARD_GAP : footerBottomMargin(insets.bottom)
|
|
32584
|
-
}
|
|
32585
|
-
],
|
|
33062
|
+
style: [styles78.footer, { marginBottom: bottomClearance }],
|
|
32586
33063
|
children: [
|
|
32587
|
-
footerErrorText ? /* @__PURE__ */
|
|
33064
|
+
footerErrorText ? /* @__PURE__ */ jsx163(
|
|
32588
33065
|
Text,
|
|
32589
33066
|
{
|
|
32590
33067
|
variant: "detail",
|
|
32591
33068
|
style: [
|
|
32592
|
-
|
|
33069
|
+
styles78.footerError,
|
|
32593
33070
|
{ color: theme.content.elements.error }
|
|
32594
33071
|
],
|
|
32595
33072
|
children: footerErrorText
|
|
32596
33073
|
}
|
|
32597
33074
|
) : null,
|
|
32598
|
-
/* @__PURE__ */
|
|
33075
|
+
/* @__PURE__ */ jsx163(
|
|
32599
33076
|
PillButton,
|
|
32600
33077
|
{
|
|
32601
33078
|
label: buttonLabel,
|
|
32602
|
-
icon: isSubmitting ? /* @__PURE__ */
|
|
33079
|
+
icon: isSubmitting ? /* @__PURE__ */ jsx163(
|
|
32603
33080
|
ActivityIndicator3,
|
|
32604
33081
|
{
|
|
32605
33082
|
size: "small",
|
|
@@ -32626,7 +33103,8 @@ function WithdrawAddressScreen({
|
|
|
32626
33103
|
}
|
|
32627
33104
|
var BODY_HORIZONTAL_MARGIN = 20;
|
|
32628
33105
|
var FOOTER_KEYBOARD_GAP = 12;
|
|
32629
|
-
var
|
|
33106
|
+
var PASTE_PANEL_GAP = 16;
|
|
33107
|
+
var styles78 = StyleSheet82.create({
|
|
32630
33108
|
body: {
|
|
32631
33109
|
marginHorizontal: BODY_HORIZONTAL_MARGIN,
|
|
32632
33110
|
paddingTop: 12,
|
|
@@ -32638,15 +33116,15 @@ var styles77 = StyleSheet81.create({
|
|
|
32638
33116
|
});
|
|
32639
33117
|
|
|
32640
33118
|
// src/screens/WithdrawAmountScreen.tsx
|
|
32641
|
-
import { USD_DECIMALS as USD_DECIMALS2 } from "@funkit/connect-core";
|
|
32642
|
-
import { Pressable as
|
|
32643
|
-
import
|
|
33119
|
+
import { USD_DECIMALS as USD_DECIMALS2, useFeatureGate as useFeatureGate4 } from "@funkit/connect-core";
|
|
33120
|
+
import { Pressable as Pressable39, StyleSheet as StyleSheet86, useWindowDimensions as useWindowDimensions16 } from "react-native";
|
|
33121
|
+
import Animated37, { Keyframe as Keyframe10, LinearTransition as LinearTransition6 } from "react-native-reanimated";
|
|
32644
33122
|
import { useSafeAreaInsets as useSafeAreaInsets32 } from "react-native-safe-area-context";
|
|
32645
33123
|
|
|
32646
33124
|
// src/components/AmountDisplay.tsx
|
|
32647
33125
|
import { useMemo as useMemo39 } from "react";
|
|
32648
|
-
import { StyleSheet as
|
|
32649
|
-
import
|
|
33126
|
+
import { StyleSheet as StyleSheet83, useWindowDimensions as useWindowDimensions15 } from "react-native";
|
|
33127
|
+
import Animated35, {
|
|
32650
33128
|
Keyframe as Keyframe9,
|
|
32651
33129
|
LinearTransition as LinearTransition4,
|
|
32652
33130
|
useAnimatedStyle as useAnimatedStyle18,
|
|
@@ -32670,7 +33148,7 @@ function amountGlyphs2(value, prefix) {
|
|
|
32670
33148
|
}
|
|
32671
33149
|
|
|
32672
33150
|
// src/components/AmountDisplay.tsx
|
|
32673
|
-
import { jsx as
|
|
33151
|
+
import { jsx as jsx164 } from "react/jsx-runtime";
|
|
32674
33152
|
var AMOUNT_FONT_SIZE2 = 96;
|
|
32675
33153
|
var PLACEHOLDER_OPACITY2 = 0.2;
|
|
32676
33154
|
var LINE_HEIGHT_RATIO2 = 1.25;
|
|
@@ -32679,13 +33157,13 @@ var CAP_BOX_RATIO2 = 68 / 96;
|
|
|
32679
33157
|
var CHARACTER_ADVANCE_RATIO = 0.6;
|
|
32680
33158
|
var HORIZONTAL_INSET = 16;
|
|
32681
33159
|
var MIN_FONT_SIZE = 40;
|
|
32682
|
-
var AnimatedBox8 =
|
|
32683
|
-
var AnimatedText2 =
|
|
33160
|
+
var AnimatedBox8 = Animated35.createAnimatedComponent(Box);
|
|
33161
|
+
var AnimatedText2 = Animated35.createAnimatedComponent(Text);
|
|
32684
33162
|
var GLYPH_LAYOUT2 = LinearTransition4.duration(MOTION_DURATION).easing(MOTION_EASING);
|
|
32685
33163
|
function AmountDisplay2({
|
|
32686
33164
|
value,
|
|
32687
33165
|
prefix = "$",
|
|
32688
|
-
|
|
33166
|
+
hasWarning = false,
|
|
32689
33167
|
accessibilityLabel
|
|
32690
33168
|
}) {
|
|
32691
33169
|
const theme = useTheme();
|
|
@@ -32715,20 +33193,20 @@ function AmountDisplay2({
|
|
|
32715
33193
|
return (
|
|
32716
33194
|
// The window the characters slide through. What it clips is the dead space
|
|
32717
33195
|
// the margin takes back, never the glyphs.
|
|
32718
|
-
/* @__PURE__ */
|
|
33196
|
+
/* @__PURE__ */ jsx164(
|
|
32719
33197
|
Box,
|
|
32720
33198
|
{
|
|
32721
33199
|
accessible: true,
|
|
32722
33200
|
accessibilityLabel,
|
|
32723
33201
|
accessibilityValue: { text: text3 },
|
|
32724
|
-
style: [
|
|
32725
|
-
children: glyphs.map(({ key, char, kind }) => /* @__PURE__ */
|
|
33202
|
+
style: [styles79.row, { marginVertical: -overhang }],
|
|
33203
|
+
children: glyphs.map(({ key, char, kind }) => /* @__PURE__ */ jsx164(
|
|
32726
33204
|
AnimatedBox8,
|
|
32727
33205
|
{
|
|
32728
33206
|
entering: nativeMotion(slides[glyphSide(kind, isEmpty)].entering),
|
|
32729
33207
|
exiting: nativeMotion(slides[glyphSide(kind, isEmpty)].exiting),
|
|
32730
33208
|
layout: nativeMotion(GLYPH_LAYOUT2),
|
|
32731
|
-
children: /* @__PURE__ */
|
|
33209
|
+
children: /* @__PURE__ */ jsx164(
|
|
32732
33210
|
AnimatedText2,
|
|
32733
33211
|
{
|
|
32734
33212
|
weight: "medium",
|
|
@@ -32738,7 +33216,7 @@ function AmountDisplay2({
|
|
|
32738
33216
|
fontSize,
|
|
32739
33217
|
lineHeight,
|
|
32740
33218
|
letterSpacing: fontSize * LETTER_SPACING_RATIO2,
|
|
32741
|
-
color:
|
|
33219
|
+
color: hasWarning ? theme.content.elements.warning : theme.content.elements.primary,
|
|
32742
33220
|
opacity: kind === "placeholder" ? PLACEHOLDER_OPACITY2 : 1
|
|
32743
33221
|
},
|
|
32744
33222
|
kind === "prefix" ? prefixDimming : null
|
|
@@ -32778,7 +33256,7 @@ function fitAmountFontSize(text3, available) {
|
|
|
32778
33256
|
const fitted = available / (text3.length * CHARACTER_ADVANCE_RATIO);
|
|
32779
33257
|
return Math.max(MIN_FONT_SIZE, Math.min(AMOUNT_FONT_SIZE2, fitted));
|
|
32780
33258
|
}
|
|
32781
|
-
var
|
|
33259
|
+
var styles79 = StyleSheet83.create({
|
|
32782
33260
|
row: {
|
|
32783
33261
|
flexDirection: "row",
|
|
32784
33262
|
justifyContent: "center",
|
|
@@ -32788,8 +33266,8 @@ var styles78 = StyleSheet82.create({
|
|
|
32788
33266
|
});
|
|
32789
33267
|
|
|
32790
33268
|
// src/components/NumPad.tsx
|
|
32791
|
-
import { Pressable as
|
|
32792
|
-
import { jsx as
|
|
33269
|
+
import { Pressable as Pressable37, StyleSheet as StyleSheet84 } from "react-native";
|
|
33270
|
+
import { jsx as jsx165 } from "react/jsx-runtime";
|
|
32793
33271
|
var KEY_FONT_SIZE = 24;
|
|
32794
33272
|
var COLUMN_ALIGNMENT2 = ["flex-start", "center", "flex-end"];
|
|
32795
33273
|
var ROWS3 = [
|
|
@@ -32804,8 +33282,8 @@ function NumPad3({
|
|
|
32804
33282
|
}) {
|
|
32805
33283
|
const theme = useTheme();
|
|
32806
33284
|
const haptic = useHapticFeedback();
|
|
32807
|
-
return /* @__PURE__ */
|
|
32808
|
-
|
|
33285
|
+
return /* @__PURE__ */ jsx165(Box, { flex: 1, children: ROWS3.map((row2) => /* @__PURE__ */ jsx165(Box, { flexDirection: "row", flex: 1, children: row2.map((key, column) => /* @__PURE__ */ jsx165(
|
|
33286
|
+
Pressable37,
|
|
32809
33287
|
{
|
|
32810
33288
|
onPress: () => {
|
|
32811
33289
|
haptic();
|
|
@@ -32813,20 +33291,20 @@ function NumPad3({
|
|
|
32813
33291
|
},
|
|
32814
33292
|
accessibilityRole: "button",
|
|
32815
33293
|
accessibilityLabel: key === "backspace" ? backspaceAccessibilityLabel : key,
|
|
32816
|
-
style: [
|
|
32817
|
-
children: key === "backspace" ? /* @__PURE__ */
|
|
33294
|
+
style: [styles80.key, { alignItems: COLUMN_ALIGNMENT2[column] }],
|
|
33295
|
+
children: key === "backspace" ? /* @__PURE__ */ jsx165(
|
|
32818
33296
|
FigmaChevronLeftIcon,
|
|
32819
33297
|
{
|
|
32820
33298
|
size: KEY_FONT_SIZE,
|
|
32821
33299
|
color: theme.content.elements.primary
|
|
32822
33300
|
}
|
|
32823
|
-
) : /* @__PURE__ */
|
|
33301
|
+
) : /* @__PURE__ */ jsx165(
|
|
32824
33302
|
Text,
|
|
32825
33303
|
{
|
|
32826
33304
|
weight: "medium",
|
|
32827
33305
|
style: [
|
|
32828
|
-
|
|
32829
|
-
key === "." ?
|
|
33306
|
+
styles80.label,
|
|
33307
|
+
key === "." ? styles80.decimalLabel : null
|
|
32830
33308
|
],
|
|
32831
33309
|
children: key
|
|
32832
33310
|
}
|
|
@@ -32835,7 +33313,7 @@ function NumPad3({
|
|
|
32835
33313
|
key
|
|
32836
33314
|
)) }, row2.join(""))) });
|
|
32837
33315
|
}
|
|
32838
|
-
var
|
|
33316
|
+
var styles80 = StyleSheet84.create({
|
|
32839
33317
|
key: { flex: 1, justifyContent: "center" },
|
|
32840
33318
|
label: {
|
|
32841
33319
|
fontSize: KEY_FONT_SIZE,
|
|
@@ -32852,10 +33330,10 @@ var styles79 = StyleSheet83.create({
|
|
|
32852
33330
|
});
|
|
32853
33331
|
|
|
32854
33332
|
// src/components/WithdrawSourceCard.tsx
|
|
32855
|
-
import { Pressable as
|
|
32856
|
-
import
|
|
32857
|
-
import { jsx as
|
|
32858
|
-
var AnimatedBox9 =
|
|
33333
|
+
import { Pressable as Pressable38, StyleSheet as StyleSheet85 } from "react-native";
|
|
33334
|
+
import Animated36, { LinearTransition as LinearTransition5 } from "react-native-reanimated";
|
|
33335
|
+
import { Fragment as Fragment18, jsx as jsx166, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
33336
|
+
var AnimatedBox9 = Animated36.createAnimatedComponent(Box);
|
|
32859
33337
|
var FOOT_TRANSITION = LinearTransition5.duration(MOTION_DURATION).easing(MOTION_EASING);
|
|
32860
33338
|
var HORIZONTAL_PADDING = 12;
|
|
32861
33339
|
var VERTICAL_PADDING = 13;
|
|
@@ -32864,6 +33342,7 @@ function WithdrawSourceCard({
|
|
|
32864
33342
|
icon,
|
|
32865
33343
|
title,
|
|
32866
33344
|
subtitle,
|
|
33345
|
+
balance,
|
|
32867
33346
|
useMaxLabel,
|
|
32868
33347
|
onUseMax,
|
|
32869
33348
|
onPress,
|
|
@@ -32871,14 +33350,14 @@ function WithdrawSourceCard({
|
|
|
32871
33350
|
attachedToButton = false
|
|
32872
33351
|
}) {
|
|
32873
33352
|
const theme = useTheme();
|
|
32874
|
-
return /* @__PURE__ */
|
|
33353
|
+
return /* @__PURE__ */ jsxs72(
|
|
32875
33354
|
AnimatedBox9,
|
|
32876
33355
|
{
|
|
32877
33356
|
flexDirection: "row",
|
|
32878
33357
|
alignItems: "center",
|
|
32879
33358
|
layout: nativeMotion(FOOT_TRANSITION),
|
|
32880
33359
|
style: [
|
|
32881
|
-
|
|
33360
|
+
styles81.card,
|
|
32882
33361
|
{
|
|
32883
33362
|
backgroundColor: theme.background.secondary,
|
|
32884
33363
|
borderTopLeftRadius: theme.borderRadii.element,
|
|
@@ -32889,11 +33368,22 @@ function WithdrawSourceCard({
|
|
|
32889
33368
|
}
|
|
32890
33369
|
],
|
|
32891
33370
|
children: [
|
|
32892
|
-
/* @__PURE__ */
|
|
32893
|
-
icon,
|
|
32894
|
-
/* @__PURE__ */
|
|
32895
|
-
/* @__PURE__ */
|
|
32896
|
-
|
|
33371
|
+
/* @__PURE__ */ jsx166(TokenPressable, { onPress, accessibilityLabel, children: /* @__PURE__ */ jsxs72(Box, { flexDirection: "row", alignItems: "center", style: styles81.token, children: [
|
|
33372
|
+
balance ? null : icon,
|
|
33373
|
+
/* @__PURE__ */ jsx166(Box, { flex: 1, style: styles81.details, children: balance ? /* @__PURE__ */ jsxs72(Fragment18, { children: [
|
|
33374
|
+
/* @__PURE__ */ jsx166(
|
|
33375
|
+
Text,
|
|
33376
|
+
{
|
|
33377
|
+
variant: "detail",
|
|
33378
|
+
numberOfLines: 1,
|
|
33379
|
+
style: { color: theme.content.elements.secondary },
|
|
33380
|
+
children: balance.label
|
|
33381
|
+
}
|
|
33382
|
+
),
|
|
33383
|
+
/* @__PURE__ */ jsx166(Text, { variant: "bodyMedium", numberOfLines: 1, children: balance.value })
|
|
33384
|
+
] }) : /* @__PURE__ */ jsxs72(Fragment18, { children: [
|
|
33385
|
+
/* @__PURE__ */ jsx166(Text, { variant: "bodyMedium", numberOfLines: 1, children: title }),
|
|
33386
|
+
subtitle ? /* @__PURE__ */ jsx166(
|
|
32897
33387
|
Text,
|
|
32898
33388
|
{
|
|
32899
33389
|
variant: "detail",
|
|
@@ -32902,28 +33392,28 @@ function WithdrawSourceCard({
|
|
|
32902
33392
|
children: subtitle
|
|
32903
33393
|
}
|
|
32904
33394
|
) : null
|
|
32905
|
-
] })
|
|
33395
|
+
] }) })
|
|
32906
33396
|
] }) }),
|
|
32907
|
-
onUseMax ? /* @__PURE__ */
|
|
32908
|
-
|
|
33397
|
+
onUseMax ? /* @__PURE__ */ jsx166(
|
|
33398
|
+
Pressable38,
|
|
32909
33399
|
{
|
|
32910
33400
|
onPress: onUseMax,
|
|
32911
33401
|
accessibilityRole: "button",
|
|
32912
33402
|
accessibilityLabel: useMaxLabel,
|
|
32913
|
-
children: /* @__PURE__ */
|
|
33403
|
+
children: /* @__PURE__ */ jsx166(
|
|
32914
33404
|
Box,
|
|
32915
33405
|
{
|
|
32916
33406
|
borderRadius: "button",
|
|
32917
33407
|
alignItems: "center",
|
|
32918
33408
|
justifyContent: "center",
|
|
32919
33409
|
style: [
|
|
32920
|
-
|
|
33410
|
+
styles81.useMax,
|
|
32921
33411
|
{
|
|
32922
33412
|
height: theme.sizes.buttonXs,
|
|
32923
33413
|
backgroundColor: theme.background.button.secondary.default
|
|
32924
33414
|
}
|
|
32925
33415
|
],
|
|
32926
|
-
children: /* @__PURE__ */
|
|
33416
|
+
children: /* @__PURE__ */ jsx166(
|
|
32927
33417
|
Text,
|
|
32928
33418
|
{
|
|
32929
33419
|
variant: "bodyMedium",
|
|
@@ -32940,13 +33430,13 @@ function WithdrawSourceCard({
|
|
|
32940
33430
|
// The chevron repeats the token area's target so the right edge stays
|
|
32941
33431
|
// tappable; the labelled button beside it already carries the
|
|
32942
33432
|
// semantics, so this one is decoration to a screen reader.
|
|
32943
|
-
/* @__PURE__ */
|
|
32944
|
-
|
|
33433
|
+
/* @__PURE__ */ jsx166(
|
|
33434
|
+
Pressable38,
|
|
32945
33435
|
{
|
|
32946
33436
|
onPress,
|
|
32947
33437
|
accessibilityElementsHidden: true,
|
|
32948
33438
|
focusable: false,
|
|
32949
|
-
children: /* @__PURE__ */
|
|
33439
|
+
children: /* @__PURE__ */ jsx166(
|
|
32950
33440
|
FigmaChevronRightIcon,
|
|
32951
33441
|
{
|
|
32952
33442
|
size: 16,
|
|
@@ -32966,20 +33456,20 @@ function TokenPressable({
|
|
|
32966
33456
|
children
|
|
32967
33457
|
}) {
|
|
32968
33458
|
if (!onPress) {
|
|
32969
|
-
return /* @__PURE__ */
|
|
33459
|
+
return /* @__PURE__ */ jsx166(Box, { flex: 1, children });
|
|
32970
33460
|
}
|
|
32971
|
-
return /* @__PURE__ */
|
|
32972
|
-
|
|
33461
|
+
return /* @__PURE__ */ jsx166(
|
|
33462
|
+
Pressable38,
|
|
32973
33463
|
{
|
|
32974
33464
|
onPress,
|
|
32975
33465
|
accessibilityRole: "button",
|
|
32976
33466
|
accessibilityLabel,
|
|
32977
|
-
style:
|
|
33467
|
+
style: styles81.tokenTarget,
|
|
32978
33468
|
children
|
|
32979
33469
|
}
|
|
32980
33470
|
);
|
|
32981
33471
|
}
|
|
32982
|
-
var
|
|
33472
|
+
var styles81 = StyleSheet85.create({
|
|
32983
33473
|
card: {
|
|
32984
33474
|
gap: 8,
|
|
32985
33475
|
paddingHorizontal: HORIZONTAL_PADDING,
|
|
@@ -32992,10 +33482,10 @@ var styles80 = StyleSheet84.create({
|
|
|
32992
33482
|
});
|
|
32993
33483
|
|
|
32994
33484
|
// src/screens/WithdrawAmountScreen.tsx
|
|
32995
|
-
import { jsx as
|
|
33485
|
+
import { jsx as jsx167, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
32996
33486
|
var NUMPAD_BOTTOM_MARGIN = 25;
|
|
32997
33487
|
var NUMPAD_MIN_BOTTOM_MARGIN = 40;
|
|
32998
|
-
var AnimatedBox10 =
|
|
33488
|
+
var AnimatedBox10 = Animated37.createAnimatedComponent(Box);
|
|
32999
33489
|
var CARD_TRANSITION = LinearTransition6.duration(MOTION_DURATION).easing(MOTION_EASING);
|
|
33000
33490
|
var BUTTON_TRAVEL = 24;
|
|
33001
33491
|
var BUTTON_ENTERING = new Keyframe10({
|
|
@@ -33010,6 +33500,7 @@ var BUTTON_EXITING = new Keyframe10({
|
|
|
33010
33500
|
easing: MOTION_EASING
|
|
33011
33501
|
}
|
|
33012
33502
|
}).duration(MOTION_DURATION);
|
|
33503
|
+
var BALANCE_PLACEHOLDER = "\u2014";
|
|
33013
33504
|
function WithdrawAmountScreen({
|
|
33014
33505
|
title,
|
|
33015
33506
|
amount,
|
|
@@ -33022,6 +33513,7 @@ function WithdrawAmountScreen({
|
|
|
33022
33513
|
onSwapDenomination,
|
|
33023
33514
|
sourceDecimals,
|
|
33024
33515
|
balance,
|
|
33516
|
+
balanceFiatLabel,
|
|
33025
33517
|
maxAmount,
|
|
33026
33518
|
isAboveMaximum: isAboveMaximum2 = false,
|
|
33027
33519
|
statusText,
|
|
@@ -33040,27 +33532,31 @@ function WithdrawAmountScreen({
|
|
|
33040
33532
|
const { height: windowHeight } = useWindowDimensions16();
|
|
33041
33533
|
const height = useFullHeightStep(windowHeight);
|
|
33042
33534
|
const insets = useSafeAreaInsets32();
|
|
33535
|
+
const isOmnibusWithdrawFlow = useFeatureGate4("enable-omnibus-withdraw-flow");
|
|
33043
33536
|
const currencySymbol = displayCurrency === "EUR" ? "\u20AC" : "$";
|
|
33044
|
-
const
|
|
33537
|
+
const hasMax = maxAmount !== void 0;
|
|
33538
|
+
const showButton = !hasMax || input !== "" && !isAboveMaximum2;
|
|
33539
|
+
const showUseMax = hasMax && (isOmnibusWithdrawFlow || !showButton);
|
|
33045
33540
|
const tokenLabel = `${formatTokenAmount(amount === "" ? "0" : amount)} ${source.symbol}`;
|
|
33046
33541
|
const convertedLabel = inFiat ? tokenLabel : fiatLabel ?? tokenLabel;
|
|
33542
|
+
const lineText = errorText2 ?? statusText ?? (isOmnibusWithdrawFlow ? void 0 : convertedLabel);
|
|
33047
33543
|
const canSwap = !!onSwapDenomination && !errorText2 && !statusText;
|
|
33048
|
-
const convertedLine = /* @__PURE__ */
|
|
33049
|
-
/* @__PURE__ */
|
|
33544
|
+
const convertedLine = lineText === void 0 ? null : /* @__PURE__ */ jsxs73(Box, { flexDirection: "row", alignItems: "center", style: styles82.convertedRow, children: [
|
|
33545
|
+
/* @__PURE__ */ jsx167(
|
|
33050
33546
|
Text,
|
|
33051
33547
|
{
|
|
33052
33548
|
variant: "bodyMedium",
|
|
33053
33549
|
numberOfLines: errorText2 || statusText ? 2 : 1,
|
|
33054
33550
|
style: {
|
|
33055
33551
|
flexShrink: 1,
|
|
33056
|
-
color: errorText2 ? theme.content.elements.
|
|
33552
|
+
color: errorText2 ? theme.content.elements.warning : theme.content.elements.secondary
|
|
33057
33553
|
},
|
|
33058
|
-
children:
|
|
33554
|
+
children: lineText
|
|
33059
33555
|
}
|
|
33060
33556
|
),
|
|
33061
|
-
canSwap ? /* @__PURE__ */
|
|
33557
|
+
canSwap ? /* @__PURE__ */ jsx167(FigmaSwapIcon, { size: 16, color: theme.content.elements.secondary }) : null
|
|
33062
33558
|
] });
|
|
33063
|
-
return /* @__PURE__ */
|
|
33559
|
+
return /* @__PURE__ */ jsxs73(
|
|
33064
33560
|
Box,
|
|
33065
33561
|
{
|
|
33066
33562
|
style: {
|
|
@@ -33069,19 +33565,19 @@ function WithdrawAmountScreen({
|
|
|
33069
33565
|
backgroundColor: theme.background.modal
|
|
33070
33566
|
},
|
|
33071
33567
|
children: [
|
|
33072
|
-
/* @__PURE__ */
|
|
33073
|
-
/* @__PURE__ */
|
|
33074
|
-
/* @__PURE__ */
|
|
33568
|
+
/* @__PURE__ */ jsx167(TopBar, { title, onBack, onClose }),
|
|
33569
|
+
/* @__PURE__ */ jsxs73(Box, { style: styles82.amount, children: [
|
|
33570
|
+
/* @__PURE__ */ jsx167(
|
|
33075
33571
|
AmountDisplay2,
|
|
33076
33572
|
{
|
|
33077
33573
|
value: groupThousands(input),
|
|
33078
|
-
prefix: inFiat ? currencySymbol : "",
|
|
33079
|
-
|
|
33574
|
+
prefix: inFiat || isOmnibusWithdrawFlow ? currencySymbol : "",
|
|
33575
|
+
hasWarning: !!errorText2,
|
|
33080
33576
|
accessibilityLabel: t("withdrawAmount.amountLabel")
|
|
33081
33577
|
}
|
|
33082
33578
|
),
|
|
33083
|
-
/* @__PURE__ */
|
|
33084
|
-
|
|
33579
|
+
/* @__PURE__ */ jsx167(Box, { style: styles82.converted, children: canSwap ? /* @__PURE__ */ jsx167(
|
|
33580
|
+
Pressable39,
|
|
33085
33581
|
{
|
|
33086
33582
|
onPress: onSwapDenomination,
|
|
33087
33583
|
accessibilityRole: "button",
|
|
@@ -33093,12 +33589,12 @@ function WithdrawAmountScreen({
|
|
|
33093
33589
|
}
|
|
33094
33590
|
) : convertedLine })
|
|
33095
33591
|
] }),
|
|
33096
|
-
/* @__PURE__ */
|
|
33097
|
-
/* @__PURE__ */
|
|
33098
|
-
/* @__PURE__ */
|
|
33592
|
+
/* @__PURE__ */ jsx167(Box, { flex: 1 }),
|
|
33593
|
+
/* @__PURE__ */ jsxs73(AnimatedBox10, { layout: nativeMotion(CARD_TRANSITION), style: styles82.card, children: [
|
|
33594
|
+
/* @__PURE__ */ jsx167(
|
|
33099
33595
|
WithdrawSourceCard,
|
|
33100
33596
|
{
|
|
33101
|
-
icon: /* @__PURE__ */
|
|
33597
|
+
icon: /* @__PURE__ */ jsx167(
|
|
33102
33598
|
TokenChainIcon,
|
|
33103
33599
|
{
|
|
33104
33600
|
symbol: source.symbol,
|
|
@@ -33109,24 +33605,28 @@ function WithdrawAmountScreen({
|
|
|
33109
33605
|
),
|
|
33110
33606
|
title: source.label,
|
|
33111
33607
|
subtitle: balance ? `${groupThousands(balance)} ${source.symbol}` : void 0,
|
|
33608
|
+
balance: isOmnibusWithdrawFlow ? {
|
|
33609
|
+
label: t("withdrawAmount.availableBalance"),
|
|
33610
|
+
value: balanceFiatLabel ?? BALANCE_PLACEHOLDER
|
|
33611
|
+
} : void 0,
|
|
33112
33612
|
useMaxLabel: t("withdrawAmount.useMax"),
|
|
33113
33613
|
onUseMax: showUseMax && maxAmount ? () => onChangeAmount(maxAmount) : void 0,
|
|
33114
33614
|
onPress: onPressSource,
|
|
33115
33615
|
accessibilityLabel: t("withdrawCrypto.sendFrom"),
|
|
33116
|
-
attachedToButton:
|
|
33616
|
+
attachedToButton: showButton
|
|
33117
33617
|
}
|
|
33118
33618
|
),
|
|
33119
|
-
/* @__PURE__ */
|
|
33619
|
+
/* @__PURE__ */ jsx167(
|
|
33120
33620
|
AnimatedBox10,
|
|
33121
33621
|
{
|
|
33122
33622
|
layout: nativeMotion(CARD_TRANSITION),
|
|
33123
|
-
style: [
|
|
33124
|
-
children:
|
|
33623
|
+
style: [styles82.buttonClip, showButton ? styles82.buttonSlot : null],
|
|
33624
|
+
children: showButton ? /* @__PURE__ */ jsx167(
|
|
33125
33625
|
AnimatedBox10,
|
|
33126
33626
|
{
|
|
33127
33627
|
entering: nativeMotion(BUTTON_ENTERING),
|
|
33128
33628
|
exiting: nativeMotion(BUTTON_EXITING),
|
|
33129
|
-
children: /* @__PURE__ */
|
|
33629
|
+
children: /* @__PURE__ */ jsx167(
|
|
33130
33630
|
PillButton,
|
|
33131
33631
|
{
|
|
33132
33632
|
label: onRetryMaximum ? t("common.tryAgain") : t("common.continue"),
|
|
@@ -33136,15 +33636,15 @@ function WithdrawAmountScreen({
|
|
|
33136
33636
|
}
|
|
33137
33637
|
)
|
|
33138
33638
|
}
|
|
33139
|
-
)
|
|
33639
|
+
) : null
|
|
33140
33640
|
}
|
|
33141
33641
|
)
|
|
33142
33642
|
] }),
|
|
33143
|
-
/* @__PURE__ */
|
|
33643
|
+
/* @__PURE__ */ jsx167(
|
|
33144
33644
|
Box,
|
|
33145
33645
|
{
|
|
33146
33646
|
style: [
|
|
33147
|
-
|
|
33647
|
+
styles82.numpad,
|
|
33148
33648
|
{
|
|
33149
33649
|
marginBottom: Math.max(
|
|
33150
33650
|
NUMPAD_BOTTOM_MARGIN + insets.bottom,
|
|
@@ -33152,7 +33652,7 @@ function WithdrawAmountScreen({
|
|
|
33152
33652
|
)
|
|
33153
33653
|
}
|
|
33154
33654
|
],
|
|
33155
|
-
children: /* @__PURE__ */
|
|
33655
|
+
children: /* @__PURE__ */ jsx167(
|
|
33156
33656
|
NumPad3,
|
|
33157
33657
|
{
|
|
33158
33658
|
backspaceAccessibilityLabel: t("withdrawAmount.delete"),
|
|
@@ -33171,7 +33671,7 @@ function WithdrawAmountScreen({
|
|
|
33171
33671
|
}
|
|
33172
33672
|
);
|
|
33173
33673
|
}
|
|
33174
|
-
var
|
|
33674
|
+
var styles82 = StyleSheet86.create({
|
|
33175
33675
|
amount: { alignItems: "center", paddingTop: 78 },
|
|
33176
33676
|
converted: { paddingTop: 32 },
|
|
33177
33677
|
convertedRow: { gap: 6 },
|
|
@@ -33188,7 +33688,7 @@ var styles81 = StyleSheet85.create({
|
|
|
33188
33688
|
});
|
|
33189
33689
|
|
|
33190
33690
|
// src/screens/WithdrawCryptoSteps.tsx
|
|
33191
|
-
import { Fragment as
|
|
33691
|
+
import { Fragment as Fragment19, jsx as jsx168, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
33192
33692
|
function WithdrawCryptoSteps({
|
|
33193
33693
|
config,
|
|
33194
33694
|
callbacks,
|
|
@@ -33213,9 +33713,16 @@ function WithdrawCryptoSteps({
|
|
|
33213
33713
|
} = useNestedSheet();
|
|
33214
33714
|
const connectedWalletAddress = useConnectedRecipientAddress(config);
|
|
33215
33715
|
const isStablecoin = useIsStablecoin();
|
|
33216
|
-
const hideStablecoinSwap =
|
|
33217
|
-
const
|
|
33716
|
+
const hideStablecoinSwap = useFeatureGate5("hide-stablecoin-amount-switch") && config.displayCurrency !== "EUR" && isStablecoin(form.sourceToken.symbol);
|
|
33717
|
+
const isOmnibusWithdrawFlow = useFeatureGate5("enable-omnibus-withdraw-flow");
|
|
33718
|
+
const canSwapDenomination = form.canSwapDenomination && !hideStablecoinSwap && !isOmnibusWithdrawFlow;
|
|
33719
|
+
const isAwaitingFiatRate = isOmnibusWithdrawFlow && !form.inFiat;
|
|
33218
33720
|
const amountFiatLabel = form.amountFiat === void 0 ? void 0 : formatFiat(Number(form.amountFiat), config.displayCurrency ?? "USD");
|
|
33721
|
+
const withdrawTitleFiatLabel = withdrawTitleFiat(
|
|
33722
|
+
form.amountFiat,
|
|
33723
|
+
config.displayCurrency ?? "USD"
|
|
33724
|
+
);
|
|
33725
|
+
const balanceFiatLabel = form.balanceFiat !== void 0 ? formatFiat(form.balanceFiat, config.displayCurrency ?? "USD") : void 0;
|
|
33219
33726
|
const receiveFiatLabel = form.receiveFiat === void 0 ? void 0 : formatFiat(form.receiveFiat, config.displayCurrency ?? "USD");
|
|
33220
33727
|
const receiveTokenLabel = form.receiveAmount && form.destinationToken ? `${formatTokenAmount(form.receiveAmount)} ${form.destinationToken.symbol}` : void 0;
|
|
33221
33728
|
const { submit, isSubmitting, isBusy, executionErrorText } = useCryptoWithdrawalSubmit({
|
|
@@ -33233,7 +33740,7 @@ function WithdrawCryptoSteps({
|
|
|
33233
33740
|
const [isPickingSource, setIsPickingSource] = useState71(false);
|
|
33234
33741
|
const [isPasting, setIsPasting] = useState71(false);
|
|
33235
33742
|
if (isPickingSource) {
|
|
33236
|
-
return /* @__PURE__ */
|
|
33743
|
+
return /* @__PURE__ */ jsx168(
|
|
33237
33744
|
SelectSourceTokenScreen,
|
|
33238
33745
|
{
|
|
33239
33746
|
options: form.sourceOptions,
|
|
@@ -33249,7 +33756,7 @@ function WithdrawCryptoSteps({
|
|
|
33249
33756
|
);
|
|
33250
33757
|
}
|
|
33251
33758
|
if (current === "withdrawReceiveToken") {
|
|
33252
|
-
return /* @__PURE__ */
|
|
33759
|
+
return /* @__PURE__ */ jsx168(
|
|
33253
33760
|
SelectReceiveTokenAndChainScreen,
|
|
33254
33761
|
{
|
|
33255
33762
|
chains: form.destinationChains,
|
|
@@ -33267,21 +33774,22 @@ function WithdrawCryptoSteps({
|
|
|
33267
33774
|
);
|
|
33268
33775
|
}
|
|
33269
33776
|
if (current === "withdrawAmount") {
|
|
33270
|
-
return /* @__PURE__ */
|
|
33777
|
+
return /* @__PURE__ */ jsx168(
|
|
33271
33778
|
WithdrawAmountScreen,
|
|
33272
33779
|
{
|
|
33273
33780
|
title: t("withdrawCrypto.title"),
|
|
33274
33781
|
amount: form.amount,
|
|
33275
|
-
onChangeAmount: form.setAmount,
|
|
33782
|
+
onChangeAmount: isAwaitingFiatRate ? ignoreInput : form.setAmount,
|
|
33276
33783
|
input: form.input,
|
|
33277
|
-
onChangeInput: form.setInput,
|
|
33784
|
+
onChangeInput: isAwaitingFiatRate ? ignoreInput : form.setInput,
|
|
33278
33785
|
inFiat: form.inFiat,
|
|
33279
33786
|
displayCurrency: config.displayCurrency,
|
|
33280
33787
|
fiatLabel: amountFiatLabel,
|
|
33281
33788
|
onSwapDenomination: canSwapDenomination ? form.swapDenomination : void 0,
|
|
33282
33789
|
sourceDecimals: form.sourceDecimals,
|
|
33283
33790
|
balance: form.balance,
|
|
33284
|
-
|
|
33791
|
+
balanceFiatLabel,
|
|
33792
|
+
maxAmount: isAwaitingFiatRate ? void 0 : form.maxAmount,
|
|
33285
33793
|
isAboveMaximum: form.amountValidation.isWithdrawAmountAboveBalance || form.amountValidation.isWithdrawAmountTooHigh,
|
|
33286
33794
|
source: {
|
|
33287
33795
|
label: form.sourceLabel,
|
|
@@ -33309,17 +33817,18 @@ function WithdrawCryptoSteps({
|
|
|
33309
33817
|
}
|
|
33310
33818
|
);
|
|
33311
33819
|
}
|
|
33312
|
-
return /* @__PURE__ */
|
|
33313
|
-
/* @__PURE__ */
|
|
33820
|
+
return /* @__PURE__ */ jsxs74(Fragment19, { children: [
|
|
33821
|
+
/* @__PURE__ */ jsx168(
|
|
33314
33822
|
WithdrawAddressScreen,
|
|
33315
33823
|
{
|
|
33316
33824
|
title: t("withdrawAddress.title", {
|
|
33317
|
-
amount:
|
|
33825
|
+
amount: withdrawTitleFiatLabel ?? `${groupThousands(form.amount)} ${form.sourceToken.symbol}`
|
|
33318
33826
|
}),
|
|
33319
33827
|
recipient: form.recipient,
|
|
33320
33828
|
onChangeRecipient: form.setRecipient,
|
|
33321
33829
|
isAddress: form.isRecipientAddress,
|
|
33322
33830
|
isPasting,
|
|
33831
|
+
pastePanel: isOmnibusWithdrawFlow,
|
|
33323
33832
|
onPaste: async () => {
|
|
33324
33833
|
setIsPasting(true);
|
|
33325
33834
|
try {
|
|
@@ -33351,7 +33860,7 @@ function WithdrawCryptoSteps({
|
|
|
33351
33860
|
onClose: nav.closeFlow
|
|
33352
33861
|
}
|
|
33353
33862
|
),
|
|
33354
|
-
/* @__PURE__ */
|
|
33863
|
+
/* @__PURE__ */ jsx168(
|
|
33355
33864
|
BottomSheetModal5,
|
|
33356
33865
|
{
|
|
33357
33866
|
ref: nestedSheetRef,
|
|
@@ -33361,7 +33870,7 @@ function WithdrawCryptoSteps({
|
|
|
33361
33870
|
backgroundComponent: FlowSheetBackground,
|
|
33362
33871
|
backdropComponent: renderNestedBackdrop,
|
|
33363
33872
|
onDismiss: () => setNestedScreen(null),
|
|
33364
|
-
children: /* @__PURE__ */
|
|
33873
|
+
children: /* @__PURE__ */ jsx168(BottomSheetView5, { children: nestedScreen === "transactionBreakdown" ? /* @__PURE__ */ jsx168(
|
|
33365
33874
|
TransactionBreakdownScreen,
|
|
33366
33875
|
{
|
|
33367
33876
|
usdLabel: receiveFiatLabel ?? "",
|
|
@@ -33375,6 +33884,15 @@ function WithdrawCryptoSteps({
|
|
|
33375
33884
|
)
|
|
33376
33885
|
] });
|
|
33377
33886
|
}
|
|
33887
|
+
function ignoreInput() {
|
|
33888
|
+
}
|
|
33889
|
+
function withdrawTitleFiat(amountFiat, currency) {
|
|
33890
|
+
if (amountFiat === void 0) {
|
|
33891
|
+
return void 0;
|
|
33892
|
+
}
|
|
33893
|
+
const value = Number(amountFiat);
|
|
33894
|
+
return formatFiatWhole(value, currency);
|
|
33895
|
+
}
|
|
33378
33896
|
function useConnectedRecipientAddress(config) {
|
|
33379
33897
|
const { walletAddress } = useFunkitIdentity();
|
|
33380
33898
|
if (config.disableConnectedWallet || !isUsableWalletAddress(walletAddress)) {
|
|
@@ -33384,7 +33902,7 @@ function useConnectedRecipientAddress(config) {
|
|
|
33384
33902
|
}
|
|
33385
33903
|
|
|
33386
33904
|
// src/screens/WithdrawMethodScreen.tsx
|
|
33387
|
-
import { jsx as
|
|
33905
|
+
import { jsx as jsx169 } from "react/jsx-runtime";
|
|
33388
33906
|
function getTerminalError(t, isBelowMinimum2, isEmpty) {
|
|
33389
33907
|
if (isBelowMinimum2) {
|
|
33390
33908
|
return {
|
|
@@ -33415,7 +33933,7 @@ function WithdrawMethodScreen(props) {
|
|
|
33415
33933
|
} = props;
|
|
33416
33934
|
const terminalError2 = getTerminalError(t, isBelowMinimum2, isEmpty);
|
|
33417
33935
|
if (terminalError2 && !hasError && !loading3) {
|
|
33418
|
-
return /* @__PURE__ */
|
|
33936
|
+
return /* @__PURE__ */ jsx169(
|
|
33419
33937
|
SelectMethodScreen,
|
|
33420
33938
|
{
|
|
33421
33939
|
title,
|
|
@@ -33427,7 +33945,7 @@ function WithdrawMethodScreen(props) {
|
|
|
33427
33945
|
}
|
|
33428
33946
|
);
|
|
33429
33947
|
}
|
|
33430
|
-
return /* @__PURE__ */
|
|
33948
|
+
return /* @__PURE__ */ jsx169(
|
|
33431
33949
|
SelectMethodScreen,
|
|
33432
33950
|
{
|
|
33433
33951
|
title,
|
|
@@ -33448,7 +33966,7 @@ import {
|
|
|
33448
33966
|
isValidOrderData
|
|
33449
33967
|
} from "@funkit/connect-core";
|
|
33450
33968
|
import { useCallback as useCallback34 } from "react";
|
|
33451
|
-
import { jsx as
|
|
33969
|
+
import { jsx as jsx170 } from "react/jsx-runtime";
|
|
33452
33970
|
function SwappedWithdrawScreen({
|
|
33453
33971
|
url,
|
|
33454
33972
|
onClose,
|
|
@@ -33503,7 +34021,7 @@ function SwappedWithdrawScreen({
|
|
|
33503
34021
|
targetChainId
|
|
33504
34022
|
]
|
|
33505
34023
|
);
|
|
33506
|
-
return /* @__PURE__ */
|
|
34024
|
+
return /* @__PURE__ */ jsx170(SwappedScreenShell, { url, onMessage: handleMessage, onBack });
|
|
33507
34025
|
}
|
|
33508
34026
|
|
|
33509
34027
|
// src/transfer/hooks/useWithdrawalFops.ts
|
|
@@ -33860,7 +34378,7 @@ function useWithdrawalExecution({
|
|
|
33860
34378
|
}
|
|
33861
34379
|
|
|
33862
34380
|
// src/flow/WithdrawalFlowContent.tsx
|
|
33863
|
-
import { jsx as
|
|
34381
|
+
import { jsx as jsx171 } from "react/jsx-runtime";
|
|
33864
34382
|
var CRYPTO_WITHDRAWAL_METHOD_ID = "crypto-withdrawal";
|
|
33865
34383
|
var HOST_METHOD_ID_PREFIX = "method:";
|
|
33866
34384
|
function WithdrawalFlowContent({
|
|
@@ -33906,7 +34424,7 @@ function WithdrawalFlowContent({
|
|
|
33906
34424
|
void queryClient.invalidateQueries({ queryKey: [WITHDRAW_FOPS_QUERY_KEY] });
|
|
33907
34425
|
}, [queryClient]);
|
|
33908
34426
|
if (hasExecutionError) {
|
|
33909
|
-
return /* @__PURE__ */
|
|
34427
|
+
return /* @__PURE__ */ jsx171(
|
|
33910
34428
|
WithdrawMethodScreen,
|
|
33911
34429
|
{
|
|
33912
34430
|
title: config.title ?? t("withdraw.title"),
|
|
@@ -33928,7 +34446,7 @@ function WithdrawalFlowContent({
|
|
|
33928
34446
|
id: String(i),
|
|
33929
34447
|
title: row2.name,
|
|
33930
34448
|
subtitle: row2.subtitle,
|
|
33931
|
-
icon: /* @__PURE__ */
|
|
34449
|
+
icon: /* @__PURE__ */ jsx171(PaymentMethodIcon, { fop: fops[i] })
|
|
33932
34450
|
})
|
|
33933
34451
|
);
|
|
33934
34452
|
const showCashList = isLoading || cashMethods.length > 0;
|
|
@@ -33936,13 +34454,13 @@ function WithdrawalFlowContent({
|
|
|
33936
34454
|
id: CRYPTO_WITHDRAWAL_METHOD_ID,
|
|
33937
34455
|
title: t("withdrawCrypto.methodTitle"),
|
|
33938
34456
|
subtitle: t("withdrawCrypto.methodSubtitle"),
|
|
33939
|
-
icon: /* @__PURE__ */
|
|
34457
|
+
icon: /* @__PURE__ */ jsx171(CryptoBitcoinIcon, {})
|
|
33940
34458
|
};
|
|
33941
34459
|
const cryptoMethods = methodOptions.length ? methodOptions.map((method) => ({
|
|
33942
34460
|
id: `${HOST_METHOD_ID_PREFIX}${method.id}`,
|
|
33943
34461
|
title: method.title,
|
|
33944
34462
|
subtitle: method.subtitle,
|
|
33945
|
-
icon: method.icon ?? /* @__PURE__ */
|
|
34463
|
+
icon: method.icon ?? /* @__PURE__ */ jsx171(CryptoBitcoinIcon, {})
|
|
33946
34464
|
})) : [genericCryptoRow];
|
|
33947
34465
|
const methods = [
|
|
33948
34466
|
...cryptoMethods,
|
|
@@ -33954,7 +34472,7 @@ function WithdrawalFlowContent({
|
|
|
33954
34472
|
})) : []
|
|
33955
34473
|
];
|
|
33956
34474
|
const cashNote = showCashList ? void 0 : isError ? t("withdraw.cashMethodsError") : t("withdraw.noCashMethods");
|
|
33957
|
-
return /* @__PURE__ */
|
|
34475
|
+
return /* @__PURE__ */ jsx171(
|
|
33958
34476
|
WithdrawMethodScreen,
|
|
33959
34477
|
{
|
|
33960
34478
|
title: config.title ?? t("withdraw.title"),
|
|
@@ -33990,7 +34508,7 @@ function WithdrawalFlowContent({
|
|
|
33990
34508
|
case "withdrawAmount":
|
|
33991
34509
|
case "withdrawAddress":
|
|
33992
34510
|
case "withdrawReceiveToken":
|
|
33993
|
-
return /* @__PURE__ */
|
|
34511
|
+
return /* @__PURE__ */ jsx171(
|
|
33994
34512
|
WithdrawCryptoSteps,
|
|
33995
34513
|
{
|
|
33996
34514
|
config: selectedMethodConfig ?? config,
|
|
@@ -34008,7 +34526,7 @@ function WithdrawalFlowContent({
|
|
|
34008
34526
|
}
|
|
34009
34527
|
);
|
|
34010
34528
|
case "withdrawComplete":
|
|
34011
|
-
return submittedWithdrawal ? /* @__PURE__ */
|
|
34529
|
+
return submittedWithdrawal ? /* @__PURE__ */ jsx171(
|
|
34012
34530
|
WithdrawCryptoComplete,
|
|
34013
34531
|
{
|
|
34014
34532
|
depositAddressOrHash: submittedWithdrawal.depositAddressOrHash,
|
|
@@ -34020,7 +34538,7 @@ function WithdrawalFlowContent({
|
|
|
34020
34538
|
}
|
|
34021
34539
|
) : null;
|
|
34022
34540
|
case "swapped":
|
|
34023
|
-
return selectedFop?.embeddedFlowUrl ? /* @__PURE__ */
|
|
34541
|
+
return selectedFop?.embeddedFlowUrl ? /* @__PURE__ */ jsx171(
|
|
34024
34542
|
SwappedWithdrawScreen,
|
|
34025
34543
|
{
|
|
34026
34544
|
url: selectedFop.embeddedFlowUrl,
|
|
@@ -34060,7 +34578,7 @@ function WithdrawalFlowContent({
|
|
|
34060
34578
|
}
|
|
34061
34579
|
|
|
34062
34580
|
// src/fiat/providers/stripe/stripeOnrampBridge.tsx
|
|
34063
|
-
import { useEffect as
|
|
34581
|
+
import { useEffect as useEffect92, useState as useState73 } from "react";
|
|
34064
34582
|
|
|
34065
34583
|
// src/fiat/providers/stripe/stripeSdk.ts
|
|
34066
34584
|
var INSTALL_STEPS = "Install `@stripe/stripe-react-native` in your app and enable its Onramp module: Expo \u2014 the config plugin with `includeOnramp: true`; bare iOS \u2014 add 'stripe-react-native/Onramp' to your Podfile; bare Android \u2014 set 'StripeSdk_includeOnramp=true' in gradle.properties. Then rebuild the native binary. Stripe cannot run in Expo Go.";
|
|
@@ -34087,10 +34605,10 @@ function loadStripeSdk() {
|
|
|
34087
34605
|
}
|
|
34088
34606
|
|
|
34089
34607
|
// src/fiat/providers/stripe/useStripeOnrampClient.ts
|
|
34090
|
-
import { useCallback as useCallback37, useEffect as
|
|
34608
|
+
import { useCallback as useCallback37, useEffect as useEffect91, useMemo as useMemo41, useRef as useRef66 } from "react";
|
|
34091
34609
|
|
|
34092
34610
|
// src/fiat/providers/stripe/stripeApplePayButton.tsx
|
|
34093
|
-
import { jsx as
|
|
34611
|
+
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
34094
34612
|
var APPLE_WHITE = "#FFFFFF";
|
|
34095
34613
|
var APPLE_BLACK = "#000000";
|
|
34096
34614
|
function bindStripeApplePayButton({
|
|
@@ -34102,7 +34620,7 @@ function bindStripeApplePayButton({
|
|
|
34102
34620
|
const height = theme.sizes.buttonLg;
|
|
34103
34621
|
const radius = buttonRadius(theme, height);
|
|
34104
34622
|
const onDark = isDarkColor(theme.background.modal);
|
|
34105
|
-
return /* @__PURE__ */
|
|
34623
|
+
return /* @__PURE__ */ jsx172(
|
|
34106
34624
|
DepositActionLayers,
|
|
34107
34625
|
{
|
|
34108
34626
|
stateKey: "apple-pay",
|
|
@@ -34110,7 +34628,7 @@ function bindStripeApplePayButton({
|
|
|
34110
34628
|
radius,
|
|
34111
34629
|
fillOpacity: disabled ? 0 : 1,
|
|
34112
34630
|
style: { height },
|
|
34113
|
-
children: /* @__PURE__ */
|
|
34631
|
+
children: /* @__PURE__ */ jsx172(
|
|
34114
34632
|
PlatformPayButton,
|
|
34115
34633
|
{
|
|
34116
34634
|
type: PlatformPay.ButtonType.InStore,
|
|
@@ -34157,15 +34675,18 @@ function useStripeOnrampClient({
|
|
|
34157
34675
|
config.urlScheme ?? ""
|
|
34158
34676
|
].join("\0");
|
|
34159
34677
|
const readyRef = useRef66(void 0);
|
|
34678
|
+
const configRef = useRef66(config);
|
|
34679
|
+
configRef.current = config;
|
|
34160
34680
|
const ensureReady = useCallback37(() => {
|
|
34681
|
+
const config2 = configRef.current;
|
|
34161
34682
|
if (readyRef.current?.key !== configKey || readyRef.current.scheme !== scheme) {
|
|
34162
34683
|
const promise = initStripe({
|
|
34163
|
-
publishableKey:
|
|
34164
|
-
merchantIdentifier:
|
|
34165
|
-
urlScheme:
|
|
34684
|
+
publishableKey: config2.publishableKey,
|
|
34685
|
+
merchantIdentifier: config2.merchantIdentifier,
|
|
34686
|
+
urlScheme: config2.urlScheme
|
|
34166
34687
|
}).then(async () => {
|
|
34167
34688
|
const configured = await configure({
|
|
34168
|
-
merchantDisplayName:
|
|
34689
|
+
merchantDisplayName: config2.merchantDisplayName,
|
|
34169
34690
|
appearance: {
|
|
34170
34691
|
style: scheme === "dark" ? "ALWAYS_DARK" : "ALWAYS_LIGHT"
|
|
34171
34692
|
}
|
|
@@ -34183,8 +34704,8 @@ function useStripeOnrampClient({
|
|
|
34183
34704
|
return promise;
|
|
34184
34705
|
}
|
|
34185
34706
|
return readyRef.current.promise;
|
|
34186
|
-
}, [
|
|
34187
|
-
|
|
34707
|
+
}, [configKey, configure, initStripe, scheme]);
|
|
34708
|
+
useEffect91(() => {
|
|
34188
34709
|
void ensureReady().catch((error) => {
|
|
34189
34710
|
logger.warn("connect-rn:stripe_init_failed", {
|
|
34190
34711
|
error: error instanceof Error ? error.message : error
|
|
@@ -34272,10 +34793,10 @@ function useStripeOnrampClient({
|
|
|
34272
34793
|
}
|
|
34273
34794
|
|
|
34274
34795
|
// src/fiat/providers/stripe/stripeOnrampBridge.tsx
|
|
34275
|
-
import { jsx as
|
|
34796
|
+
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
34276
34797
|
function StripeOnrampBridge(props) {
|
|
34277
34798
|
const [sdk, setSdk] = useState73(void 0);
|
|
34278
|
-
|
|
34799
|
+
useEffect92(() => {
|
|
34279
34800
|
let cancelled = false;
|
|
34280
34801
|
loadStripeSdk().then((loaded) => {
|
|
34281
34802
|
if (cancelled) {
|
|
@@ -34298,7 +34819,7 @@ function StripeOnrampBridge(props) {
|
|
|
34298
34819
|
if (sdk === void 0) {
|
|
34299
34820
|
return null;
|
|
34300
34821
|
}
|
|
34301
|
-
return /* @__PURE__ */
|
|
34822
|
+
return /* @__PURE__ */ jsx173(StripeOnrampClientBinder, { sdk, ...props });
|
|
34302
34823
|
}
|
|
34303
34824
|
function StripeOnrampClientBinder({
|
|
34304
34825
|
sdk,
|
|
@@ -34306,7 +34827,7 @@ function StripeOnrampClientBinder({
|
|
|
34306
34827
|
onClient
|
|
34307
34828
|
}) {
|
|
34308
34829
|
const client = useStripeOnrampClient(sdk, config);
|
|
34309
|
-
|
|
34830
|
+
useEffect92(() => {
|
|
34310
34831
|
onClient(client);
|
|
34311
34832
|
return () => onClient(void 0);
|
|
34312
34833
|
}, [client, onClient]);
|
|
@@ -34314,7 +34835,7 @@ function StripeOnrampClientBinder({
|
|
|
34314
34835
|
}
|
|
34315
34836
|
|
|
34316
34837
|
// src/flow/FunkitFlowProvider.tsx
|
|
34317
|
-
import { jsx as
|
|
34838
|
+
import { jsx as jsx174, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
34318
34839
|
var CRYPTO_WITHDRAWAL_STEPS = /* @__PURE__ */ new Set([
|
|
34319
34840
|
"withdrawAmount",
|
|
34320
34841
|
"withdrawAddress",
|
|
@@ -34404,7 +34925,7 @@ function FunkitFlowProvider({
|
|
|
34404
34925
|
setRootHeight(event.nativeEvent.layout.height);
|
|
34405
34926
|
}, []);
|
|
34406
34927
|
const [stripeOnrampClient, setStripeOnrampClient] = useState74(void 0);
|
|
34407
|
-
const isV2DepositGateOn =
|
|
34928
|
+
const isV2DepositGateOn = useFeatureGate6(RN_V2_DEPOSIT_GATE);
|
|
34408
34929
|
const isV2DepositEnabled = isV2DepositGateOn || isV2DepositCustomer(apiKey);
|
|
34409
34930
|
const nativeCapabilities = useMemo42(
|
|
34410
34931
|
() => ({
|
|
@@ -34621,18 +35142,18 @@ function FunkitFlowProvider({
|
|
|
34621
35142
|
() => ({ navigate, back, reset, popTo, closeFlow }),
|
|
34622
35143
|
[navigate, back, reset, popTo, closeFlow]
|
|
34623
35144
|
);
|
|
34624
|
-
return /* @__PURE__ */
|
|
34625
|
-
stripeOnramp === void 0 ? null : /* @__PURE__ */
|
|
35145
|
+
return /* @__PURE__ */ jsxs75(FunkitFlowContext.Provider, { value, children: [
|
|
35146
|
+
stripeOnramp === void 0 ? null : /* @__PURE__ */ jsx174(
|
|
34626
35147
|
StripeOnrampBridge,
|
|
34627
35148
|
{
|
|
34628
35149
|
config: stripeOnramp,
|
|
34629
35150
|
onClient: setStripeOnrampClient
|
|
34630
35151
|
}
|
|
34631
35152
|
),
|
|
34632
|
-
state.isOpen && state.flow?.mode === "deposit" ? /* @__PURE__ */
|
|
34633
|
-
/* @__PURE__ */
|
|
34634
|
-
/* @__PURE__ */
|
|
34635
|
-
/* @__PURE__ */
|
|
35153
|
+
state.isOpen && state.flow?.mode === "deposit" ? /* @__PURE__ */ jsx174(GeoblockReporter, { onChange: setIsGeoblocked }) : null,
|
|
35154
|
+
/* @__PURE__ */ jsx174(DepositPreload, {}),
|
|
35155
|
+
/* @__PURE__ */ jsx174(FlowDismissLockProvider, { value: acquireDismissLock, children: /* @__PURE__ */ jsx174(NativeCapabilitiesProvider, { capabilities: nativeCapabilities, children: /* @__PURE__ */ jsx174(View39, { style: rootContainer, onLayout: onRootLayout, children: /* @__PURE__ */ jsxs75(FlowContainerHeightProvider, { height: rootHeight, children: [
|
|
35156
|
+
/* @__PURE__ */ jsx174(
|
|
34636
35157
|
FlowSheet,
|
|
34637
35158
|
{
|
|
34638
35159
|
isOpen: state.isOpen,
|
|
@@ -34654,12 +35175,12 @@ function FunkitFlowProvider({
|
|
|
34654
35175
|
controlRef: sheetControl,
|
|
34655
35176
|
content: (
|
|
34656
35177
|
// Mounted only while open so the flow queries run only then.
|
|
34657
|
-
state.isOpen && state.flow ? /* @__PURE__ */
|
|
35178
|
+
state.isOpen && state.flow ? /* @__PURE__ */ jsx174(
|
|
34658
35179
|
ActiveFlowPreview,
|
|
34659
35180
|
{
|
|
34660
35181
|
deposit: state.preview?.deposit,
|
|
34661
35182
|
withdrawal: state.preview?.withdrawal,
|
|
34662
|
-
children: state.flow.mode === "deposit" ? /* @__PURE__ */
|
|
35183
|
+
children: state.flow.mode === "deposit" ? /* @__PURE__ */ jsx174(StoredChainProvider, { value: storedChain, children: /* @__PURE__ */ jsx174(
|
|
34663
35184
|
FlowContent,
|
|
34664
35185
|
{
|
|
34665
35186
|
checkoutId: state.flow.checkoutId,
|
|
@@ -34672,7 +35193,7 @@ function FunkitFlowProvider({
|
|
|
34672
35193
|
callbacks: state.flow.callbacks
|
|
34673
35194
|
},
|
|
34674
35195
|
state.flow.checkoutId
|
|
34675
|
-
) }) : /* @__PURE__ */
|
|
35196
|
+
) }) : /* @__PURE__ */ jsx174(
|
|
34676
35197
|
WithdrawalFlowContent,
|
|
34677
35198
|
{
|
|
34678
35199
|
checkoutId: state.flow.checkoutId,
|
|
@@ -34734,10 +35255,10 @@ function usePendingOpens(state, setState) {
|
|
|
34734
35255
|
pending.current = waiting;
|
|
34735
35256
|
done.forEach((p) => p.resolve());
|
|
34736
35257
|
};
|
|
34737
|
-
|
|
35258
|
+
useEffect93(() => {
|
|
34738
35259
|
settle(state.isOpen ? state.session : Number.POSITIVE_INFINITY);
|
|
34739
35260
|
}, [state]);
|
|
34740
|
-
|
|
35261
|
+
useEffect93(() => () => settle(Number.POSITIVE_INFINITY), []);
|
|
34741
35262
|
return useMemo42(
|
|
34742
35263
|
() => ({
|
|
34743
35264
|
open: (next) => new Promise((resolve2) => {
|
|
@@ -34761,7 +35282,7 @@ function openSessionUnder(previousTrace, openSession) {
|
|
|
34761
35282
|
}
|
|
34762
35283
|
}
|
|
34763
35284
|
function useFlowTraceLifetime(openTraceId) {
|
|
34764
|
-
|
|
35285
|
+
useEffect93(() => {
|
|
34765
35286
|
if (openTraceId === void 0) {
|
|
34766
35287
|
return;
|
|
34767
35288
|
}
|
|
@@ -34835,7 +35356,7 @@ function sameIdentity(a, b) {
|
|
|
34835
35356
|
}
|
|
34836
35357
|
|
|
34837
35358
|
// src/version.ts
|
|
34838
|
-
var CONNECT_RN_VERSION = true ? "9.1.
|
|
35359
|
+
var CONNECT_RN_VERSION = true ? "9.1.2" : "0.0.0-dev";
|
|
34839
35360
|
|
|
34840
35361
|
// src/providers/FunkitStatsigProvider.tsx
|
|
34841
35362
|
import {
|
|
@@ -34843,7 +35364,7 @@ import {
|
|
|
34843
35364
|
LogLevel,
|
|
34844
35365
|
StatsigProvider
|
|
34845
35366
|
} from "@statsig/react-bindings";
|
|
34846
|
-
import { useEffect as
|
|
35367
|
+
import { useEffect as useEffect94, useMemo as useMemo43 } from "react";
|
|
34847
35368
|
|
|
34848
35369
|
// src/statsig/useClientAsyncInitRN.ts
|
|
34849
35370
|
import {
|
|
@@ -35028,7 +35549,7 @@ function useClientAsyncInitRN(sdkKey, initialUser, statsigOptions = null) {
|
|
|
35028
35549
|
}
|
|
35029
35550
|
|
|
35030
35551
|
// src/providers/FunkitStatsigProvider.tsx
|
|
35031
|
-
import { jsx as
|
|
35552
|
+
import { jsx as jsx175 } from "react/jsx-runtime";
|
|
35032
35553
|
var STATSIG_API = "https://data-api.fun.xyz/v1";
|
|
35033
35554
|
var STATSIG_CLIENT_KEY = "client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM";
|
|
35034
35555
|
var STATSIG_SDK_TYPE = "react-native";
|
|
@@ -35064,7 +35585,7 @@ function FunkitStatsigProvider({
|
|
|
35064
35585
|
tier: isDevelopment ? "development" : "production"
|
|
35065
35586
|
}
|
|
35066
35587
|
});
|
|
35067
|
-
|
|
35588
|
+
useEffect94(() => {
|
|
35068
35589
|
if (isLoading) {
|
|
35069
35590
|
return;
|
|
35070
35591
|
}
|
|
@@ -35076,11 +35597,11 @@ function FunkitStatsigProvider({
|
|
|
35076
35597
|
client.updateUserAsync(user).catch((error) => logger.error("statsig:updateUser:error", error));
|
|
35077
35598
|
}
|
|
35078
35599
|
}, [client, isLoading, user, apiKey, userId]);
|
|
35079
|
-
return /* @__PURE__ */
|
|
35600
|
+
return /* @__PURE__ */ jsx175(StatsigProvider, { client, children });
|
|
35080
35601
|
}
|
|
35081
35602
|
|
|
35082
35603
|
// src/providers/FunkitProvider.tsx
|
|
35083
|
-
import { jsx as
|
|
35604
|
+
import { jsx as jsx176 } from "react/jsx-runtime";
|
|
35084
35605
|
var ANONYMOUS_CONFIG = { apiKey: "" };
|
|
35085
35606
|
var IS_DEV_BUILD2 = typeof __DEV__ !== "undefined" && !!__DEV__;
|
|
35086
35607
|
function createFallbackQueryClient() {
|
|
@@ -35119,13 +35640,13 @@ function FunkitProvider({
|
|
|
35119
35640
|
() => resolveFunkitIdentity(identityProps.config, identityProps.walletAddress),
|
|
35120
35641
|
[identityProps]
|
|
35121
35642
|
);
|
|
35122
|
-
|
|
35643
|
+
useEffect95(() => {
|
|
35123
35644
|
if (!identity.apiKey) {
|
|
35124
35645
|
return;
|
|
35125
35646
|
}
|
|
35126
35647
|
logger.configure(identity.apiKey, debug, CONNECT_RN_VERSION);
|
|
35127
35648
|
}, [identity.apiKey, debug]);
|
|
35128
|
-
|
|
35649
|
+
useEffect95(() => {
|
|
35129
35650
|
logger.setUserInfo(
|
|
35130
35651
|
identity.userId,
|
|
35131
35652
|
identity.walletAddress,
|
|
@@ -35134,13 +35655,13 @@ function FunkitProvider({
|
|
|
35134
35655
|
""
|
|
35135
35656
|
);
|
|
35136
35657
|
}, [identity]);
|
|
35137
|
-
return /* @__PURE__ */
|
|
35658
|
+
return /* @__PURE__ */ jsx176(SafeAreaProvider2, { children: /* @__PURE__ */ jsx176(
|
|
35138
35659
|
FunkitStatsigProvider,
|
|
35139
35660
|
{
|
|
35140
35661
|
apiKey: identity.apiKey,
|
|
35141
35662
|
userId: identity.userId,
|
|
35142
35663
|
isDevelopment: debug,
|
|
35143
|
-
children: /* @__PURE__ */
|
|
35664
|
+
children: /* @__PURE__ */ jsx176(QueryClientProvider, { client, children: /* @__PURE__ */ jsx176(FunkitIdentityProvider, { identity, children: /* @__PURE__ */ jsx176(FunkitBrandingProvider, { hideAttribution: config?.hideAttribution, children: /* @__PURE__ */ jsx176(FunkitThemeProvider, { themes, colorScheme, children: /* @__PURE__ */ jsx176(FunkitI18nProvider, { locale, children: /* @__PURE__ */ jsx176(FunkitHapticsProvider, { hapticFeedback, children: /* @__PURE__ */ jsx176(
|
|
35144
35665
|
FunkitFlowProvider,
|
|
35145
35666
|
{
|
|
35146
35667
|
copyToClipboard: copyToClipboard2,
|