@funkit/connect-rn 3.8.0 → 3.9.0
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 +23 -0
- package/dist/chunk-FTD4HETU.js +94 -0
- package/dist/chunk-FTD4HETU.js.map +7 -0
- package/dist/{chunk-UN5NP4RP.js → chunk-PHUM52HD.js} +99 -1
- package/dist/chunk-PHUM52HD.js.map +7 -0
- package/dist/clients/lighter.js +1 -1
- package/dist/clients/nado/index.d.ts +4 -0
- package/dist/clients/nado/index.d.ts.map +1 -0
- package/dist/clients/nado/nadoWithdrawalConfig.d.ts +38 -0
- package/dist/clients/nado/nadoWithdrawalConfig.d.ts.map +1 -0
- package/dist/clients/nado/useNadoWithdrawal.d.ts +14 -0
- package/dist/clients/nado/useNadoWithdrawal.d.ts.map +1 -0
- package/dist/clients/nado/withdrawalErrors.d.ts +9 -0
- package/dist/clients/nado/withdrawalErrors.d.ts.map +1 -0
- package/dist/clients/nado/withdrawalSubmit.d.ts +37 -0
- package/dist/clients/nado/withdrawalSubmit.d.ts.map +1 -0
- package/dist/clients/nado.d.ts +1 -0
- package/dist/clients/nado.js +417 -0
- package/dist/clients/nado.js.map +7 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +415 -360
- package/dist/index.js.map +4 -4
- package/dist/src/flow/WithdrawalFlowContent.d.ts.map +1 -1
- package/dist/src/flow/withdrawalFlowConfig.d.ts +25 -3
- package/dist/src/flow/withdrawalFlowConfig.d.ts.map +1 -1
- package/dist/src/screens/WithdrawCompleteScreen.d.ts +16 -7
- package/dist/src/screens/WithdrawCompleteScreen.d.ts.map +1 -1
- package/dist/src/screens/WithdrawCryptoComplete.d.ts +9 -4
- package/dist/src/screens/WithdrawCryptoComplete.d.ts.map +1 -1
- package/dist/src/screens/WithdrawCryptoSteps.d.ts +2 -1
- package/dist/src/screens/WithdrawCryptoSteps.d.ts.map +1 -1
- package/dist/src/swapped/SwappedWebView.d.ts.map +1 -1
- package/dist/src/withdrawal/useCryptoWithdrawalExecution.d.ts +16 -2
- package/dist/src/withdrawal/useCryptoWithdrawalExecution.d.ts.map +1 -1
- package/dist/src/withdrawal/useCryptoWithdrawalSubmit.d.ts +2 -1
- package/dist/src/withdrawal/useCryptoWithdrawalSubmit.d.ts.map +1 -1
- package/dist/src/withdrawal/useDepositAddressWithdrawalStatus.d.ts +21 -0
- package/dist/src/withdrawal/useDepositAddressWithdrawalStatus.d.ts.map +1 -0
- package/dist/src/withdrawal/useWithdrawalStatus.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-UN5NP4RP.js.map +0 -7
package/dist/index.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDynamicConfig,
|
|
3
|
+
useIsStablecoin,
|
|
4
|
+
useSourceTokenUsdPrice,
|
|
5
|
+
useUserIpInfo
|
|
6
|
+
} from "./chunk-FTD4HETU.js";
|
|
1
7
|
import {
|
|
2
8
|
FunkitI18nProvider,
|
|
3
9
|
FunkitIdentityProvider,
|
|
10
|
+
UNSET_WALLET_ADDRESS,
|
|
4
11
|
isLighterxyzApiKey,
|
|
5
12
|
isUsableWalletAddress,
|
|
6
13
|
logger,
|
|
7
14
|
resolveFunkitIdentity,
|
|
8
15
|
useFunkitIdentity,
|
|
9
16
|
useFunkitTranslation
|
|
10
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PHUM52HD.js";
|
|
11
18
|
|
|
12
19
|
// src/theme/tokens.ts
|
|
13
20
|
function fontFamilyForWeight(family, styleName) {
|
|
@@ -453,16 +460,16 @@ function useFunkitColorScheme() {
|
|
|
453
460
|
|
|
454
461
|
// src/providers/FunkitProvider.tsx
|
|
455
462
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
456
|
-
import { useEffect as
|
|
463
|
+
import { useEffect as useEffect21, useMemo as useMemo14, useRef as useRef16 } from "react";
|
|
457
464
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
458
465
|
|
|
459
466
|
// src/flow/FunkitFlowProvider.tsx
|
|
460
467
|
import {
|
|
461
468
|
createContext as createContext3,
|
|
462
|
-
useCallback as
|
|
469
|
+
useCallback as useCallback15,
|
|
463
470
|
useContext as useContext3,
|
|
464
471
|
useMemo as useMemo12,
|
|
465
|
-
useState as
|
|
472
|
+
useState as useState23
|
|
466
473
|
} from "react";
|
|
467
474
|
import { View as View9 } from "react-native";
|
|
468
475
|
|
|
@@ -517,7 +524,7 @@ async function pasteFromClipboard() {
|
|
|
517
524
|
// src/flow/DepositFlowContent.tsx
|
|
518
525
|
import { BottomSheetModal as BottomSheetModal2, BottomSheetView as BottomSheetView2 } from "@gorhom/bottom-sheet";
|
|
519
526
|
import { useStatsigClient } from "@statsig/react-bindings";
|
|
520
|
-
import { useCallback as
|
|
527
|
+
import { useCallback as useCallback7, useEffect as useEffect15, useState as useState11 } from "react";
|
|
521
528
|
import { Share } from "react-native";
|
|
522
529
|
import { useSafeAreaInsets as useSafeAreaInsets5 } from "react-native-safe-area-context";
|
|
523
530
|
|
|
@@ -525,32 +532,6 @@ import { useSafeAreaInsets as useSafeAreaInsets5 } from "react-native-safe-area-
|
|
|
525
532
|
import { useEffect as useEffect2, useMemo as useMemo3 } from "react";
|
|
526
533
|
import { useEffectEvent } from "@funkit/connect-core";
|
|
527
534
|
|
|
528
|
-
// src/statsig/useDynamicConfig.ts
|
|
529
|
-
import {
|
|
530
|
-
useDynamicConfig as useCoreDynamicConfig
|
|
531
|
-
} from "@funkit/connect-core";
|
|
532
|
-
|
|
533
|
-
// src/geo/useUserIpInfo.ts
|
|
534
|
-
import { useUserIpInfo as useCoreUserIpInfo } from "@funkit/connect-core";
|
|
535
|
-
function useUserIpInfo() {
|
|
536
|
-
const { apiKey } = useFunkitIdentity();
|
|
537
|
-
return useCoreUserIpInfo({
|
|
538
|
-
logger,
|
|
539
|
-
apiKey,
|
|
540
|
-
enabled: true,
|
|
541
|
-
staleTime: Number.POSITIVE_INFINITY
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
// src/statsig/useDynamicConfig.ts
|
|
546
|
-
var useDynamicConfig = (name, options) => {
|
|
547
|
-
const { userIpInfo } = useUserIpInfo();
|
|
548
|
-
return useCoreDynamicConfig(name, {
|
|
549
|
-
bypassCountryCode: options?.bypassCountryCode,
|
|
550
|
-
countryCode: userIpInfo?.alpha2
|
|
551
|
-
});
|
|
552
|
-
};
|
|
553
|
-
|
|
554
535
|
// src/geo/isCountryBlocked.ts
|
|
555
536
|
var ALL_MATCH = "*";
|
|
556
537
|
function isCountryBlocked(blockedList, userIpInfo) {
|
|
@@ -3047,15 +3028,16 @@ var styles8 = StyleSheet8.create({
|
|
|
3047
3028
|
});
|
|
3048
3029
|
|
|
3049
3030
|
// src/swapped/SwappedScreen.tsx
|
|
3050
|
-
import { useCallback as
|
|
3031
|
+
import { useCallback as useCallback4 } from "react";
|
|
3051
3032
|
|
|
3052
3033
|
// src/swapped/SwappedScreenShell.tsx
|
|
3053
|
-
import { useCallback as
|
|
3034
|
+
import { useCallback as useCallback3 } from "react";
|
|
3054
3035
|
|
|
3055
3036
|
// src/swapped/SwappedWebView.tsx
|
|
3056
3037
|
import { useTheme as useTheme2 } from "@shopify/restyle";
|
|
3057
|
-
import {
|
|
3038
|
+
import { useEffect as useEffect9, useMemo as useMemo4, useRef as useRef7, useState as useState9 } from "react";
|
|
3058
3039
|
import { ActivityIndicator, View as View3 } from "react-native";
|
|
3040
|
+
import Animated3, { FadeOut } from "react-native-reanimated";
|
|
3059
3041
|
import {
|
|
3060
3042
|
WebView
|
|
3061
3043
|
} from "react-native-webview";
|
|
@@ -3314,7 +3296,7 @@ function createWebViewSwappedTransport({
|
|
|
3314
3296
|
}
|
|
3315
3297
|
|
|
3316
3298
|
// src/swapped/SwappedWebView.tsx
|
|
3317
|
-
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3299
|
+
import { jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3318
3300
|
function SwappedWebView({ url, onMessage, style }) {
|
|
3319
3301
|
const webViewRef = useRef7(null);
|
|
3320
3302
|
const lastCommittedUrlRef = useRef7(url);
|
|
@@ -3334,11 +3316,21 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
3334
3316
|
swappedThemeRef.current = swappedTheme;
|
|
3335
3317
|
const colorSchemeRef = useRef7(colorScheme);
|
|
3336
3318
|
colorSchemeRef.current = colorScheme;
|
|
3319
|
+
const [isEmbedReady, setIsEmbedReady] = useState9(false);
|
|
3320
|
+
useEffect9(() => {
|
|
3321
|
+
setIsEmbedReady(false);
|
|
3322
|
+
const timer = setTimeout(
|
|
3323
|
+
() => setIsEmbedReady(true),
|
|
3324
|
+
EMBED_READY_TIMEOUT_MS
|
|
3325
|
+
);
|
|
3326
|
+
return () => clearTimeout(timer);
|
|
3327
|
+
}, [url]);
|
|
3337
3328
|
const handlerRef = useRef7(onMessage);
|
|
3338
3329
|
handlerRef.current = onMessage;
|
|
3339
3330
|
useEffect9(
|
|
3340
3331
|
() => transport.onMessage((msg) => {
|
|
3341
3332
|
if (msg.type === "SWAPPED_READY") {
|
|
3333
|
+
setIsEmbedReady(true);
|
|
3342
3334
|
transport.send({
|
|
3343
3335
|
type: "SWAPPED_THEME",
|
|
3344
3336
|
data: swappedThemeRef.current
|
|
@@ -3362,17 +3354,8 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
3362
3354
|
event.nativeEvent.url || lastCommittedUrlRef.current
|
|
3363
3355
|
);
|
|
3364
3356
|
};
|
|
3365
|
-
const renderLoading = useCallback3(
|
|
3366
|
-
() => /* @__PURE__ */ jsx22(
|
|
3367
|
-
View3,
|
|
3368
|
-
{
|
|
3369
|
-
style: [loadingOverlay, { backgroundColor: theme.background.modal }],
|
|
3370
|
-
children: /* @__PURE__ */ jsx22(ActivityIndicator, { color: theme.content.elements.secondary })
|
|
3371
|
-
}
|
|
3372
|
-
),
|
|
3373
|
-
[theme.background.modal, theme.content.elements.secondary]
|
|
3374
|
-
);
|
|
3375
3357
|
const handleError = (event) => {
|
|
3358
|
+
setIsEmbedReady(true);
|
|
3376
3359
|
logger.warn("connect-rn:swapped:webview:error", {
|
|
3377
3360
|
code: String(event.nativeEvent.code),
|
|
3378
3361
|
description: event.nativeEvent.description,
|
|
@@ -3385,34 +3368,45 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
3385
3368
|
url: event.nativeEvent.url
|
|
3386
3369
|
});
|
|
3387
3370
|
};
|
|
3388
|
-
return /* @__PURE__ */
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3371
|
+
return /* @__PURE__ */ jsxs10(View3, { style: [fill, style], children: [
|
|
3372
|
+
/* @__PURE__ */ jsx22(
|
|
3373
|
+
WebView,
|
|
3374
|
+
{
|
|
3375
|
+
ref: webViewRef,
|
|
3376
|
+
source: { uri: url },
|
|
3377
|
+
onMessage: handleMessage,
|
|
3378
|
+
onNavigationStateChange: handleNavigationStateChange,
|
|
3379
|
+
onError: handleError,
|
|
3380
|
+
onHttpError: handleHttpError,
|
|
3381
|
+
scrollEnabled: false,
|
|
3382
|
+
injectedJavaScriptBeforeContentLoaded: SWAPPED_WEBVIEW_INJECTED_JS,
|
|
3383
|
+
javaScriptEnabled: true,
|
|
3384
|
+
domStorageEnabled: true,
|
|
3385
|
+
sharedCookiesEnabled: true,
|
|
3386
|
+
thirdPartyCookiesEnabled: true,
|
|
3387
|
+
allowsInlineMediaPlayback: true,
|
|
3388
|
+
keyboardDisplayRequiresUserAction: false,
|
|
3389
|
+
hideKeyboardAccessoryView: true,
|
|
3390
|
+
automaticallyAdjustContentInsets: false,
|
|
3391
|
+
contentInsetAdjustmentBehavior: "never",
|
|
3392
|
+
setSupportMultipleWindows: false,
|
|
3393
|
+
originWhitelist: ["https://*", "about:srcdoc"],
|
|
3394
|
+
style: [fill, { backgroundColor: theme.background.modal }]
|
|
3395
|
+
}
|
|
3396
|
+
),
|
|
3397
|
+
isEmbedReady ? null : /* @__PURE__ */ jsx22(
|
|
3398
|
+
Animated3.View,
|
|
3399
|
+
{
|
|
3400
|
+
exiting: coverFadeOut,
|
|
3401
|
+
style: [loadingOverlay, { backgroundColor: theme.background.modal }],
|
|
3402
|
+
children: /* @__PURE__ */ jsx22(ActivityIndicator, { color: theme.content.elements.secondary })
|
|
3403
|
+
}
|
|
3404
|
+
)
|
|
3405
|
+
] });
|
|
3415
3406
|
}
|
|
3407
|
+
var EMBED_READY_TIMEOUT_MS = 1e4;
|
|
3408
|
+
var coverFadeOut = FadeOut.duration(250);
|
|
3409
|
+
var fill = { flex: 1 };
|
|
3416
3410
|
var loadingOverlay = {
|
|
3417
3411
|
position: "absolute",
|
|
3418
3412
|
top: 0,
|
|
@@ -3430,7 +3424,7 @@ function SwappedScreenShell({
|
|
|
3430
3424
|
onMessage
|
|
3431
3425
|
}) {
|
|
3432
3426
|
const theme = useTheme();
|
|
3433
|
-
const handleMessage =
|
|
3427
|
+
const handleMessage = useCallback3(
|
|
3434
3428
|
(msg) => {
|
|
3435
3429
|
switch (msg.type) {
|
|
3436
3430
|
case "SWAPPED_ERROR":
|
|
@@ -3462,13 +3456,13 @@ function SwappedScreenShell({
|
|
|
3462
3456
|
borderTopLeftRadius: "modal",
|
|
3463
3457
|
borderTopRightRadius: "modal",
|
|
3464
3458
|
style: [sheet2, { backgroundColor: theme.background.modal }],
|
|
3465
|
-
children: /* @__PURE__ */ jsx23(SwappedWebView, { url, onMessage: handleMessage, style:
|
|
3459
|
+
children: /* @__PURE__ */ jsx23(SwappedWebView, { url, onMessage: handleMessage, style: fill2 })
|
|
3466
3460
|
}
|
|
3467
3461
|
);
|
|
3468
3462
|
}
|
|
3469
3463
|
var SHEET_HEIGHT = 550;
|
|
3470
3464
|
var sheet2 = { height: SHEET_HEIGHT, overflow: "hidden" };
|
|
3471
|
-
var
|
|
3465
|
+
var fill2 = { flex: 1 };
|
|
3472
3466
|
|
|
3473
3467
|
// src/swapped/SwappedScreen.tsx
|
|
3474
3468
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
@@ -3478,7 +3472,7 @@ function SwappedScreen({
|
|
|
3478
3472
|
onBack,
|
|
3479
3473
|
onSuccess
|
|
3480
3474
|
}) {
|
|
3481
|
-
const handleMessage =
|
|
3475
|
+
const handleMessage = useCallback4(
|
|
3482
3476
|
(msg) => {
|
|
3483
3477
|
switch (msg.type) {
|
|
3484
3478
|
// Same destination, logged apart: "went back" and "started another
|
|
@@ -3584,14 +3578,14 @@ function formatDepositAddress(address, leading = 6, trailing = 6) {
|
|
|
3584
3578
|
}
|
|
3585
3579
|
|
|
3586
3580
|
// src/transfer/hooks/useCopyDepositAddress.ts
|
|
3587
|
-
import { useCallback as
|
|
3581
|
+
import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef8 } from "react";
|
|
3588
3582
|
function useCopyDepositAddress({
|
|
3589
3583
|
copyToClipboard: copyToClipboard2,
|
|
3590
3584
|
onCopySuccess,
|
|
3591
3585
|
isTransferOpen,
|
|
3592
3586
|
address
|
|
3593
3587
|
}) {
|
|
3594
|
-
const copyAddress =
|
|
3588
|
+
const copyAddress = useCallback5(
|
|
3595
3589
|
async (value) => {
|
|
3596
3590
|
try {
|
|
3597
3591
|
const ok = await copyToClipboard2(value) !== false;
|
|
@@ -4095,7 +4089,7 @@ function getDefaultDynamicTargetAsset(candidates, dynamicRoutingId) {
|
|
|
4095
4089
|
|
|
4096
4090
|
// src/flow/FlowSheet.tsx
|
|
4097
4091
|
import {
|
|
4098
|
-
useCallback as
|
|
4092
|
+
useCallback as useCallback6,
|
|
4099
4093
|
useEffect as useEffect14,
|
|
4100
4094
|
useRef as useRef9
|
|
4101
4095
|
} from "react";
|
|
@@ -4123,10 +4117,10 @@ function useInertScrollableFocus(_register) {
|
|
|
4123
4117
|
}
|
|
4124
4118
|
|
|
4125
4119
|
// src/flow/useKeyboardHeight.ts
|
|
4126
|
-
import { useEffect as useEffect13, useState as
|
|
4120
|
+
import { useEffect as useEffect13, useState as useState10 } from "react";
|
|
4127
4121
|
import { Keyboard, Platform } from "react-native";
|
|
4128
4122
|
function useKeyboardHeight(enabled) {
|
|
4129
|
-
const [height, setHeight] =
|
|
4123
|
+
const [height, setHeight] = useState10(0);
|
|
4130
4124
|
useEffect13(() => {
|
|
4131
4125
|
if (!enabled) {
|
|
4132
4126
|
setHeight(0);
|
|
@@ -4148,7 +4142,7 @@ function useKeyboardHeight(enabled) {
|
|
|
4148
4142
|
}
|
|
4149
4143
|
|
|
4150
4144
|
// src/flow/FlowSheet.tsx
|
|
4151
|
-
import { jsx as jsx26, jsxs as
|
|
4145
|
+
import { jsx as jsx26, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4152
4146
|
function FlowSheet({
|
|
4153
4147
|
isOpen,
|
|
4154
4148
|
session,
|
|
@@ -4161,7 +4155,7 @@ function FlowSheet({
|
|
|
4161
4155
|
renderBackdropBlur
|
|
4162
4156
|
}) {
|
|
4163
4157
|
const ref = useRef9(null);
|
|
4164
|
-
const setRef =
|
|
4158
|
+
const setRef = useCallback6((instance) => {
|
|
4165
4159
|
ref.current = instance;
|
|
4166
4160
|
}, []);
|
|
4167
4161
|
const keyboardHeight = useKeyboardHeight(keyboardAvoidEnabled);
|
|
@@ -4186,7 +4180,7 @@ function FlowSheet({
|
|
|
4186
4180
|
}
|
|
4187
4181
|
ref.current?.dismiss();
|
|
4188
4182
|
}, [isOpen, session]);
|
|
4189
|
-
const handleDismiss =
|
|
4183
|
+
const handleDismiss = useCallback6(() => {
|
|
4190
4184
|
sheetSelfDismissed.current = true;
|
|
4191
4185
|
onClose();
|
|
4192
4186
|
}, [onClose]);
|
|
@@ -4194,8 +4188,8 @@ function FlowSheet({
|
|
|
4194
4188
|
duration: 300,
|
|
4195
4189
|
easing: Easing2.bezier(0.22, 1, 0.36, 1)
|
|
4196
4190
|
});
|
|
4197
|
-
const renderBackdrop =
|
|
4198
|
-
(props) => /* @__PURE__ */
|
|
4191
|
+
const renderBackdrop = useCallback6(
|
|
4192
|
+
(props) => /* @__PURE__ */ jsxs11(
|
|
4199
4193
|
BottomSheetBackdrop2,
|
|
4200
4194
|
{
|
|
4201
4195
|
...props,
|
|
@@ -4218,7 +4212,7 @@ function FlowSheet({
|
|
|
4218
4212
|
),
|
|
4219
4213
|
[renderBackdropBlur, theme.background.overlay]
|
|
4220
4214
|
);
|
|
4221
|
-
return /* @__PURE__ */
|
|
4215
|
+
return /* @__PURE__ */ jsxs11(BottomSheetModalProvider, { children: [
|
|
4222
4216
|
children,
|
|
4223
4217
|
/* @__PURE__ */ jsx26(
|
|
4224
4218
|
BottomSheetModal,
|
|
@@ -4234,7 +4228,7 @@ function FlowSheet({
|
|
|
4234
4228
|
backdropComponent: renderBackdrop,
|
|
4235
4229
|
handleComponent: null,
|
|
4236
4230
|
backgroundComponent: FlowSheetBackground,
|
|
4237
|
-
children: /* @__PURE__ */
|
|
4231
|
+
children: /* @__PURE__ */ jsxs11(
|
|
4238
4232
|
BottomSheetView,
|
|
4239
4233
|
{
|
|
4240
4234
|
focusHook: fullHeight ? useInertScrollableFocus : void 0,
|
|
@@ -4299,7 +4293,7 @@ async function writeSelectedChainId(userId, chainId) {
|
|
|
4299
4293
|
}
|
|
4300
4294
|
|
|
4301
4295
|
// src/flow/DepositFlowContent.tsx
|
|
4302
|
-
import { Fragment as Fragment2, jsx as jsx27, jsxs as
|
|
4296
|
+
import { Fragment as Fragment2, jsx as jsx27, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4303
4297
|
var FULL_HEIGHT_SCREENS = {
|
|
4304
4298
|
selectChain: true,
|
|
4305
4299
|
changeChain: true,
|
|
@@ -4342,7 +4336,7 @@ function FlowContent({
|
|
|
4342
4336
|
dynamicRoutingId: targetAsset.activeDynamicRoutingId
|
|
4343
4337
|
});
|
|
4344
4338
|
const { isLoading: isStatsigLoading } = useStatsigClient();
|
|
4345
|
-
const [selectedSwappedUrl, setSelectedSwappedUrl] =
|
|
4339
|
+
const [selectedSwappedUrl, setSelectedSwappedUrl] = useState11();
|
|
4346
4340
|
const minDepositTarget = {
|
|
4347
4341
|
targetChain: targetAsset.activeCheckoutConfig?.targetChain,
|
|
4348
4342
|
targetAsset: targetAsset.activeCheckoutConfig?.targetAsset,
|
|
@@ -4448,7 +4442,7 @@ function FlowContent({
|
|
|
4448
4442
|
if (isGeoblocked) {
|
|
4449
4443
|
return /* @__PURE__ */ jsx27(CheckoutBlockedScreen, {});
|
|
4450
4444
|
}
|
|
4451
|
-
return /* @__PURE__ */
|
|
4445
|
+
return /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
4452
4446
|
screen,
|
|
4453
4447
|
/* @__PURE__ */ jsx27(
|
|
4454
4448
|
BottomSheetModal2,
|
|
@@ -4619,7 +4613,7 @@ function DepositNestedSheet({
|
|
|
4619
4613
|
}
|
|
4620
4614
|
}
|
|
4621
4615
|
function useDepositTargetAsset(config) {
|
|
4622
|
-
const [selectedCandidate, setSelectedCandidate] =
|
|
4616
|
+
const [selectedCandidate, setSelectedCandidate] = useState11(
|
|
4623
4617
|
() => getDefaultDynamicTargetAsset(
|
|
4624
4618
|
config.dynamicTargetAssetCandidates,
|
|
4625
4619
|
config.dynamicRoutingId
|
|
@@ -4640,7 +4634,7 @@ function useDepositTargetAsset(config) {
|
|
|
4640
4634
|
};
|
|
4641
4635
|
}
|
|
4642
4636
|
function useRememberedChain(userId) {
|
|
4643
|
-
const [selectedChainId, setSelectedChainId] =
|
|
4637
|
+
const [selectedChainId, setSelectedChainId] = useState11();
|
|
4644
4638
|
useEffect15(() => {
|
|
4645
4639
|
let active = true;
|
|
4646
4640
|
setSelectedChainId(void 0);
|
|
@@ -4653,7 +4647,7 @@ function useRememberedChain(userId) {
|
|
|
4653
4647
|
active = false;
|
|
4654
4648
|
};
|
|
4655
4649
|
}, [userId]);
|
|
4656
|
-
const rememberChainId =
|
|
4650
|
+
const rememberChainId = useCallback7(
|
|
4657
4651
|
(chainId) => {
|
|
4658
4652
|
setSelectedChainId(chainId);
|
|
4659
4653
|
void writeSelectedChainId(userId, chainId);
|
|
@@ -4693,14 +4687,14 @@ function warn(name, error) {
|
|
|
4693
4687
|
}
|
|
4694
4688
|
|
|
4695
4689
|
// src/flow/useCopiedToast.tsx
|
|
4696
|
-
import { useCallback as
|
|
4690
|
+
import { useCallback as useCallback8, useEffect as useEffect16, useRef as useRef10, useState as useState12 } from "react";
|
|
4697
4691
|
import { StyleSheet as StyleSheet11, View as View5 } from "react-native";
|
|
4698
4692
|
import { useSafeAreaInsets as useSafeAreaInsets6 } from "react-native-safe-area-context";
|
|
4699
4693
|
|
|
4700
4694
|
// src/flow/AddressCopiedToast.tsx
|
|
4701
4695
|
import { StyleSheet as StyleSheet10 } from "react-native";
|
|
4702
|
-
import
|
|
4703
|
-
import { jsx as jsx28, jsxs as
|
|
4696
|
+
import Animated4, { Easing as Easing3, FadeOutUp, Keyframe as Keyframe2 } from "react-native-reanimated";
|
|
4697
|
+
import { jsx as jsx28, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4704
4698
|
var enterAnimation = new Keyframe2({
|
|
4705
4699
|
0: {
|
|
4706
4700
|
opacity: 0,
|
|
@@ -4717,8 +4711,8 @@ function AddressCopiedToast() {
|
|
|
4717
4711
|
const { t } = useFunkitTranslation();
|
|
4718
4712
|
const label = t("common.addressCopied");
|
|
4719
4713
|
const theme = useTheme();
|
|
4720
|
-
return /* @__PURE__ */
|
|
4721
|
-
|
|
4714
|
+
return /* @__PURE__ */ jsxs13(
|
|
4715
|
+
Animated4.View,
|
|
4722
4716
|
{
|
|
4723
4717
|
entering: enterAnimation,
|
|
4724
4718
|
exiting: exitAnimation,
|
|
@@ -4758,15 +4752,15 @@ var toastOverlay = {
|
|
|
4758
4752
|
};
|
|
4759
4753
|
function useCopiedToast() {
|
|
4760
4754
|
const insets = useSafeAreaInsets6();
|
|
4761
|
-
const [toastMounted, setToastMounted] =
|
|
4762
|
-
const [copiedToastShown, setCopiedToastShown] =
|
|
4755
|
+
const [toastMounted, setToastMounted] = useState12(false);
|
|
4756
|
+
const [copiedToastShown, setCopiedToastShown] = useState12(false);
|
|
4763
4757
|
const hideTimerRef = useRef10(
|
|
4764
4758
|
void 0
|
|
4765
4759
|
);
|
|
4766
4760
|
const unmountTimerRef = useRef10(
|
|
4767
4761
|
void 0
|
|
4768
4762
|
);
|
|
4769
|
-
const clearToast =
|
|
4763
|
+
const clearToast = useCallback8(() => {
|
|
4770
4764
|
if (hideTimerRef.current) {
|
|
4771
4765
|
clearTimeout(hideTimerRef.current);
|
|
4772
4766
|
}
|
|
@@ -4776,7 +4770,7 @@ function useCopiedToast() {
|
|
|
4776
4770
|
setCopiedToastShown(false);
|
|
4777
4771
|
setToastMounted(false);
|
|
4778
4772
|
}, []);
|
|
4779
|
-
const showCopiedToast =
|
|
4773
|
+
const showCopiedToast = useCallback8(() => {
|
|
4780
4774
|
if (hideTimerRef.current) {
|
|
4781
4775
|
clearTimeout(hideTimerRef.current);
|
|
4782
4776
|
}
|
|
@@ -4807,10 +4801,18 @@ function useCopiedToast() {
|
|
|
4807
4801
|
|
|
4808
4802
|
// src/flow/WithdrawalFlowContent.tsx
|
|
4809
4803
|
import { useQueryClient } from "@tanstack/react-query";
|
|
4810
|
-
import { useCallback as
|
|
4804
|
+
import { useCallback as useCallback14, useState as useState22 } from "react";
|
|
4811
4805
|
|
|
4812
4806
|
// src/screens/WithdrawCryptoComplete.tsx
|
|
4813
|
-
import { useEffect as
|
|
4807
|
+
import { useEffect as useEffect18, useRef as useRef12 } from "react";
|
|
4808
|
+
|
|
4809
|
+
// src/withdrawal/useDepositAddressWithdrawalStatus.ts
|
|
4810
|
+
import {
|
|
4811
|
+
getCompletionTxInfo,
|
|
4812
|
+
resolveOnChainCompletionTxHash,
|
|
4813
|
+
useDirectExecutionForDepositAddress
|
|
4814
|
+
} from "@funkit/connect-core";
|
|
4815
|
+
import { useEffect as useEffect17, useState as useState13 } from "react";
|
|
4814
4816
|
|
|
4815
4817
|
// src/withdrawal/useWithdrawalStatus.ts
|
|
4816
4818
|
import {
|
|
@@ -4841,6 +4843,11 @@ function shouldKeepPollingStatus({
|
|
|
4841
4843
|
function useWithdrawalStatus(txHash) {
|
|
4842
4844
|
const { apiKey } = useFunkitIdentity();
|
|
4843
4845
|
const notFoundFetches = useRef11(0);
|
|
4846
|
+
const countedFor = useRef11(txHash);
|
|
4847
|
+
if (countedFor.current !== txHash) {
|
|
4848
|
+
countedFor.current = txHash;
|
|
4849
|
+
notFoundFetches.current = 0;
|
|
4850
|
+
}
|
|
4844
4851
|
const query = useQuery5({
|
|
4845
4852
|
queryKey: [WITHDRAWAL_STATUS_QUERY_KEY, apiKey, txHash],
|
|
4846
4853
|
queryFn: async () => {
|
|
@@ -4888,6 +4895,37 @@ function useWithdrawalStatus(txHash) {
|
|
|
4888
4895
|
};
|
|
4889
4896
|
}
|
|
4890
4897
|
|
|
4898
|
+
// src/withdrawal/useDepositAddressWithdrawalStatus.ts
|
|
4899
|
+
var DEFAULT_POLL_INTERVAL_MS = 1e4;
|
|
4900
|
+
function useDepositAddressWithdrawalStatus(depositAddress, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS) {
|
|
4901
|
+
const { apiKey, walletAddress } = useFunkitIdentity();
|
|
4902
|
+
const [hasSettled, setHasSettled] = useState13(false);
|
|
4903
|
+
const { latestStep, isFinalStep } = useDirectExecutionForDepositAddress({
|
|
4904
|
+
depositAddress,
|
|
4905
|
+
apiKey,
|
|
4906
|
+
// The wallet, not the host's `userId`: the deposit address is registered
|
|
4907
|
+
// under the owner wallet, and the scanner records the arrival there.
|
|
4908
|
+
// The unset sentinel is truthy, so the finder needs it mapped away or it
|
|
4909
|
+
// polls for a user that does not exist.
|
|
4910
|
+
walletAddress: walletAddress === UNSET_WALLET_ADDRESS ? "" : walletAddress,
|
|
4911
|
+
pollIntervalMs,
|
|
4912
|
+
hasSettled,
|
|
4913
|
+
logger
|
|
4914
|
+
});
|
|
4915
|
+
const arrivalStatus = useWithdrawalStatus(latestStep?.txHash);
|
|
4916
|
+
const isCompleted = arrivalStatus.isCompleted && isFinalStep;
|
|
4917
|
+
const completionTxHash = latestStep ? resolveOnChainCompletionTxHash(
|
|
4918
|
+
latestStep,
|
|
4919
|
+
getCompletionTxInfo(latestStep).txHash
|
|
4920
|
+
) : void 0;
|
|
4921
|
+
useEffect17(() => {
|
|
4922
|
+
if (isCompleted || arrivalStatus.isFailed) {
|
|
4923
|
+
setHasSettled(true);
|
|
4924
|
+
}
|
|
4925
|
+
}, [isCompleted, arrivalStatus.isFailed]);
|
|
4926
|
+
return { ...arrivalStatus, isCompleted, txHash: completionTxHash };
|
|
4927
|
+
}
|
|
4928
|
+
|
|
4891
4929
|
// src/screens/WithdrawCompleteScreen.tsx
|
|
4892
4930
|
import {
|
|
4893
4931
|
ActivityIndicator as ActivityIndicator2,
|
|
@@ -4898,7 +4936,7 @@ import { useSafeAreaInsets as useSafeAreaInsets7 } from "react-native-safe-area-
|
|
|
4898
4936
|
|
|
4899
4937
|
// src/components/PillButton.tsx
|
|
4900
4938
|
import { Pressable as Pressable7, StyleSheet as StyleSheet12 } from "react-native";
|
|
4901
|
-
import { jsx as jsx30, jsxs as
|
|
4939
|
+
import { jsx as jsx30, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4902
4940
|
function PillButton2({
|
|
4903
4941
|
label,
|
|
4904
4942
|
onPress,
|
|
@@ -4925,7 +4963,7 @@ function PillButton2({
|
|
|
4925
4963
|
{
|
|
4926
4964
|
borderRadius: radius,
|
|
4927
4965
|
style: { backgroundColor: theme.background.modal },
|
|
4928
|
-
children: /* @__PURE__ */
|
|
4966
|
+
children: /* @__PURE__ */ jsxs14(
|
|
4929
4967
|
Box,
|
|
4930
4968
|
{
|
|
4931
4969
|
flexDirection: "row",
|
|
@@ -4969,14 +5007,14 @@ var styles10 = StyleSheet12.create({
|
|
|
4969
5007
|
|
|
4970
5008
|
// src/components/ReceiveAmountSummary.tsx
|
|
4971
5009
|
import { Pressable as Pressable8, StyleSheet as StyleSheet13 } from "react-native";
|
|
4972
|
-
import
|
|
5010
|
+
import Animated6, {
|
|
4973
5011
|
Easing as Easing4,
|
|
4974
5012
|
FadeIn,
|
|
4975
5013
|
LinearTransition
|
|
4976
5014
|
} from "react-native-reanimated";
|
|
4977
5015
|
|
|
4978
5016
|
// src/components/SkeletonBar.tsx
|
|
4979
|
-
import { Animated as
|
|
5017
|
+
import { Animated as Animated5 } from "react-native";
|
|
4980
5018
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4981
5019
|
function SkeletonBar({
|
|
4982
5020
|
width,
|
|
@@ -4986,7 +5024,7 @@ function SkeletonBar({
|
|
|
4986
5024
|
const theme = useTheme();
|
|
4987
5025
|
const opacity = usePulse();
|
|
4988
5026
|
return /* @__PURE__ */ jsx31(
|
|
4989
|
-
|
|
5027
|
+
Animated5.View,
|
|
4990
5028
|
{
|
|
4991
5029
|
accessibilityRole: "progressbar",
|
|
4992
5030
|
style: {
|
|
@@ -5001,8 +5039,8 @@ function SkeletonBar({
|
|
|
5001
5039
|
}
|
|
5002
5040
|
|
|
5003
5041
|
// src/components/ReceiveAmountSummary.tsx
|
|
5004
|
-
import { jsx as jsx32, jsxs as
|
|
5005
|
-
var AnimatedBox =
|
|
5042
|
+
import { jsx as jsx32, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5043
|
+
var AnimatedBox = Animated6.createAnimatedComponent(Box);
|
|
5006
5044
|
var ICON_ENTERING = FadeIn.duration(420);
|
|
5007
5045
|
var DISPLACED_TRANSITION = LinearTransition.duration(420).easing(
|
|
5008
5046
|
Easing4.bezier(0.34, 1.56, 0.64, 1)
|
|
@@ -5025,7 +5063,7 @@ function ReceiveAmountSummary({
|
|
|
5025
5063
|
}) {
|
|
5026
5064
|
const { t } = useFunkitTranslation();
|
|
5027
5065
|
const theme = useTheme();
|
|
5028
|
-
return /* @__PURE__ */
|
|
5066
|
+
return /* @__PURE__ */ jsxs15(
|
|
5029
5067
|
AnimatedBox,
|
|
5030
5068
|
{
|
|
5031
5069
|
alignItems: "center",
|
|
@@ -5034,7 +5072,7 @@ function ReceiveAmountSummary({
|
|
|
5034
5072
|
style: styles11.root,
|
|
5035
5073
|
children: [
|
|
5036
5074
|
icon ? /* @__PURE__ */ jsx32(AnimatedBox, { entering: ICON_ENTERING, children: icon }) : null,
|
|
5037
|
-
/* @__PURE__ */
|
|
5075
|
+
/* @__PURE__ */ jsxs15(
|
|
5038
5076
|
AnimatedBox,
|
|
5039
5077
|
{
|
|
5040
5078
|
alignItems: "center",
|
|
@@ -5082,7 +5120,7 @@ function ReceiveAmountSummary({
|
|
|
5082
5120
|
disabled: !onPressBreakdown,
|
|
5083
5121
|
accessibilityRole: onPressBreakdown ? "button" : void 0,
|
|
5084
5122
|
accessibilityLabel: onPressBreakdown ? t("withdrawAddress.breakdownTitle") : tokenLabel,
|
|
5085
|
-
children: /* @__PURE__ */
|
|
5123
|
+
children: /* @__PURE__ */ jsxs15(
|
|
5086
5124
|
Box,
|
|
5087
5125
|
{
|
|
5088
5126
|
flexDirection: "row",
|
|
@@ -5136,12 +5174,10 @@ function footerBottomMargin(bottomInset2) {
|
|
|
5136
5174
|
}
|
|
5137
5175
|
|
|
5138
5176
|
// src/screens/WithdrawCompleteScreen.tsx
|
|
5139
|
-
import { jsx as jsx33, jsxs as
|
|
5177
|
+
import { jsx as jsx33, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5140
5178
|
var OUTCOME_ICON_SIZE = 46;
|
|
5141
5179
|
function WithdrawCompleteScreen({
|
|
5142
|
-
|
|
5143
|
-
isFailed = false,
|
|
5144
|
-
isRefunded = false,
|
|
5180
|
+
status,
|
|
5145
5181
|
amountLabel,
|
|
5146
5182
|
usdLabel,
|
|
5147
5183
|
tokenLabel,
|
|
@@ -5153,7 +5189,9 @@ function WithdrawCompleteScreen({
|
|
|
5153
5189
|
const insets = useSafeAreaInsets7();
|
|
5154
5190
|
const leadLabel = usdLabel ?? tokenLabel ?? amountLabel;
|
|
5155
5191
|
const secondaryLabel = usdLabel === void 0 ? void 0 : tokenLabel;
|
|
5156
|
-
|
|
5192
|
+
const isFailed = status === "failed" || status === "refunded";
|
|
5193
|
+
const isSettling = status === "settling";
|
|
5194
|
+
return /* @__PURE__ */ jsxs16(
|
|
5157
5195
|
Box,
|
|
5158
5196
|
{
|
|
5159
5197
|
style: {
|
|
@@ -5162,12 +5200,12 @@ function WithdrawCompleteScreen({
|
|
|
5162
5200
|
backgroundColor: theme.background.modal
|
|
5163
5201
|
},
|
|
5164
5202
|
children: [
|
|
5165
|
-
/* @__PURE__ */
|
|
5203
|
+
/* @__PURE__ */ jsxs16(Box, { flex: 1, justifyContent: "center", style: styles12.summary, children: [
|
|
5166
5204
|
/* @__PURE__ */ jsx33(
|
|
5167
5205
|
ReceiveAmountSummary,
|
|
5168
5206
|
{
|
|
5169
|
-
icon: resolveIcon({ theme,
|
|
5170
|
-
label: resolveLabel({ t,
|
|
5207
|
+
icon: resolveIcon({ theme, status }),
|
|
5208
|
+
label: resolveLabel({ t, status }),
|
|
5171
5209
|
usdLabel: leadLabel,
|
|
5172
5210
|
tokenLabel: secondaryLabel,
|
|
5173
5211
|
isQuotePending: false
|
|
@@ -5178,7 +5216,7 @@ function WithdrawCompleteScreen({
|
|
|
5178
5216
|
{
|
|
5179
5217
|
variant: "detail",
|
|
5180
5218
|
style: [styles12.detail, { color: theme.content.elements.secondary }],
|
|
5181
|
-
children:
|
|
5219
|
+
children: status === "refunded" ? t("withdrawCrypto.refundedMessage", { amount: amountLabel }) : t("withdrawCrypto.failedMessage", { amount: amountLabel })
|
|
5182
5220
|
}
|
|
5183
5221
|
) : null
|
|
5184
5222
|
] }),
|
|
@@ -5189,7 +5227,7 @@ function WithdrawCompleteScreen({
|
|
|
5189
5227
|
styles12.footer,
|
|
5190
5228
|
{ marginBottom: footerBottomMargin(insets.bottom) }
|
|
5191
5229
|
],
|
|
5192
|
-
children:
|
|
5230
|
+
children: isSettling ? /* @__PURE__ */ jsx33(
|
|
5193
5231
|
PillButton2,
|
|
5194
5232
|
{
|
|
5195
5233
|
label: t("withdrawAddress.withdrawing"),
|
|
@@ -5212,35 +5250,42 @@ function WithdrawCompleteScreen({
|
|
|
5212
5250
|
}
|
|
5213
5251
|
function resolveIcon({
|
|
5214
5252
|
theme,
|
|
5215
|
-
|
|
5216
|
-
isFailed
|
|
5253
|
+
status
|
|
5217
5254
|
}) {
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5255
|
+
switch (status) {
|
|
5256
|
+
case "failed":
|
|
5257
|
+
case "refunded":
|
|
5258
|
+
return /* @__PURE__ */ jsx33(
|
|
5259
|
+
FigmaAlertCircleIcon,
|
|
5260
|
+
{
|
|
5261
|
+
size: OUTCOME_ICON_SIZE,
|
|
5262
|
+
color: theme.content.elements.error
|
|
5263
|
+
}
|
|
5264
|
+
);
|
|
5265
|
+
// Nothing marks it: a check that arrived before the chain had would be a lie.
|
|
5266
|
+
case "settling":
|
|
5267
|
+
return void 0;
|
|
5268
|
+
default:
|
|
5269
|
+
return /* @__PURE__ */ jsx33(FigmaSuccessCheckIcon, { size: OUTCOME_ICON_SIZE });
|
|
5229
5270
|
}
|
|
5230
|
-
return /* @__PURE__ */ jsx33(FigmaSuccessCheckIcon, { size: OUTCOME_ICON_SIZE });
|
|
5231
5271
|
}
|
|
5232
5272
|
function resolveLabel({
|
|
5233
5273
|
t,
|
|
5234
|
-
|
|
5235
|
-
isFailed
|
|
5274
|
+
status
|
|
5236
5275
|
}) {
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5276
|
+
switch (status) {
|
|
5277
|
+
case "failed":
|
|
5278
|
+
case "refunded":
|
|
5279
|
+
return t("withdrawCrypto.failedTitle");
|
|
5280
|
+
// Still going: the design leaves the label as it was on the step before, and
|
|
5281
|
+
// lets the button carry the news.
|
|
5282
|
+
case "settling":
|
|
5283
|
+
return t("withdrawAddress.youllReceive");
|
|
5284
|
+
case "requested":
|
|
5285
|
+
return t("withdrawAddress.requested");
|
|
5286
|
+
default:
|
|
5287
|
+
return t("withdrawAddress.withdrew");
|
|
5242
5288
|
}
|
|
5243
|
-
return t("withdrawAddress.withdrew");
|
|
5244
5289
|
}
|
|
5245
5290
|
var styles12 = StyleSheet14.create({
|
|
5246
5291
|
// The band the figure is centred in, matching the recipient step's own, so the
|
|
@@ -5253,16 +5298,24 @@ var styles12 = StyleSheet14.create({
|
|
|
5253
5298
|
// src/screens/WithdrawCryptoComplete.tsx
|
|
5254
5299
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
5255
5300
|
function WithdrawCryptoComplete({
|
|
5256
|
-
|
|
5301
|
+
depositAddressOrHash,
|
|
5257
5302
|
amountLabel,
|
|
5258
5303
|
usdLabel,
|
|
5259
5304
|
tokenLabel,
|
|
5260
5305
|
callbacks,
|
|
5261
5306
|
onDone
|
|
5262
5307
|
}) {
|
|
5263
|
-
const
|
|
5308
|
+
const isVenueSubmitted = depositAddressOrHash.kind === "depositAddress";
|
|
5309
|
+
const byTransaction = useWithdrawalStatus(
|
|
5310
|
+
depositAddressOrHash.kind === "transaction" ? depositAddressOrHash.txHash : void 0
|
|
5311
|
+
);
|
|
5312
|
+
const byDepositAddress = useDepositAddressWithdrawalStatus(
|
|
5313
|
+
depositAddressOrHash.kind === "depositAddress" ? depositAddressOrHash.depositAddress : void 0
|
|
5314
|
+
);
|
|
5315
|
+
const { isCompleted, isFailed, isRefunded } = isVenueSubmitted ? byDepositAddress : byTransaction;
|
|
5316
|
+
const txHash = isVenueSubmitted ? byDepositAddress.txHash : depositAddressOrHash.txHash;
|
|
5264
5317
|
const notifiedRef = useRef12(false);
|
|
5265
|
-
|
|
5318
|
+
useEffect18(() => {
|
|
5266
5319
|
if (notifiedRef.current) {
|
|
5267
5320
|
return;
|
|
5268
5321
|
}
|
|
@@ -5278,21 +5331,32 @@ function WithdrawCryptoComplete({
|
|
|
5278
5331
|
});
|
|
5279
5332
|
}
|
|
5280
5333
|
}, [isCompleted, isFailed, isRefunded, callbacks, txHash]);
|
|
5281
|
-
|
|
5334
|
+
useEffect18(
|
|
5282
5335
|
() => () => {
|
|
5283
5336
|
if (notifiedRef.current) {
|
|
5284
5337
|
return;
|
|
5285
5338
|
}
|
|
5286
|
-
|
|
5339
|
+
if (isVenueSubmitted) {
|
|
5340
|
+
logger.info("crypto-withdrawal:closed_before_arrival", {
|
|
5341
|
+
depositAddressOrHash
|
|
5342
|
+
});
|
|
5343
|
+
return;
|
|
5344
|
+
}
|
|
5345
|
+
logger.warn("connect-rn:crypto-withdrawal:outcome_unreported", {
|
|
5346
|
+
depositAddressOrHash
|
|
5347
|
+
});
|
|
5287
5348
|
},
|
|
5288
|
-
[
|
|
5349
|
+
[depositAddressOrHash, isVenueSubmitted]
|
|
5289
5350
|
);
|
|
5290
5351
|
return /* @__PURE__ */ jsx34(
|
|
5291
5352
|
WithdrawCompleteScreen,
|
|
5292
5353
|
{
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5354
|
+
status: resolveStatus({
|
|
5355
|
+
isCompleted,
|
|
5356
|
+
isFailed,
|
|
5357
|
+
isRefunded,
|
|
5358
|
+
isVenueSubmitted
|
|
5359
|
+
}),
|
|
5296
5360
|
amountLabel,
|
|
5297
5361
|
usdLabel,
|
|
5298
5362
|
tokenLabel,
|
|
@@ -5300,25 +5364,30 @@ function WithdrawCryptoComplete({
|
|
|
5300
5364
|
}
|
|
5301
5365
|
);
|
|
5302
5366
|
}
|
|
5367
|
+
function resolveStatus({
|
|
5368
|
+
isCompleted,
|
|
5369
|
+
isFailed,
|
|
5370
|
+
isRefunded,
|
|
5371
|
+
isVenueSubmitted
|
|
5372
|
+
}) {
|
|
5373
|
+
if (isRefunded) {
|
|
5374
|
+
return "refunded";
|
|
5375
|
+
}
|
|
5376
|
+
if (isFailed) {
|
|
5377
|
+
return "failed";
|
|
5378
|
+
}
|
|
5379
|
+
if (isCompleted) {
|
|
5380
|
+
return "complete";
|
|
5381
|
+
}
|
|
5382
|
+
return isVenueSubmitted ? "requested" : "settling";
|
|
5383
|
+
}
|
|
5303
5384
|
|
|
5304
5385
|
// src/screens/WithdrawCryptoSteps.tsx
|
|
5305
5386
|
import { BottomSheetModal as BottomSheetModal4, BottomSheetView as BottomSheetView4 } from "@gorhom/bottom-sheet";
|
|
5306
5387
|
import { useFeatureGate as useFeatureGate2 } from "@funkit/connect-core";
|
|
5307
|
-
import { useState as
|
|
5388
|
+
import { useState as useState21 } from "react";
|
|
5308
5389
|
import { useSafeAreaInsets as useSafeAreaInsets14 } from "react-native-safe-area-context";
|
|
5309
5390
|
|
|
5310
|
-
// src/hooks/useIsStablecoin.ts
|
|
5311
|
-
import { useCallback as useCallback10 } from "react";
|
|
5312
|
-
function useIsStablecoin() {
|
|
5313
|
-
const stablecoinSymbols = useDynamicConfig("stablecoinsymbols");
|
|
5314
|
-
return useCallback10(
|
|
5315
|
-
(symbol) => stablecoinSymbols.some(
|
|
5316
|
-
(stable) => symbol.toLowerCase().includes(stable.toLowerCase())
|
|
5317
|
-
),
|
|
5318
|
-
[stablecoinSymbols]
|
|
5319
|
-
);
|
|
5320
|
-
}
|
|
5321
|
-
|
|
5322
5391
|
// src/utils/formatAmount.ts
|
|
5323
5392
|
function groupThousands(amount) {
|
|
5324
5393
|
const [whole, ...fraction] = amount.split(".");
|
|
@@ -5343,7 +5412,7 @@ import {
|
|
|
5343
5412
|
resolveWithdrawalSourceTokenBalance,
|
|
5344
5413
|
useDebouncedValue
|
|
5345
5414
|
} from "@funkit/connect-core";
|
|
5346
|
-
import { useState as
|
|
5415
|
+
import { useState as useState16 } from "react";
|
|
5347
5416
|
|
|
5348
5417
|
// src/withdrawal/sourceToken.ts
|
|
5349
5418
|
function resolveWithdrawalSourceTokens(config) {
|
|
@@ -5467,48 +5536,6 @@ import {
|
|
|
5467
5536
|
isBlacklistedWithdrawalAddress
|
|
5468
5537
|
} from "@funkit/connect-core";
|
|
5469
5538
|
|
|
5470
|
-
// src/withdrawal/useSourceTokenUsdPrice.ts
|
|
5471
|
-
import { getAssetPriceInfoWithFallback } from "@funkit/connect-core";
|
|
5472
|
-
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
5473
|
-
var SOURCE_TOKEN_PRICE_QUERY_KEY = "sourceTokenUsdPrice";
|
|
5474
|
-
var PRICE_STALE_TIME_MS = 6e4;
|
|
5475
|
-
var STABLECOIN_USD_PRICE = 1;
|
|
5476
|
-
function useSourceTokenUsdPrice(sourceToken) {
|
|
5477
|
-
const { apiKey } = useFunkitIdentity();
|
|
5478
|
-
const isStablecoin = useIsStablecoin();
|
|
5479
|
-
const isStable = isStablecoin(sourceToken.symbol);
|
|
5480
|
-
const { data } = useQuery8({
|
|
5481
|
-
queryKey: [
|
|
5482
|
-
SOURCE_TOKEN_PRICE_QUERY_KEY,
|
|
5483
|
-
apiKey,
|
|
5484
|
-
sourceToken.chainId,
|
|
5485
|
-
sourceToken.address
|
|
5486
|
-
],
|
|
5487
|
-
queryFn: async () => {
|
|
5488
|
-
const info = await getAssetPriceInfoWithFallback({
|
|
5489
|
-
chainId: sourceToken.chainId,
|
|
5490
|
-
assetTokenAddress: sourceToken.address,
|
|
5491
|
-
apiKey,
|
|
5492
|
-
logger
|
|
5493
|
-
});
|
|
5494
|
-
const unitPrice = info.unitPrice;
|
|
5495
|
-
if (!Number.isFinite(unitPrice) || unitPrice <= 0) {
|
|
5496
|
-
logger.warn("connect-rn:withdrawal:unusable_source_price", {
|
|
5497
|
-
chainId: sourceToken.chainId,
|
|
5498
|
-
address: sourceToken.address,
|
|
5499
|
-
unitPrice
|
|
5500
|
-
});
|
|
5501
|
-
return 0;
|
|
5502
|
-
}
|
|
5503
|
-
return unitPrice;
|
|
5504
|
-
},
|
|
5505
|
-
enabled: !!apiKey && !isStable,
|
|
5506
|
-
staleTime: PRICE_STALE_TIME_MS,
|
|
5507
|
-
retry: false
|
|
5508
|
-
});
|
|
5509
|
-
return isStable ? STABLECOIN_USD_PRICE : data ?? 0;
|
|
5510
|
-
}
|
|
5511
|
-
|
|
5512
5539
|
// src/withdrawal/validation.ts
|
|
5513
5540
|
import {
|
|
5514
5541
|
deductFlatFee,
|
|
@@ -5662,7 +5689,7 @@ function useCryptoWithdrawalValidation({
|
|
|
5662
5689
|
|
|
5663
5690
|
// src/withdrawal/useWithdrawalAmountInput.ts
|
|
5664
5691
|
import { tokenAmountToUsd, usdToTokenAmount } from "@funkit/connect-core";
|
|
5665
|
-
import { useCallback as
|
|
5692
|
+
import { useCallback as useCallback9, useState as useState14 } from "react";
|
|
5666
5693
|
function withoutTrailingDot(value) {
|
|
5667
5694
|
return value.endsWith(".") ? value.slice(0, -1) : value;
|
|
5668
5695
|
}
|
|
@@ -5688,11 +5715,11 @@ function useWithdrawalAmountInput({
|
|
|
5688
5715
|
sourceUsdPrice,
|
|
5689
5716
|
sourceDecimals
|
|
5690
5717
|
}) {
|
|
5691
|
-
const [usdInput, setUsdInput] =
|
|
5718
|
+
const [usdInput, setUsdInput] = useState14("");
|
|
5692
5719
|
const canPriceInUsd = sourceUsdPrice > 0 && sourceDecimals !== void 0;
|
|
5693
|
-
const [prefersUsd, setPrefersUsd] =
|
|
5720
|
+
const [prefersUsd, setPrefersUsd] = useState14(true);
|
|
5694
5721
|
const inUsd = prefersUsd && canPriceInUsd;
|
|
5695
|
-
const [derivedFrom, setDerivedFrom] =
|
|
5722
|
+
const [derivedFrom, setDerivedFrom] = useState14({
|
|
5696
5723
|
amount: "",
|
|
5697
5724
|
isPriced: false
|
|
5698
5725
|
});
|
|
@@ -5705,7 +5732,7 @@ function useWithdrawalAmountInput({
|
|
|
5705
5732
|
amount === "" || !canPriceInUsd ? "" : tokenAmountToUsd(withoutTrailingDot(amount), sourceUsdPrice)
|
|
5706
5733
|
);
|
|
5707
5734
|
}
|
|
5708
|
-
const setInput =
|
|
5735
|
+
const setInput = useCallback9(
|
|
5709
5736
|
(next) => {
|
|
5710
5737
|
if (!inUsd) {
|
|
5711
5738
|
setAmount(next);
|
|
@@ -5733,7 +5760,7 @@ function useWithdrawalAmountInput({
|
|
|
5733
5760
|
* - The staleness is bounded by refreshing the price on the way into this
|
|
5734
5761
|
* screen rather than while it is open.
|
|
5735
5762
|
*/
|
|
5736
|
-
swapDenomination:
|
|
5763
|
+
swapDenomination: useCallback9(() => setPrefersUsd((was) => !was), []),
|
|
5737
5764
|
/** Offering the swap without a rate would promise one we don't have. */
|
|
5738
5765
|
canSwapDenomination: canPriceInUsd,
|
|
5739
5766
|
/** What the amount is worth, or `undefined` when nothing prices it. */
|
|
@@ -5750,8 +5777,8 @@ function useWithdrawalAmountInput({
|
|
|
5750
5777
|
// src/withdrawal/useWithdrawalDestinationTokens.ts
|
|
5751
5778
|
import { getSupportedAssets as getSupportedAssets2 } from "@funkit/api-base";
|
|
5752
5779
|
import { resolveTokenTransferConfig as resolveTokenTransferConfig2 } from "@funkit/connect-core";
|
|
5753
|
-
import { useQuery as
|
|
5754
|
-
import { useMemo as useMemo8, useState as
|
|
5780
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
5781
|
+
import { useMemo as useMemo8, useState as useState15 } from "react";
|
|
5755
5782
|
var WITHDRAWAL_DESTINATION_TOKENS_QUERY_KEY = "withdrawalDestinations";
|
|
5756
5783
|
function useWithdrawalDestinationTokens({
|
|
5757
5784
|
sourceToken,
|
|
@@ -5762,7 +5789,7 @@ function useWithdrawalDestinationTokens({
|
|
|
5762
5789
|
const disabledChainAssets = useDynamicConfig(
|
|
5763
5790
|
"disablewithdrawalchainsandassets"
|
|
5764
5791
|
);
|
|
5765
|
-
const { data: supportedAssets, isLoading } =
|
|
5792
|
+
const { data: supportedAssets, isLoading } = useQuery8({
|
|
5766
5793
|
queryKey: [WITHDRAWAL_DESTINATION_TOKENS_QUERY_KEY, apiKey],
|
|
5767
5794
|
queryFn: () => getSupportedAssets2({ apiKey, logger }),
|
|
5768
5795
|
enabled: !!apiKey,
|
|
@@ -5789,7 +5816,7 @@ function useWithdrawalDestinationTokens({
|
|
|
5789
5816
|
symbols: resolved.symbolsByChainId[chainId] ?? []
|
|
5790
5817
|
}));
|
|
5791
5818
|
}, [resolved]);
|
|
5792
|
-
const [picked, setPicked] =
|
|
5819
|
+
const [picked, setPicked] = useState15();
|
|
5793
5820
|
const destinationToken = useMemo8(() => {
|
|
5794
5821
|
if (!resolved) {
|
|
5795
5822
|
return void 0;
|
|
@@ -5830,12 +5857,12 @@ import {
|
|
|
5830
5857
|
isWithdrawalRisky,
|
|
5831
5858
|
useFeatureGate
|
|
5832
5859
|
} from "@funkit/connect-core";
|
|
5833
|
-
import { useQuery as
|
|
5860
|
+
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
5834
5861
|
var WITHDRAWAL_RISK_QUERY_KEY = "withdrawalRisk";
|
|
5835
5862
|
function useWithdrawalRisk(address, chainId) {
|
|
5836
5863
|
const { apiKey } = useFunkitIdentity();
|
|
5837
5864
|
const screeningDisabled = useFeatureGate("disable-frontend-chainalysis");
|
|
5838
|
-
const query =
|
|
5865
|
+
const query = useQuery9({
|
|
5839
5866
|
queryKey: [WITHDRAWAL_RISK_QUERY_KEY, apiKey, address, chainId],
|
|
5840
5867
|
queryFn: () => isWithdrawalRisky({
|
|
5841
5868
|
address,
|
|
@@ -5877,10 +5904,10 @@ function useCryptoWithdrawalForm({
|
|
|
5877
5904
|
quoteInputFeeSettled = true
|
|
5878
5905
|
}) {
|
|
5879
5906
|
const { t } = useFunkitTranslation();
|
|
5880
|
-
const [amount, setAmount] =
|
|
5881
|
-
const [recipient, setRecipient] =
|
|
5907
|
+
const [amount, setAmount] = useState16("");
|
|
5908
|
+
const [recipient, setRecipient] = useState16("");
|
|
5882
5909
|
const sourceOptions = resolveWithdrawalSourceTokens(config);
|
|
5883
|
-
const [sourceIndex, setSourceIndex] =
|
|
5910
|
+
const [sourceIndex, setSourceIndex] = useState16(0);
|
|
5884
5911
|
const selectedSourceIndex = sourceIndex < sourceOptions.length ? sourceIndex : 0;
|
|
5885
5912
|
const sourceOption = sourceOptions[selectedSourceIndex];
|
|
5886
5913
|
const sourceToken = sourceOption.token;
|
|
@@ -6082,7 +6109,7 @@ function resolveAmountErrorText({
|
|
|
6082
6109
|
|
|
6083
6110
|
// src/withdrawal/useCryptoWithdrawalSubmit.ts
|
|
6084
6111
|
import { useEffectEvent as useEffectEvent2 } from "@funkit/connect-core";
|
|
6085
|
-
import { useEffect as
|
|
6112
|
+
import { useEffect as useEffect19, useRef as useRef14 } from "react";
|
|
6086
6113
|
|
|
6087
6114
|
// src/utils/executionErrorMessage.ts
|
|
6088
6115
|
var MAX_ERROR_DETAIL_CHARS = 160;
|
|
@@ -6108,7 +6135,7 @@ import {
|
|
|
6108
6135
|
processCryptoWithdrawalOrder,
|
|
6109
6136
|
toWalletExecutionErrorCode
|
|
6110
6137
|
} from "@funkit/connect-core";
|
|
6111
|
-
import { useCallback as
|
|
6138
|
+
import { useCallback as useCallback10, useRef as useRef13, useState as useState17 } from "react";
|
|
6112
6139
|
var inFlightWithdrawals = /* @__PURE__ */ new Set();
|
|
6113
6140
|
function withdrawalKey({
|
|
6114
6141
|
walletAddress,
|
|
@@ -6127,6 +6154,7 @@ function withdrawalKey({
|
|
|
6127
6154
|
destinationToken.address
|
|
6128
6155
|
].join("|").toLowerCase();
|
|
6129
6156
|
}
|
|
6157
|
+
var SYNTHETIC_DEPOSIT_ADDRESS = "0x0000000000000000000000000000000000000001";
|
|
6130
6158
|
function useCryptoWithdrawalExecution({
|
|
6131
6159
|
config,
|
|
6132
6160
|
sourceToken,
|
|
@@ -6135,10 +6163,10 @@ function useCryptoWithdrawalExecution({
|
|
|
6135
6163
|
}) {
|
|
6136
6164
|
const { apiKey, userId } = useFunkitIdentity();
|
|
6137
6165
|
const isSubmittingRef = useRef13(false);
|
|
6138
|
-
const [submission, setSubmission] =
|
|
6166
|
+
const [submission, setSubmission] = useState17({
|
|
6139
6167
|
status: "idle"
|
|
6140
6168
|
});
|
|
6141
|
-
const submit =
|
|
6169
|
+
const submit = useCallback10(
|
|
6142
6170
|
async ({
|
|
6143
6171
|
quote,
|
|
6144
6172
|
recipientAddress,
|
|
@@ -6161,30 +6189,54 @@ function useCryptoWithdrawalExecution({
|
|
|
6161
6189
|
}
|
|
6162
6190
|
isSubmittingRef.current = true;
|
|
6163
6191
|
inFlightWithdrawals.add(key);
|
|
6164
|
-
const
|
|
6165
|
-
submissionId: createWithdrawalSubmissionId(),
|
|
6166
|
-
recipientAddress,
|
|
6167
|
-
sourceAmountHumanUnit: amount,
|
|
6168
|
-
sourceToken,
|
|
6169
|
-
destinationToken
|
|
6170
|
-
};
|
|
6192
|
+
const submissionId = createWithdrawalSubmissionId();
|
|
6171
6193
|
setSubmission({ status: "submitting" });
|
|
6172
|
-
|
|
6194
|
+
logger.info("crypto-withdrawal:rail_selected", {
|
|
6195
|
+
rail: config.submitWithdrawal ? "venue" : "relay",
|
|
6196
|
+
submissionId,
|
|
6197
|
+
fromChainId: sourceToken.chainId,
|
|
6198
|
+
fromToken: sourceToken.address,
|
|
6199
|
+
toChainId: destinationToken.chainId,
|
|
6200
|
+
toToken: destinationToken.address
|
|
6201
|
+
});
|
|
6202
|
+
let depositAddressOrHash;
|
|
6173
6203
|
try {
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6204
|
+
if (config.submitWithdrawal) {
|
|
6205
|
+
const { depositAddress } = await config.submitWithdrawal({
|
|
6206
|
+
quote,
|
|
6207
|
+
recipientAddress,
|
|
6208
|
+
sourceToken,
|
|
6209
|
+
destinationToken,
|
|
6210
|
+
amountTokenUnits: amount
|
|
6211
|
+
});
|
|
6212
|
+
depositAddressOrHash = {
|
|
6213
|
+
kind: "depositAddress",
|
|
6214
|
+
depositAddress: depositAddress ?? SYNTHETIC_DEPOSIT_ADDRESS
|
|
6215
|
+
};
|
|
6216
|
+
} else {
|
|
6217
|
+
const order = {
|
|
6218
|
+
submissionId,
|
|
6219
|
+
recipientAddress,
|
|
6220
|
+
sourceAmountHumanUnit: amount,
|
|
6221
|
+
sourceToken,
|
|
6222
|
+
destinationToken
|
|
6223
|
+
};
|
|
6224
|
+
ensureRelayClientInitialized(logger, "funkit-connect-rn");
|
|
6225
|
+
const { txHash } = await processCryptoWithdrawalOrder({
|
|
6226
|
+
order,
|
|
6227
|
+
quote,
|
|
6228
|
+
wallet: config.withdrawalWallet,
|
|
6229
|
+
apiKey,
|
|
6230
|
+
userId,
|
|
6231
|
+
logger,
|
|
6232
|
+
onStepMessage: (stepMessage) => setSubmission({ status: "submitting", stepMessage })
|
|
6233
|
+
});
|
|
6234
|
+
depositAddressOrHash = { kind: "transaction", txHash };
|
|
6235
|
+
}
|
|
6184
6236
|
} catch (error) {
|
|
6185
6237
|
if (isUserRejectedError(error)) {
|
|
6186
6238
|
logger.warn("connect-rn:crypto-withdrawal:user_rejected", {
|
|
6187
|
-
submission_id:
|
|
6239
|
+
submission_id: submissionId
|
|
6188
6240
|
});
|
|
6189
6241
|
setSubmission({ status: "idle" });
|
|
6190
6242
|
return;
|
|
@@ -6193,7 +6245,7 @@ function useCryptoWithdrawalExecution({
|
|
|
6193
6245
|
logger.error(
|
|
6194
6246
|
"connect-rn:crypto-withdrawal:execution_failed",
|
|
6195
6247
|
error,
|
|
6196
|
-
{ submission_id:
|
|
6248
|
+
{ submission_id: submissionId }
|
|
6197
6249
|
);
|
|
6198
6250
|
setSubmission({
|
|
6199
6251
|
status: "failed",
|
|
@@ -6208,15 +6260,18 @@ function useCryptoWithdrawalExecution({
|
|
|
6208
6260
|
}
|
|
6209
6261
|
setSubmission({
|
|
6210
6262
|
status: "submitted",
|
|
6211
|
-
|
|
6212
|
-
submissionId
|
|
6263
|
+
depositAddressOrHash,
|
|
6264
|
+
submissionId,
|
|
6213
6265
|
amount
|
|
6214
6266
|
});
|
|
6215
|
-
callbacks.onWithdrawalSubmitted?.(
|
|
6267
|
+
callbacks.onWithdrawalSubmitted?.(
|
|
6268
|
+
submissionId,
|
|
6269
|
+
depositAddressOrHash.kind === "transaction" ? depositAddressOrHash.txHash : depositAddressOrHash.depositAddress
|
|
6270
|
+
);
|
|
6216
6271
|
},
|
|
6217
6272
|
[apiKey, userId, config, sourceToken, destinationToken, callbacks]
|
|
6218
6273
|
);
|
|
6219
|
-
const reset =
|
|
6274
|
+
const reset = useCallback10(() => setSubmission({ status: "idle" }), []);
|
|
6220
6275
|
return { submission, submit, reset };
|
|
6221
6276
|
}
|
|
6222
6277
|
|
|
@@ -6242,13 +6297,13 @@ function useCryptoWithdrawalSubmit({
|
|
|
6242
6297
|
tokenLabel: void 0
|
|
6243
6298
|
});
|
|
6244
6299
|
const onSubmittedEvent = useEffectEvent2(onSubmitted);
|
|
6245
|
-
|
|
6300
|
+
useEffect19(() => {
|
|
6246
6301
|
if (submission.status !== "submitted" || handedOffRef.current) {
|
|
6247
6302
|
return;
|
|
6248
6303
|
}
|
|
6249
6304
|
handedOffRef.current = true;
|
|
6250
6305
|
onSubmittedEvent({
|
|
6251
|
-
|
|
6306
|
+
depositAddressOrHash: submission.depositAddressOrHash,
|
|
6252
6307
|
amountLabel: `${submission.amount} ${submittedSourceLabel.current ?? form.sourceLabel}`,
|
|
6253
6308
|
...submittedFigures.current
|
|
6254
6309
|
});
|
|
@@ -6288,7 +6343,7 @@ import {
|
|
|
6288
6343
|
BottomSheetScrollView as BottomSheetScrollView3,
|
|
6289
6344
|
BottomSheetView as BottomSheetView3
|
|
6290
6345
|
} from "@gorhom/bottom-sheet";
|
|
6291
|
-
import { useMemo as useMemo9, useState as
|
|
6346
|
+
import { useMemo as useMemo9, useState as useState20 } from "react";
|
|
6292
6347
|
import { StyleSheet as StyleSheet20, View as View7, useWindowDimensions as useWindowDimensions4 } from "react-native";
|
|
6293
6348
|
import { useSafeAreaInsets as useSafeAreaInsets9 } from "react-native-safe-area-context";
|
|
6294
6349
|
|
|
@@ -6322,12 +6377,12 @@ function chunk(items, size) {
|
|
|
6322
6377
|
}
|
|
6323
6378
|
|
|
6324
6379
|
// src/components/AssetGrid.tsx
|
|
6325
|
-
import { Fragment as Fragment3, jsx as jsx35, jsxs as
|
|
6380
|
+
import { Fragment as Fragment3, jsx as jsx35, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
6326
6381
|
function AssetGrid({ title, items, overflow }) {
|
|
6327
6382
|
const theme = useTheme();
|
|
6328
|
-
return /* @__PURE__ */
|
|
6383
|
+
return /* @__PURE__ */ jsxs17(Box, { style: styles13.section, children: [
|
|
6329
6384
|
/* @__PURE__ */ jsx35(Text, { variant: "bodyMedium", numberOfLines: 1, style: styles13.title, children: title }),
|
|
6330
|
-
/* @__PURE__ */ jsx35(Box, { style: styles13.grid, children: chunk(items, ASSET_GRID_COLUMNS).map((row2, rowIndex) => /* @__PURE__ */
|
|
6385
|
+
/* @__PURE__ */ jsx35(Box, { style: styles13.grid, children: chunk(items, ASSET_GRID_COLUMNS).map((row2, rowIndex) => /* @__PURE__ */ jsxs17(Box, { flexDirection: "row", style: styles13.row, children: [
|
|
6331
6386
|
row2.map((item) => /* @__PURE__ */ jsx35(AssetGridItem, { ...item }, item.id)),
|
|
6332
6387
|
Array.from(
|
|
6333
6388
|
{ length: ASSET_GRID_COLUMNS - row2.length },
|
|
@@ -6340,7 +6395,7 @@ function AssetGrid({ title, items, overflow }) {
|
|
|
6340
6395
|
onPress: overflow.onPress,
|
|
6341
6396
|
accessibilityRole: "button",
|
|
6342
6397
|
accessibilityLabel: overflow.accessibilityLabel,
|
|
6343
|
-
children: /* @__PURE__ */
|
|
6398
|
+
children: /* @__PURE__ */ jsxs17(Box, { flexDirection: "row", alignItems: "center", style: styles13.overflow, children: [
|
|
6344
6399
|
/* @__PURE__ */ jsx35(Box, { flex: 1, children: /* @__PURE__ */ jsx35(
|
|
6345
6400
|
Text,
|
|
6346
6401
|
{
|
|
@@ -6381,8 +6436,8 @@ function AssetGridItem({
|
|
|
6381
6436
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
6382
6437
|
accessibilityState: { selected: isMarked, disabled: unsupported },
|
|
6383
6438
|
style: styles13.cell,
|
|
6384
|
-
children: /* @__PURE__ */
|
|
6385
|
-
/* @__PURE__ */
|
|
6439
|
+
children: /* @__PURE__ */ jsxs17(Box, { alignItems: "center", style: styles13.stack, children: [
|
|
6440
|
+
/* @__PURE__ */ jsxs17(Box, { style: styles13.avatar, children: [
|
|
6386
6441
|
/* @__PURE__ */ jsx35(
|
|
6387
6442
|
Box,
|
|
6388
6443
|
{
|
|
@@ -6390,7 +6445,7 @@ function AssetGridItem({
|
|
|
6390
6445
|
children: icon
|
|
6391
6446
|
}
|
|
6392
6447
|
),
|
|
6393
|
-
isMarked ? /* @__PURE__ */
|
|
6448
|
+
isMarked ? /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
6394
6449
|
/* @__PURE__ */ jsx35(
|
|
6395
6450
|
Box,
|
|
6396
6451
|
{
|
|
@@ -6492,12 +6547,12 @@ var styles13 = StyleSheet15.create({
|
|
|
6492
6547
|
|
|
6493
6548
|
// src/components/TopBar.tsx
|
|
6494
6549
|
import { Pressable as Pressable10, StyleSheet as StyleSheet16 } from "react-native";
|
|
6495
|
-
import { jsx as jsx36, jsxs as
|
|
6550
|
+
import { jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
6496
6551
|
var ICON_SIZE = 20;
|
|
6497
6552
|
function TopBar({ title, onBack, onClose }) {
|
|
6498
6553
|
const { t } = useFunkitTranslation();
|
|
6499
6554
|
const theme = useTheme();
|
|
6500
|
-
return /* @__PURE__ */
|
|
6555
|
+
return /* @__PURE__ */ jsxs18(Box, { flexDirection: "row", alignItems: "center", style: styles14.bar, children: [
|
|
6501
6556
|
/* @__PURE__ */ jsx36(
|
|
6502
6557
|
IconSlot,
|
|
6503
6558
|
{
|
|
@@ -6588,15 +6643,15 @@ function receivableTokens(chains) {
|
|
|
6588
6643
|
|
|
6589
6644
|
// src/screens/SelectReceiveTokenScreen.tsx
|
|
6590
6645
|
import { BottomSheetScrollView as BottomSheetScrollView2 } from "@gorhom/bottom-sheet";
|
|
6591
|
-
import { useState as
|
|
6646
|
+
import { useState as useState19 } from "react";
|
|
6592
6647
|
import { StyleSheet as StyleSheet19, View as View6 } from "react-native";
|
|
6593
6648
|
import { useSafeAreaInsets as useSafeAreaInsets8 } from "react-native-safe-area-context";
|
|
6594
6649
|
|
|
6595
6650
|
// src/components/SearchInput.tsx
|
|
6596
6651
|
import { BottomSheetTextInput } from "@gorhom/bottom-sheet";
|
|
6597
|
-
import { useState as
|
|
6652
|
+
import { useState as useState18 } from "react";
|
|
6598
6653
|
import { StyleSheet as StyleSheet17 } from "react-native";
|
|
6599
|
-
import { jsx as jsx37, jsxs as
|
|
6654
|
+
import { jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6600
6655
|
function SearchInput({
|
|
6601
6656
|
value,
|
|
6602
6657
|
onChangeValue,
|
|
@@ -6604,8 +6659,8 @@ function SearchInput({
|
|
|
6604
6659
|
accessibilityLabel
|
|
6605
6660
|
}) {
|
|
6606
6661
|
const theme = useTheme();
|
|
6607
|
-
const [isFocused, setIsFocused] =
|
|
6608
|
-
return /* @__PURE__ */
|
|
6662
|
+
const [isFocused, setIsFocused] = useState18(false);
|
|
6663
|
+
return /* @__PURE__ */ jsxs19(
|
|
6609
6664
|
Box,
|
|
6610
6665
|
{
|
|
6611
6666
|
flexDirection: "row",
|
|
@@ -6654,7 +6709,7 @@ var styles15 = StyleSheet17.create({
|
|
|
6654
6709
|
|
|
6655
6710
|
// src/components/SelectableAssetRow.tsx
|
|
6656
6711
|
import { Pressable as Pressable11, StyleSheet as StyleSheet18 } from "react-native";
|
|
6657
|
-
import { jsx as jsx38, jsxs as
|
|
6712
|
+
import { jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6658
6713
|
function SelectableAssetRow({
|
|
6659
6714
|
name,
|
|
6660
6715
|
icon,
|
|
@@ -6672,7 +6727,7 @@ function SelectableAssetRow({
|
|
|
6672
6727
|
accessibilityRole: "button",
|
|
6673
6728
|
accessibilityLabel,
|
|
6674
6729
|
accessibilityState: { selected, disabled },
|
|
6675
|
-
children: /* @__PURE__ */
|
|
6730
|
+
children: /* @__PURE__ */ jsxs20(
|
|
6676
6731
|
Box,
|
|
6677
6732
|
{
|
|
6678
6733
|
flexDirection: "row",
|
|
@@ -6706,7 +6761,7 @@ var styles16 = StyleSheet18.create({
|
|
|
6706
6761
|
});
|
|
6707
6762
|
|
|
6708
6763
|
// src/screens/SelectReceiveTokenScreen.tsx
|
|
6709
|
-
import { jsx as jsx39, jsxs as
|
|
6764
|
+
import { jsx as jsx39, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
6710
6765
|
var ROW_AVATAR_SIZE = 36;
|
|
6711
6766
|
function SelectReceiveTokenScreen({
|
|
6712
6767
|
tokens,
|
|
@@ -6719,14 +6774,14 @@ function SelectReceiveTokenScreen({
|
|
|
6719
6774
|
const sheetHeight = useNestedSheetHeight();
|
|
6720
6775
|
const insets = useSafeAreaInsets8();
|
|
6721
6776
|
const { showTopFade, showBottomFade, scrollProps } = useScrollEdgeFades();
|
|
6722
|
-
const [query, setQuery] =
|
|
6777
|
+
const [query, setQuery] = useState19("");
|
|
6723
6778
|
const needle = query.trim().toLowerCase();
|
|
6724
6779
|
const orderedTokens = selectedToken && tokens.includes(selectedToken) ? [selectedToken, ...tokens.filter((token) => token !== selectedToken)] : tokens;
|
|
6725
6780
|
const matches = orderedTokens.filter(
|
|
6726
6781
|
(token) => token.toLowerCase().includes(needle)
|
|
6727
6782
|
);
|
|
6728
6783
|
const searchPlaceholder = t("selectReceiveToken.searchTokens");
|
|
6729
|
-
return /* @__PURE__ */
|
|
6784
|
+
return /* @__PURE__ */ jsxs21(
|
|
6730
6785
|
Box,
|
|
6731
6786
|
{
|
|
6732
6787
|
borderTopLeftRadius: "modal",
|
|
@@ -6752,7 +6807,7 @@ function SelectReceiveTokenScreen({
|
|
|
6752
6807
|
accessibilityLabel: searchPlaceholder
|
|
6753
6808
|
}
|
|
6754
6809
|
) }),
|
|
6755
|
-
/* @__PURE__ */
|
|
6810
|
+
/* @__PURE__ */ jsxs21(View6, { style: styles17.scrollArea, children: [
|
|
6756
6811
|
/* @__PURE__ */ jsx39(
|
|
6757
6812
|
BottomSheetScrollView2,
|
|
6758
6813
|
{
|
|
@@ -6807,7 +6862,7 @@ var styles17 = StyleSheet19.create({
|
|
|
6807
6862
|
});
|
|
6808
6863
|
|
|
6809
6864
|
// src/screens/SelectReceiveTokenAndChainScreen.tsx
|
|
6810
|
-
import { jsx as jsx40, jsxs as
|
|
6865
|
+
import { jsx as jsx40, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6811
6866
|
function SelectReceiveTokenAndChainScreen({
|
|
6812
6867
|
chains,
|
|
6813
6868
|
committed,
|
|
@@ -6827,11 +6882,11 @@ function SelectReceiveTokenAndChainScreen({
|
|
|
6827
6882
|
closeNestedScreen,
|
|
6828
6883
|
renderNestedBackdrop
|
|
6829
6884
|
} = useNestedSheet();
|
|
6830
|
-
const [token, setToken] =
|
|
6831
|
-
const [chainId, setChainId] =
|
|
6885
|
+
const [token, setToken] = useState20(committed?.symbol);
|
|
6886
|
+
const [chainId, setChainId] = useState20(
|
|
6832
6887
|
committed ? Number(committed.chainId) : void 0
|
|
6833
6888
|
);
|
|
6834
|
-
const [pinnedToken, setPinnedToken] =
|
|
6889
|
+
const [pinnedToken, setPinnedToken] = useState20(committed?.symbol);
|
|
6835
6890
|
const tokens = useMemo9(() => receivableTokens(chains), [chains]);
|
|
6836
6891
|
const { cells, overflowCount } = gridCells(tokens, TOKEN_CELLS, pinnedToken);
|
|
6837
6892
|
const draftToken = (next) => {
|
|
@@ -6843,7 +6898,7 @@ function SelectReceiveTokenAndChainScreen({
|
|
|
6843
6898
|
const moreLabel = t("selectReceiveToken.moreTokens", {
|
|
6844
6899
|
count: overflowCount
|
|
6845
6900
|
});
|
|
6846
|
-
return /* @__PURE__ */
|
|
6901
|
+
return /* @__PURE__ */ jsxs22(
|
|
6847
6902
|
Box,
|
|
6848
6903
|
{
|
|
6849
6904
|
style: {
|
|
@@ -6853,8 +6908,8 @@ function SelectReceiveTokenAndChainScreen({
|
|
|
6853
6908
|
},
|
|
6854
6909
|
children: [
|
|
6855
6910
|
/* @__PURE__ */ jsx40(TopBar, { title: t("selectReceiveToken.title"), onBack }),
|
|
6856
|
-
/* @__PURE__ */
|
|
6857
|
-
/* @__PURE__ */
|
|
6911
|
+
/* @__PURE__ */ jsxs22(View7, { style: styles18.scrollArea, children: [
|
|
6912
|
+
/* @__PURE__ */ jsxs22(
|
|
6858
6913
|
BottomSheetScrollView3,
|
|
6859
6914
|
{
|
|
6860
6915
|
style: styles18.scroll,
|
|
@@ -6980,7 +7035,7 @@ var styles18 = StyleSheet20.create({
|
|
|
6980
7035
|
import { BottomSheetScrollView as BottomSheetScrollView4 } from "@gorhom/bottom-sheet";
|
|
6981
7036
|
import { Pressable as Pressable12, StyleSheet as StyleSheet21, View as View8, useWindowDimensions as useWindowDimensions5 } from "react-native";
|
|
6982
7037
|
import { useSafeAreaInsets as useSafeAreaInsets10 } from "react-native-safe-area-context";
|
|
6983
|
-
import { jsx as jsx41, jsxs as
|
|
7038
|
+
import { jsx as jsx41, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6984
7039
|
function SelectSourceTokenScreen({
|
|
6985
7040
|
options,
|
|
6986
7041
|
selectedIndex,
|
|
@@ -6995,9 +7050,9 @@ function SelectSourceTokenScreen({
|
|
|
6995
7050
|
return (
|
|
6996
7051
|
// A full window tall, like the step it replaces — the flow sheet is pinned
|
|
6997
7052
|
// to a fixed detent while a crypto withdrawal step is up (see sheetSizing).
|
|
6998
|
-
/* @__PURE__ */
|
|
7053
|
+
/* @__PURE__ */ jsxs23(Box, { style: { height, paddingTop: insets.top }, children: [
|
|
6999
7054
|
/* @__PURE__ */ jsx41(Grabber, {}),
|
|
7000
|
-
/* @__PURE__ */
|
|
7055
|
+
/* @__PURE__ */ jsxs23(
|
|
7001
7056
|
Box,
|
|
7002
7057
|
{
|
|
7003
7058
|
flexDirection: "row",
|
|
@@ -7019,7 +7074,7 @@ function SelectSourceTokenScreen({
|
|
|
7019
7074
|
]
|
|
7020
7075
|
}
|
|
7021
7076
|
),
|
|
7022
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsxs23(View8, { style: styles19.scrollArea, children: [
|
|
7023
7078
|
/* @__PURE__ */ jsx41(
|
|
7024
7079
|
BottomSheetScrollView4,
|
|
7025
7080
|
{
|
|
@@ -7040,7 +7095,7 @@ function SelectSourceTokenScreen({
|
|
|
7040
7095
|
accessibilityRole: "button",
|
|
7041
7096
|
accessibilityLabel: label,
|
|
7042
7097
|
accessibilityState: { selected: isSelected },
|
|
7043
|
-
children: /* @__PURE__ */
|
|
7098
|
+
children: /* @__PURE__ */ jsxs23(
|
|
7044
7099
|
Box,
|
|
7045
7100
|
{
|
|
7046
7101
|
flexDirection: "row",
|
|
@@ -7052,7 +7107,7 @@ function SelectSourceTokenScreen({
|
|
|
7052
7107
|
isSelected ? { backgroundColor: theme.background.secondary } : void 0
|
|
7053
7108
|
],
|
|
7054
7109
|
children: [
|
|
7055
|
-
/* @__PURE__ */
|
|
7110
|
+
/* @__PURE__ */ jsxs23(
|
|
7056
7111
|
Box,
|
|
7057
7112
|
{
|
|
7058
7113
|
flexDirection: "row",
|
|
@@ -7122,7 +7177,7 @@ var styles19 = StyleSheet21.create({
|
|
|
7122
7177
|
// src/screens/TransactionBreakdownScreen.tsx
|
|
7123
7178
|
import { StyleSheet as StyleSheet22 } from "react-native";
|
|
7124
7179
|
import { useSafeAreaInsets as useSafeAreaInsets11 } from "react-native-safe-area-context";
|
|
7125
|
-
import { jsx as jsx42, jsxs as
|
|
7180
|
+
import { jsx as jsx42, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
7126
7181
|
function TransactionBreakdownScreen({
|
|
7127
7182
|
usdLabel,
|
|
7128
7183
|
floorLabel
|
|
@@ -7130,7 +7185,7 @@ function TransactionBreakdownScreen({
|
|
|
7130
7185
|
const { t } = useFunkitTranslation();
|
|
7131
7186
|
const theme = useTheme();
|
|
7132
7187
|
const insets = useSafeAreaInsets11();
|
|
7133
|
-
return /* @__PURE__ */
|
|
7188
|
+
return /* @__PURE__ */ jsxs24(Box, { children: [
|
|
7134
7189
|
/* @__PURE__ */ jsx42(Grabber, {}),
|
|
7135
7190
|
/* @__PURE__ */ jsx42(TopBar, { title: t("withdrawAddress.breakdownTitle") }),
|
|
7136
7191
|
/* @__PURE__ */ jsx42(
|
|
@@ -7182,7 +7237,7 @@ import {
|
|
|
7182
7237
|
StyleSheet as StyleSheet24,
|
|
7183
7238
|
useWindowDimensions as useWindowDimensions6
|
|
7184
7239
|
} from "react-native";
|
|
7185
|
-
import
|
|
7240
|
+
import Animated7, {
|
|
7186
7241
|
Easing as Easing5,
|
|
7187
7242
|
Keyframe as Keyframe3,
|
|
7188
7243
|
LinearTransition as LinearTransition2
|
|
@@ -7213,7 +7268,7 @@ function ReceiveAsRow({ destinationToken, onPress }) {
|
|
|
7213
7268
|
// src/components/WalletAddressInput.tsx
|
|
7214
7269
|
import { BottomSheetTextInput as BottomSheetTextInput2 } from "@gorhom/bottom-sheet";
|
|
7215
7270
|
import { StyleSheet as StyleSheet23 } from "react-native";
|
|
7216
|
-
import { jsx as jsx44, jsxs as
|
|
7271
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7217
7272
|
var STATUS_ICON_SIZE = 16;
|
|
7218
7273
|
function WalletAddressInput({
|
|
7219
7274
|
value,
|
|
@@ -7230,8 +7285,8 @@ function WalletAddressInput({
|
|
|
7230
7285
|
const label = t("withdrawCrypto.addressPlaceholder");
|
|
7231
7286
|
const isEmpty = value === "";
|
|
7232
7287
|
const helperText = errorText2 ?? warningText;
|
|
7233
|
-
return /* @__PURE__ */
|
|
7234
|
-
/* @__PURE__ */
|
|
7288
|
+
return /* @__PURE__ */ jsxs25(Box, { style: styles21.root, children: [
|
|
7289
|
+
/* @__PURE__ */ jsxs25(
|
|
7235
7290
|
Box,
|
|
7236
7291
|
{
|
|
7237
7292
|
flexDirection: "row",
|
|
@@ -7249,7 +7304,7 @@ function WalletAddressInput({
|
|
|
7249
7304
|
children: label
|
|
7250
7305
|
}
|
|
7251
7306
|
),
|
|
7252
|
-
isAddress === void 0 ? null : /* @__PURE__ */
|
|
7307
|
+
isAddress === void 0 ? null : /* @__PURE__ */ jsxs25(Box, { flexDirection: "row", alignItems: "center", style: styles21.status, children: [
|
|
7253
7308
|
isAddress ? /* @__PURE__ */ jsx44(FigmaSuccessCheckIcon, { size: STATUS_ICON_SIZE }) : /* @__PURE__ */ jsx44(
|
|
7254
7309
|
FigmaAlertCircleIcon,
|
|
7255
7310
|
{
|
|
@@ -7305,7 +7360,7 @@ function WalletAddressInput({
|
|
|
7305
7360
|
)
|
|
7306
7361
|
}
|
|
7307
7362
|
),
|
|
7308
|
-
/* @__PURE__ */
|
|
7363
|
+
/* @__PURE__ */ jsxs25(Box, { flexDirection: "row", style: styles21.buttonRow, children: [
|
|
7309
7364
|
/* @__PURE__ */ jsx44(Box, { style: styles21.button, children: /* @__PURE__ */ jsx44(
|
|
7310
7365
|
PillButton2,
|
|
7311
7366
|
{
|
|
@@ -7362,8 +7417,8 @@ var styles21 = StyleSheet23.create({
|
|
|
7362
7417
|
});
|
|
7363
7418
|
|
|
7364
7419
|
// src/screens/WithdrawAddressScreen.tsx
|
|
7365
|
-
import { jsx as jsx45, jsxs as
|
|
7366
|
-
var AnimatedBox2 =
|
|
7420
|
+
import { jsx as jsx45, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7421
|
+
var AnimatedBox2 = Animated7.createAnimatedComponent(Box);
|
|
7367
7422
|
var SUBMIT_TRANSITION_DURATION = 380;
|
|
7368
7423
|
var SUBMIT_TRANSITION_EASING = Easing5.bezier(0.16, 1, 0.3, 1);
|
|
7369
7424
|
var SUBMIT_TRAVEL = 24;
|
|
@@ -7408,7 +7463,7 @@ function WithdrawAddressScreen({
|
|
|
7408
7463
|
const insets = useSafeAreaInsets12();
|
|
7409
7464
|
const keyboardHeight = useKeyboardHeight(true);
|
|
7410
7465
|
const footerErrorText = executionErrorText ?? quoteErrorText;
|
|
7411
|
-
return /* @__PURE__ */
|
|
7466
|
+
return /* @__PURE__ */ jsxs26(
|
|
7412
7467
|
Box,
|
|
7413
7468
|
{
|
|
7414
7469
|
style: {
|
|
@@ -7418,7 +7473,7 @@ function WithdrawAddressScreen({
|
|
|
7418
7473
|
},
|
|
7419
7474
|
children: [
|
|
7420
7475
|
isSubmitting ? null : /* @__PURE__ */ jsx45(AnimatedBox2, { exiting: FADE_SLIDE_UP_EXITING, children: /* @__PURE__ */ jsx45(TopBar, { title, onBack, onClose }) }),
|
|
7421
|
-
isSubmitting ? null : /* @__PURE__ */
|
|
7476
|
+
isSubmitting ? null : /* @__PURE__ */ jsxs26(AnimatedBox2, { exiting: FADE_SLIDE_UP_EXITING, style: styles22.body, children: [
|
|
7422
7477
|
/* @__PURE__ */ jsx45(
|
|
7423
7478
|
ReceiveAsRow,
|
|
7424
7479
|
{
|
|
@@ -7458,7 +7513,7 @@ function WithdrawAddressScreen({
|
|
|
7458
7513
|
) }) : null
|
|
7459
7514
|
}
|
|
7460
7515
|
),
|
|
7461
|
-
recipient === "" ? null : /* @__PURE__ */
|
|
7516
|
+
recipient === "" ? null : /* @__PURE__ */ jsxs26(
|
|
7462
7517
|
AnimatedBox2,
|
|
7463
7518
|
{
|
|
7464
7519
|
layout: SUBMIT_TRANSITION,
|
|
@@ -7524,13 +7579,13 @@ var styles22 = StyleSheet24.create({
|
|
|
7524
7579
|
// src/screens/WithdrawAmountScreen.tsx
|
|
7525
7580
|
import { USD_DECIMALS, percentOfAmount } from "@funkit/connect-core";
|
|
7526
7581
|
import { Pressable as Pressable15, StyleSheet as StyleSheet28, useWindowDimensions as useWindowDimensions8 } from "react-native";
|
|
7527
|
-
import
|
|
7582
|
+
import Animated10, { Keyframe as Keyframe5, LinearTransition as LinearTransition5 } from "react-native-reanimated";
|
|
7528
7583
|
import { useSafeAreaInsets as useSafeAreaInsets13 } from "react-native-safe-area-context";
|
|
7529
7584
|
|
|
7530
7585
|
// src/components/AmountDisplay.tsx
|
|
7531
7586
|
import { useMemo as useMemo10 } from "react";
|
|
7532
7587
|
import { StyleSheet as StyleSheet25, useWindowDimensions as useWindowDimensions7 } from "react-native";
|
|
7533
|
-
import
|
|
7588
|
+
import Animated8, {
|
|
7534
7589
|
Keyframe as Keyframe4,
|
|
7535
7590
|
LinearTransition as LinearTransition3,
|
|
7536
7591
|
useAnimatedStyle as useAnimatedStyle2,
|
|
@@ -7568,8 +7623,8 @@ var CAP_BOX_RATIO2 = 68 / 96;
|
|
|
7568
7623
|
var CHARACTER_ADVANCE_RATIO = 0.6;
|
|
7569
7624
|
var HORIZONTAL_INSET = 16;
|
|
7570
7625
|
var MIN_FONT_SIZE = 40;
|
|
7571
|
-
var AnimatedBox3 =
|
|
7572
|
-
var AnimatedText =
|
|
7626
|
+
var AnimatedBox3 = Animated8.createAnimatedComponent(Box);
|
|
7627
|
+
var AnimatedText = Animated8.createAnimatedComponent(Text);
|
|
7573
7628
|
var GLYPH_LAYOUT = LinearTransition3.duration(MOTION_DURATION).easing(MOTION_EASING);
|
|
7574
7629
|
function AmountDisplay({
|
|
7575
7630
|
value,
|
|
@@ -7680,7 +7735,7 @@ var styles23 = StyleSheet25.create({
|
|
|
7680
7735
|
import { Pressable as Pressable13, StyleSheet as StyleSheet26 } from "react-native";
|
|
7681
7736
|
|
|
7682
7737
|
// src/haptics/HapticsContext.tsx
|
|
7683
|
-
import { createContext as createContext2, useCallback as
|
|
7738
|
+
import { createContext as createContext2, useCallback as useCallback11, useContext as useContext2 } from "react";
|
|
7684
7739
|
|
|
7685
7740
|
// src/haptics/hapticTap.ts
|
|
7686
7741
|
var loading;
|
|
@@ -7714,7 +7769,7 @@ function FunkitHapticsProvider({
|
|
|
7714
7769
|
var hasWarned = false;
|
|
7715
7770
|
function useHapticFeedback() {
|
|
7716
7771
|
const haptic = useContext2(HapticsContext);
|
|
7717
|
-
return
|
|
7772
|
+
return useCallback11(() => {
|
|
7718
7773
|
const warn2 = (error) => {
|
|
7719
7774
|
if (hasWarned) {
|
|
7720
7775
|
return;
|
|
@@ -7797,9 +7852,9 @@ var styles24 = StyleSheet26.create({
|
|
|
7797
7852
|
|
|
7798
7853
|
// src/components/WithdrawSourceCard.tsx
|
|
7799
7854
|
import { Pressable as Pressable14, StyleSheet as StyleSheet27 } from "react-native";
|
|
7800
|
-
import
|
|
7801
|
-
import { jsx as jsx49, jsxs as
|
|
7802
|
-
var AnimatedBox4 =
|
|
7855
|
+
import Animated9, { LinearTransition as LinearTransition4 } from "react-native-reanimated";
|
|
7856
|
+
import { jsx as jsx49, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7857
|
+
var AnimatedBox4 = Animated9.createAnimatedComponent(Box);
|
|
7803
7858
|
var FOOT_TRANSITION = LinearTransition4.duration(MOTION_DURATION).easing(MOTION_EASING);
|
|
7804
7859
|
var HORIZONTAL_PADDING = 12;
|
|
7805
7860
|
var VERTICAL_PADDING = 13;
|
|
@@ -7815,7 +7870,7 @@ function WithdrawSourceCard({
|
|
|
7815
7870
|
attachedToButton = false
|
|
7816
7871
|
}) {
|
|
7817
7872
|
const theme = useTheme();
|
|
7818
|
-
const card2 = /* @__PURE__ */
|
|
7873
|
+
const card2 = /* @__PURE__ */ jsxs27(
|
|
7819
7874
|
AnimatedBox4,
|
|
7820
7875
|
{
|
|
7821
7876
|
flexDirection: "row",
|
|
@@ -7833,7 +7888,7 @@ function WithdrawSourceCard({
|
|
|
7833
7888
|
}
|
|
7834
7889
|
],
|
|
7835
7890
|
children: [
|
|
7836
|
-
/* @__PURE__ */
|
|
7891
|
+
/* @__PURE__ */ jsxs27(
|
|
7837
7892
|
Box,
|
|
7838
7893
|
{
|
|
7839
7894
|
flex: 1,
|
|
@@ -7842,7 +7897,7 @@ function WithdrawSourceCard({
|
|
|
7842
7897
|
style: styles25.token,
|
|
7843
7898
|
children: [
|
|
7844
7899
|
icon,
|
|
7845
|
-
/* @__PURE__ */
|
|
7900
|
+
/* @__PURE__ */ jsxs27(Box, { flex: 1, style: styles25.details, children: [
|
|
7846
7901
|
/* @__PURE__ */ jsx49(Text, { variant: "bodyMedium", numberOfLines: 1, children: title }),
|
|
7847
7902
|
subtitle ? /* @__PURE__ */ jsx49(
|
|
7848
7903
|
Text,
|
|
@@ -7946,10 +8001,10 @@ function applyNumpadKey(value, key, maxDecimals) {
|
|
|
7946
8001
|
}
|
|
7947
8002
|
|
|
7948
8003
|
// src/screens/WithdrawAmountScreen.tsx
|
|
7949
|
-
import { jsx as jsx50, jsxs as
|
|
8004
|
+
import { jsx as jsx50, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7950
8005
|
var NUMPAD_BOTTOM_MARGIN = 25;
|
|
7951
8006
|
var NUMPAD_MIN_BOTTOM_MARGIN = 40;
|
|
7952
|
-
var AnimatedBox5 =
|
|
8007
|
+
var AnimatedBox5 = Animated10.createAnimatedComponent(Box);
|
|
7953
8008
|
var CARD_TRANSITION = LinearTransition5.duration(MOTION_DURATION).easing(MOTION_EASING);
|
|
7954
8009
|
var BUTTON_TRAVEL = 24;
|
|
7955
8010
|
var BUTTON_ENTERING = new Keyframe5({
|
|
@@ -7991,7 +8046,7 @@ function WithdrawAmountScreen({
|
|
|
7991
8046
|
const tokenLabel = `${formatTokenAmount(amount === "" ? "0" : amount)} ${source.symbol}`;
|
|
7992
8047
|
const convertedLabel = inUsd ? tokenLabel : usdLabel ?? tokenLabel;
|
|
7993
8048
|
const canSwap = !!onSwapDenomination && !errorText2;
|
|
7994
|
-
const convertedLine = /* @__PURE__ */
|
|
8049
|
+
const convertedLine = /* @__PURE__ */ jsxs28(Box, { flexDirection: "row", alignItems: "center", style: styles26.convertedRow, children: [
|
|
7995
8050
|
/* @__PURE__ */ jsx50(
|
|
7996
8051
|
Text,
|
|
7997
8052
|
{
|
|
@@ -8006,7 +8061,7 @@ function WithdrawAmountScreen({
|
|
|
8006
8061
|
),
|
|
8007
8062
|
canSwap ? /* @__PURE__ */ jsx50(FigmaSwapIcon, { size: 16, color: theme.content.elements.secondary }) : null
|
|
8008
8063
|
] });
|
|
8009
|
-
return /* @__PURE__ */
|
|
8064
|
+
return /* @__PURE__ */ jsxs28(
|
|
8010
8065
|
Box,
|
|
8011
8066
|
{
|
|
8012
8067
|
style: {
|
|
@@ -8016,7 +8071,7 @@ function WithdrawAmountScreen({
|
|
|
8016
8071
|
},
|
|
8017
8072
|
children: [
|
|
8018
8073
|
/* @__PURE__ */ jsx50(TopBar, { title, onBack, onClose }),
|
|
8019
|
-
/* @__PURE__ */
|
|
8074
|
+
/* @__PURE__ */ jsxs28(Box, { style: styles26.amount, children: [
|
|
8020
8075
|
/* @__PURE__ */ jsx50(
|
|
8021
8076
|
AmountDisplay,
|
|
8022
8077
|
{
|
|
@@ -8038,7 +8093,7 @@ function WithdrawAmountScreen({
|
|
|
8038
8093
|
) : convertedLine })
|
|
8039
8094
|
] }),
|
|
8040
8095
|
/* @__PURE__ */ jsx50(Box, { flex: 1 }),
|
|
8041
|
-
/* @__PURE__ */
|
|
8096
|
+
/* @__PURE__ */ jsxs28(AnimatedBox5, { layout: CARD_TRANSITION, style: styles26.card, children: [
|
|
8042
8097
|
/* @__PURE__ */ jsx50(
|
|
8043
8098
|
WithdrawSourceCard,
|
|
8044
8099
|
{
|
|
@@ -8121,7 +8176,7 @@ var styles26 = StyleSheet28.create({
|
|
|
8121
8176
|
});
|
|
8122
8177
|
|
|
8123
8178
|
// src/screens/WithdrawCryptoSteps.tsx
|
|
8124
|
-
import { Fragment as Fragment4, jsx as jsx51, jsxs as
|
|
8179
|
+
import { Fragment as Fragment4, jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
8125
8180
|
function WithdrawCryptoSteps({
|
|
8126
8181
|
config,
|
|
8127
8182
|
callbacks,
|
|
@@ -8163,8 +8218,8 @@ function WithdrawCryptoSteps({
|
|
|
8163
8218
|
},
|
|
8164
8219
|
onSubmitted
|
|
8165
8220
|
});
|
|
8166
|
-
const [isPickingSource, setIsPickingSource] =
|
|
8167
|
-
const [isPasting, setIsPasting] =
|
|
8221
|
+
const [isPickingSource, setIsPickingSource] = useState21(false);
|
|
8222
|
+
const [isPasting, setIsPasting] = useState21(false);
|
|
8168
8223
|
if (isPickingSource) {
|
|
8169
8224
|
return /* @__PURE__ */ jsx51(
|
|
8170
8225
|
SelectSourceTokenScreen,
|
|
@@ -8236,7 +8291,7 @@ function WithdrawCryptoSteps({
|
|
|
8236
8291
|
}
|
|
8237
8292
|
);
|
|
8238
8293
|
}
|
|
8239
|
-
return /* @__PURE__ */
|
|
8294
|
+
return /* @__PURE__ */ jsxs29(Fragment4, { children: [
|
|
8240
8295
|
/* @__PURE__ */ jsx51(
|
|
8241
8296
|
WithdrawAddressScreen,
|
|
8242
8297
|
{
|
|
@@ -8369,7 +8424,7 @@ function WithdrawMethodScreen(props) {
|
|
|
8369
8424
|
import {
|
|
8370
8425
|
isValidOrderData
|
|
8371
8426
|
} from "@funkit/connect-core";
|
|
8372
|
-
import { useCallback as
|
|
8427
|
+
import { useCallback as useCallback12 } from "react";
|
|
8373
8428
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
8374
8429
|
function SwappedWithdrawScreen({
|
|
8375
8430
|
url,
|
|
@@ -8379,7 +8434,7 @@ function SwappedWithdrawScreen({
|
|
|
8379
8434
|
onWithdrawalSuccess,
|
|
8380
8435
|
onOrderData
|
|
8381
8436
|
}) {
|
|
8382
|
-
const handleMessage =
|
|
8437
|
+
const handleMessage = useCallback12(
|
|
8383
8438
|
(msg) => {
|
|
8384
8439
|
switch (msg.type) {
|
|
8385
8440
|
case "SWAPPED_GO_BACK":
|
|
@@ -8439,7 +8494,7 @@ import {
|
|
|
8439
8494
|
} from "@funkit/connect-core";
|
|
8440
8495
|
import { useTheme as useTheme4 } from "@shopify/restyle";
|
|
8441
8496
|
import { useStatsigClient as useStatsigClient2 } from "@statsig/react-bindings";
|
|
8442
|
-
import { useQuery as
|
|
8497
|
+
import { useQuery as useQuery10 } from "@tanstack/react-query";
|
|
8443
8498
|
import { useMemo as useMemo11 } from "react";
|
|
8444
8499
|
var WITHDRAW_FOPS_QUERY_KEY = "withdrawFops";
|
|
8445
8500
|
function useWithdrawalRoute(config) {
|
|
@@ -8460,7 +8515,7 @@ function useWithdrawalSellCap(config, walletAddress) {
|
|
|
8460
8515
|
const { sourceUsdBalance } = config;
|
|
8461
8516
|
const isBalanceCallback = typeof sourceUsdBalance === "function";
|
|
8462
8517
|
const hasBalanceInfo = sourceUsdBalance != null;
|
|
8463
|
-
const balanceQuery =
|
|
8518
|
+
const balanceQuery = useQuery10({
|
|
8464
8519
|
queryKey: [
|
|
8465
8520
|
"withdrawSourceUsdBalance",
|
|
8466
8521
|
walletAddress,
|
|
@@ -8583,7 +8638,7 @@ function useWithdrawalFops({
|
|
|
8583
8638
|
);
|
|
8584
8639
|
const { usdBalance, eurMax, isBelowMinimumBalance, isAwaitingCap } = useWithdrawalSellCap(config, walletAddress);
|
|
8585
8640
|
const isEnabled = enabled && isWithdrawalEnabled && !!apiKey && !!userId && !!walletAddress && walletAddress !== "0x" && !!countryCode && !isSwappedCurrencyCodeLoading && !isAwaitingCap;
|
|
8586
|
-
const query =
|
|
8641
|
+
const query = useQuery10({
|
|
8587
8642
|
// `prefillFiatEmail` is intentionally NOT in the queryKey (web parity): it's
|
|
8588
8643
|
// read at fetch time, so post-mount changes don't trigger a refetch.
|
|
8589
8644
|
queryKey: [
|
|
@@ -8649,7 +8704,7 @@ import {
|
|
|
8649
8704
|
processFiatWithdrawalOrder,
|
|
8650
8705
|
toFiatWithdrawalOrder
|
|
8651
8706
|
} from "@funkit/connect-core";
|
|
8652
|
-
import { useCallback as
|
|
8707
|
+
import { useCallback as useCallback13, useRef as useRef15 } from "react";
|
|
8653
8708
|
var submittedOrderIds = /* @__PURE__ */ new Set();
|
|
8654
8709
|
function useWithdrawalExecution({
|
|
8655
8710
|
config,
|
|
@@ -8659,7 +8714,7 @@ function useWithdrawalExecution({
|
|
|
8659
8714
|
}) {
|
|
8660
8715
|
const { apiKey, userId } = useFunkitIdentity();
|
|
8661
8716
|
const isProcessingRef = useRef15(false);
|
|
8662
|
-
const executeOrder =
|
|
8717
|
+
const executeOrder = useCallback13(
|
|
8663
8718
|
async (data) => {
|
|
8664
8719
|
const order = toFiatWithdrawalOrder(data);
|
|
8665
8720
|
if (isProcessingRef.current) {
|
|
@@ -8752,21 +8807,21 @@ function WithdrawalFlowContent({
|
|
|
8752
8807
|
const queryClient = useQueryClient();
|
|
8753
8808
|
const { fops, isLoading, isBelowMinimumBalance, isError, route } = useWithdrawalFops({ config });
|
|
8754
8809
|
const methodOptions = config.methods ?? [];
|
|
8755
|
-
const [selectedMethodId, setSelectedMethodId] =
|
|
8810
|
+
const [selectedMethodId, setSelectedMethodId] = useState22();
|
|
8756
8811
|
const selectedMethodConfig = methodOptions.find(
|
|
8757
8812
|
(method) => method.id === selectedMethodId
|
|
8758
8813
|
)?.config;
|
|
8759
|
-
const [selectedFop, setSelectedFop] =
|
|
8760
|
-
const [hasExecutionError, setHasExecutionError] =
|
|
8761
|
-
const [submittedWithdrawal, setSubmittedWithdrawal] =
|
|
8762
|
-
const onExecutionError =
|
|
8814
|
+
const [selectedFop, setSelectedFop] = useState22();
|
|
8815
|
+
const [hasExecutionError, setHasExecutionError] = useState22(false);
|
|
8816
|
+
const [submittedWithdrawal, setSubmittedWithdrawal] = useState22();
|
|
8817
|
+
const onExecutionError = useCallback14(() => setHasExecutionError(true), []);
|
|
8763
8818
|
const { executeOrder } = useWithdrawalExecution({
|
|
8764
8819
|
config,
|
|
8765
8820
|
route,
|
|
8766
8821
|
callbacks,
|
|
8767
8822
|
onError: onExecutionError
|
|
8768
8823
|
});
|
|
8769
|
-
const invalidateWithdrawFops =
|
|
8824
|
+
const invalidateWithdrawFops = useCallback14(() => {
|
|
8770
8825
|
void queryClient.invalidateQueries({ queryKey: [WITHDRAW_FOPS_QUERY_KEY] });
|
|
8771
8826
|
}, [queryClient]);
|
|
8772
8827
|
if (hasExecutionError) {
|
|
@@ -8873,7 +8928,7 @@ function WithdrawalFlowContent({
|
|
|
8873
8928
|
return submittedWithdrawal ? /* @__PURE__ */ jsx54(
|
|
8874
8929
|
WithdrawCryptoComplete,
|
|
8875
8930
|
{
|
|
8876
|
-
|
|
8931
|
+
depositAddressOrHash: submittedWithdrawal.depositAddressOrHash,
|
|
8877
8932
|
amountLabel: submittedWithdrawal.amountLabel,
|
|
8878
8933
|
usdLabel: submittedWithdrawal.usdLabel,
|
|
8879
8934
|
tokenLabel: submittedWithdrawal.tokenLabel,
|
|
@@ -8921,7 +8976,7 @@ function WithdrawalFlowContent({
|
|
|
8921
8976
|
}
|
|
8922
8977
|
|
|
8923
8978
|
// src/flow/FunkitFlowProvider.tsx
|
|
8924
|
-
import { jsx as jsx55, jsxs as
|
|
8979
|
+
import { jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
8925
8980
|
var CRYPTO_WITHDRAWAL_STEPS = /* @__PURE__ */ new Set([
|
|
8926
8981
|
"withdrawAmount",
|
|
8927
8982
|
"withdrawAddress",
|
|
@@ -8941,13 +8996,13 @@ function FunkitFlowProvider({
|
|
|
8941
8996
|
pasteFromClipboard: pasteFromClipboard2 = pasteFromClipboard,
|
|
8942
8997
|
renderBackdropBlur
|
|
8943
8998
|
}) {
|
|
8944
|
-
const [state, setState] =
|
|
8999
|
+
const [state, setState] = useState23(CLOSED);
|
|
8945
9000
|
const { hideCryptoDeposit } = useFunkitIdentity();
|
|
8946
9001
|
const readClipboard = useMemo12(
|
|
8947
9002
|
() => guardClipboardReader(pasteFromClipboard2),
|
|
8948
9003
|
[pasteFromClipboard2]
|
|
8949
9004
|
);
|
|
8950
|
-
const beginDeposit =
|
|
9005
|
+
const beginDeposit = useCallback15(
|
|
8951
9006
|
(config, hostCallbacks = {}) => {
|
|
8952
9007
|
logger.info("beginDeposit", { ...config, hideCryptoDeposit });
|
|
8953
9008
|
const callbacks = guardHostCallbacks(hostCallbacks);
|
|
@@ -8961,7 +9016,7 @@ function FunkitFlowProvider({
|
|
|
8961
9016
|
},
|
|
8962
9017
|
[hideCryptoDeposit]
|
|
8963
9018
|
);
|
|
8964
|
-
const beginWithdrawal =
|
|
9019
|
+
const beginWithdrawal = useCallback15(
|
|
8965
9020
|
(config, hostCallbacks = {}) => {
|
|
8966
9021
|
logger.info("beginWithdrawal", config);
|
|
8967
9022
|
const callbacks = guardHostCallbacks(hostCallbacks);
|
|
@@ -8976,7 +9031,7 @@ function FunkitFlowProvider({
|
|
|
8976
9031
|
[]
|
|
8977
9032
|
);
|
|
8978
9033
|
const { toast, showCopiedToast, clearToast } = useCopiedToast();
|
|
8979
|
-
const closeFlow =
|
|
9034
|
+
const closeFlow = useCallback15(() => {
|
|
8980
9035
|
setState((prev) => {
|
|
8981
9036
|
if (!prev.isOpen) {
|
|
8982
9037
|
return prev;
|
|
@@ -8986,13 +9041,13 @@ function FunkitFlowProvider({
|
|
|
8986
9041
|
});
|
|
8987
9042
|
clearToast();
|
|
8988
9043
|
}, [clearToast]);
|
|
8989
|
-
const navigate =
|
|
9044
|
+
const navigate = useCallback15((screen) => {
|
|
8990
9045
|
setState((prev) => ({ ...prev, stack: [...prev.stack, screen] }));
|
|
8991
9046
|
}, []);
|
|
8992
|
-
const reset =
|
|
9047
|
+
const reset = useCallback15((screen) => {
|
|
8993
9048
|
setState((prev) => prev.isOpen ? { ...prev, stack: [screen] } : prev);
|
|
8994
9049
|
}, []);
|
|
8995
|
-
const popTo =
|
|
9050
|
+
const popTo = useCallback15((screen) => {
|
|
8996
9051
|
setState((prev) => {
|
|
8997
9052
|
const index = prev.stack.lastIndexOf(screen);
|
|
8998
9053
|
if (!prev.isOpen || index < 0) {
|
|
@@ -9001,7 +9056,7 @@ function FunkitFlowProvider({
|
|
|
9001
9056
|
return { ...prev, stack: prev.stack.slice(0, index + 1) };
|
|
9002
9057
|
});
|
|
9003
9058
|
}, []);
|
|
9004
|
-
const back =
|
|
9059
|
+
const back = useCallback15(() => {
|
|
9005
9060
|
setState((prev) => {
|
|
9006
9061
|
if (!prev.isOpen) {
|
|
9007
9062
|
return prev;
|
|
@@ -9024,7 +9079,7 @@ function FunkitFlowProvider({
|
|
|
9024
9079
|
() => ({ navigate, back, reset, popTo, closeFlow }),
|
|
9025
9080
|
[navigate, back, reset, popTo, closeFlow]
|
|
9026
9081
|
);
|
|
9027
|
-
return /* @__PURE__ */ jsx55(FunkitFlowContext.Provider, { value, children: /* @__PURE__ */
|
|
9082
|
+
return /* @__PURE__ */ jsx55(FunkitFlowContext.Provider, { value, children: /* @__PURE__ */ jsxs30(View9, { style: rootContainer, children: [
|
|
9028
9083
|
/* @__PURE__ */ jsx55(
|
|
9029
9084
|
FlowSheet,
|
|
9030
9085
|
{
|
|
@@ -9074,7 +9129,7 @@ function useFunkitFlow() {
|
|
|
9074
9129
|
}
|
|
9075
9130
|
|
|
9076
9131
|
// src/version.ts
|
|
9077
|
-
var CONNECT_RN_VERSION = true ? "3.
|
|
9132
|
+
var CONNECT_RN_VERSION = true ? "3.9.0" : "0.0.0-dev";
|
|
9078
9133
|
|
|
9079
9134
|
// src/providers/FunkitStatsigProvider.tsx
|
|
9080
9135
|
import {
|
|
@@ -9082,7 +9137,7 @@ import {
|
|
|
9082
9137
|
LogLevel,
|
|
9083
9138
|
StatsigProvider
|
|
9084
9139
|
} from "@statsig/react-bindings";
|
|
9085
|
-
import { useEffect as
|
|
9140
|
+
import { useEffect as useEffect20, useMemo as useMemo13 } from "react";
|
|
9086
9141
|
|
|
9087
9142
|
// src/statsig/useClientAsyncInitRN.ts
|
|
9088
9143
|
import {
|
|
@@ -9303,7 +9358,7 @@ function FunkitStatsigProvider({
|
|
|
9303
9358
|
tier: isDevelopment ? "development" : "production"
|
|
9304
9359
|
}
|
|
9305
9360
|
});
|
|
9306
|
-
|
|
9361
|
+
useEffect20(() => {
|
|
9307
9362
|
if (isLoading) {
|
|
9308
9363
|
return;
|
|
9309
9364
|
}
|
|
@@ -9352,13 +9407,13 @@ function FunkitProvider({
|
|
|
9352
9407
|
() => resolveFunkitIdentity(config ?? ANONYMOUS_CONFIG, walletAddress),
|
|
9353
9408
|
[config, walletAddress]
|
|
9354
9409
|
);
|
|
9355
|
-
|
|
9410
|
+
useEffect21(() => {
|
|
9356
9411
|
if (!config?.apiKey) {
|
|
9357
9412
|
return;
|
|
9358
9413
|
}
|
|
9359
9414
|
logger.configure(config.apiKey, debug, CONNECT_RN_VERSION);
|
|
9360
9415
|
}, [config?.apiKey, debug]);
|
|
9361
|
-
|
|
9416
|
+
useEffect21(() => {
|
|
9362
9417
|
logger.setUserInfo(
|
|
9363
9418
|
identity.userId,
|
|
9364
9419
|
identity.walletAddress,
|
|
@@ -9387,14 +9442,14 @@ function FunkitProvider({
|
|
|
9387
9442
|
}
|
|
9388
9443
|
|
|
9389
9444
|
// src/providers/useFunkitCheckout.ts
|
|
9390
|
-
import { useCallback as
|
|
9445
|
+
import { useCallback as useCallback16 } from "react";
|
|
9391
9446
|
function useFunkitCheckout(callbacks = {}) {
|
|
9392
9447
|
const { beginDeposit: openDepositFlow, beginWithdrawal: openWithdrawalFlow } = useFunkitFlow();
|
|
9393
|
-
const beginDeposit =
|
|
9448
|
+
const beginDeposit = useCallback16(
|
|
9394
9449
|
(config) => openDepositFlow(config, callbacks),
|
|
9395
9450
|
[openDepositFlow, callbacks]
|
|
9396
9451
|
);
|
|
9397
|
-
const beginWithdrawal =
|
|
9452
|
+
const beginWithdrawal = useCallback16(
|
|
9398
9453
|
(config) => openWithdrawalFlow(config, callbacks),
|
|
9399
9454
|
[openWithdrawalFlow, callbacks]
|
|
9400
9455
|
);
|
|
@@ -9462,7 +9517,7 @@ import {
|
|
|
9462
9517
|
import {
|
|
9463
9518
|
purifyCheckoutHistoryItem as purifyCheckoutHistoryItem2
|
|
9464
9519
|
} from "@funkit/connect-core";
|
|
9465
|
-
import { useQuery as
|
|
9520
|
+
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
9466
9521
|
var CHECKOUT_HISTORY_HOOK_LIMIT = 100;
|
|
9467
9522
|
function useCheckoutsListenerByUserId(userId) {
|
|
9468
9523
|
const { apiKey, userId: identityUserId } = useFunkitIdentity();
|
|
@@ -9471,7 +9526,7 @@ function useCheckoutsListenerByUserId(userId) {
|
|
|
9471
9526
|
);
|
|
9472
9527
|
const resolvedUserId = userId ?? identityUserId;
|
|
9473
9528
|
const effectiveUserId = resolvedUserId === "0x" ? "" : resolvedUserId;
|
|
9474
|
-
const { data, isLoading } =
|
|
9529
|
+
const { data, isLoading } = useQuery11({
|
|
9475
9530
|
enabled: !!effectiveUserId,
|
|
9476
9531
|
queryKey: ["getPurifiedCheckoutsByUserId", effectiveUserId],
|
|
9477
9532
|
queryFn: async () => {
|