@funkit/connect-rn 9.6.0 → 9.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/index.js +326 -243
- package/dist/index.js.map +3 -3
- package/dist/src/fiat/providers/stripe/stripeCheckout.d.ts +1 -0
- package/dist/src/fiat/providers/stripe/stripeCheckout.d.ts.map +1 -1
- package/dist/src/fiat/providers/stripe/stripeErrorDetail.d.ts.map +1 -1
- package/dist/src/flow/FlowSheet.d.ts +3 -1
- package/dist/src/flow/FlowSheet.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -619,7 +619,7 @@ function useFunkitThemePair() {
|
|
|
619
619
|
|
|
620
620
|
// src/providers/FunkitProvider.tsx
|
|
621
621
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
622
|
-
import { useEffect as useEffect120, useMemo as
|
|
622
|
+
import { useEffect as useEffect120, useMemo as useMemo54, useRef as useRef96 } from "react";
|
|
623
623
|
import { SafeAreaProvider as SafeAreaProvider2 } from "react-native-safe-area-context";
|
|
624
624
|
|
|
625
625
|
// src/providers/BrandingContext.tsx
|
|
@@ -646,12 +646,12 @@ import {
|
|
|
646
646
|
} from "@funkit/connect-core";
|
|
647
647
|
import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
648
648
|
import {
|
|
649
|
-
createContext as
|
|
649
|
+
createContext as createContext17,
|
|
650
650
|
useCallback as useCallback52,
|
|
651
|
-
useContext as
|
|
651
|
+
useContext as useContext19,
|
|
652
652
|
useEffect as useEffect118,
|
|
653
653
|
useLayoutEffect as useLayoutEffect6,
|
|
654
|
-
useMemo as
|
|
654
|
+
useMemo as useMemo51,
|
|
655
655
|
useRef as useRef94,
|
|
656
656
|
useState as useState97
|
|
657
657
|
} from "react";
|
|
@@ -1862,7 +1862,7 @@ import { useStatsigClient as useStatsigClient2 } from "@statsig/react-bindings";
|
|
|
1862
1862
|
import {
|
|
1863
1863
|
useCallback as useCallback43,
|
|
1864
1864
|
useEffect as useEffect106,
|
|
1865
|
-
useMemo as
|
|
1865
|
+
useMemo as useMemo43,
|
|
1866
1866
|
useRef as useRef83,
|
|
1867
1867
|
useState as useState85
|
|
1868
1868
|
} from "react";
|
|
@@ -4906,7 +4906,7 @@ function useDepositAssets({
|
|
|
4906
4906
|
}
|
|
4907
4907
|
|
|
4908
4908
|
// src/flow/DepositAssetPicker.tsx
|
|
4909
|
-
import { useMemo as
|
|
4909
|
+
import { useMemo as useMemo11 } from "react";
|
|
4910
4910
|
|
|
4911
4911
|
// src/screens/TokenAndChainPickerScreen.tsx
|
|
4912
4912
|
import {
|
|
@@ -5742,13 +5742,21 @@ import {
|
|
|
5742
5742
|
useBottomSheetTimingConfigs
|
|
5743
5743
|
} from "@gorhom/bottom-sheet";
|
|
5744
5744
|
import {
|
|
5745
|
+
createContext as createContext10,
|
|
5745
5746
|
useCallback as useCallback8,
|
|
5747
|
+
useContext as useContext10,
|
|
5746
5748
|
useEffect as useEffect18,
|
|
5747
5749
|
useImperativeHandle,
|
|
5750
|
+
useMemo as useMemo10,
|
|
5748
5751
|
useRef as useRef11
|
|
5749
5752
|
} from "react";
|
|
5750
5753
|
import { Pressable as Pressable10, StyleSheet as StyleSheet18, View as View8 } from "react-native";
|
|
5751
|
-
import Animated9, {
|
|
5754
|
+
import Animated9, {
|
|
5755
|
+
Easing as Easing4,
|
|
5756
|
+
useAnimatedStyle as useAnimatedStyle5,
|
|
5757
|
+
useSharedValue as useSharedValue4,
|
|
5758
|
+
withSpring as withSpring2
|
|
5759
|
+
} from "react-native-reanimated";
|
|
5752
5760
|
import { useSafeAreaInsets as useSafeAreaInsets4 } from "react-native-safe-area-context";
|
|
5753
5761
|
|
|
5754
5762
|
// src/flow/sheetSizing.ts
|
|
@@ -5913,6 +5921,7 @@ function useV2DrawerMotion() {
|
|
|
5913
5921
|
// src/flow/FlowSheet.tsx
|
|
5914
5922
|
import { jsx as jsx38, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5915
5923
|
var insetSheet = { marginHorizontal: CRYPTO_SHEET_INSET };
|
|
5924
|
+
var ResizingSheet = createContext10(null);
|
|
5916
5925
|
var INSTANT = { duration: 0 };
|
|
5917
5926
|
var LOCKED_PAN_ACTIVATION = [-1e5, 1e5];
|
|
5918
5927
|
function FlowSheet({
|
|
@@ -5926,6 +5935,7 @@ function FlowSheet({
|
|
|
5926
5935
|
dismissLocked = false,
|
|
5927
5936
|
fullHeight = false,
|
|
5928
5937
|
insetDetents,
|
|
5938
|
+
resizeInPlace = false,
|
|
5929
5939
|
glass = false,
|
|
5930
5940
|
hidden = false,
|
|
5931
5941
|
animateTransitions = true,
|
|
@@ -6049,6 +6059,17 @@ function FlowSheet({
|
|
|
6049
6059
|
easing: Easing4.bezier(0.22, 1, 0.36, 1)
|
|
6050
6060
|
});
|
|
6051
6061
|
const v2AnimationConfigs = useV2DrawerMotion();
|
|
6062
|
+
const inset = insetDetents !== void 0;
|
|
6063
|
+
const gap = useSharedValue4(inset ? CRYPTO_SHEET_INSET : 0);
|
|
6064
|
+
useEffect18(() => {
|
|
6065
|
+
if (resizeInPlace) {
|
|
6066
|
+
gap.value = withSpring2(inset ? CRYPTO_SHEET_INSET : 0, v2AnimationConfigs);
|
|
6067
|
+
}
|
|
6068
|
+
}, [resizeInPlace, inset, gap, v2AnimationConfigs]);
|
|
6069
|
+
const resizingSheet = useMemo10(
|
|
6070
|
+
() => resizeInPlace ? { inset, gap } : null,
|
|
6071
|
+
[resizeInPlace, inset, gap]
|
|
6072
|
+
);
|
|
6052
6073
|
const renderBackdropBlur = useBackdropBlur();
|
|
6053
6074
|
const blurBehindOverlay = glass ? null : renderBackdropBlur;
|
|
6054
6075
|
const renderBackdrop = useCallback8(
|
|
@@ -6091,7 +6112,7 @@ function FlowSheet({
|
|
|
6091
6112
|
),
|
|
6092
6113
|
[blurBehindOverlay, closeUnlessLocked, glass, theme.background.overlay, t]
|
|
6093
6114
|
);
|
|
6094
|
-
|
|
6115
|
+
const sheet3 = /* @__PURE__ */ jsxs17(BottomSheetModalProvider, { children: [
|
|
6095
6116
|
children,
|
|
6096
6117
|
/* @__PURE__ */ jsx38(
|
|
6097
6118
|
BottomSheetModal,
|
|
@@ -6102,7 +6123,7 @@ function FlowSheet({
|
|
|
6102
6123
|
activeOffsetY: dismissLocked || pressHold.held ? LOCKED_PAN_ACTIVATION : void 0,
|
|
6103
6124
|
...insetDetents ? insetSheetSizing(insetDetents, CRYPTO_SHEET_INSET) : sheetSizing({ detent: fullHeight ? "100%" : void 0 }),
|
|
6104
6125
|
topInset: fullHeight || insetDetents ? 0 : insets.top,
|
|
6105
|
-
style: insetDetents ? insetSheet : void 0,
|
|
6126
|
+
style: !resizeInPlace && insetDetents ? insetSheet : void 0,
|
|
6106
6127
|
enablePanDownToClose: enableSwipeToDismiss && !dismissLocked,
|
|
6107
6128
|
animationConfigs: glass ? v2AnimationConfigs : animationConfigs,
|
|
6108
6129
|
onAnimate: handleAnimate,
|
|
@@ -6111,7 +6132,7 @@ function FlowSheet({
|
|
|
6111
6132
|
enableDismissOnClose: false,
|
|
6112
6133
|
backdropComponent: renderBackdrop,
|
|
6113
6134
|
handleComponent: null,
|
|
6114
|
-
backgroundComponent: sheetBackground(insetDetents, glass),
|
|
6135
|
+
backgroundComponent: resizeInPlace ? ResizingGlassSheetBackground : sheetBackground(insetDetents, glass),
|
|
6115
6136
|
children: /* @__PURE__ */ jsxs17(
|
|
6116
6137
|
BottomSheetView,
|
|
6117
6138
|
{
|
|
@@ -6127,6 +6148,7 @@ function FlowSheet({
|
|
|
6127
6148
|
}
|
|
6128
6149
|
)
|
|
6129
6150
|
] });
|
|
6151
|
+
return /* @__PURE__ */ jsx38(ResizingSheet.Provider, { value: resizingSheet, children: sheet3 });
|
|
6130
6152
|
}
|
|
6131
6153
|
function SheetFrame({
|
|
6132
6154
|
fullHeight,
|
|
@@ -6134,9 +6156,19 @@ function SheetFrame({
|
|
|
6134
6156
|
children
|
|
6135
6157
|
}) {
|
|
6136
6158
|
const { animatedLayoutState, animatedPosition } = useBottomSheetInternal();
|
|
6159
|
+
const resizing = useContext10(ResizingSheet);
|
|
6137
6160
|
const frame = useAnimatedStyle5(() => {
|
|
6138
6161
|
"worklet";
|
|
6139
6162
|
const { containerHeight } = animatedLayoutState.get();
|
|
6163
|
+
if (resizing && containerHeight > 0) {
|
|
6164
|
+
return {
|
|
6165
|
+
height: Math.max(
|
|
6166
|
+
0,
|
|
6167
|
+
containerHeight - animatedPosition.get() - resizing.gap.value
|
|
6168
|
+
),
|
|
6169
|
+
marginHorizontal: resizing.gap.value
|
|
6170
|
+
};
|
|
6171
|
+
}
|
|
6140
6172
|
if (insetDetents !== void 0) {
|
|
6141
6173
|
return {
|
|
6142
6174
|
height: insetCardHeight(
|
|
@@ -6162,6 +6194,28 @@ function FlowSheetBackground(props) {
|
|
|
6162
6194
|
var GLASS_SURFACE_OPACITY = 0.8;
|
|
6163
6195
|
var GLASS_DARK_MATERIAL = "#000000";
|
|
6164
6196
|
var GLASS_OVERLAY = "transparent";
|
|
6197
|
+
function ResizingGlassSheetBackground(props) {
|
|
6198
|
+
const resizing = useContext10(ResizingSheet);
|
|
6199
|
+
const { animatedLayoutState, animatedPosition } = useBottomSheetInternal();
|
|
6200
|
+
const shape = useAnimatedStyle5(() => {
|
|
6201
|
+
"worklet";
|
|
6202
|
+
const { containerHeight } = animatedLayoutState.get();
|
|
6203
|
+
const gap = resizing?.gap.value ?? 0;
|
|
6204
|
+
return {
|
|
6205
|
+
left: gap,
|
|
6206
|
+
right: gap,
|
|
6207
|
+
height: Math.max(0, containerHeight - animatedPosition.get() - gap)
|
|
6208
|
+
};
|
|
6209
|
+
});
|
|
6210
|
+
return /* @__PURE__ */ jsx38(Animated9.View, { pointerEvents: "none", style: [props.style, shape], children: /* @__PURE__ */ jsx38(
|
|
6211
|
+
GlassSheetBackground,
|
|
6212
|
+
{
|
|
6213
|
+
...props,
|
|
6214
|
+
nested: resizing?.inset,
|
|
6215
|
+
style: StyleSheet18.absoluteFill
|
|
6216
|
+
}
|
|
6217
|
+
) });
|
|
6218
|
+
}
|
|
6165
6219
|
function sheetBackground(insetDetents, glass) {
|
|
6166
6220
|
if (insetDetents !== void 0) {
|
|
6167
6221
|
return InsetGlassSheetBackground;
|
|
@@ -6565,7 +6619,7 @@ function DepositAssetPicker({
|
|
|
6565
6619
|
const height = useNestedSheetHeight();
|
|
6566
6620
|
const theme = useTheme();
|
|
6567
6621
|
const selectedAsset = selectedToken ? assets.find((asset) => asset.id === assetId(selectedToken.symbol)) : void 0;
|
|
6568
|
-
const tokens =
|
|
6622
|
+
const tokens = useMemo11(
|
|
6569
6623
|
() => assets.map((asset) => ({
|
|
6570
6624
|
symbol: asset.symbol,
|
|
6571
6625
|
chainIds: asset.tokens.map((token) => token.chainId)
|
|
@@ -6610,7 +6664,7 @@ function DepositAssetPicker({
|
|
|
6610
6664
|
}
|
|
6611
6665
|
|
|
6612
6666
|
// src/flow/useDepositSelection.ts
|
|
6613
|
-
import { useMemo as
|
|
6667
|
+
import { useMemo as useMemo12 } from "react";
|
|
6614
6668
|
|
|
6615
6669
|
// src/transfer/depositSelection.ts
|
|
6616
6670
|
import {
|
|
@@ -6628,7 +6682,7 @@ function useDepositSelection({
|
|
|
6628
6682
|
checkoutId,
|
|
6629
6683
|
onChange
|
|
6630
6684
|
}) {
|
|
6631
|
-
const tokenSymbols =
|
|
6685
|
+
const tokenSymbols = useMemo12(
|
|
6632
6686
|
() => assets.map((asset) => asset.symbol),
|
|
6633
6687
|
[assets]
|
|
6634
6688
|
);
|
|
@@ -6636,7 +6690,7 @@ function useDepositSelection({
|
|
|
6636
6690
|
const selectedTokenSymbol = assets.find(
|
|
6637
6691
|
(asset) => selectedSymbol && asset.id === assetId(selectedSymbol)
|
|
6638
6692
|
)?.symbol;
|
|
6639
|
-
const disabledChainIds =
|
|
6693
|
+
const disabledChainIds = useMemo12(() => {
|
|
6640
6694
|
if (!selectedSymbol) {
|
|
6641
6695
|
return [];
|
|
6642
6696
|
}
|
|
@@ -7546,7 +7600,7 @@ import Svg3, { Path as Path2 } from "react-native-svg";
|
|
|
7546
7600
|
import { SvgCss as SvgCss2 } from "react-native-svg/css";
|
|
7547
7601
|
|
|
7548
7602
|
// src/transfer/DepositQrCode.tsx
|
|
7549
|
-
import { useMemo as
|
|
7603
|
+
import { useMemo as useMemo13 } from "react";
|
|
7550
7604
|
import Svg2, { Path, Rect as Rect2 } from "react-native-svg";
|
|
7551
7605
|
|
|
7552
7606
|
// src/transfer/qrModules.ts
|
|
@@ -7658,7 +7712,7 @@ function DepositQrCode({
|
|
|
7658
7712
|
ecl = "H"
|
|
7659
7713
|
}) {
|
|
7660
7714
|
const theme = useTheme();
|
|
7661
|
-
const { count, modules } =
|
|
7715
|
+
const { count, modules } = useMemo13(
|
|
7662
7716
|
() => depositQrShape(value, ecl),
|
|
7663
7717
|
[value, ecl]
|
|
7664
7718
|
);
|
|
@@ -8269,13 +8323,13 @@ import { useCallback as useCallback9, useState as useState20 } from "react";
|
|
|
8269
8323
|
import { useSafeAreaInsets as useSafeAreaInsets8 } from "react-native-safe-area-context";
|
|
8270
8324
|
|
|
8271
8325
|
// src/flow/FlowDismissLock.tsx
|
|
8272
|
-
import { createContext as
|
|
8273
|
-
var FlowDismissLockContext =
|
|
8326
|
+
import { createContext as createContext11, useContext as useContext11, useEffect as useEffect23 } from "react";
|
|
8327
|
+
var FlowDismissLockContext = createContext11(
|
|
8274
8328
|
() => () => void 0
|
|
8275
8329
|
);
|
|
8276
8330
|
var FlowDismissLockProvider = FlowDismissLockContext.Provider;
|
|
8277
8331
|
function useLockFlowDismiss(locked) {
|
|
8278
|
-
const acquire =
|
|
8332
|
+
const acquire = useContext11(FlowDismissLockContext);
|
|
8279
8333
|
useEffect23(() => locked ? acquire() : void 0, [locked, acquire]);
|
|
8280
8334
|
}
|
|
8281
8335
|
|
|
@@ -8284,7 +8338,7 @@ import {
|
|
|
8284
8338
|
getSwappedOrigin as getSwappedOrigin2
|
|
8285
8339
|
} from "@funkit/connect-core";
|
|
8286
8340
|
import { useTheme as useTheme2 } from "@shopify/restyle";
|
|
8287
|
-
import { useEffect as useEffect24, useMemo as
|
|
8341
|
+
import { useEffect as useEffect24, useMemo as useMemo14, useRef as useRef13, useState as useState19 } from "react";
|
|
8288
8342
|
import {
|
|
8289
8343
|
ActivityIndicator,
|
|
8290
8344
|
BackHandler,
|
|
@@ -8584,7 +8638,7 @@ function SwappedWebView({
|
|
|
8584
8638
|
const webViewRef = useRef13(null);
|
|
8585
8639
|
const canGoBackRef = useRef13(false);
|
|
8586
8640
|
const lastCommittedUrlRef = useRef13(url);
|
|
8587
|
-
const { transport, dispatch } =
|
|
8641
|
+
const { transport, dispatch } = useMemo14(
|
|
8588
8642
|
() => createWebViewSwappedTransport({
|
|
8589
8643
|
getWebView: () => webViewRef.current
|
|
8590
8644
|
}),
|
|
@@ -8592,7 +8646,7 @@ function SwappedWebView({
|
|
|
8592
8646
|
);
|
|
8593
8647
|
const theme = useTheme2();
|
|
8594
8648
|
const { colorScheme } = useFunkitColorScheme();
|
|
8595
|
-
const swappedTheme =
|
|
8649
|
+
const swappedTheme = useMemo14(
|
|
8596
8650
|
() => ({
|
|
8597
8651
|
...buildSwappedThemeRN(theme, colorScheme === "dark"),
|
|
8598
8652
|
...buyingCrypto
|
|
@@ -8904,7 +8958,7 @@ import {
|
|
|
8904
8958
|
getSwappedBuyingCrypto,
|
|
8905
8959
|
useFeatureGate
|
|
8906
8960
|
} from "@funkit/connect-core";
|
|
8907
|
-
import { useMemo as
|
|
8961
|
+
import { useMemo as useMemo15 } from "react";
|
|
8908
8962
|
function useSwappedBuyingCrypto({
|
|
8909
8963
|
candidate,
|
|
8910
8964
|
showFiatDestinationToken
|
|
@@ -8912,7 +8966,7 @@ function useSwappedBuyingCrypto({
|
|
|
8912
8966
|
const isGateEnabled = useFeatureGate("enable-swapped-destination-token");
|
|
8913
8967
|
const tokenSymbol = candidate?.tokenSymbol;
|
|
8914
8968
|
const iconSrc = candidate?.iconSrc;
|
|
8915
|
-
return
|
|
8969
|
+
return useMemo15(() => {
|
|
8916
8970
|
if (!isGateEnabled || showFiatDestinationToken === false) {
|
|
8917
8971
|
return void 0;
|
|
8918
8972
|
}
|
|
@@ -9092,7 +9146,7 @@ import {
|
|
|
9092
9146
|
} from "@funkit/connect-core";
|
|
9093
9147
|
import { useTheme as useTheme3 } from "@shopify/restyle";
|
|
9094
9148
|
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
9095
|
-
import { useMemo as
|
|
9149
|
+
import { useMemo as useMemo17 } from "react";
|
|
9096
9150
|
|
|
9097
9151
|
// src/transfer/hooks/useTransferInit.ts
|
|
9098
9152
|
import {
|
|
@@ -9160,10 +9214,10 @@ function useDepositRecipient({
|
|
|
9160
9214
|
}
|
|
9161
9215
|
|
|
9162
9216
|
// src/transfer/hooks/useUDAParams.ts
|
|
9163
|
-
import { useMemo as
|
|
9217
|
+
import { useMemo as useMemo16 } from "react";
|
|
9164
9218
|
function useUDAParams(dynamicRoutingId) {
|
|
9165
9219
|
const udaParams = useDynamicConfig("uda_params");
|
|
9166
|
-
return
|
|
9220
|
+
return useMemo16(
|
|
9167
9221
|
() => udaParams?.find((param) => param.dynamicRoutingId === dynamicRoutingId)?.params,
|
|
9168
9222
|
[udaParams, dynamicRoutingId]
|
|
9169
9223
|
);
|
|
@@ -9304,7 +9358,7 @@ function useFopsQueryInput({
|
|
|
9304
9358
|
enabled
|
|
9305
9359
|
});
|
|
9306
9360
|
const theme = useTheme3();
|
|
9307
|
-
const themeConfig =
|
|
9361
|
+
const themeConfig = useMemo17(
|
|
9308
9362
|
() => buildSwappedThemeQueryParamsRN(theme),
|
|
9309
9363
|
[theme]
|
|
9310
9364
|
);
|
|
@@ -9473,7 +9527,7 @@ import {
|
|
|
9473
9527
|
resolveTokenTransferConfig
|
|
9474
9528
|
} from "@funkit/connect-core";
|
|
9475
9529
|
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
9476
|
-
import { useMemo as
|
|
9530
|
+
import { useMemo as useMemo18 } from "react";
|
|
9477
9531
|
|
|
9478
9532
|
// src/transfer/supportedTokens.ts
|
|
9479
9533
|
function buildSupportedTokenList(resolved) {
|
|
@@ -9523,7 +9577,7 @@ function useSupportedTokens({
|
|
|
9523
9577
|
staleTime: 5 * 6e4,
|
|
9524
9578
|
refetchOnWindowFocus: false
|
|
9525
9579
|
});
|
|
9526
|
-
const { tokens, chainFilters, prioritySymbols } =
|
|
9580
|
+
const { tokens, chainFilters, prioritySymbols } = useMemo18(() => {
|
|
9527
9581
|
if (!data) {
|
|
9528
9582
|
return {
|
|
9529
9583
|
tokens: [],
|
|
@@ -9605,14 +9659,14 @@ function QrCode({ value, size = 220, ecl = "H" }) {
|
|
|
9605
9659
|
|
|
9606
9660
|
// src/flow/DepositAmountStep.tsx
|
|
9607
9661
|
import { useDebouncedValue } from "@funkit/connect-core";
|
|
9608
|
-
import { useEffect as useEffect34, useMemo as
|
|
9662
|
+
import { useEffect as useEffect34, useMemo as useMemo19, useState as useState23 } from "react";
|
|
9609
9663
|
|
|
9610
9664
|
// src/hooks/useGuardedAmountInput.ts
|
|
9611
9665
|
import { USD_DECIMALS } from "@funkit/connect-core";
|
|
9612
9666
|
import { useCallback as useCallback13, useEffect as useEffect27, useRef as useRef15, useState as useState21 } from "react";
|
|
9613
9667
|
import {
|
|
9614
9668
|
useAnimatedStyle as useAnimatedStyle6,
|
|
9615
|
-
useSharedValue as
|
|
9669
|
+
useSharedValue as useSharedValue5,
|
|
9616
9670
|
withSequence,
|
|
9617
9671
|
withTiming as withTiming3
|
|
9618
9672
|
} from "react-native-reanimated";
|
|
@@ -9680,8 +9734,8 @@ function useGuardedAmountInput({
|
|
|
9680
9734
|
const [hasWarning, setHasWarning] = useState21(false);
|
|
9681
9735
|
const warningTimer = useRef15(void 0);
|
|
9682
9736
|
useEffect27(() => () => clearTimeout(warningTimer.current), []);
|
|
9683
|
-
const shake =
|
|
9684
|
-
const pulse =
|
|
9737
|
+
const shake = useSharedValue5(0);
|
|
9738
|
+
const pulse = useSharedValue5(1);
|
|
9685
9739
|
const feedbackStyle = useAnimatedStyle6(() => {
|
|
9686
9740
|
"worklet";
|
|
9687
9741
|
return {
|
|
@@ -9783,7 +9837,7 @@ import Animated17, {
|
|
|
9783
9837
|
Easing as Easing8,
|
|
9784
9838
|
useAnimatedStyle as useAnimatedStyle13,
|
|
9785
9839
|
useReducedMotion as useReducedMotion8,
|
|
9786
|
-
useSharedValue as
|
|
9840
|
+
useSharedValue as useSharedValue11,
|
|
9787
9841
|
withTiming as withTiming9
|
|
9788
9842
|
} from "react-native-reanimated";
|
|
9789
9843
|
import { useSafeAreaInsets as useSafeAreaInsets9 } from "react-native-safe-area-context";
|
|
@@ -10070,7 +10124,7 @@ var styles25 = StyleSheet26.create({
|
|
|
10070
10124
|
});
|
|
10071
10125
|
|
|
10072
10126
|
// src/components/v2/QuickAmountsRow.tsx
|
|
10073
|
-
import { memo, useContext as
|
|
10127
|
+
import { memo, useContext as useContext12 } from "react";
|
|
10074
10128
|
import { Animated as Animated11, Pressable as Pressable16, ScrollView as ScrollView2, StyleSheet as StyleSheet27 } from "react-native";
|
|
10075
10129
|
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
10076
10130
|
var LOADING_CHIP_COUNT = 4;
|
|
@@ -10122,7 +10176,7 @@ function QuickAmountChip({
|
|
|
10122
10176
|
stateKey,
|
|
10123
10177
|
label
|
|
10124
10178
|
}) {
|
|
10125
|
-
const animateDeposit =
|
|
10179
|
+
const animateDeposit = useContext12(DepositActionMotion);
|
|
10126
10180
|
const theme = useTheme();
|
|
10127
10181
|
const fillColor = withAlpha(theme.content.elements.primary, 0.07);
|
|
10128
10182
|
const text3 = label === void 0 ? null : /* @__PURE__ */ jsx54(
|
|
@@ -10200,7 +10254,7 @@ import Animated12, {
|
|
|
10200
10254
|
Easing as Easing5,
|
|
10201
10255
|
Keyframe as Keyframe3,
|
|
10202
10256
|
useAnimatedStyle as useAnimatedStyle7,
|
|
10203
|
-
useSharedValue as
|
|
10257
|
+
useSharedValue as useSharedValue6,
|
|
10204
10258
|
withTiming as withTiming4
|
|
10205
10259
|
} from "react-native-reanimated";
|
|
10206
10260
|
|
|
@@ -10415,8 +10469,8 @@ function useMountStagger(glyphs) {
|
|
|
10415
10469
|
return (key) => mountingKeys.length > 1 ? Math.max(0, mountingKeys.indexOf(key)) * DIGIT_STAGGER : 0;
|
|
10416
10470
|
}
|
|
10417
10471
|
function useFittedRow() {
|
|
10418
|
-
const scale =
|
|
10419
|
-
const translateX =
|
|
10472
|
+
const scale = useSharedValue6(1);
|
|
10473
|
+
const translateX = useSharedValue6(0);
|
|
10420
10474
|
const trackWidth = useRef16(void 0);
|
|
10421
10475
|
const rowWidth = useRef16(void 0);
|
|
10422
10476
|
const previous = useRef16(void 0);
|
|
@@ -10458,7 +10512,7 @@ function useFittedRow() {
|
|
|
10458
10512
|
return { onTrackLayout, onRowLayout, rowFit, rowPosition };
|
|
10459
10513
|
}
|
|
10460
10514
|
function useDimming(targetOpacity) {
|
|
10461
|
-
const opacity =
|
|
10515
|
+
const opacity = useSharedValue6(targetOpacity);
|
|
10462
10516
|
useEffect28(() => {
|
|
10463
10517
|
opacity.value = withTiming4(targetOpacity, MOTION_TIMING);
|
|
10464
10518
|
}, [opacity, targetOpacity]);
|
|
@@ -10536,8 +10590,8 @@ import { memo as memo3 } from "react";
|
|
|
10536
10590
|
import { Pressable as Pressable17, StyleSheet as StyleSheet29 } from "react-native";
|
|
10537
10591
|
import Animated13, {
|
|
10538
10592
|
useAnimatedStyle as useAnimatedStyle8,
|
|
10539
|
-
useSharedValue as
|
|
10540
|
-
withSpring as
|
|
10593
|
+
useSharedValue as useSharedValue7,
|
|
10594
|
+
withSpring as withSpring3,
|
|
10541
10595
|
withTiming as withTiming5
|
|
10542
10596
|
} from "react-native-reanimated";
|
|
10543
10597
|
|
|
@@ -10613,7 +10667,7 @@ var NumPadKey = memo3(function NumPadKey2({
|
|
|
10613
10667
|
onPress,
|
|
10614
10668
|
onLongPress
|
|
10615
10669
|
}) {
|
|
10616
|
-
const scale =
|
|
10670
|
+
const scale = useSharedValue7(1);
|
|
10617
10671
|
const pressScaling = useAnimatedStyle8(() => {
|
|
10618
10672
|
"worklet";
|
|
10619
10673
|
return { transform: [{ scale: scale.value }] };
|
|
@@ -10624,7 +10678,7 @@ var NumPadKey = memo3(function NumPadKey2({
|
|
|
10624
10678
|
});
|
|
10625
10679
|
};
|
|
10626
10680
|
const handlePressOut = () => {
|
|
10627
|
-
scale.value =
|
|
10681
|
+
scale.value = withSpring3(1, KEY_RELEASE_SPRING);
|
|
10628
10682
|
};
|
|
10629
10683
|
return /* @__PURE__ */ jsx57(
|
|
10630
10684
|
Pressable17,
|
|
@@ -10675,13 +10729,13 @@ import {
|
|
|
10675
10729
|
Easing as Easing6,
|
|
10676
10730
|
useAnimatedStyle as useAnimatedStyle9,
|
|
10677
10731
|
useReducedMotion as useReducedMotion5,
|
|
10678
|
-
useSharedValue as
|
|
10732
|
+
useSharedValue as useSharedValue8,
|
|
10679
10733
|
withTiming as withTiming6
|
|
10680
10734
|
} from "react-native-reanimated";
|
|
10681
10735
|
var FEE_FADE_TIMING = { duration: 100, easing: Easing6.linear };
|
|
10682
10736
|
function useSettledOpacity(pending, settledOnMount = false) {
|
|
10683
10737
|
const reduceMotion = useReducedMotion5();
|
|
10684
|
-
const visibility =
|
|
10738
|
+
const visibility = useSharedValue8(settledOnMount && !pending ? 1 : 0);
|
|
10685
10739
|
useEffect29(() => {
|
|
10686
10740
|
const target = pending ? 0 : 1;
|
|
10687
10741
|
if (reduceMotion) {
|
|
@@ -11033,10 +11087,10 @@ import {
|
|
|
11033
11087
|
useAnimatedReaction,
|
|
11034
11088
|
useAnimatedStyle as useAnimatedStyle11,
|
|
11035
11089
|
useReducedMotion as useReducedMotion6,
|
|
11036
|
-
useSharedValue as
|
|
11090
|
+
useSharedValue as useSharedValue9,
|
|
11037
11091
|
withDelay as withDelay2,
|
|
11038
11092
|
withSequence as withSequence2,
|
|
11039
|
-
withSpring as
|
|
11093
|
+
withSpring as withSpring4,
|
|
11040
11094
|
withTiming as withTiming7
|
|
11041
11095
|
} from "react-native-reanimated";
|
|
11042
11096
|
var DROP_SPRING = { duration: 600, dampingRatio: 0.8 };
|
|
@@ -11049,11 +11103,11 @@ function useMethodMerge(merged) {
|
|
|
11049
11103
|
const reduceMotion = useReducedMotion6();
|
|
11050
11104
|
const hapticFeedback = useHapticFeedback();
|
|
11051
11105
|
const initial2 = useRef17(merged ? 1 : 0).current;
|
|
11052
|
-
const travel =
|
|
11053
|
-
const absorb =
|
|
11054
|
-
const fill3 =
|
|
11055
|
-
const nudge =
|
|
11056
|
-
const hasLanded =
|
|
11106
|
+
const travel = useSharedValue9(initial2);
|
|
11107
|
+
const absorb = useSharedValue9(initial2);
|
|
11108
|
+
const fill3 = useSharedValue9(initial2);
|
|
11109
|
+
const nudge = useSharedValue9(0);
|
|
11110
|
+
const hasLanded = useSharedValue9(initial2 === 1);
|
|
11057
11111
|
const isFirstRun = useRef17(true);
|
|
11058
11112
|
useAnimatedReaction(
|
|
11059
11113
|
() => travel.value >= 1,
|
|
@@ -11086,7 +11140,7 @@ function useMethodMerge(merged) {
|
|
|
11086
11140
|
fill3.value = 1;
|
|
11087
11141
|
return;
|
|
11088
11142
|
}
|
|
11089
|
-
travel.value =
|
|
11143
|
+
travel.value = withSpring4(1, DROP_SPRING);
|
|
11090
11144
|
absorb.value = withTiming7(1, ABSORB_TIMING);
|
|
11091
11145
|
fill3.value = withDelay2(FILL_DELAY, withTiming7(1, FILL_TIMING));
|
|
11092
11146
|
nudge.value = withDelay2(
|
|
@@ -11123,13 +11177,13 @@ import { useEffect as useEffect31 } from "react";
|
|
|
11123
11177
|
import Animated16, {
|
|
11124
11178
|
useAnimatedStyle as useAnimatedStyle12,
|
|
11125
11179
|
useReducedMotion as useReducedMotion7,
|
|
11126
|
-
useSharedValue as
|
|
11180
|
+
useSharedValue as useSharedValue10,
|
|
11127
11181
|
withTiming as withTiming8
|
|
11128
11182
|
} from "react-native-reanimated";
|
|
11129
11183
|
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
11130
11184
|
function FiatActionButton(props) {
|
|
11131
11185
|
const reduceMotion = useReducedMotion7();
|
|
11132
|
-
const arrival =
|
|
11186
|
+
const arrival = useSharedValue10(reduceMotion ? 1 : 0);
|
|
11133
11187
|
useEffect31(() => {
|
|
11134
11188
|
arrival.value = reduceMotion ? 1 : 0;
|
|
11135
11189
|
if (!reduceMotion) {
|
|
@@ -11507,7 +11561,7 @@ var PROCESSING_MOTION_MS = 480;
|
|
|
11507
11561
|
var PROCESSING_EASING = Easing8.bezier(0.22, 1, 0.36, 1);
|
|
11508
11562
|
function useProcessingFade(processing) {
|
|
11509
11563
|
const reduceMotion = useReducedMotion8();
|
|
11510
|
-
const shown =
|
|
11564
|
+
const shown = useSharedValue11(processing ? 0 : 1);
|
|
11511
11565
|
useEffect32(() => {
|
|
11512
11566
|
const target = processing ? 0 : 1;
|
|
11513
11567
|
shown.value = reduceMotion ? target : withTiming9(target, { duration: PROCESSING_MOTION_MS / 2 });
|
|
@@ -11519,7 +11573,7 @@ function useProcessingFade(processing) {
|
|
|
11519
11573
|
}
|
|
11520
11574
|
function useProcessingLift(lift) {
|
|
11521
11575
|
const reduceMotion = useReducedMotion8();
|
|
11522
|
-
const offset =
|
|
11576
|
+
const offset = useSharedValue11(lift);
|
|
11523
11577
|
useEffect32(() => {
|
|
11524
11578
|
offset.value = reduceMotion ? lift : withTiming9(lift, {
|
|
11525
11579
|
duration: PROCESSING_MOTION_MS,
|
|
@@ -11937,7 +11991,7 @@ import {
|
|
|
11937
11991
|
import { Pressable as Pressable20, StyleSheet as StyleSheet34, View as View12 } from "react-native";
|
|
11938
11992
|
import Animated18, {
|
|
11939
11993
|
useAnimatedStyle as useAnimatedStyle14,
|
|
11940
|
-
useSharedValue as
|
|
11994
|
+
useSharedValue as useSharedValue12,
|
|
11941
11995
|
withTiming as withTiming10
|
|
11942
11996
|
} from "react-native-reanimated";
|
|
11943
11997
|
import { useSafeAreaInsets as useSafeAreaInsets11 } from "react-native-safe-area-context";
|
|
@@ -11974,7 +12028,7 @@ function Drawer({
|
|
|
11974
12028
|
onNestedSheetDismiss
|
|
11975
12029
|
} = sheet3;
|
|
11976
12030
|
useEffect33(() => () => setNestedScreen(null), [setNestedScreen]);
|
|
11977
|
-
const dimLevel =
|
|
12031
|
+
const dimLevel = useSharedValue12(dim ?? 0);
|
|
11978
12032
|
useEffect33(() => {
|
|
11979
12033
|
dimLevel.value = withTiming10(dim ?? 0, DIM_TIMING);
|
|
11980
12034
|
}, [dim, dimLevel]);
|
|
@@ -12194,7 +12248,7 @@ function DepositAmountStep({
|
|
|
12194
12248
|
const settledFeeUsd = settledAmountUsd * feeRate;
|
|
12195
12249
|
const fee = settledAmountUsd > 0 ? t("depositAmount.fee", { amount: formatUsd(settledFeeUsd) }) : void 0;
|
|
12196
12250
|
const quickAmountsUsd = config.quickAmountsUsd;
|
|
12197
|
-
const quickAmounts =
|
|
12251
|
+
const quickAmounts = useMemo19(
|
|
12198
12252
|
() => (quickAmountsUsd ?? DEFAULT_QUICK_AMOUNTS).map((value) => ({
|
|
12199
12253
|
value,
|
|
12200
12254
|
label: `$${groupThousands(value)}`
|
|
@@ -12817,12 +12871,12 @@ import {
|
|
|
12817
12871
|
useCallback as useCallback41,
|
|
12818
12872
|
useEffect as useEffect101,
|
|
12819
12873
|
useLayoutEffect as useLayoutEffect5,
|
|
12820
|
-
useMemo as
|
|
12874
|
+
useMemo as useMemo41,
|
|
12821
12875
|
useRef as useRef79,
|
|
12822
12876
|
useState as useState83
|
|
12823
12877
|
} from "react";
|
|
12824
12878
|
import { View as View40 } from "react-native";
|
|
12825
|
-
import { useSharedValue as
|
|
12879
|
+
import { useSharedValue as useSharedValue28 } from "react-native-reanimated";
|
|
12826
12880
|
import { useSafeAreaInsets as useSafeAreaInsets25 } from "react-native-safe-area-context";
|
|
12827
12881
|
|
|
12828
12882
|
// src/fiat/ctaLabel.ts
|
|
@@ -12865,10 +12919,10 @@ function isEntryPay(entry) {
|
|
|
12865
12919
|
|
|
12866
12920
|
// src/fiat/disclosureFooter.tsx
|
|
12867
12921
|
import {
|
|
12868
|
-
createContext as
|
|
12869
|
-
useContext as
|
|
12922
|
+
createContext as createContext12,
|
|
12923
|
+
useContext as useContext13,
|
|
12870
12924
|
useLayoutEffect as useLayoutEffect2,
|
|
12871
|
-
useMemo as
|
|
12925
|
+
useMemo as useMemo20,
|
|
12872
12926
|
useState as useState25
|
|
12873
12927
|
} from "react";
|
|
12874
12928
|
|
|
@@ -13031,10 +13085,10 @@ var styles35 = StyleSheet36.create({
|
|
|
13031
13085
|
|
|
13032
13086
|
// src/fiat/disclosureFooter.tsx
|
|
13033
13087
|
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
13034
|
-
var ShownFooterContext =
|
|
13088
|
+
var ShownFooterContext = createContext12(void 0);
|
|
13035
13089
|
function DisclosureFooterHost({ children }) {
|
|
13036
13090
|
const [shown, setShown] = useState25();
|
|
13037
|
-
const value =
|
|
13091
|
+
const value = useMemo20(() => [shown, setShown], [shown]);
|
|
13038
13092
|
return /* @__PURE__ */ jsx72(ShownFooterContext.Provider, { value, children });
|
|
13039
13093
|
}
|
|
13040
13094
|
function useDisclosureFooter({
|
|
@@ -13042,7 +13096,7 @@ function useDisclosureFooter({
|
|
|
13042
13096
|
content: content2
|
|
13043
13097
|
}) {
|
|
13044
13098
|
const local = useState25();
|
|
13045
|
-
const [held, setHeld] =
|
|
13099
|
+
const [held, setHeld] = useContext13(ShownFooterContext) ?? local;
|
|
13046
13100
|
const isCurrent = held !== void 0 && sameContent(held.content, content2);
|
|
13047
13101
|
useLayoutEffect2(() => {
|
|
13048
13102
|
if (ready && !isCurrent) {
|
|
@@ -13685,7 +13739,7 @@ function coinbaseWarmupFields() {
|
|
|
13685
13739
|
}
|
|
13686
13740
|
|
|
13687
13741
|
// src/fiat/providers/useWebViewTermination.ts
|
|
13688
|
-
import { useMemo as
|
|
13742
|
+
import { useMemo as useMemo21, useRef as useRef26 } from "react";
|
|
13689
13743
|
import { Platform as Platform5 } from "react-native";
|
|
13690
13744
|
var WEBVIEW_TERMINATED = "webview_terminated";
|
|
13691
13745
|
function useWebViewTermination(provider, onFailed, isInFront = true) {
|
|
@@ -13693,7 +13747,7 @@ function useWebViewTermination(provider, onFailed, isInFront = true) {
|
|
|
13693
13747
|
fail.current = onFailed;
|
|
13694
13748
|
const inFront2 = useRef26(isInFront);
|
|
13695
13749
|
inFront2.current = isInFront;
|
|
13696
|
-
return
|
|
13750
|
+
return useMemo21(() => {
|
|
13697
13751
|
const terminated = (didCrash) => {
|
|
13698
13752
|
logger.warn("connect-rn:fiat:webview_terminated", {
|
|
13699
13753
|
provider,
|
|
@@ -14071,11 +14125,11 @@ import {
|
|
|
14071
14125
|
useMoonPay
|
|
14072
14126
|
} from "@moonpay/platform-sdk-react-native";
|
|
14073
14127
|
import {
|
|
14074
|
-
createContext as
|
|
14128
|
+
createContext as createContext14,
|
|
14075
14129
|
useCallback as useCallback22,
|
|
14076
|
-
useContext as
|
|
14130
|
+
useContext as useContext15,
|
|
14077
14131
|
useEffect as useEffect41,
|
|
14078
|
-
useMemo as
|
|
14132
|
+
useMemo as useMemo23,
|
|
14079
14133
|
useRef as useRef29,
|
|
14080
14134
|
useState as useState29
|
|
14081
14135
|
} from "react";
|
|
@@ -14087,12 +14141,12 @@ import { Keyboard as Keyboard2, Pressable as Pressable22, StyleSheet as StyleShe
|
|
|
14087
14141
|
|
|
14088
14142
|
// src/flow/swipeBack.tsx
|
|
14089
14143
|
import {
|
|
14090
|
-
createContext as
|
|
14144
|
+
createContext as createContext13,
|
|
14091
14145
|
useCallback as useCallback21,
|
|
14092
|
-
useContext as
|
|
14146
|
+
useContext as useContext14,
|
|
14093
14147
|
useEffect as useEffect40,
|
|
14094
14148
|
useLayoutEffect as useLayoutEffect3,
|
|
14095
|
-
useMemo as
|
|
14149
|
+
useMemo as useMemo22,
|
|
14096
14150
|
useRef as useRef28,
|
|
14097
14151
|
useState as useState28
|
|
14098
14152
|
} from "react";
|
|
@@ -14101,7 +14155,7 @@ import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
|
14101
14155
|
import Animated19, {
|
|
14102
14156
|
runOnJS as runOnJS2,
|
|
14103
14157
|
useAnimatedStyle as useAnimatedStyle15,
|
|
14104
|
-
useSharedValue as
|
|
14158
|
+
useSharedValue as useSharedValue13,
|
|
14105
14159
|
withTiming as withTiming11
|
|
14106
14160
|
} from "react-native-reanimated";
|
|
14107
14161
|
|
|
@@ -14157,9 +14211,9 @@ function shouldCommitSwipeBack(translationX, velocityX, width) {
|
|
|
14157
14211
|
}
|
|
14158
14212
|
return translationX > width / 2 && velocityX > -SWIPE_BACK_FLICK;
|
|
14159
14213
|
}
|
|
14160
|
-
var SwipeBackContext =
|
|
14214
|
+
var SwipeBackContext = createContext13(void 0);
|
|
14161
14215
|
function useSwipeBack(back, enabled = true) {
|
|
14162
|
-
const arm =
|
|
14216
|
+
const arm = useContext14(SwipeBackContext);
|
|
14163
14217
|
const latest = useRef28(back);
|
|
14164
14218
|
useLayoutEffect3(() => {
|
|
14165
14219
|
latest.current = back;
|
|
@@ -14176,7 +14230,7 @@ function SwipeBackSurface({
|
|
|
14176
14230
|
children
|
|
14177
14231
|
}) {
|
|
14178
14232
|
const { width } = useWindowDimensions8();
|
|
14179
|
-
const drag =
|
|
14233
|
+
const drag = useSharedValue13(0);
|
|
14180
14234
|
const back = useRef28(void 0);
|
|
14181
14235
|
const [armed, setArmed] = useState28(false);
|
|
14182
14236
|
const mounted = useRef28(true);
|
|
@@ -14205,7 +14259,7 @@ function SwipeBackSurface({
|
|
|
14205
14259
|
}
|
|
14206
14260
|
});
|
|
14207
14261
|
}, [drag, swiped]);
|
|
14208
|
-
const pan =
|
|
14262
|
+
const pan = useMemo22(
|
|
14209
14263
|
() => Gesture.Pan().enabled(armed).hitSlop({ left: 0, width: SWIPE_BACK_EDGE }).activeOffsetX(ACTIVATE_AFTER).failOffsetY([-VERTICAL_SLOP, VERTICAL_SLOP]).onUpdate((event) => {
|
|
14210
14264
|
"worklet";
|
|
14211
14265
|
drag.value = Math.max(0, event.translationX);
|
|
@@ -14883,7 +14937,7 @@ function MoonPayCheckoutSurface({
|
|
|
14883
14937
|
prepared,
|
|
14884
14938
|
context
|
|
14885
14939
|
}) {
|
|
14886
|
-
const session =
|
|
14940
|
+
const session = useContext15(MoonPaySessionContext);
|
|
14887
14941
|
if (session === void 0) {
|
|
14888
14942
|
if (auth !== void 0) {
|
|
14889
14943
|
return /* @__PURE__ */ jsx81(MoonPayAuthSession, { sessionToken: auth.sessionToken, children: /* @__PURE__ */ jsx81(MoonPayAuthSurface, { params: auth, context }) });
|
|
@@ -14922,7 +14976,7 @@ function useScreenStyle() {
|
|
|
14922
14976
|
return { ...styles41.screen, backgroundColor: theme.background.modal };
|
|
14923
14977
|
}
|
|
14924
14978
|
function MoonPayChallengeSession({ children }) {
|
|
14925
|
-
const session =
|
|
14979
|
+
const session = useContext15(MoonPaySessionContext);
|
|
14926
14980
|
if (session !== void 0) {
|
|
14927
14981
|
return children;
|
|
14928
14982
|
}
|
|
@@ -14930,7 +14984,7 @@ function MoonPayChallengeSession({ children }) {
|
|
|
14930
14984
|
}
|
|
14931
14985
|
function useChallengeWebViewProps(terminationProps) {
|
|
14932
14986
|
const theme = useTheme();
|
|
14933
|
-
return
|
|
14987
|
+
return useMemo23(() => {
|
|
14934
14988
|
const palette = moonPayChallengePalette(theme);
|
|
14935
14989
|
const challengeStyle = moonPayChallengeFrameStyle(palette);
|
|
14936
14990
|
return {
|
|
@@ -15015,12 +15069,12 @@ function logConnectionCheck(session, params, surface) {
|
|
|
15015
15069
|
...session?.recordCheck(params.sessionToken)
|
|
15016
15070
|
});
|
|
15017
15071
|
}
|
|
15018
|
-
var MoonPaySessionContext =
|
|
15072
|
+
var MoonPaySessionContext = createContext14(
|
|
15019
15073
|
void 0
|
|
15020
15074
|
);
|
|
15021
|
-
var MoonPayRoutingInputsContext =
|
|
15075
|
+
var MoonPayRoutingInputsContext = createContext14(void 0);
|
|
15022
15076
|
function useMoonPayRoutingInputs() {
|
|
15023
|
-
return
|
|
15077
|
+
return useContext15(MoonPayRoutingInputsContext);
|
|
15024
15078
|
}
|
|
15025
15079
|
function MoonPaySurfaceHost({ children }) {
|
|
15026
15080
|
return /* @__PURE__ */ jsx81(ThemedMoonPayProvider, { children: /* @__PURE__ */ jsx81(MoonPaySessionProvider, { children }) });
|
|
@@ -15110,7 +15164,7 @@ function MoonPaySessionProvider({ children }) {
|
|
|
15110
15164
|
const invalidate = useCallback22(() => {
|
|
15111
15165
|
active.current = void 0;
|
|
15112
15166
|
}, []);
|
|
15113
|
-
const session =
|
|
15167
|
+
const session = useMemo23(
|
|
15114
15168
|
() => ({
|
|
15115
15169
|
bound,
|
|
15116
15170
|
bind,
|
|
@@ -15143,7 +15197,7 @@ function MoonPayAuthSession({
|
|
|
15143
15197
|
sessionToken,
|
|
15144
15198
|
children
|
|
15145
15199
|
}) {
|
|
15146
|
-
const session =
|
|
15200
|
+
const session = useContext15(MoonPaySessionContext);
|
|
15147
15201
|
if (session === void 0) {
|
|
15148
15202
|
return /* @__PURE__ */ jsx81(ThemedMoonPayProvider, { sessionToken, children });
|
|
15149
15203
|
}
|
|
@@ -15216,7 +15270,7 @@ function HostedMoonPayCheckoutSurface({
|
|
|
15216
15270
|
context.onFailed("quote_session_unavailable");
|
|
15217
15271
|
}
|
|
15218
15272
|
}, [context, sessionToken]);
|
|
15219
|
-
const preparedContext =
|
|
15273
|
+
const preparedContext = useMemo23(
|
|
15220
15274
|
() => ({
|
|
15221
15275
|
placement: "INLINE",
|
|
15222
15276
|
...context.readinessTiming === void 0 ? {} : { readinessTiming: context.readinessTiming },
|
|
@@ -15299,7 +15353,7 @@ function MoonPayAuthSurface({
|
|
|
15299
15353
|
onActive,
|
|
15300
15354
|
isBehindPayment = false
|
|
15301
15355
|
}) {
|
|
15302
|
-
const session =
|
|
15356
|
+
const session = useContext15(MoonPaySessionContext);
|
|
15303
15357
|
const [mode, setMode] = useState29(
|
|
15304
15358
|
() => openingMode(context, session)
|
|
15305
15359
|
);
|
|
@@ -15538,7 +15592,7 @@ function MoonPayAuthPage({
|
|
|
15538
15592
|
function useAuthFrameWebViewProps(terminationProps) {
|
|
15539
15593
|
const theme = useTheme();
|
|
15540
15594
|
const script = moonPayAuthFrameStyle(moonPayAuthPalette(theme));
|
|
15541
|
-
return
|
|
15595
|
+
return useMemo23(
|
|
15542
15596
|
() => ({
|
|
15543
15597
|
...terminationProps,
|
|
15544
15598
|
injectedJavaScriptBeforeContentLoaded: script,
|
|
@@ -15549,7 +15603,7 @@ function useAuthFrameWebViewProps(terminationProps) {
|
|
|
15549
15603
|
}
|
|
15550
15604
|
function useApplePayFrame(paintToken) {
|
|
15551
15605
|
const { height, radius } = applePayButtonMetrics(useTheme());
|
|
15552
|
-
const buttonSettings =
|
|
15606
|
+
const buttonSettings = useMemo23(
|
|
15553
15607
|
() => moonPayApplePayButtonSettings({ height, radius }),
|
|
15554
15608
|
[height, radius]
|
|
15555
15609
|
);
|
|
@@ -15593,7 +15647,7 @@ function MoonPayPaymentSession({
|
|
|
15593
15647
|
params,
|
|
15594
15648
|
context
|
|
15595
15649
|
}) {
|
|
15596
|
-
const session =
|
|
15650
|
+
const session = useContext15(MoonPaySessionContext);
|
|
15597
15651
|
const sessionToken = params.sessionToken ?? (params.clientHeldSession ? session?.bound : void 0);
|
|
15598
15652
|
const unavailableReported = useRef29(false);
|
|
15599
15653
|
useEffect41(() => {
|
|
@@ -15693,7 +15747,7 @@ function MoonPayPayment({
|
|
|
15693
15747
|
applePayReady.paintToken
|
|
15694
15748
|
);
|
|
15695
15749
|
const [connected, setConnected] = useState29(connectionReady);
|
|
15696
|
-
const session =
|
|
15750
|
+
const session = useContext15(MoonPaySessionContext);
|
|
15697
15751
|
const checkLogged = useRef29(false);
|
|
15698
15752
|
useEffect41(() => {
|
|
15699
15753
|
if (connectionReady || checkLogged.current) {
|
|
@@ -16112,13 +16166,13 @@ import {
|
|
|
16112
16166
|
kycSdkCompleted,
|
|
16113
16167
|
kycSdkFailed
|
|
16114
16168
|
} from "@funkit/connect-core";
|
|
16115
|
-
import { useEffect as useEffect43, useMemo as
|
|
16169
|
+
import { useEffect as useEffect43, useMemo as useMemo25, useRef as useRef32 } from "react";
|
|
16116
16170
|
import { View as View15, useWindowDimensions as useWindowDimensions9 } from "react-native";
|
|
16117
16171
|
import { useSafeAreaInsets as useSafeAreaInsets13 } from "react-native-safe-area-context";
|
|
16118
16172
|
|
|
16119
16173
|
// src/fiat/providers/sumsub/SumsubKycSurface.tsx
|
|
16120
16174
|
import { useEffectEvent as useEffectEvent4 } from "@funkit/connect-core";
|
|
16121
|
-
import { useMemo as
|
|
16175
|
+
import { useMemo as useMemo24, useRef as useRef30 } from "react";
|
|
16122
16176
|
import { WebView as WebView3 } from "react-native-webview";
|
|
16123
16177
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
16124
16178
|
var SUMSUB_ORIGIN = "https://static.sumsub.com";
|
|
@@ -16139,7 +16193,7 @@ function SumsubKycSurface({
|
|
|
16139
16193
|
const onSubmissionObservedCommitted = useEffectEvent4(
|
|
16140
16194
|
() => submissionObserver.current?.()
|
|
16141
16195
|
);
|
|
16142
|
-
const html =
|
|
16196
|
+
const html = useMemo24(
|
|
16143
16197
|
() => buildDocument(accessToken, scheme),
|
|
16144
16198
|
[accessToken, scheme]
|
|
16145
16199
|
);
|
|
@@ -16709,7 +16763,7 @@ function SumsubNativeKycScreen({
|
|
|
16709
16763
|
const active = useTheme();
|
|
16710
16764
|
const pair = useFunkitThemePair() ?? { light: active, dark: active };
|
|
16711
16765
|
const scheme = isDarkColor(active.background.modal) ? "dark" : "light";
|
|
16712
|
-
const theme =
|
|
16766
|
+
const theme = useMemo25(
|
|
16713
16767
|
() => buildSumsubTheme(pair, scheme),
|
|
16714
16768
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- TODO(review): suppressed when the rule was turned on
|
|
16715
16769
|
[pair.light, pair.dark, scheme]
|
|
@@ -16781,7 +16835,7 @@ import {
|
|
|
16781
16835
|
expectedOriginOf,
|
|
16782
16836
|
translateApplePayEvent
|
|
16783
16837
|
} from "@transak/ui-components-core";
|
|
16784
|
-
import { useEffect as useEffect44, useMemo as
|
|
16838
|
+
import { useEffect as useEffect44, useMemo as useMemo26, useRef as useRef33 } from "react";
|
|
16785
16839
|
import { WebView as WebView4 } from "react-native-webview";
|
|
16786
16840
|
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
16787
16841
|
function parseMessage2(data) {
|
|
@@ -16807,11 +16861,11 @@ function TransakApplePaySurface({
|
|
|
16807
16861
|
}) {
|
|
16808
16862
|
const callbacks = useRef33({ onReady, onSuccess, onError });
|
|
16809
16863
|
callbacks.current = { onReady, onSuccess, onError };
|
|
16810
|
-
const uri =
|
|
16864
|
+
const uri = useMemo26(
|
|
16811
16865
|
() => buildApplePayUrl({ sessionId, environment }),
|
|
16812
16866
|
[environment, sessionId]
|
|
16813
16867
|
);
|
|
16814
|
-
const machine =
|
|
16868
|
+
const machine = useMemo26(
|
|
16815
16869
|
() => createStateMachine(() => ({
|
|
16816
16870
|
onReady: () => callbacks.current.onReady?.(),
|
|
16817
16871
|
onSuccess: (payload) => callbacks.current.onSuccess?.(payload),
|
|
@@ -16824,7 +16878,7 @@ function TransakApplePaySurface({
|
|
|
16824
16878
|
machine.apply({ type: "mount" });
|
|
16825
16879
|
return () => machine.apply({ type: "unmount" });
|
|
16826
16880
|
}, [machine]);
|
|
16827
|
-
const expectedOrigin =
|
|
16881
|
+
const expectedOrigin = useMemo26(() => originOf2(uri), [uri]);
|
|
16828
16882
|
const shouldStartLoad = (request) => request.isTopFrame !== true || originOf2(request.url) === expectedOrigin;
|
|
16829
16883
|
const handleMessage = (event) => {
|
|
16830
16884
|
if (expectedOrigin === void 0 || originOf2(event.nativeEvent.url) !== expectedOrigin) {
|
|
@@ -17238,6 +17292,9 @@ function stripeErrorDetail(error) {
|
|
|
17238
17292
|
const detail = {};
|
|
17239
17293
|
for (const field of [
|
|
17240
17294
|
"code",
|
|
17295
|
+
"providerCode",
|
|
17296
|
+
"reason",
|
|
17297
|
+
"recovery",
|
|
17241
17298
|
"message",
|
|
17242
17299
|
"onrampErrorType",
|
|
17243
17300
|
"stripeErrorCode",
|
|
@@ -17546,6 +17603,7 @@ function StripeAuthorizeSurface({
|
|
|
17546
17603
|
}
|
|
17547
17604
|
|
|
17548
17605
|
// src/fiat/providers/stripe/stripeCheckout.tsx
|
|
17606
|
+
import { getResponseErrorBody } from "@funkit/api-base";
|
|
17549
17607
|
import { useEffect as useEffect50, useRef as useRef38 } from "react";
|
|
17550
17608
|
|
|
17551
17609
|
// src/fiat/providers/stripe/stripePayment.tsx
|
|
@@ -18019,24 +18077,40 @@ async function performStripeCheckout(stripe, params, requestClientSecret) {
|
|
|
18019
18077
|
stage: "perform_checkout"
|
|
18020
18078
|
});
|
|
18021
18079
|
let attempts = 0;
|
|
18080
|
+
let callbackFailure;
|
|
18022
18081
|
const result = await stripe.performCheckout(params.sessionId, async () => {
|
|
18023
18082
|
attempts += 1;
|
|
18024
18083
|
logger.info("connect-rn:fiat:stripe_checkout_callback", {
|
|
18025
18084
|
attempt: attempts
|
|
18026
18085
|
});
|
|
18027
18086
|
try {
|
|
18028
|
-
|
|
18087
|
+
const secret = await requestClientSecret({
|
|
18029
18088
|
callbackEndpoint: params.callbackEndpoint,
|
|
18030
18089
|
callbackIdField: params.callbackIdField
|
|
18031
18090
|
});
|
|
18091
|
+
callbackFailure = void 0;
|
|
18092
|
+
return secret;
|
|
18032
18093
|
} catch (error) {
|
|
18094
|
+
callbackFailure = { error };
|
|
18095
|
+
const body = getResponseErrorBody(error);
|
|
18033
18096
|
logger.warn("connect-rn:fiat:stripe_checkout_callback_failed", {
|
|
18034
18097
|
attempt: attempts,
|
|
18035
|
-
|
|
18098
|
+
reason: body?.reason,
|
|
18099
|
+
recovery: body?.recovery,
|
|
18100
|
+
providerCode: body?.providerCode
|
|
18036
18101
|
});
|
|
18037
18102
|
return null;
|
|
18038
18103
|
}
|
|
18039
18104
|
});
|
|
18105
|
+
if (callbackFailure !== void 0) {
|
|
18106
|
+
const body = getResponseErrorBody(callbackFailure.error);
|
|
18107
|
+
const code = checkoutRefusalCode(body);
|
|
18108
|
+
throw Object.assign(new Error(`perform_checkout:${code}`), {
|
|
18109
|
+
providerCode: body?.providerCode,
|
|
18110
|
+
reason: body?.reason,
|
|
18111
|
+
recovery: body?.recovery
|
|
18112
|
+
});
|
|
18113
|
+
}
|
|
18040
18114
|
if (result?.error !== void 0) {
|
|
18041
18115
|
const failure2 = new Error(
|
|
18042
18116
|
`perform_checkout:${stripePaymentErrorCode(result.error)}`
|
|
@@ -18048,6 +18122,15 @@ async function performStripeCheckout(stripe, params, requestClientSecret) {
|
|
|
18048
18122
|
attempts
|
|
18049
18123
|
});
|
|
18050
18124
|
}
|
|
18125
|
+
function checkoutRefusalCode(body) {
|
|
18126
|
+
if (typeof body?.providerCode === "string") return body.providerCode;
|
|
18127
|
+
if (body?.reason === "PAYMENT_DECLINED") {
|
|
18128
|
+
if (body.recovery === "NONE") return "crypto_onramp_transaction_blocked";
|
|
18129
|
+
return "card_declined";
|
|
18130
|
+
}
|
|
18131
|
+
if (typeof body?.reason === "string") return body.reason;
|
|
18132
|
+
return "checkout_callback_failed";
|
|
18133
|
+
}
|
|
18051
18134
|
|
|
18052
18135
|
// src/fiat/providers/stripe/stripeKyc.tsx
|
|
18053
18136
|
import { useEffect as useEffect51, useRef as useRef39 } from "react";
|
|
@@ -18315,7 +18398,7 @@ function useStripeState(flow, stripeOnramp) {
|
|
|
18315
18398
|
|
|
18316
18399
|
// src/fiat/providers/stripe/stripeApplePayReady.tsx
|
|
18317
18400
|
import { useEffectEvent as useEffectEvent7 } from "@funkit/connect-core";
|
|
18318
|
-
import { useEffect as useEffect52, useMemo as
|
|
18401
|
+
import { useEffect as useEffect52, useMemo as useMemo27, useRef as useRef40 } from "react";
|
|
18319
18402
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
18320
18403
|
function useStripeApplePayButton(stripeOnramp, applePayTiming, provider, paymentMethod, events) {
|
|
18321
18404
|
const stripeApplePayTiming = provider === "STRIPE" ? applePayTiming : void 0;
|
|
@@ -18363,7 +18446,7 @@ function useStripeApplePayButton(stripeOnramp, applePayTiming, provider, payment
|
|
|
18363
18446
|
return provider === "STRIPE" && paymentMethod === "apple_pay" ? StripeApplePayReadyButton : void 0;
|
|
18364
18447
|
}
|
|
18365
18448
|
function useStripeApplePayReadyButton(Button, onReady, onPress) {
|
|
18366
|
-
return
|
|
18449
|
+
return useMemo27(
|
|
18367
18450
|
() => Button === void 0 ? void 0 : withReadyReport(Button, onReady, onPress),
|
|
18368
18451
|
[Button, onReady, onPress]
|
|
18369
18452
|
);
|
|
@@ -18718,7 +18801,7 @@ function useProviderFailovers() {
|
|
|
18718
18801
|
|
|
18719
18802
|
// src/flow/FlowPage.tsx
|
|
18720
18803
|
import { StyleSheet as StyleSheet45, useWindowDimensions as useWindowDimensions10 } from "react-native";
|
|
18721
|
-
import Animated20, { useSharedValue as
|
|
18804
|
+
import Animated20, { useSharedValue as useSharedValue14, withTiming as withTiming12 } from "react-native-reanimated";
|
|
18722
18805
|
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
18723
18806
|
function FlowPage({
|
|
18724
18807
|
motion,
|
|
@@ -18729,7 +18812,7 @@ function FlowPage({
|
|
|
18729
18812
|
const { width } = useWindowDimensions10();
|
|
18730
18813
|
const { exit } = turn;
|
|
18731
18814
|
const timing = pageTiming(motion);
|
|
18732
|
-
const swiped =
|
|
18815
|
+
const swiped = useSharedValue14(false);
|
|
18733
18816
|
const exiting = () => {
|
|
18734
18817
|
"worklet";
|
|
18735
18818
|
const planned = typeof exit === "number" ? exit : exit.value;
|
|
@@ -18767,7 +18850,7 @@ import {
|
|
|
18767
18850
|
Component,
|
|
18768
18851
|
useCallback as useCallback28,
|
|
18769
18852
|
useEffect as useEffect55,
|
|
18770
|
-
useMemo as
|
|
18853
|
+
useMemo as useMemo30,
|
|
18771
18854
|
useRef as useRef44,
|
|
18772
18855
|
useState as useState36
|
|
18773
18856
|
} from "react";
|
|
@@ -18783,7 +18866,7 @@ import {
|
|
|
18783
18866
|
memo as memo5,
|
|
18784
18867
|
useCallback as useCallback27,
|
|
18785
18868
|
useEffect as useEffect54,
|
|
18786
|
-
useMemo as
|
|
18869
|
+
useMemo as useMemo29,
|
|
18787
18870
|
useRef as useRef43,
|
|
18788
18871
|
useState as useState35
|
|
18789
18872
|
} from "react";
|
|
@@ -18798,8 +18881,8 @@ import Animated22, {
|
|
|
18798
18881
|
FadeIn as FadeIn2,
|
|
18799
18882
|
FadeOut as FadeOut3,
|
|
18800
18883
|
useAnimatedStyle as useAnimatedStyle17,
|
|
18801
|
-
useSharedValue as
|
|
18802
|
-
withSpring as
|
|
18884
|
+
useSharedValue as useSharedValue16,
|
|
18885
|
+
withSpring as withSpring6
|
|
18803
18886
|
} from "react-native-reanimated";
|
|
18804
18887
|
import { useSafeAreaInsets as useSafeAreaInsets14 } from "react-native-safe-area-context";
|
|
18805
18888
|
|
|
@@ -18884,7 +18967,7 @@ function flatTextStyle(theme, options = {}) {
|
|
|
18884
18967
|
}
|
|
18885
18968
|
|
|
18886
18969
|
// src/fiat/FiatCountryIndexRail.tsx
|
|
18887
|
-
import { memo as memo4, useMemo as
|
|
18970
|
+
import { memo as memo4, useMemo as useMemo28, useRef as useRef42, useState as useState34 } from "react";
|
|
18888
18971
|
import {
|
|
18889
18972
|
Text as RNText,
|
|
18890
18973
|
StyleSheet as StyleSheet47,
|
|
@@ -18895,8 +18978,8 @@ import Animated21, {
|
|
|
18895
18978
|
FadeIn,
|
|
18896
18979
|
FadeOut as FadeOut2,
|
|
18897
18980
|
useAnimatedStyle as useAnimatedStyle16,
|
|
18898
|
-
useSharedValue as
|
|
18899
|
-
withSpring as
|
|
18981
|
+
useSharedValue as useSharedValue15,
|
|
18982
|
+
withSpring as withSpring5
|
|
18900
18983
|
} from "react-native-reanimated";
|
|
18901
18984
|
import { jsx as jsx98, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
18902
18985
|
var FiatCountryIndexRail = memo4(function FiatCountryIndexRail2({
|
|
@@ -18911,7 +18994,7 @@ var FiatCountryIndexRail = memo4(function FiatCountryIndexRail2({
|
|
|
18911
18994
|
inset: 0
|
|
18912
18995
|
});
|
|
18913
18996
|
const [peek, setPeek] = useState34();
|
|
18914
|
-
const peekY =
|
|
18997
|
+
const peekY = useSharedValue15(0);
|
|
18915
18998
|
const lastKey = useRef42(void 0);
|
|
18916
18999
|
const scrub = (y) => {
|
|
18917
19000
|
const { inset, pitch } = strip;
|
|
@@ -18922,7 +19005,7 @@ var FiatCountryIndexRail = memo4(function FiatCountryIndexRail2({
|
|
|
18922
19005
|
return;
|
|
18923
19006
|
}
|
|
18924
19007
|
onScrub(at, through - at);
|
|
18925
|
-
peekY.value = lastKey.current === void 0 ? y :
|
|
19008
|
+
peekY.value = lastKey.current === void 0 ? y : withSpring5(y, PEEK_SPRING);
|
|
18926
19009
|
if (key === lastKey.current) {
|
|
18927
19010
|
return;
|
|
18928
19011
|
}
|
|
@@ -18936,7 +19019,7 @@ var FiatCountryIndexRail = memo4(function FiatCountryIndexRail2({
|
|
|
18936
19019
|
lastKey.current = void 0;
|
|
18937
19020
|
setPeek(void 0);
|
|
18938
19021
|
};
|
|
18939
|
-
const pan =
|
|
19022
|
+
const pan = useMemo28(
|
|
18940
19023
|
() => Gesture2.Pan().minDistance(0).shouldCancelWhenOutside(false).runOnJS(true).onBegin((event) => latest.current(event.y)).onUpdate((event) => latest.current(event.y)).onFinalize(release),
|
|
18941
19024
|
[]
|
|
18942
19025
|
);
|
|
@@ -18953,7 +19036,7 @@ var FiatCountryIndexRail = memo4(function FiatCountryIndexRail2({
|
|
|
18953
19036
|
return { transform: [{ translateY: peekY.value - RAIL.peekSize / 2 }] };
|
|
18954
19037
|
});
|
|
18955
19038
|
const marked = peek ?? active;
|
|
18956
|
-
const letterStyles =
|
|
19039
|
+
const letterStyles = useMemo28(
|
|
18957
19040
|
() => letterPalette(theme, strip.pitch),
|
|
18958
19041
|
[theme, strip.pitch]
|
|
18959
19042
|
);
|
|
@@ -19593,7 +19676,7 @@ function FiatCountrySheet({
|
|
|
19593
19676
|
}) {
|
|
19594
19677
|
const { t } = useFunkitTranslation();
|
|
19595
19678
|
const { closeNestedScreen } = sheet3;
|
|
19596
|
-
const header =
|
|
19679
|
+
const header = useMemo29(
|
|
19597
19680
|
() => /* @__PURE__ */ jsx99(
|
|
19598
19681
|
FiatSearchListHeader,
|
|
19599
19682
|
{
|
|
@@ -19617,7 +19700,7 @@ function FiatCountrySheet({
|
|
|
19617
19700
|
}
|
|
19618
19701
|
function FiatCountryList(props) {
|
|
19619
19702
|
const { t, locale } = useFunkitTranslation();
|
|
19620
|
-
const sections =
|
|
19703
|
+
const sections = useMemo29(
|
|
19621
19704
|
() => countrySections(PHONE_COUNTRIES, locale),
|
|
19622
19705
|
[locale]
|
|
19623
19706
|
);
|
|
@@ -19669,8 +19752,8 @@ function FiatSearchList({
|
|
|
19669
19752
|
},
|
|
19670
19753
|
[]
|
|
19671
19754
|
);
|
|
19672
|
-
const entries =
|
|
19673
|
-
const measured =
|
|
19755
|
+
const entries = useMemo29(() => listEntries(sections, query), [sections, query]);
|
|
19756
|
+
const measured = useMemo29(() => measureEntries(entries, HEIGHTS), [entries]);
|
|
19674
19757
|
const getItemLayout = useCallback27(
|
|
19675
19758
|
(_data, index) => {
|
|
19676
19759
|
const cell = measured.cells[index];
|
|
@@ -19707,7 +19790,7 @@ function FiatSearchList({
|
|
|
19707
19790
|
const selectRef = useRef43(onSelect);
|
|
19708
19791
|
selectRef.current = onSelect;
|
|
19709
19792
|
const select = useCallback27((key) => selectRef.current(key), []);
|
|
19710
|
-
const palette =
|
|
19793
|
+
const palette = useMemo29(() => rowPalette(theme), [theme]);
|
|
19711
19794
|
const renderItem = useCallback27(
|
|
19712
19795
|
({ item }) => /* @__PURE__ */ jsx99(
|
|
19713
19796
|
ListRow,
|
|
@@ -19721,9 +19804,9 @@ function FiatSearchList({
|
|
|
19721
19804
|
[selected, palette, select]
|
|
19722
19805
|
);
|
|
19723
19806
|
const motion = useV2DrawerMotion();
|
|
19724
|
-
const restingOn =
|
|
19807
|
+
const restingOn = useSharedValue16(insets.bottom);
|
|
19725
19808
|
useEffect54(() => {
|
|
19726
|
-
restingOn.value =
|
|
19809
|
+
restingOn.value = withSpring6(
|
|
19727
19810
|
Math.max(keyboardHeight, insets.bottom),
|
|
19728
19811
|
motion
|
|
19729
19812
|
);
|
|
@@ -19738,7 +19821,7 @@ function FiatSearchList({
|
|
|
19738
19821
|
height: restingOn.value + METRICS.searchGap + METRICS.rowHeight + METRICS.footLead
|
|
19739
19822
|
};
|
|
19740
19823
|
});
|
|
19741
|
-
const listPadding =
|
|
19824
|
+
const listPadding = useMemo29(
|
|
19742
19825
|
() => ({
|
|
19743
19826
|
paddingHorizontal: METRICS.screenInset,
|
|
19744
19827
|
paddingTop: LIST_TOP,
|
|
@@ -20330,7 +20413,7 @@ function usePaymentMethodPickerSheet({
|
|
|
20330
20413
|
openNestedScreen("paymentMethodPicker");
|
|
20331
20414
|
}
|
|
20332
20415
|
}, [checkoutId, openedBySeed, openNestedScreen]);
|
|
20333
|
-
const header =
|
|
20416
|
+
const header = useMemo30(
|
|
20334
20417
|
() => /* @__PURE__ */ jsx101(
|
|
20335
20418
|
FiatSearchListHeader,
|
|
20336
20419
|
{
|
|
@@ -20470,7 +20553,7 @@ var styles48 = StyleSheet50.create({
|
|
|
20470
20553
|
|
|
20471
20554
|
// src/flow/pageTurn.ts
|
|
20472
20555
|
import { useRef as useRef45 } from "react";
|
|
20473
|
-
import { useSharedValue as
|
|
20556
|
+
import { useSharedValue as useSharedValue17 } from "react-native-reanimated";
|
|
20474
20557
|
var OPENING_PAGE = { enter: -1, exit: 1, moved: true };
|
|
20475
20558
|
function turnTo(stack, key) {
|
|
20476
20559
|
const at = stack.keys.indexOf(key);
|
|
@@ -20494,7 +20577,7 @@ function turnOnwardTo(stack, key, home) {
|
|
|
20494
20577
|
var EMPTY_STACK = { keys: [], direction: 1 };
|
|
20495
20578
|
function usePageTurn(key, onward) {
|
|
20496
20579
|
const stack = useRef45(EMPTY_STACK);
|
|
20497
|
-
const ownExit =
|
|
20580
|
+
const ownExit = useSharedValue17(1);
|
|
20498
20581
|
const exit = onward?.exit ?? ownExit;
|
|
20499
20582
|
const next = onward === void 0 ? turnTo(stack.current, key) : turnOnwardTo(stack.current, key, onward.home);
|
|
20500
20583
|
if (next !== stack.current) {
|
|
@@ -20969,7 +21052,7 @@ function usePaymentFailureAnswer({
|
|
|
20969
21052
|
}
|
|
20970
21053
|
|
|
20971
21054
|
// src/fiat/usePaymentAttempts.ts
|
|
20972
|
-
import { useEffect as useEffect58, useMemo as
|
|
21055
|
+
import { useEffect as useEffect58, useMemo as useMemo31, useRef as useRef48 } from "react";
|
|
20973
21056
|
|
|
20974
21057
|
// src/fiat/paymentAttempts.ts
|
|
20975
21058
|
var EMPTY_LEDGER = { count: 0, open: void 0 };
|
|
@@ -21092,7 +21175,7 @@ function usePaymentAttempts(checkoutId) {
|
|
|
21092
21175
|
});
|
|
21093
21176
|
};
|
|
21094
21177
|
}, [dispatch]);
|
|
21095
|
-
return
|
|
21178
|
+
return useMemo31(
|
|
21096
21179
|
() => ({
|
|
21097
21180
|
capture: () => void dispatch({ kind: "captured" }),
|
|
21098
21181
|
uncapture: () => void dispatch({ kind: "uncaptured" }),
|
|
@@ -21267,7 +21350,7 @@ function flattenFeeBreakdown(quote) {
|
|
|
21267
21350
|
}
|
|
21268
21351
|
|
|
21269
21352
|
// src/hooks/track/useTrackFiatPaymentEvents.ts
|
|
21270
|
-
import { useCallback as useCallback30, useMemo as
|
|
21353
|
+
import { useCallback as useCallback30, useMemo as useMemo32, useRef as useRef50 } from "react";
|
|
21271
21354
|
function getPaymentQuoteContext(paymentMethod, provider, quote) {
|
|
21272
21355
|
return {
|
|
21273
21356
|
fiat_amount: quote?.fiat.amount ?? null,
|
|
@@ -21623,7 +21706,7 @@ function useTrackFiatPaymentEvents({
|
|
|
21623
21706
|
},
|
|
21624
21707
|
[paymentMethod, track]
|
|
21625
21708
|
);
|
|
21626
|
-
return
|
|
21709
|
+
return useMemo32(
|
|
21627
21710
|
() => ({
|
|
21628
21711
|
clearAuthorization,
|
|
21629
21712
|
trackDepositFailed,
|
|
@@ -21751,7 +21834,7 @@ function useIdentityAssertion({
|
|
|
21751
21834
|
}
|
|
21752
21835
|
|
|
21753
21836
|
// src/fiat/depositOutcome.ts
|
|
21754
|
-
import { useEffect as useEffect59, useMemo as
|
|
21837
|
+
import { useEffect as useEffect59, useMemo as useMemo33, useRef as useRef51 } from "react";
|
|
21755
21838
|
var ORDERED_SCREENS = /* @__PURE__ */ new Set([
|
|
21756
21839
|
"ORDER_REVIEW",
|
|
21757
21840
|
"ORDER_PENDING",
|
|
@@ -21771,7 +21854,7 @@ function useDepositOutcomeReporter({
|
|
|
21771
21854
|
const effectGeneration = useRef51(0);
|
|
21772
21855
|
const latest = useRef51({ callbacks, t });
|
|
21773
21856
|
latest.current = { callbacks, t };
|
|
21774
|
-
const reporter =
|
|
21857
|
+
const reporter = useMemo33(
|
|
21775
21858
|
() => ({
|
|
21776
21859
|
ordered() {
|
|
21777
21860
|
ordered.current = true;
|
|
@@ -22081,7 +22164,7 @@ function completionOutcome(state) {
|
|
|
22081
22164
|
}
|
|
22082
22165
|
|
|
22083
22166
|
// src/fiat/kyc/kycFailover.ts
|
|
22084
|
-
import { getResponseErrorBody } from "@funkit/api-base";
|
|
22167
|
+
import { getResponseErrorBody as getResponseErrorBody2 } from "@funkit/api-base";
|
|
22085
22168
|
function rejectedKycProvider(state, provider, failovers) {
|
|
22086
22169
|
if (state?.kind !== "KYC" || state.phase !== "NO_ACTION_REQUIRED" || state.reason !== "REJECTED" || state.failureReason?.category !== "KYC_REJECTED" || state.failureReason.recovery !== "REQUOTE" || provider === void 0 || failedProviders(failovers).includes(provider)) {
|
|
22087
22170
|
return void 0;
|
|
@@ -22089,7 +22172,7 @@ function rejectedKycProvider(state, provider, failovers) {
|
|
|
22089
22172
|
return provider;
|
|
22090
22173
|
}
|
|
22091
22174
|
function kycFailoverExhausted(error, failovers, state, provider) {
|
|
22092
|
-
const body =
|
|
22175
|
+
const body = getResponseErrorBody2(error);
|
|
22093
22176
|
return body?.errorCode === "FiatNoRouteError" && hasFailedOver(failovers, "kyc") && (body.reason === "NO_CANDIDATE" || body.reason === "PROVIDER_DECLINED") || state?.kind === "KYC" && state.phase === "NO_ACTION_REQUIRED" && state.reason === "REJECTED" && state.failureReason?.category === "KYC_REJECTED" && state.failureReason.recovery === "REQUOTE" && provider !== void 0 && failedProviders(failovers).includes(provider);
|
|
22094
22177
|
}
|
|
22095
22178
|
|
|
@@ -23730,7 +23813,7 @@ function isAdditionalKycForm(form) {
|
|
|
23730
23813
|
var isBirthDate = (field) => field.id === "DATE_OF_BIRTH";
|
|
23731
23814
|
|
|
23732
23815
|
// src/fiat/FiatIdentityStep.tsx
|
|
23733
|
-
import { useEffect as useEffect69, useMemo as
|
|
23816
|
+
import { useEffect as useEffect69, useMemo as useMemo36, useState as useState58 } from "react";
|
|
23734
23817
|
|
|
23735
23818
|
// src/fiat/subdivisions.ts
|
|
23736
23819
|
import { country } from "iso-3166-2";
|
|
@@ -23758,7 +23841,7 @@ function keepsRegion(region, alpha2) {
|
|
|
23758
23841
|
|
|
23759
23842
|
// src/fiat/FiatFormScreen.tsx
|
|
23760
23843
|
import { useForm, useSelector } from "@tanstack/react-form";
|
|
23761
|
-
import { useEffect as useEffect68, useMemo as
|
|
23844
|
+
import { useEffect as useEffect68, useMemo as useMemo35, useRef as useRef61, useState as useState56 } from "react";
|
|
23762
23845
|
import {
|
|
23763
23846
|
Animated as Animated27,
|
|
23764
23847
|
Keyboard as Keyboard7,
|
|
@@ -23797,7 +23880,7 @@ import { StyleSheet as StyleSheet57, View as View26 } from "react-native";
|
|
|
23797
23880
|
import {
|
|
23798
23881
|
BottomSheetScrollView as BottomSheetScrollView5
|
|
23799
23882
|
} from "@gorhom/bottom-sheet";
|
|
23800
|
-
import { useMemo as
|
|
23883
|
+
import { useMemo as useMemo34, useRef as useRef58 } from "react";
|
|
23801
23884
|
import {
|
|
23802
23885
|
Keyboard as Keyboard5,
|
|
23803
23886
|
Pressable as Pressable25,
|
|
@@ -23827,7 +23910,7 @@ function FiatChoiceField({
|
|
|
23827
23910
|
const isOpen = nestedScreen !== null;
|
|
23828
23911
|
const selected = options.find((option) => option.id === value);
|
|
23829
23912
|
const surface = chooserSurface(theme, grouped ?? false, invalid);
|
|
23830
|
-
const sections =
|
|
23913
|
+
const sections = useMemo34(
|
|
23831
23914
|
() => searchable ? listSections(
|
|
23832
23915
|
options.map(({ id, labelFallback }) => ({
|
|
23833
23916
|
key: id,
|
|
@@ -23841,7 +23924,7 @@ function FiatChoiceField({
|
|
|
23841
23924
|
onChange(next);
|
|
23842
23925
|
closeNestedScreen();
|
|
23843
23926
|
};
|
|
23844
|
-
const header =
|
|
23927
|
+
const header = useMemo34(
|
|
23845
23928
|
() => country2 || searchable ? /* @__PURE__ */ jsx106(FiatSearchListHeader, { title, onClose: closeNestedScreen }) : void 0,
|
|
23846
23929
|
[country2, searchable, title, closeNestedScreen]
|
|
23847
23930
|
);
|
|
@@ -26209,7 +26292,7 @@ function FiatFormContent({
|
|
|
26209
26292
|
};
|
|
26210
26293
|
const refusedPages = useRef61(/* @__PURE__ */ new Set());
|
|
26211
26294
|
const jumpedTo = useRef61(void 0);
|
|
26212
|
-
const attemptsAtEntry =
|
|
26295
|
+
const attemptsAtEntry = useMemo35(() => {
|
|
26213
26296
|
const attempts = kyc.state.submissionAttempts;
|
|
26214
26297
|
return jumpedTo.current === step ? attempts - 1 : attempts;
|
|
26215
26298
|
}, [step]);
|
|
@@ -27043,7 +27126,7 @@ function useAskedFields(props, isCorrection) {
|
|
|
27043
27126
|
setOpening({ formId: form.formId, carriedValues: props.carriedValues });
|
|
27044
27127
|
}
|
|
27045
27128
|
const carriedValues = opening.formId === form.formId ? opening.carriedValues : props.carriedValues;
|
|
27046
|
-
const asked =
|
|
27129
|
+
const asked = useMemo36(() => {
|
|
27047
27130
|
if (isCorrection) {
|
|
27048
27131
|
return void 0;
|
|
27049
27132
|
}
|
|
@@ -27118,7 +27201,7 @@ import {
|
|
|
27118
27201
|
} from "@funkit/connect-core";
|
|
27119
27202
|
import {
|
|
27120
27203
|
useEffect as useEffect70,
|
|
27121
|
-
useMemo as
|
|
27204
|
+
useMemo as useMemo37,
|
|
27122
27205
|
useState as useState59
|
|
27123
27206
|
} from "react";
|
|
27124
27207
|
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
@@ -27131,7 +27214,7 @@ function useCreateStripeAccountWithExistingUserData(stepResponse, params, subjec
|
|
|
27131
27214
|
}
|
|
27132
27215
|
const arrivedFor = arrival.stepResponse === stepResponse ? arrival.subject : subject;
|
|
27133
27216
|
const ours = arrivedFor === subject;
|
|
27134
|
-
const data =
|
|
27217
|
+
const data = useMemo37(() => {
|
|
27135
27218
|
const known = ours ? getPrefilledStripeFormData(stepResponse, params) : void 0;
|
|
27136
27219
|
if (known === void 0) {
|
|
27137
27220
|
return { carried };
|
|
@@ -27571,7 +27654,7 @@ function captureQuoteRefOf(flow) {
|
|
|
27571
27654
|
|
|
27572
27655
|
// src/fiat/applePayAttempt.ts
|
|
27573
27656
|
import { preparedPaymentOf, useLogOnce as useLogOnce4 } from "@funkit/connect-core";
|
|
27574
|
-
import { useCallback as useCallback34, useEffect as useEffect73, useMemo as
|
|
27657
|
+
import { useCallback as useCallback34, useEffect as useEffect73, useMemo as useMemo38, useRef as useRef65 } from "react";
|
|
27575
27658
|
|
|
27576
27659
|
// src/fiat/providers/moonpay/moonpayPreparedPayment.ts
|
|
27577
27660
|
function promoteMoonPayPreparedPayment(response, prepared) {
|
|
@@ -27768,7 +27851,7 @@ function useApplePayAttempt({
|
|
|
27768
27851
|
setVerifiedQuote
|
|
27769
27852
|
}) {
|
|
27770
27853
|
const previousReadiness = useRef65(void 0);
|
|
27771
|
-
const applePayTiming =
|
|
27854
|
+
const applePayTiming = useMemo38(() => {
|
|
27772
27855
|
if (flowStep === void 0 && !quoteState.isQuoteFresh) {
|
|
27773
27856
|
previousReadiness.current = void 0;
|
|
27774
27857
|
return void 0;
|
|
@@ -28182,7 +28265,7 @@ import {
|
|
|
28182
28265
|
useEffectEvent as useEffectEvent20,
|
|
28183
28266
|
useLogOnce as useLogOnce6
|
|
28184
28267
|
} from "@funkit/connect-core";
|
|
28185
|
-
import { useCallback as useCallback36, useEffect as useEffect76, useMemo as
|
|
28268
|
+
import { useCallback as useCallback36, useEffect as useEffect76, useMemo as useMemo39, useState as useState65 } from "react";
|
|
28186
28269
|
|
|
28187
28270
|
// src/fiat/closeFailure.ts
|
|
28188
28271
|
function closeFailure({
|
|
@@ -28436,7 +28519,7 @@ function useFailedPayment({
|
|
|
28436
28519
|
const { t } = useFunkitTranslation();
|
|
28437
28520
|
const isQuoteSurfaceFailure = surfaceFailure !== void 0 && flow.stepResponse === void 0;
|
|
28438
28521
|
const orderFailedCode = orderFailureCode(flow);
|
|
28439
|
-
const polledOrderFailure =
|
|
28522
|
+
const polledOrderFailure = useMemo39(
|
|
28440
28523
|
() => orderFailedCode === void 0 ? void 0 : { code: orderFailedCode },
|
|
28441
28524
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28442
28525
|
[orderFailedCode, flow.page.identity]
|
|
@@ -28905,15 +28988,15 @@ function embeddedSlot({
|
|
|
28905
28988
|
import { StyleSheet as StyleSheet65 } from "react-native";
|
|
28906
28989
|
|
|
28907
28990
|
// src/components/DismissibleToast.tsx
|
|
28908
|
-
import { useCallback as useCallback38, useMemo as
|
|
28991
|
+
import { useCallback as useCallback38, useMemo as useMemo40, useState as useState69 } from "react";
|
|
28909
28992
|
import { Gesture as Gesture3, GestureDetector as GestureDetector3 } from "react-native-gesture-handler";
|
|
28910
28993
|
import Animated28, {
|
|
28911
28994
|
ReduceMotion as ReduceMotion3,
|
|
28912
28995
|
runOnJS as runOnJS3,
|
|
28913
28996
|
useAnimatedStyle as useAnimatedStyle18,
|
|
28914
28997
|
useReducedMotion as useReducedMotion9,
|
|
28915
|
-
useSharedValue as
|
|
28916
|
-
withSpring as
|
|
28998
|
+
useSharedValue as useSharedValue18,
|
|
28999
|
+
withSpring as withSpring7,
|
|
28917
29000
|
withTiming as withTiming13
|
|
28918
29001
|
} from "react-native-reanimated";
|
|
28919
29002
|
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
@@ -28951,20 +29034,20 @@ function DismissibleToast({
|
|
|
28951
29034
|
children
|
|
28952
29035
|
}) {
|
|
28953
29036
|
const reduceMotion = useReducedMotion9();
|
|
28954
|
-
const drag =
|
|
28955
|
-
const opacity =
|
|
29037
|
+
const drag = useSharedValue18(0);
|
|
29038
|
+
const opacity = useSharedValue18(1);
|
|
28956
29039
|
const [height, setHeight] = useState69(0);
|
|
28957
29040
|
const onLayout = useCallback38((event) => {
|
|
28958
29041
|
setHeight(event.nativeEvent.layout.height);
|
|
28959
29042
|
}, []);
|
|
28960
|
-
const pan =
|
|
29043
|
+
const pan = useMemo40(
|
|
28961
29044
|
() => Gesture3.Pan().activeOffsetY(ACTIVATE_AFTER2).failOffsetY(FAIL_DOWN_AFTER).failOffsetX([-HORIZONTAL_SLOP, HORIZONTAL_SLOP]).onUpdate((event) => {
|
|
28962
29045
|
"worklet";
|
|
28963
29046
|
drag.value = event.translationY > 0 ? event.translationY * DOWNWARD_RESISTANCE : event.translationY;
|
|
28964
29047
|
}).onEnd((event, success) => {
|
|
28965
29048
|
"worklet";
|
|
28966
29049
|
if (!success || !shouldDismissToast(event.translationY, event.velocityY)) {
|
|
28967
|
-
drag.value =
|
|
29050
|
+
drag.value = withSpring7(0, SETTLE_SPRING);
|
|
28968
29051
|
return;
|
|
28969
29052
|
}
|
|
28970
29053
|
const dismissed = (finished) => {
|
|
@@ -29293,7 +29376,7 @@ import { StyleSheet as StyleSheet66, View as View29 } from "react-native";
|
|
|
29293
29376
|
import Animated29, {
|
|
29294
29377
|
useAnimatedStyle as useAnimatedStyle19,
|
|
29295
29378
|
useReducedMotion as useReducedMotion10,
|
|
29296
|
-
useSharedValue as
|
|
29379
|
+
useSharedValue as useSharedValue19,
|
|
29297
29380
|
withTiming as withTiming14
|
|
29298
29381
|
} from "react-native-reanimated";
|
|
29299
29382
|
import { jsx as jsx132, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
@@ -29321,7 +29404,7 @@ function SurfaceSlot({
|
|
|
29321
29404
|
const [readyFor, setReadyFor] = useState70();
|
|
29322
29405
|
const [uncoveredFor, setUncoveredFor] = useState70();
|
|
29323
29406
|
const ready = activeKey !== void 0 && readyFor === activeKey && !covered;
|
|
29324
|
-
const coverOpacity =
|
|
29407
|
+
const coverOpacity = useSharedValue19(1);
|
|
29325
29408
|
const uncovered = useRef69(onUncovered);
|
|
29326
29409
|
uncovered.current = onUncovered;
|
|
29327
29410
|
const coveredAgain = useRef69(onCovered);
|
|
@@ -30005,15 +30088,15 @@ import { StyleSheet as StyleSheet73, View as View36, useWindowDimensions as useW
|
|
|
30005
30088
|
import Animated34, {
|
|
30006
30089
|
runOnJS as runOnJS4,
|
|
30007
30090
|
useAnimatedStyle as useAnimatedStyle23,
|
|
30008
|
-
useSharedValue as
|
|
30009
|
-
withSpring as
|
|
30091
|
+
useSharedValue as useSharedValue26,
|
|
30092
|
+
withSpring as withSpring10
|
|
30010
30093
|
} from "react-native-reanimated";
|
|
30011
30094
|
import { useSafeAreaInsets as useSafeAreaInsets19 } from "react-native-safe-area-context";
|
|
30012
30095
|
|
|
30013
30096
|
// src/fiat/processing/DepositProcessingCard.tsx
|
|
30014
30097
|
import {
|
|
30015
30098
|
useCallback as useCallback39,
|
|
30016
|
-
useContext as
|
|
30099
|
+
useContext as useContext16,
|
|
30017
30100
|
useEffect as useEffect89,
|
|
30018
30101
|
useRef as useRef71,
|
|
30019
30102
|
useState as useState72
|
|
@@ -30022,8 +30105,8 @@ import { StyleSheet as StyleSheet71, View as View34 } from "react-native";
|
|
|
30022
30105
|
import Animated33, {
|
|
30023
30106
|
useAnimatedStyle as useAnimatedStyle22,
|
|
30024
30107
|
useReducedMotion as useReducedMotion15,
|
|
30025
|
-
useSharedValue as
|
|
30026
|
-
withSpring as
|
|
30108
|
+
useSharedValue as useSharedValue25,
|
|
30109
|
+
withSpring as withSpring9,
|
|
30027
30110
|
withTiming as withTiming20
|
|
30028
30111
|
} from "react-native-reanimated";
|
|
30029
30112
|
|
|
@@ -30120,7 +30203,7 @@ import Animated30, {
|
|
|
30120
30203
|
Easing as Easing10,
|
|
30121
30204
|
useAnimatedProps,
|
|
30122
30205
|
useReducedMotion as useReducedMotion11,
|
|
30123
|
-
useSharedValue as
|
|
30206
|
+
useSharedValue as useSharedValue20,
|
|
30124
30207
|
withDelay as withDelay3,
|
|
30125
30208
|
withTiming as withTiming15
|
|
30126
30209
|
} from "react-native-reanimated";
|
|
@@ -30145,8 +30228,8 @@ function CompletionCheck({
|
|
|
30145
30228
|
onDrawn
|
|
30146
30229
|
}) {
|
|
30147
30230
|
const reduceMotion = useReducedMotion11();
|
|
30148
|
-
const ring2 =
|
|
30149
|
-
const tick =
|
|
30231
|
+
const ring2 = useSharedValue20(reduceMotion ? 1 : 0);
|
|
30232
|
+
const tick = useSharedValue20(reduceMotion ? 1 : 0);
|
|
30150
30233
|
const haptic = useHapticFeedback();
|
|
30151
30234
|
const latestDrawn = useRef70(onDrawn);
|
|
30152
30235
|
latestDrawn.current = onDrawn;
|
|
@@ -30221,7 +30304,7 @@ import { StyleSheet as StyleSheet67, View as View30 } from "react-native";
|
|
|
30221
30304
|
import {
|
|
30222
30305
|
Easing as Easing11,
|
|
30223
30306
|
useDerivedValue,
|
|
30224
|
-
useSharedValue as
|
|
30307
|
+
useSharedValue as useSharedValue21,
|
|
30225
30308
|
withTiming as withTiming16
|
|
30226
30309
|
} from "react-native-reanimated";
|
|
30227
30310
|
import { jsx as jsx135 } from "react/jsx-runtime";
|
|
@@ -30236,7 +30319,7 @@ function CompletionWave({
|
|
|
30236
30319
|
onDone
|
|
30237
30320
|
}) {
|
|
30238
30321
|
const { Canvas, FilterMode, Fill, ImageShader, MipmapMode, Shader } = effects.skia;
|
|
30239
|
-
const elapsed =
|
|
30322
|
+
const elapsed = useSharedValue21(0);
|
|
30240
30323
|
useEffect85(() => {
|
|
30241
30324
|
elapsed.value = withTiming16(PRESSURE_WAVE_DURATION_MS, {
|
|
30242
30325
|
duration: PRESSURE_WAVE_DURATION_MS,
|
|
@@ -30272,8 +30355,8 @@ import { StyleSheet as StyleSheet68, View as View31 } from "react-native";
|
|
|
30272
30355
|
import {
|
|
30273
30356
|
useDerivedValue as useDerivedValue2,
|
|
30274
30357
|
useReducedMotion as useReducedMotion12,
|
|
30275
|
-
useSharedValue as
|
|
30276
|
-
withSpring as
|
|
30358
|
+
useSharedValue as useSharedValue22,
|
|
30359
|
+
withSpring as withSpring8,
|
|
30277
30360
|
withTiming as withTiming17
|
|
30278
30361
|
} from "react-native-reanimated";
|
|
30279
30362
|
import { jsx as jsx136 } from "react/jsx-runtime";
|
|
@@ -30289,10 +30372,10 @@ function ProcessingAurora({
|
|
|
30289
30372
|
const { Canvas, Fill, Shader, useClock } = effects.skia;
|
|
30290
30373
|
const clock = useClock();
|
|
30291
30374
|
const reduceMotion = useReducedMotion12();
|
|
30292
|
-
const fade2 =
|
|
30375
|
+
const fade2 = useSharedValue22(0);
|
|
30293
30376
|
useEffect86(() => {
|
|
30294
30377
|
const target = visible ? 1 : 0;
|
|
30295
|
-
fade2.value = motion === void 0 ? withTiming17(target, { duration: AURORA_FADE_MS }) :
|
|
30378
|
+
fade2.value = motion === void 0 ? withTiming17(target, { duration: AURORA_FADE_MS }) : withSpring8(target, motion);
|
|
30296
30379
|
}, [fade2, motion, visible]);
|
|
30297
30380
|
const uniforms = useDerivedValue2(() => {
|
|
30298
30381
|
"worklet";
|
|
@@ -30312,7 +30395,7 @@ import { StyleSheet as StyleSheet69, View as View32 } from "react-native";
|
|
|
30312
30395
|
import Animated31, {
|
|
30313
30396
|
useAnimatedStyle as useAnimatedStyle20,
|
|
30314
30397
|
useReducedMotion as useReducedMotion13,
|
|
30315
|
-
useSharedValue as
|
|
30398
|
+
useSharedValue as useSharedValue23,
|
|
30316
30399
|
withTiming as withTiming18
|
|
30317
30400
|
} from "react-native-reanimated";
|
|
30318
30401
|
import { jsx as jsx137 } from "react/jsx-runtime";
|
|
@@ -30340,7 +30423,7 @@ function Segment({
|
|
|
30340
30423
|
trackColor
|
|
30341
30424
|
}) {
|
|
30342
30425
|
const reduceMotion = useReducedMotion13();
|
|
30343
|
-
const fill3 =
|
|
30426
|
+
const fill3 = useSharedValue23(reached ? 1 : 0);
|
|
30344
30427
|
useEffect87(() => {
|
|
30345
30428
|
const target = reached ? 1 : 0;
|
|
30346
30429
|
fill3.value = reduceMotion ? target : withTiming18(target, { duration: FILL_MS, easing: MOTION_EASING });
|
|
@@ -30380,7 +30463,7 @@ import Animated32, {
|
|
|
30380
30463
|
Easing as Easing12,
|
|
30381
30464
|
useAnimatedStyle as useAnimatedStyle21,
|
|
30382
30465
|
useReducedMotion as useReducedMotion14,
|
|
30383
|
-
useSharedValue as
|
|
30466
|
+
useSharedValue as useSharedValue24,
|
|
30384
30467
|
withDelay as withDelay4,
|
|
30385
30468
|
withTiming as withTiming19
|
|
30386
30469
|
} from "react-native-reanimated";
|
|
@@ -30403,7 +30486,7 @@ function RevealText({
|
|
|
30403
30486
|
const reduceMotion = useReducedMotion14();
|
|
30404
30487
|
const still = reduceMotion || instant;
|
|
30405
30488
|
const end2 = words.length + FEATHER;
|
|
30406
|
-
const progress =
|
|
30489
|
+
const progress = useSharedValue24(still ? end2 : 0);
|
|
30407
30490
|
useEffect88(() => {
|
|
30408
30491
|
if (still) {
|
|
30409
30492
|
progress.value = end2;
|
|
@@ -30484,7 +30567,7 @@ function DepositProcessingCard({
|
|
|
30484
30567
|
const { t } = useFunkitTranslation();
|
|
30485
30568
|
const effects = useSkiaEffects();
|
|
30486
30569
|
const fadeSpring = useV2DrawerMotion();
|
|
30487
|
-
const corners2 =
|
|
30570
|
+
const corners2 = useContext16(CardContentCornersContext);
|
|
30488
30571
|
const phase = useProcessingPhase(delivered);
|
|
30489
30572
|
const complete = phase.message === "complete";
|
|
30490
30573
|
const { shown, leaving } = useCopySwap(phase.message);
|
|
@@ -30604,9 +30687,9 @@ function FadeOutGroup({
|
|
|
30604
30687
|
motion,
|
|
30605
30688
|
children
|
|
30606
30689
|
}) {
|
|
30607
|
-
const opacity =
|
|
30690
|
+
const opacity = useSharedValue25(1);
|
|
30608
30691
|
useEffect89(() => {
|
|
30609
|
-
opacity.value =
|
|
30692
|
+
opacity.value = withSpring9(fadingOut ? 0 : 1, motion);
|
|
30610
30693
|
}, [fadingOut, motion, opacity]);
|
|
30611
30694
|
const fade2 = useAnimatedStyle22(() => {
|
|
30612
30695
|
"worklet";
|
|
@@ -30623,7 +30706,7 @@ function ProcessingCopy({
|
|
|
30623
30706
|
detailColor
|
|
30624
30707
|
}) {
|
|
30625
30708
|
const reduceMotion = useReducedMotion15();
|
|
30626
|
-
const opacity =
|
|
30709
|
+
const opacity = useSharedValue25(landed && !reduceMotion ? 0 : 1);
|
|
30627
30710
|
useEffect89(() => {
|
|
30628
30711
|
if (leaving) {
|
|
30629
30712
|
opacity.value = withTiming20(0, { duration: COPY_SWAP_MS });
|
|
@@ -31035,11 +31118,11 @@ function useFailureHaptic(failed2) {
|
|
|
31035
31118
|
function useCardTurn(screen2) {
|
|
31036
31119
|
const spring = useV2DrawerMotion();
|
|
31037
31120
|
const [shown, setShown] = useState74(screen2);
|
|
31038
|
-
const progress =
|
|
31121
|
+
const progress = useSharedValue26(screen2 === "paymentFailed" ? 1 : 0);
|
|
31039
31122
|
const turning = shown === "processing" && screen2 === "paymentFailed";
|
|
31040
31123
|
useEffect90(() => {
|
|
31041
31124
|
if (turning) {
|
|
31042
|
-
progress.value =
|
|
31125
|
+
progress.value = withSpring10(1, spring, (finished) => {
|
|
31043
31126
|
"worklet";
|
|
31044
31127
|
if (finished) {
|
|
31045
31128
|
runOnJS4(setShown)("paymentFailed");
|
|
@@ -31830,7 +31913,7 @@ import { useEffect as useEffect95, useRef as useRef74, useState as useState77 }
|
|
|
31830
31913
|
import Animated36, {
|
|
31831
31914
|
useAnimatedStyle as useAnimatedStyle24,
|
|
31832
31915
|
useReducedMotion as useReducedMotion16,
|
|
31833
|
-
useSharedValue as
|
|
31916
|
+
useSharedValue as useSharedValue27,
|
|
31834
31917
|
withTiming as withTiming21
|
|
31835
31918
|
} from "react-native-reanimated";
|
|
31836
31919
|
import { jsx as jsx149 } from "react/jsx-runtime";
|
|
@@ -31846,8 +31929,8 @@ function StateSwap({
|
|
|
31846
31929
|
if (shownKey === stateKey) {
|
|
31847
31930
|
shownChildren.current = children;
|
|
31848
31931
|
}
|
|
31849
|
-
const opacity =
|
|
31850
|
-
const offset =
|
|
31932
|
+
const opacity = useSharedValue27(1);
|
|
31933
|
+
const offset = useSharedValue27(0);
|
|
31851
31934
|
const entered = useRef74(shownKey);
|
|
31852
31935
|
useEffect95(() => {
|
|
31853
31936
|
if (reduceMotion) {
|
|
@@ -34629,7 +34712,7 @@ function FiatDepositAmountStep({
|
|
|
34629
34712
|
const { height } = useFlowStepFrame();
|
|
34630
34713
|
const isCoinbaseWarmupOn = useCoinbaseWarmupGate();
|
|
34631
34714
|
const [coinbaseRouted, setCoinbaseRouted] = useState83(false);
|
|
34632
|
-
const sessionExit =
|
|
34715
|
+
const sessionExit = useSharedValue28(1);
|
|
34633
34716
|
const hasTurned = useRef79(false);
|
|
34634
34717
|
const onEntryScreen = useCallback41((screen2) => {
|
|
34635
34718
|
if (screen2 === null) {
|
|
@@ -34761,7 +34844,7 @@ function useCardSheetFailure({
|
|
|
34761
34844
|
const cardSheet = useNestedSheet();
|
|
34762
34845
|
const actionSlotRef = useRef79(null);
|
|
34763
34846
|
const methodPickerRef = useRef79(null);
|
|
34764
|
-
const coverRefs =
|
|
34847
|
+
const coverRefs = useMemo41(
|
|
34765
34848
|
() => ({ actionSlot: actionSlotRef, methodPicker: methodPickerRef }),
|
|
34766
34849
|
[]
|
|
34767
34850
|
);
|
|
@@ -36243,8 +36326,8 @@ import Animated40, {
|
|
|
36243
36326
|
FadeIn as FadeIn3,
|
|
36244
36327
|
FadeOut as FadeOut4,
|
|
36245
36328
|
useAnimatedStyle as useAnimatedStyle25,
|
|
36246
|
-
useSharedValue as
|
|
36247
|
-
withSpring as
|
|
36329
|
+
useSharedValue as useSharedValue29,
|
|
36330
|
+
withSpring as withSpring11
|
|
36248
36331
|
} from "react-native-reanimated";
|
|
36249
36332
|
|
|
36250
36333
|
// src/flow/cryptoTokenList.ts
|
|
@@ -36403,9 +36486,9 @@ function SearchBar({
|
|
|
36403
36486
|
const { t } = useFunkitTranslation();
|
|
36404
36487
|
const theme = useTheme();
|
|
36405
36488
|
const motion = useV2DrawerMotion();
|
|
36406
|
-
const restingOn =
|
|
36489
|
+
const restingOn = useSharedValue29(bottom);
|
|
36407
36490
|
useEffect103(() => {
|
|
36408
|
-
restingOn.value =
|
|
36491
|
+
restingOn.value = withSpring11(bottom, motion);
|
|
36409
36492
|
}, [bottom, motion, restingOn]);
|
|
36410
36493
|
const barStyle = useAnimatedStyle25(() => {
|
|
36411
36494
|
"worklet";
|
|
@@ -36753,11 +36836,11 @@ function useDepositFlowEvents({
|
|
|
36753
36836
|
|
|
36754
36837
|
// src/flow/storedChain.tsx
|
|
36755
36838
|
import {
|
|
36756
|
-
createContext as
|
|
36839
|
+
createContext as createContext15,
|
|
36757
36840
|
useCallback as useCallback42,
|
|
36758
|
-
useContext as
|
|
36841
|
+
useContext as useContext17,
|
|
36759
36842
|
useEffect as useEffect105,
|
|
36760
|
-
useMemo as
|
|
36843
|
+
useMemo as useMemo42,
|
|
36761
36844
|
useState as useState84
|
|
36762
36845
|
} from "react";
|
|
36763
36846
|
|
|
@@ -36819,7 +36902,7 @@ async function writeSelectedToken(userId, pick) {
|
|
|
36819
36902
|
}
|
|
36820
36903
|
|
|
36821
36904
|
// src/flow/storedChain.tsx
|
|
36822
|
-
var StoredChainContext =
|
|
36905
|
+
var StoredChainContext = createContext15(void 0);
|
|
36823
36906
|
var StoredChainProvider = StoredChainContext.Provider;
|
|
36824
36907
|
function useStoredChainState(userId) {
|
|
36825
36908
|
const [read2, setRead] = useState84();
|
|
@@ -36860,7 +36943,7 @@ function useStoredChainState(userId) {
|
|
|
36860
36943
|
},
|
|
36861
36944
|
[userId]
|
|
36862
36945
|
);
|
|
36863
|
-
return
|
|
36946
|
+
return useMemo42(() => {
|
|
36864
36947
|
const current = read2?.userId === userId ? read2 : void 0;
|
|
36865
36948
|
return {
|
|
36866
36949
|
userId,
|
|
@@ -36871,7 +36954,7 @@ function useStoredChainState(userId) {
|
|
|
36871
36954
|
}, [userId, read2, remember]);
|
|
36872
36955
|
}
|
|
36873
36956
|
function useStoredChain(userId) {
|
|
36874
|
-
const fromProvider =
|
|
36957
|
+
const fromProvider = useContext17(StoredChainContext);
|
|
36875
36958
|
const shared = fromProvider?.userId === userId ? fromProvider : void 0;
|
|
36876
36959
|
const own = useStoredChainState(shared ? void 0 : userId);
|
|
36877
36960
|
return shared ?? own;
|
|
@@ -36996,7 +37079,7 @@ function FlowContent({
|
|
|
36996
37079
|
const fops = hideCashMethods ? withoutCashMethods(fetchedFops) : fetchedFops;
|
|
36997
37080
|
const { isLoading: isStatsigLoading } = useStatsigClient2();
|
|
36998
37081
|
const [selectedSwappedUrl, setSelectedSwappedUrl] = useState85();
|
|
36999
|
-
const minDepositTarget =
|
|
37082
|
+
const minDepositTarget = useMemo43(
|
|
37000
37083
|
() => ({
|
|
37001
37084
|
targetChain: targetAsset.activeCheckoutConfig?.targetChain,
|
|
37002
37085
|
targetAsset: targetAsset.activeCheckoutConfig?.targetAsset,
|
|
@@ -37010,7 +37093,7 @@ function FlowContent({
|
|
|
37010
37093
|
config.checkoutConfig?.getMinDepositUSD
|
|
37011
37094
|
]
|
|
37012
37095
|
);
|
|
37013
|
-
const availableChains =
|
|
37096
|
+
const availableChains = useMemo43(
|
|
37014
37097
|
() => buildAvailableChains({
|
|
37015
37098
|
t,
|
|
37016
37099
|
chainFilters: tokenChainFilters,
|
|
@@ -37036,7 +37119,7 @@ function FlowContent({
|
|
|
37036
37119
|
rememberedSymbol,
|
|
37037
37120
|
tokenFirst: isCryptoFlowScreen(current)
|
|
37038
37121
|
});
|
|
37039
|
-
const lockedQuoteTarget =
|
|
37122
|
+
const lockedQuoteTarget = useMemo43(() => {
|
|
37040
37123
|
const active = targetAsset.activeCheckoutConfig;
|
|
37041
37124
|
if (!active || !isAddress(active.targetAsset)) {
|
|
37042
37125
|
return void 0;
|
|
@@ -37755,10 +37838,10 @@ function isV2DepositCustomer(apiKey) {
|
|
|
37755
37838
|
}
|
|
37756
37839
|
|
|
37757
37840
|
// src/flow/flowStepHeight.tsx
|
|
37758
|
-
import { createContext as
|
|
37841
|
+
import { createContext as createContext16, useContext as useContext18 } from "react";
|
|
37759
37842
|
import { Platform as Platform9 } from "react-native";
|
|
37760
37843
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
37761
|
-
var FlowContainerHeightContext =
|
|
37844
|
+
var FlowContainerHeightContext = createContext16(void 0);
|
|
37762
37845
|
function FlowContainerHeightProvider({
|
|
37763
37846
|
height,
|
|
37764
37847
|
children
|
|
@@ -37766,7 +37849,7 @@ function FlowContainerHeightProvider({
|
|
|
37766
37849
|
return /* @__PURE__ */ jsx182(FlowContainerHeightContext.Provider, { value: height, children });
|
|
37767
37850
|
}
|
|
37768
37851
|
function useFullHeightStep(windowHeight) {
|
|
37769
|
-
const containerHeight =
|
|
37852
|
+
const containerHeight = useContext18(FlowContainerHeightContext);
|
|
37770
37853
|
return Platform9.OS === "web" || Platform9.OS === "android" ? containerHeight ?? windowHeight : windowHeight;
|
|
37771
37854
|
}
|
|
37772
37855
|
|
|
@@ -37973,7 +38056,7 @@ function useCopiedToast() {
|
|
|
37973
38056
|
import {
|
|
37974
38057
|
useCallback as useCallback45,
|
|
37975
38058
|
useEffect as useEffect109,
|
|
37976
|
-
useMemo as
|
|
38059
|
+
useMemo as useMemo44,
|
|
37977
38060
|
useRef as useRef85,
|
|
37978
38061
|
useState as useState87
|
|
37979
38062
|
} from "react";
|
|
@@ -38074,7 +38157,7 @@ function useFlowTransitions({
|
|
|
38074
38157
|
settle("close", true);
|
|
38075
38158
|
settle("any", false);
|
|
38076
38159
|
}, [settle]);
|
|
38077
|
-
const transitions =
|
|
38160
|
+
const transitions = useMemo44(
|
|
38078
38161
|
() => ({ close, hide, resume, isHidden }),
|
|
38079
38162
|
[close, hide, resume, isHidden]
|
|
38080
38163
|
);
|
|
@@ -38658,7 +38741,7 @@ import {
|
|
|
38658
38741
|
isWithdrawalAddressSupported as isWithdrawalAddressSupported2,
|
|
38659
38742
|
useDebouncedValue as useDebouncedValue2
|
|
38660
38743
|
} from "@funkit/connect-core";
|
|
38661
|
-
import { useMemo as
|
|
38744
|
+
import { useMemo as useMemo46, useState as useState92 } from "react";
|
|
38662
38745
|
import { zeroAddress as zeroAddress2 } from "viem";
|
|
38663
38746
|
|
|
38664
38747
|
// src/withdrawal/sourceToken.ts
|
|
@@ -39298,7 +39381,7 @@ function useWithdrawalMaximum({
|
|
|
39298
39381
|
import { getSupportedAssets as getSupportedAssets2 } from "@funkit/api-base";
|
|
39299
39382
|
import { resolveTokenTransferConfig as resolveTokenTransferConfig2 } from "@funkit/connect-core";
|
|
39300
39383
|
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
39301
|
-
import { useMemo as
|
|
39384
|
+
import { useMemo as useMemo45, useState as useState90 } from "react";
|
|
39302
39385
|
var WITHDRAWAL_DESTINATION_TOKENS_QUERY_KEY = "withdrawalDestinations";
|
|
39303
39386
|
function useWithdrawalDestinationTokens({
|
|
39304
39387
|
sourceToken,
|
|
@@ -39315,7 +39398,7 @@ function useWithdrawalDestinationTokens({
|
|
|
39315
39398
|
enabled: !!apiKey,
|
|
39316
39399
|
staleTime: Number.POSITIVE_INFINITY
|
|
39317
39400
|
});
|
|
39318
|
-
const resolved =
|
|
39401
|
+
const resolved = useMemo45(() => {
|
|
39319
39402
|
if (!supportedAssets) {
|
|
39320
39403
|
return void 0;
|
|
39321
39404
|
}
|
|
@@ -39327,7 +39410,7 @@ function useWithdrawalDestinationTokens({
|
|
|
39327
39410
|
logger
|
|
39328
39411
|
});
|
|
39329
39412
|
}, [supportedAssets, withdrawalConfig, disabledChainAssets]);
|
|
39330
|
-
const chains =
|
|
39413
|
+
const chains = useMemo45(() => {
|
|
39331
39414
|
if (!resolved) {
|
|
39332
39415
|
return [];
|
|
39333
39416
|
}
|
|
@@ -39337,7 +39420,7 @@ function useWithdrawalDestinationTokens({
|
|
|
39337
39420
|
}));
|
|
39338
39421
|
}, [resolved]);
|
|
39339
39422
|
const [picked, setPicked] = useState90();
|
|
39340
|
-
const destinationToken =
|
|
39423
|
+
const destinationToken = useMemo45(() => {
|
|
39341
39424
|
if (!resolved) {
|
|
39342
39425
|
return void 0;
|
|
39343
39426
|
}
|
|
@@ -39516,7 +39599,7 @@ function useCryptoWithdrawalForm({
|
|
|
39516
39599
|
const selectedSourceIndex = sourceIndex < sourceOptions.length ? sourceIndex : 0;
|
|
39517
39600
|
const sourceOption = sourceOptions[selectedSourceIndex];
|
|
39518
39601
|
const sourceToken = sourceOption.token;
|
|
39519
|
-
const sourceTokenParams =
|
|
39602
|
+
const sourceTokenParams = useMemo46(() => ({ sourceToken }), [sourceToken]);
|
|
39520
39603
|
const sourceLabel = sourceOption.label ?? sourceToken.symbol;
|
|
39521
39604
|
const {
|
|
39522
39605
|
value: balance,
|
|
@@ -40024,7 +40107,7 @@ function useCryptoWithdrawalSubmit({
|
|
|
40024
40107
|
}
|
|
40025
40108
|
|
|
40026
40109
|
// src/screens/SelectReceiveTokenAndChainScreen.tsx
|
|
40027
|
-
import { useMemo as
|
|
40110
|
+
import { useMemo as useMemo47 } from "react";
|
|
40028
40111
|
|
|
40029
40112
|
// src/withdrawal/receiveDestination.ts
|
|
40030
40113
|
function receivableTokens(chains) {
|
|
@@ -40042,7 +40125,7 @@ function SelectReceiveTokenAndChainScreen({
|
|
|
40042
40125
|
const { t } = useFunkitTranslation();
|
|
40043
40126
|
const theme = useTheme();
|
|
40044
40127
|
const frame = useFlowStepFrame();
|
|
40045
|
-
const tokens =
|
|
40128
|
+
const tokens = useMemo47(
|
|
40046
40129
|
() => receivableTokens(chains).map((symbol) => ({
|
|
40047
40130
|
symbol,
|
|
40048
40131
|
chainIds: chains.filter((chain) => chain.symbols.includes(symbol)).map((chain) => chain.chainId)
|
|
@@ -40936,7 +41019,7 @@ import Animated47, { Keyframe as Keyframe9, LinearTransition as LinearTransition
|
|
|
40936
41019
|
import { useSafeAreaInsets as useSafeAreaInsets32 } from "react-native-safe-area-context";
|
|
40937
41020
|
|
|
40938
41021
|
// src/components/AmountDisplay.tsx
|
|
40939
|
-
import { useMemo as
|
|
41022
|
+
import { useMemo as useMemo48 } from "react";
|
|
40940
41023
|
import { StyleSheet as StyleSheet102, useWindowDimensions as useWindowDimensions15 } from "react-native";
|
|
40941
41024
|
import Animated45, {
|
|
40942
41025
|
Keyframe as Keyframe8,
|
|
@@ -40988,7 +41071,7 @@ function AmountDisplay2({
|
|
|
40988
41071
|
const fontSize = fitAmountFontSize(text3, width - HORIZONTAL_INSET * 2);
|
|
40989
41072
|
const overhang = fontSize * (LINE_HEIGHT_RATIO2 - CAP_BOX_RATIO2) / 2;
|
|
40990
41073
|
const lineHeight = fontSize * LINE_HEIGHT_RATIO2;
|
|
40991
|
-
const slides =
|
|
41074
|
+
const slides = useMemo48(
|
|
40992
41075
|
() => ({
|
|
40993
41076
|
below: slideKeyframes2(lineHeight),
|
|
40994
41077
|
above: slideKeyframes2(-lineHeight)
|
|
@@ -41862,11 +41945,11 @@ import {
|
|
|
41862
41945
|
import { useTheme as useTheme4 } from "@shopify/restyle";
|
|
41863
41946
|
import { useStatsigClient as useStatsigClient3 } from "@statsig/react-bindings";
|
|
41864
41947
|
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
41865
|
-
import { useMemo as
|
|
41948
|
+
import { useMemo as useMemo49 } from "react";
|
|
41866
41949
|
var WITHDRAW_FOPS_QUERY_KEY = "withdrawFops";
|
|
41867
41950
|
function useWithdrawalRoute(config) {
|
|
41868
41951
|
const sourceOverrides = useDynamicConfig("swappedwithdrawalsourceoverrides");
|
|
41869
|
-
return
|
|
41952
|
+
return useMemo49(
|
|
41870
41953
|
() => resolveSwappedWithdrawalLegs({
|
|
41871
41954
|
source: config.sourceToken,
|
|
41872
41955
|
target: config.swappedAcceptedToken,
|
|
@@ -41999,7 +42082,7 @@ function useWithdrawalFops({
|
|
|
41999
42082
|
logger
|
|
42000
42083
|
});
|
|
42001
42084
|
const theme = useTheme4();
|
|
42002
|
-
const themeConfig =
|
|
42085
|
+
const themeConfig = useMemo49(
|
|
42003
42086
|
() => buildSwappedThemeQueryParamsRN(theme),
|
|
42004
42087
|
[theme]
|
|
42005
42088
|
);
|
|
@@ -42453,7 +42536,7 @@ function loadStripeSdk() {
|
|
|
42453
42536
|
}
|
|
42454
42537
|
|
|
42455
42538
|
// src/fiat/providers/stripe/useStripeOnrampClient.ts
|
|
42456
|
-
import { useCallback as useCallback51, useEffect as useEffect116, useMemo as
|
|
42539
|
+
import { useCallback as useCallback51, useEffect as useEffect116, useMemo as useMemo50, useRef as useRef93 } from "react";
|
|
42457
42540
|
|
|
42458
42541
|
// src/fiat/providers/stripe/stripeApplePayButton.tsx
|
|
42459
42542
|
import { jsx as jsx204 } from "react/jsx-runtime";
|
|
@@ -42560,11 +42643,11 @@ function useStripeOnrampClient({
|
|
|
42560
42643
|
});
|
|
42561
42644
|
});
|
|
42562
42645
|
}, [ensureReady]);
|
|
42563
|
-
const ApplePayButton =
|
|
42646
|
+
const ApplePayButton = useMemo50(
|
|
42564
42647
|
() => bindStripeApplePayButton({ PlatformPay, PlatformPayButton }),
|
|
42565
42648
|
[PlatformPay, PlatformPayButton]
|
|
42566
42649
|
);
|
|
42567
|
-
return
|
|
42650
|
+
return useMemo50(
|
|
42568
42651
|
() => ({
|
|
42569
42652
|
ApplePayButton,
|
|
42570
42653
|
hasLinkAccount: async (email) => {
|
|
@@ -42726,7 +42809,7 @@ var RN_V2_CRYPTO_DEPOSIT_GATE = "enable-rn-v2-crypto-deposit";
|
|
|
42726
42809
|
function isStaleDepositCallback(name) {
|
|
42727
42810
|
return name === "onDepositError";
|
|
42728
42811
|
}
|
|
42729
|
-
var FunkitFlowContext =
|
|
42812
|
+
var FunkitFlowContext = createContext17(null);
|
|
42730
42813
|
function FunkitFlowProvider({
|
|
42731
42814
|
children,
|
|
42732
42815
|
copyToClipboard: copyToClipboard2 = copyToClipboard,
|
|
@@ -42779,7 +42862,7 @@ function FunkitFlowProvider({
|
|
|
42779
42862
|
const isV2DepositEnabled = isV2DepositGateOn || isV2DepositCustomer(apiKey);
|
|
42780
42863
|
const isV2CryptoDepositGateOn = useFeatureGate7(RN_V2_CRYPTO_DEPOSIT_GATE);
|
|
42781
42864
|
const isV2CryptoDepositEnabled = isV2DepositEnabled && isV2CryptoDepositGateOn;
|
|
42782
|
-
const nativeCapabilities =
|
|
42865
|
+
const nativeCapabilities = useMemo51(
|
|
42783
42866
|
() => ({
|
|
42784
42867
|
renderBackdropBlur,
|
|
42785
42868
|
...liquidGlass === void 0 ? {} : { liquidGlass },
|
|
@@ -43018,7 +43101,7 @@ function FunkitFlowProvider({
|
|
|
43018
43101
|
return { ...prev, stack: prev.stack.slice(0, -1) };
|
|
43019
43102
|
});
|
|
43020
43103
|
}, [closeFlow, state]);
|
|
43021
|
-
const value =
|
|
43104
|
+
const value = useMemo51(
|
|
43022
43105
|
() => ({
|
|
43023
43106
|
activeFlow: state.flow,
|
|
43024
43107
|
beginDeposit,
|
|
@@ -43036,7 +43119,7 @@ function FunkitFlowProvider({
|
|
|
43036
43119
|
isCryptoSearchOpen
|
|
43037
43120
|
);
|
|
43038
43121
|
const isHomeScreen = state.stack.length <= 1;
|
|
43039
|
-
const nav =
|
|
43122
|
+
const nav = useMemo51(
|
|
43040
43123
|
() => ({ navigate, back, reset, popTo, closeFlow }),
|
|
43041
43124
|
[navigate, back, reset, popTo, closeFlow]
|
|
43042
43125
|
);
|
|
@@ -43144,7 +43227,7 @@ function useCryptoSheetDetents(current, rootHeight, searching) {
|
|
|
43144
43227
|
const { top: topInset } = useSafeAreaInsets34();
|
|
43145
43228
|
const page = isCryptoFlowScreen(current) ? current : void 0;
|
|
43146
43229
|
const boxHeight = rootHeight ?? windowHeight;
|
|
43147
|
-
return
|
|
43230
|
+
return useMemo51(
|
|
43148
43231
|
() => page === void 0 ? void 0 : cryptoSheetDetents(
|
|
43149
43232
|
page,
|
|
43150
43233
|
{ windowHeight: boxHeight, topInset },
|
|
@@ -43191,7 +43274,7 @@ function usePendingOpens(state, setState) {
|
|
|
43191
43274
|
settle(state.isOpen ? state.session : Number.POSITIVE_INFINITY);
|
|
43192
43275
|
}, [state]);
|
|
43193
43276
|
useEffect118(() => () => settle(Number.POSITIVE_INFINITY), []);
|
|
43194
|
-
return
|
|
43277
|
+
return useMemo51(
|
|
43195
43278
|
() => ({
|
|
43196
43279
|
open: (next) => new Promise((resolve2) => {
|
|
43197
43280
|
pending.current.push({ session: next.session, resolve: resolve2 });
|
|
@@ -43271,7 +43354,7 @@ function assertFiatRailConfigured(config, getIdentityAssertion) {
|
|
|
43271
43354
|
}
|
|
43272
43355
|
}
|
|
43273
43356
|
function useFunkitFlow() {
|
|
43274
|
-
const value =
|
|
43357
|
+
const value = useContext19(FunkitFlowContext);
|
|
43275
43358
|
if (value == null) {
|
|
43276
43359
|
throw new Error("useFunkitFlow must be used within <FunkitProvider>");
|
|
43277
43360
|
}
|
|
@@ -43303,7 +43386,7 @@ function sameIdentity(a, b) {
|
|
|
43303
43386
|
}
|
|
43304
43387
|
|
|
43305
43388
|
// src/version.ts
|
|
43306
|
-
var CONNECT_RN_VERSION = true ? "9.6.
|
|
43389
|
+
var CONNECT_RN_VERSION = true ? "9.6.1" : "0.0.0-dev";
|
|
43307
43390
|
|
|
43308
43391
|
// src/providers/FunkitStatsigProvider.tsx
|
|
43309
43392
|
import {
|
|
@@ -43312,7 +43395,7 @@ import {
|
|
|
43312
43395
|
StatsigProvider
|
|
43313
43396
|
} from "@statsig/react-bindings";
|
|
43314
43397
|
import { STATSIG_NETWORK_TIMEOUT_MS } from "@funkit/connect-core";
|
|
43315
|
-
import { useEffect as useEffect119, useMemo as
|
|
43398
|
+
import { useEffect as useEffect119, useMemo as useMemo53, useState as useState99 } from "react";
|
|
43316
43399
|
|
|
43317
43400
|
// src/statsig/useClientAsyncInitRN.ts
|
|
43318
43401
|
import {
|
|
@@ -43501,7 +43584,7 @@ import {
|
|
|
43501
43584
|
FunWhnStatsigContext,
|
|
43502
43585
|
useFunWhnStatsigClientValue
|
|
43503
43586
|
} from "@funkit/connect-core";
|
|
43504
|
-
import { useMemo as
|
|
43587
|
+
import { useMemo as useMemo52 } from "react";
|
|
43505
43588
|
import { jsx as jsx207 } from "react/jsx-runtime";
|
|
43506
43589
|
var STATSIG_CLIENT_KEY_FUN_WHN = "client-UrueDVSY9et85npGccWMFidPs00V5jzTYyzsDKlLAjr";
|
|
43507
43590
|
function FunkitStatsigWhnProvider({
|
|
@@ -43510,7 +43593,7 @@ function FunkitStatsigWhnProvider({
|
|
|
43510
43593
|
options,
|
|
43511
43594
|
userId
|
|
43512
43595
|
}) {
|
|
43513
|
-
const statsigUser =
|
|
43596
|
+
const statsigUser = useMemo52(
|
|
43514
43597
|
() => buildFunkitStatsigUser(userId, apiKey),
|
|
43515
43598
|
[apiKey, userId]
|
|
43516
43599
|
);
|
|
@@ -43546,11 +43629,11 @@ function FunkitStatsigProvider({
|
|
|
43546
43629
|
userId,
|
|
43547
43630
|
isDevelopment = false
|
|
43548
43631
|
}) {
|
|
43549
|
-
const user =
|
|
43632
|
+
const user = useMemo53(
|
|
43550
43633
|
() => buildFunkitStatsigUser(userId, apiKey),
|
|
43551
43634
|
[userId, apiKey]
|
|
43552
43635
|
);
|
|
43553
|
-
const options =
|
|
43636
|
+
const options = useMemo53(
|
|
43554
43637
|
() => ({
|
|
43555
43638
|
networkConfig: {
|
|
43556
43639
|
api: STATSIG_API,
|
|
@@ -43645,7 +43728,7 @@ function FunkitProvider({
|
|
|
43645
43728
|
config: config ?? ANONYMOUS_CONFIG,
|
|
43646
43729
|
walletAddress
|
|
43647
43730
|
});
|
|
43648
|
-
const identity =
|
|
43731
|
+
const identity = useMemo54(
|
|
43649
43732
|
() => resolveFunkitIdentity(identityProps.config, identityProps.walletAddress),
|
|
43650
43733
|
[identityProps]
|
|
43651
43734
|
);
|
|
@@ -43741,7 +43824,7 @@ import {
|
|
|
43741
43824
|
purifyCheckoutHistoryItem,
|
|
43742
43825
|
useRecentDepositsApiQuery
|
|
43743
43826
|
} from "@funkit/connect-core";
|
|
43744
|
-
import { useMemo as
|
|
43827
|
+
import { useMemo as useMemo55 } from "react";
|
|
43745
43828
|
function useFunkitRecentDeposits(query) {
|
|
43746
43829
|
const { apiKey, userId } = useFunkitIdentity();
|
|
43747
43830
|
const { listRefresh } = useDynamicConfig(
|
|
@@ -43773,14 +43856,14 @@ function useFunkitRecentDepositsImpl({
|
|
|
43773
43856
|
// over-fetch to account for merging
|
|
43774
43857
|
logger
|
|
43775
43858
|
});
|
|
43776
|
-
const mergedDirectExecutions =
|
|
43859
|
+
const mergedDirectExecutions = useMemo55(
|
|
43777
43860
|
() => processRecentDepositsForNotifications(
|
|
43778
43861
|
memoizedFilterFunc ? directExecutions?.filter(memoizedFilterFunc) : directExecutions,
|
|
43779
43862
|
{ cutOffTimeMs }
|
|
43780
43863
|
),
|
|
43781
43864
|
[directExecutions, cutOffTimeMs, memoizedFilterFunc]
|
|
43782
43865
|
);
|
|
43783
|
-
return
|
|
43866
|
+
return useMemo55(
|
|
43784
43867
|
() => ({
|
|
43785
43868
|
data: mergedDirectExecutions?.map((de) => purifyCheckoutHistoryItem(de)).slice(0, fetchSize)
|
|
43786
43869
|
}),
|