@funkit/connect 9.9.0 → 9.11.0-next.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 +28 -0
- package/dist/chunk-64NZSUGQ.js +368 -0
- package/dist/chunk-B2B6HDIE.js +238 -0
- package/dist/chunk-OQNN7EMQ.js +238 -0
- package/dist/chunk-S65TG73G.js +247 -0
- package/dist/chunk-VLAOBEJN.js +247 -0
- package/dist/clients/chunk-3LSYVQXK.js +289 -0
- package/dist/clients/chunk-5HU2XDR2.js +289 -0
- package/dist/clients/chunk-DKWYHSW3.js +225 -0
- package/dist/clients/chunk-IPK5DVIL.js +229 -0
- package/dist/clients/chunk-PVOHWTSR.js +289 -0
- package/dist/clients/chunk-SBQ2UUPK.js +214 -0
- package/dist/clients/fanatics.css +1 -1
- package/dist/clients/fanatics.js +1 -1
- package/dist/clients/lighter.css +1 -1
- package/dist/clients/lighter.d.ts +35 -28
- package/dist/clients/lighter.js +122 -26
- package/dist/clients/rolly.d.ts +42 -0
- package/dist/clients/rolly.js +91 -0
- package/dist/components/Dropdown/TokenAndChainDropdown.css.d.ts +1 -0
- package/dist/hooks/queries/useSwappedExchanges.d.ts +14 -0
- package/dist/hooks/statsig/checkFeatureGate.d.ts +19 -0
- package/dist/hooks/track/CheckoutTrackingContext.d.ts +60 -0
- package/dist/hooks/useExchangeOptions.d.ts +10 -0
- package/dist/hooks/useTokenChain.d.ts +21 -0
- package/dist/index.css +10 -10
- package/dist/index.js +97 -60
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeContainer.d.ts +17 -0
- package/dist/modals/WithdrwalModal/WithdrawalCallbackSuccess.d.ts +10 -0
- package/dist/modals/WithdrwalModal/WithdrawalContent.d.ts +11 -0
- package/dist/modals/WithdrwalModal/WithdrawalModal.d.ts +9 -0
- package/dist/modals/WithdrwalModal/WithdrawalSuccess.d.ts +15 -0
- package/dist/modals/WithdrwalModal/types.d.ts +5 -0
- package/dist/modals/WithdrwalModal/useWithdrawal.d.ts +24 -0
- package/dist/utils/openExternalFlowPopup.d.ts +21 -0
- package/dist/utils/polymarket.d.ts +6 -0
- package/dist/wallets/walletConnectors/chunk-34HACM5U.js +110 -0
- package/dist/wallets/walletConnectors/chunk-4C7ER452.js +93 -0
- package/dist/wallets/walletConnectors/chunk-53VYSPXK.js +66 -0
- package/dist/wallets/walletConnectors/chunk-5TN5Z2WY.js +87 -0
- package/dist/wallets/walletConnectors/chunk-6DRCY52E.js +69 -0
- package/dist/wallets/walletConnectors/chunk-6UCI7GM6.js +98 -0
- package/dist/wallets/walletConnectors/chunk-6YO27XOM.js +96 -0
- package/dist/wallets/walletConnectors/chunk-7OARWILZ.js +92 -0
- package/dist/wallets/walletConnectors/chunk-7V33VJAL.js +218 -0
- package/dist/wallets/walletConnectors/chunk-APHCF4DT.js +103 -0
- package/dist/wallets/walletConnectors/chunk-CJJT7LMT.js +96 -0
- package/dist/wallets/walletConnectors/chunk-DEFRRPXB.js +98 -0
- package/dist/wallets/walletConnectors/chunk-EKJHJFRN.js +69 -0
- package/dist/wallets/walletConnectors/chunk-FG2LDVXL.js +92 -0
- package/dist/wallets/walletConnectors/chunk-GH4M6FTK.js +95 -0
- package/dist/wallets/walletConnectors/chunk-GSHSWVEG.js +70 -0
- package/dist/wallets/walletConnectors/chunk-GVOQTORD.js +87 -0
- package/dist/wallets/walletConnectors/chunk-HETS3KKI.js +218 -0
- package/dist/wallets/walletConnectors/chunk-HOPH3TQ3.js +99 -0
- package/dist/wallets/walletConnectors/chunk-HRDPUW3V.js +94 -0
- package/dist/wallets/walletConnectors/chunk-HXWUH73P.js +93 -0
- package/dist/wallets/walletConnectors/chunk-IICWJWGZ.js +110 -0
- package/dist/wallets/walletConnectors/chunk-KO56HCTI.js +106 -0
- package/dist/wallets/walletConnectors/chunk-KWX2SYU2.js +100 -0
- package/dist/wallets/walletConnectors/chunk-LCIPVVH5.js +70 -0
- package/dist/wallets/walletConnectors/chunk-LI6QY2B5.js +94 -0
- package/dist/wallets/walletConnectors/chunk-PKMAPNN6.js +92 -0
- package/dist/wallets/walletConnectors/chunk-T4ROGPMF.js +106 -0
- package/dist/wallets/walletConnectors/chunk-TTHM3WUR.js +100 -0
- package/dist/wallets/walletConnectors/chunk-UDTBQV4Q.js +96 -0
- package/dist/wallets/walletConnectors/chunk-V6UOWTEZ.js +95 -0
- package/dist/wallets/walletConnectors/chunk-VJZWNQOF.js +92 -0
- package/dist/wallets/walletConnectors/chunk-XBLHZICW.js +103 -0
- package/dist/wallets/walletConnectors/chunk-XVBSJCW5.js +96 -0
- package/dist/wallets/walletConnectors/chunk-YIEASHLS.js +99 -0
- package/dist/wallets/walletConnectors/chunk-ZPSPK6LH.js +66 -0
- package/dist/wallets/walletConnectors/index.js +61 -61
- package/package.json +3 -3
- /package/dist/clients/{chunk-LMEQD56M.js → chunk-GCAV3VTB.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
lightTheme
|
|
4
|
-
} from "./chunk-76E6MOLR.js";
|
|
5
2
|
import {
|
|
6
3
|
darkTheme
|
|
7
4
|
} from "./chunk-AVVB5AIE.js";
|
|
5
|
+
import {
|
|
6
|
+
lightTheme
|
|
7
|
+
} from "./chunk-76E6MOLR.js";
|
|
8
8
|
import {
|
|
9
9
|
systemFontStack
|
|
10
10
|
} from "./chunk-O35RTEEF.js";
|
|
@@ -1140,7 +1140,7 @@ function useMainnetEnsName(address) {
|
|
|
1140
1140
|
import {
|
|
1141
1141
|
getAllWalletTokens
|
|
1142
1142
|
} from "@funkit/api-base";
|
|
1143
|
-
import { keepPreviousData as keepPreviousData2, useQuery as
|
|
1143
|
+
import { keepPreviousData as keepPreviousData2, useQuery as useQuery27 } from "@tanstack/react-query";
|
|
1144
1144
|
import { arbitrum as arbitrum8, polygon as polygon9 } from "viem/chains";
|
|
1145
1145
|
|
|
1146
1146
|
// src/domains/asset.ts
|
|
@@ -2987,7 +2987,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
2987
2987
|
localStorage.setItem(storageKey, version);
|
|
2988
2988
|
}
|
|
2989
2989
|
function getCurrentSdkVersion() {
|
|
2990
|
-
return "9.
|
|
2990
|
+
return "9.11.0-next.0";
|
|
2991
2991
|
}
|
|
2992
2992
|
function useFingerprint() {
|
|
2993
2993
|
const fingerprint = useCallback3(() => {
|
|
@@ -11217,7 +11217,8 @@ var en_default = {
|
|
|
11217
11217
|
methodFast: "Fast",
|
|
11218
11218
|
methodSecure: "Secure",
|
|
11219
11219
|
fastDisclaimer: "USDC Perps only \xB7 Multiple chains \xB7 Instant",
|
|
11220
|
-
secureDisclaimer: "All tokens \xB7 Ethereum chain only \xB7
|
|
11220
|
+
secureDisclaimer: "All tokens \xB7 Ethereum chain only \xB7 {{delay}}",
|
|
11221
|
+
secureFallbackDelay: "60+ minutes"
|
|
11221
11222
|
},
|
|
11222
11223
|
directExecution: {
|
|
11223
11224
|
fillStatus: "Fill status",
|
|
@@ -11774,7 +11775,8 @@ var es_default = {
|
|
|
11774
11775
|
methodFast: "R\xE1pido",
|
|
11775
11776
|
methodSecure: "Seguro",
|
|
11776
11777
|
fastDisclaimer: "Solo USDC Perps \xB7 M\xFAltiples cadenas \xB7 Instant\xE1neo",
|
|
11777
|
-
secureDisclaimer: "Todos los tokens \xB7 Solo cadena Ethereum \xB7
|
|
11778
|
+
secureDisclaimer: "Todos los tokens \xB7 Solo cadena Ethereum \xB7 {{delay}}",
|
|
11779
|
+
secureFallbackDelay: "60+ minutos"
|
|
11778
11780
|
},
|
|
11779
11781
|
directExecution: {
|
|
11780
11782
|
fillStatus: "Estado de completado",
|
|
@@ -12327,7 +12329,8 @@ var fr_default = {
|
|
|
12327
12329
|
methodFast: "Rapide",
|
|
12328
12330
|
methodSecure: "S\xE9curis\xE9",
|
|
12329
12331
|
fastDisclaimer: "USDC Perps uniquement \xB7 Plusieurs cha\xEEnes \xB7 Instantan\xE9",
|
|
12330
|
-
secureDisclaimer: "Tous les tokens \xB7 Cha\xEEne Ethereum uniquement \xB7
|
|
12332
|
+
secureDisclaimer: "Tous les tokens \xB7 Cha\xEEne Ethereum uniquement \xB7 {{delay}}",
|
|
12333
|
+
secureFallbackDelay: "60+ minutes"
|
|
12331
12334
|
},
|
|
12332
12335
|
directExecution: {
|
|
12333
12336
|
fillStatus: "Statut d'ex\xE9cution",
|
|
@@ -12879,8 +12882,9 @@ var ja_default = {
|
|
|
12879
12882
|
sectionCrypto: "\u6697\u53F7\u8CC7\u7523",
|
|
12880
12883
|
methodFast: "\u9AD8\u901F",
|
|
12881
12884
|
methodSecure: "\u30BB\u30AD\u30E5\u30A2",
|
|
12882
|
-
fastDisclaimer: "USDC\
|
|
12883
|
-
secureDisclaimer: "\u5168\u30C8\u30FC\u30AF\u30F3 \xB7 \u30A4\u30FC\u30B5\u30EA\u30A2\u30E0\u30C1\u30A7\u30FC\u30F3\u306E\u307F \xB7
|
|
12885
|
+
fastDisclaimer: "USDC\u30D1\u30FC\u30D7\u30B9\u306E\u307F \xB7 \u8907\u6570\u30C1\u30A7\u30FC\u30F3 \xB7 \u5373\u6642",
|
|
12886
|
+
secureDisclaimer: "\u5168\u30C8\u30FC\u30AF\u30F3 \xB7 \u30A4\u30FC\u30B5\u30EA\u30A2\u30E0\u30C1\u30A7\u30FC\u30F3\u306E\u307F \xB7 {{delay}}",
|
|
12887
|
+
secureFallbackDelay: "60\u5206\u4EE5\u4E0A"
|
|
12884
12888
|
},
|
|
12885
12889
|
directExecution: {
|
|
12886
12890
|
fillStatus: "\u51E6\u7406\u72B6\u6CC1",
|
|
@@ -13432,8 +13436,9 @@ var ko_default = {
|
|
|
13432
13436
|
sectionCrypto: "\uC554\uD638\uD654\uD3D0",
|
|
13433
13437
|
methodFast: "\uBE60\uB978",
|
|
13434
13438
|
methodSecure: "\uBCF4\uC548",
|
|
13435
|
-
fastDisclaimer: "USDC \
|
|
13436
|
-
secureDisclaimer: "\uBAA8\uB4E0 \uD1A0\uD070 \xB7 \uC774\uB354\uB9AC\uC6C0 \uCCB4\uC778\uB9CC \xB7
|
|
13439
|
+
fastDisclaimer: "USDC \uD37C\uD504\uC2A4\uB9CC \xB7 \uB2E4\uC911 \uCCB4\uC778 \xB7 \uC989\uC2DC",
|
|
13440
|
+
secureDisclaimer: "\uBAA8\uB4E0 \uD1A0\uD070 \xB7 \uC774\uB354\uB9AC\uC6C0 \uCCB4\uC778\uB9CC \xB7 {{delay}}",
|
|
13441
|
+
secureFallbackDelay: "60\uBD84 \uC774\uC0C1"
|
|
13437
13442
|
},
|
|
13438
13443
|
directExecution: {
|
|
13439
13444
|
fillStatus: "\uCC98\uB9AC \uC0C1\uD0DC",
|
|
@@ -13986,7 +13991,8 @@ var ru_default = {
|
|
|
13986
13991
|
methodFast: "\u0411\u044B\u0441\u0442\u0440\u044B\u0439",
|
|
13987
13992
|
methodSecure: "\u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0439",
|
|
13988
13993
|
fastDisclaimer: "\u0422\u043E\u043B\u044C\u043A\u043E USDC \u0431\u0435\u0441\u0441\u0440\u043E\u0447\u043D\u044B\u0435 \xB7 \u041D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u0435\u0439 \xB7 \u041C\u0433\u043D\u043E\u0432\u0435\u043D\u043D\u043E",
|
|
13989
|
-
secureDisclaimer: "\u0412\u0441\u0435 \u0442\u043E\u043A\u0435\u043D\u044B \xB7 \u0422\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u044C Ethereum \xB7
|
|
13994
|
+
secureDisclaimer: "\u0412\u0441\u0435 \u0442\u043E\u043A\u0435\u043D\u044B \xB7 \u0422\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u044C Ethereum \xB7 {{delay}}",
|
|
13995
|
+
secureFallbackDelay: "60+ \u043C\u0438\u043D\u0443\u0442"
|
|
13990
13996
|
},
|
|
13991
13997
|
directExecution: {
|
|
13992
13998
|
fillStatus: "\u0421\u0442\u0430\u0442\u0443\u0441 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F",
|
|
@@ -14539,7 +14545,8 @@ var tr_default = {
|
|
|
14539
14545
|
methodFast: "H\u0131zl\u0131",
|
|
14540
14546
|
methodSecure: "G\xFCvenli",
|
|
14541
14547
|
fastDisclaimer: "Yaln\u0131zca USDC Perps \xB7 Birden fazla zincir \xB7 An\u0131nda",
|
|
14542
|
-
secureDisclaimer: "T\xFCm tokenlar \xB7 Yaln\u0131zca Ethereum zinciri \xB7
|
|
14548
|
+
secureDisclaimer: "T\xFCm tokenlar \xB7 Yaln\u0131zca Ethereum zinciri \xB7 {{delay}}",
|
|
14549
|
+
secureFallbackDelay: "60+ dakika"
|
|
14543
14550
|
},
|
|
14544
14551
|
directExecution: {
|
|
14545
14552
|
fillStatus: "\u0130\u015Flem durumu",
|
|
@@ -15092,7 +15099,8 @@ var zh_default = {
|
|
|
15092
15099
|
methodFast: "\u5FEB\u901F",
|
|
15093
15100
|
methodSecure: "\u5B89\u5168",
|
|
15094
15101
|
fastDisclaimer: "\u4EC5\u9650USDC\u6C38\u7EED \xB7 \u591A\u94FE \xB7 \u5373\u65F6",
|
|
15095
|
-
secureDisclaimer: "\u6240\u6709\u4EE3\u5E01 \xB7 \u4EC5\u4EE5\u592A\u574A\u94FE \xB7
|
|
15102
|
+
secureDisclaimer: "\u6240\u6709\u4EE3\u5E01 \xB7 \u4EC5\u4EE5\u592A\u574A\u94FE \xB7 {{delay}}",
|
|
15103
|
+
secureFallbackDelay: "60\u5206\u949F\u4EE5\u4E0A"
|
|
15096
15104
|
},
|
|
15097
15105
|
directExecution: {
|
|
15098
15106
|
fillStatus: "\u586B\u5145\u72B6\u6001",
|
|
@@ -18835,6 +18843,7 @@ import { mainnet as mainnet7 } from "viem/chains";
|
|
|
18835
18843
|
import { SOLANA_MAINNET_CHAIN_ID } from "@funkit/chains";
|
|
18836
18844
|
import { RELAY_LIGHTER_CHAIN_ID as RELAY_LIGHTER_CHAIN_ID2 } from "@funkit/fun-relay";
|
|
18837
18845
|
import { retry } from "@lifeomic/attempt";
|
|
18846
|
+
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
18838
18847
|
import i18next from "i18next";
|
|
18839
18848
|
import React67, { useEffect as useEffect28, useMemo as useMemo23 } from "react";
|
|
18840
18849
|
import { arbitrum as arbitrum6, base as base7, bsc as bsc2, mainnet as mainnet5, optimism as optimism2 } from "viem/chains";
|
|
@@ -18862,6 +18871,18 @@ var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React66.createElement(
|
|
|
18862
18871
|
)
|
|
18863
18872
|
);
|
|
18864
18873
|
|
|
18874
|
+
// src/utils/timeFormat.ts
|
|
18875
|
+
import { formatSecondsToReadableForm } from "@funkit/utils";
|
|
18876
|
+
function formatSecondsTranslated(seconds, t, specifyUnderMinute = false, omitSeconds = false) {
|
|
18877
|
+
return formatSecondsToReadableForm(seconds, specifyUnderMinute, omitSeconds, {
|
|
18878
|
+
lessThanOneMin: t("time.lessThanOneMin"),
|
|
18879
|
+
seconds: (count) => t("time.seconds", { count }),
|
|
18880
|
+
minutes: (count) => t("time.minutes", { count }),
|
|
18881
|
+
hours: (count) => t("time.hours", { count }),
|
|
18882
|
+
secondsShort: (count) => t("time.secondsShort", { count })
|
|
18883
|
+
});
|
|
18884
|
+
}
|
|
18885
|
+
|
|
18865
18886
|
// src/clients/lighter.tsx
|
|
18866
18887
|
function freeBalance(balance, lockedBalance) {
|
|
18867
18888
|
return String(Math.max(0, Number(balance) - Number(lockedBalance)));
|
|
@@ -20402,7 +20423,10 @@ function LighterSecureReceiveAmountValue({
|
|
|
20402
20423
|
size: "withdrawalYouWillReceive",
|
|
20403
20424
|
weight: "withdrawalYouWillReceiveValueCrypto"
|
|
20404
20425
|
},
|
|
20405
|
-
amount ? formatCryptoAndStringify2(Number(amount), tokenSymbol
|
|
20426
|
+
amount ? formatCryptoAndStringify2(Number(amount), tokenSymbol, true, {
|
|
20427
|
+
minBeforeUseScientific: 0,
|
|
20428
|
+
numberFormatOptions: { maximumFractionDigits: 8 }
|
|
20429
|
+
}) : NO_DATA_VALUE
|
|
20406
20430
|
);
|
|
20407
20431
|
}
|
|
20408
20432
|
var LIGHTER_EXPLORER_BASE = "https://app.lighter.xyz/explorer/logs";
|
|
@@ -20507,14 +20531,14 @@ import React107, { useCallback as useCallback23, useEffect as useEffect34, useMe
|
|
|
20507
20531
|
import {
|
|
20508
20532
|
getDirectExecutionsByUserId as getDirectExecutionsByUserId2
|
|
20509
20533
|
} from "@funkit/api-base";
|
|
20510
|
-
import { useQuery as
|
|
20534
|
+
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
20511
20535
|
import { useMemo as useMemo25 } from "react";
|
|
20512
20536
|
|
|
20513
20537
|
// src/hooks/queries/useRecentCheckouts.ts
|
|
20514
20538
|
import {
|
|
20515
20539
|
getCheckoutsByUserId as getCheckoutsByUserId2
|
|
20516
20540
|
} from "@funkit/api-base";
|
|
20517
|
-
import { useQuery as
|
|
20541
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
20518
20542
|
var hasCorrectPaymentMethod = (checkout, paymentMethod) => !paymentMethod || checkout.clientMetadata.selectedPaymentMethodInfo?.paymentMethod === paymentMethod;
|
|
20519
20543
|
var isRecent = (checkout, timestampCutoff) => checkout.createdTimeMs > timestampCutoff;
|
|
20520
20544
|
var DEFAULT_NOTIF_CUTOFF = 7 * 24 * 60 * 60 * 1e3;
|
|
@@ -20527,7 +20551,7 @@ var useRecentCheckouts = ({
|
|
|
20527
20551
|
const { listRefresh } = useDynamicConfig(
|
|
20528
20552
|
"checkoutnotificationsrefreshinterval"
|
|
20529
20553
|
);
|
|
20530
|
-
const query =
|
|
20554
|
+
const query = useQuery14({
|
|
20531
20555
|
queryKey: ["checkouts", userInfo.id],
|
|
20532
20556
|
queryFn: async () => {
|
|
20533
20557
|
const checkouts = await getCheckoutsByUserId2({
|
|
@@ -20594,7 +20618,7 @@ function useRecentDepositsImpl({
|
|
|
20594
20618
|
apiKey
|
|
20595
20619
|
}) {
|
|
20596
20620
|
const isFasterNotificationsEnabled = useFeatureGate("faster-notifications");
|
|
20597
|
-
const { data: directExecutions } =
|
|
20621
|
+
const { data: directExecutions } = useQuery15({
|
|
20598
20622
|
queryKey: [
|
|
20599
20623
|
"useRecentDepositsImpl",
|
|
20600
20624
|
userId,
|
|
@@ -20712,20 +20736,6 @@ import React89, { useEffect as useEffect32 } from "react";
|
|
|
20712
20736
|
|
|
20713
20737
|
// src/hooks/useCheckoutTimeEstimate.ts
|
|
20714
20738
|
import { mainnet as mainnet8 } from "viem/chains";
|
|
20715
|
-
|
|
20716
|
-
// src/utils/timeFormat.ts
|
|
20717
|
-
import { formatSecondsToReadableForm } from "@funkit/utils";
|
|
20718
|
-
function formatSecondsTranslated(seconds, t, specifyUnderMinute = false, omitSeconds = false) {
|
|
20719
|
-
return formatSecondsToReadableForm(seconds, specifyUnderMinute, omitSeconds, {
|
|
20720
|
-
lessThanOneMin: t("time.lessThanOneMin"),
|
|
20721
|
-
seconds: (count) => t("time.seconds", { count }),
|
|
20722
|
-
minutes: (count) => t("time.minutes", { count }),
|
|
20723
|
-
hours: (count) => t("time.hours", { count }),
|
|
20724
|
-
secondsShort: (count) => t("time.secondsShort", { count })
|
|
20725
|
-
});
|
|
20726
|
-
}
|
|
20727
|
-
|
|
20728
|
-
// src/hooks/useCheckoutTimeEstimate.ts
|
|
20729
20739
|
var LAYERZEO_OFT_TIME_ESTIMATE_SECONDS = 180;
|
|
20730
20740
|
function useCheckoutTimeEstimate(latestQuote, originalTimeEstimationMs, paymentMethod, bypassFlag) {
|
|
20731
20741
|
const { t } = useFunkitTranslation();
|
|
@@ -20785,10 +20795,10 @@ import { polygon as polygon6 } from "viem/chains";
|
|
|
20785
20795
|
import {
|
|
20786
20796
|
getSupportedAssets
|
|
20787
20797
|
} from "@funkit/api-base";
|
|
20788
|
-
import { useQuery as
|
|
20798
|
+
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
20789
20799
|
function useSupportedAssets(options) {
|
|
20790
20800
|
const { apiKey } = useFunkitConfig();
|
|
20791
|
-
return
|
|
20801
|
+
return useQuery16({
|
|
20792
20802
|
queryKey: ["getSupportedAssets", apiKey],
|
|
20793
20803
|
queryFn: () => getSupportedAssets({ apiKey, logger }),
|
|
20794
20804
|
refetchOnMount: false,
|
|
@@ -25006,7 +25016,7 @@ function FunNotification({
|
|
|
25006
25016
|
|
|
25007
25017
|
// src/hooks/queries/useWithdrawalQuote.ts
|
|
25008
25018
|
import { isTokenEquivalent as isTokenEquivalent2 } from "@funkit/utils";
|
|
25009
|
-
import { useQuery as
|
|
25019
|
+
import { useQuery as useQuery17 } from "@tanstack/react-query";
|
|
25010
25020
|
|
|
25011
25021
|
// src/hooks/useIsBlacklistedWithdrawalAddress.ts
|
|
25012
25022
|
import { isTokenAddressEquivalent as isTokenAddressEquivalent2 } from "@funkit/utils";
|
|
@@ -25055,7 +25065,7 @@ function useWithdrawalQuote({
|
|
|
25055
25065
|
secondTokenAddress: selectedTokenAddress
|
|
25056
25066
|
});
|
|
25057
25067
|
const { logEvent } = useTrack();
|
|
25058
|
-
const query =
|
|
25068
|
+
const query = useQuery17({
|
|
25059
25069
|
queryKey: [
|
|
25060
25070
|
"withdrawal",
|
|
25061
25071
|
"quote",
|
|
@@ -25117,12 +25127,12 @@ function useWithdrawalQuote({
|
|
|
25117
25127
|
}
|
|
25118
25128
|
|
|
25119
25129
|
// src/hooks/queries/useWithdrawalRisk.ts
|
|
25120
|
-
import { useQuery as
|
|
25130
|
+
import { useQuery as useQuery18 } from "@tanstack/react-query";
|
|
25121
25131
|
import { useEffect as useEffect37, useRef as useRef17 } from "react";
|
|
25122
25132
|
import { isAddress as isAddress2 } from "viem";
|
|
25123
25133
|
var useWithdrawalRisk = (apiKey, receiveAddress) => {
|
|
25124
25134
|
const lastRiskyAddressRef = useRef17(null);
|
|
25125
|
-
const query =
|
|
25135
|
+
const query = useQuery18({
|
|
25126
25136
|
queryKey: ["withdrawal", "addressRisk", apiKey, receiveAddress],
|
|
25127
25137
|
queryFn: async () => {
|
|
25128
25138
|
try {
|
|
@@ -25161,17 +25171,17 @@ import {
|
|
|
25161
25171
|
convertFunToRelayTokenAddress,
|
|
25162
25172
|
getRelayAssetPriceInfo
|
|
25163
25173
|
} from "@funkit/fun-relay";
|
|
25164
|
-
import { skipToken, useQuery as
|
|
25174
|
+
import { skipToken, useQuery as useQuery20 } from "@tanstack/react-query";
|
|
25165
25175
|
|
|
25166
25176
|
// src/hooks/queries/useErc20Asset.ts
|
|
25167
25177
|
import { getAssetErc20ByChainAndSymbol } from "@funkit/api-base";
|
|
25168
|
-
import { useQuery as
|
|
25178
|
+
import { useQuery as useQuery19 } from "@tanstack/react-query";
|
|
25169
25179
|
var useErc20Asset = ({
|
|
25170
25180
|
chainId,
|
|
25171
25181
|
symbol
|
|
25172
25182
|
}) => {
|
|
25173
25183
|
const { apiKey } = useFunkitConfig();
|
|
25174
|
-
const query =
|
|
25184
|
+
const query = useQuery19({
|
|
25175
25185
|
queryKey: ["erc20Asset", chainId, symbol],
|
|
25176
25186
|
queryFn: async () => {
|
|
25177
25187
|
if (!apiKey || !chainId || !symbol) {
|
|
@@ -25225,7 +25235,7 @@ function useAssetAddressPrice({
|
|
|
25225
25235
|
}) {
|
|
25226
25236
|
const { apiKey } = useFunkitConfig();
|
|
25227
25237
|
const isStablecoin = useIsStablecoin();
|
|
25228
|
-
const { data, error, isLoading } =
|
|
25238
|
+
const { data, error, isLoading } = useQuery20({
|
|
25229
25239
|
queryKey: ["getAssetPriceInfo", chainId, assetTokenAddress],
|
|
25230
25240
|
queryFn: chainId && assetTokenAddress ? async () => {
|
|
25231
25241
|
try {
|
|
@@ -25541,6 +25551,28 @@ var useTokenAndChainDropdown = ({
|
|
|
25541
25551
|
};
|
|
25542
25552
|
};
|
|
25543
25553
|
|
|
25554
|
+
// src/utils/polymarket.ts
|
|
25555
|
+
import {
|
|
25556
|
+
encodeAbiParameters,
|
|
25557
|
+
getAddress as getAddress3,
|
|
25558
|
+
getCreate2Address,
|
|
25559
|
+
keccak256,
|
|
25560
|
+
parseAbiParameters
|
|
25561
|
+
} from "viem";
|
|
25562
|
+
var EOA_PROXY_WALLET_FACTORY_ADDRESS = "0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b";
|
|
25563
|
+
var EOA_PROXY_WALLET_INIT_CODE_HASH = "0x2bce2127ff07fb632d16c8347c4ebf501f4841168bed00d9e6ef715ddb6fcecf";
|
|
25564
|
+
function derivePolymarketProxyAddress(address) {
|
|
25565
|
+
return getAddress3(
|
|
25566
|
+
getCreate2Address({
|
|
25567
|
+
from: EOA_PROXY_WALLET_FACTORY_ADDRESS,
|
|
25568
|
+
salt: keccak256(
|
|
25569
|
+
encodeAbiParameters(parseAbiParameters("address"), [address])
|
|
25570
|
+
),
|
|
25571
|
+
bytecodeHash: EOA_PROXY_WALLET_INIT_CODE_HASH
|
|
25572
|
+
})
|
|
25573
|
+
);
|
|
25574
|
+
}
|
|
25575
|
+
|
|
25544
25576
|
// src/modals/WithdrawalModal/WithdrawAmountInput.tsx
|
|
25545
25577
|
import { RELAY_LIGHTER_CHAIN_ID as RELAY_LIGHTER_CHAIN_ID4 } from "@funkit/fun-relay";
|
|
25546
25578
|
import {
|
|
@@ -25620,7 +25652,8 @@ function WithdrawAmountInput({
|
|
|
25620
25652
|
)
|
|
25621
25653
|
}
|
|
25622
25654
|
), /* @__PURE__ */ React123.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React123.createElement(Text, { size: "12", color: "secondaryText" }, sourceTokenUsdPrice === void 0 ? "-" : formatCurrencyAndStringify5(
|
|
25623
|
-
Number(withdrawalUSD) * sourceTokenUsdPrice
|
|
25655
|
+
Number(withdrawalUSD) * sourceTokenUsdPrice,
|
|
25656
|
+
{ minBeforeUseScientific: 0 }
|
|
25624
25657
|
)), Number(sourceTokenBalance) > 0 && /* @__PURE__ */ React123.createElement(Text, { size: "12", color: "secondaryText" }, t("withdrawal.balance", {
|
|
25625
25658
|
amount: formatCryptoAndStringify3(Number(sourceTokenBalance)),
|
|
25626
25659
|
symbol: activeSymbol
|
|
@@ -26586,6 +26619,7 @@ var WithdrawContent = ({
|
|
|
26586
26619
|
const [recipientAddress, setRecipientAddress] = useState38("");
|
|
26587
26620
|
const [withdrawalUSD, setWithdrawalUSD] = useState38("");
|
|
26588
26621
|
const { isLighterSecure, connectedAddress, lighterBalances, lighterAssets } = useLighterWithdrawal(config, setRecipientAddress);
|
|
26622
|
+
const { address: connectedWalletAddress } = useAccount();
|
|
26589
26623
|
const sourceTokenBalance = lighterBalances[selectedSourceToken.toUpperCase()] ?? fallbackBalance;
|
|
26590
26624
|
const { price: sourceTokenUsdPrice } = useAssetSymbolPrice({
|
|
26591
26625
|
chainId: "1",
|
|
@@ -26757,6 +26791,8 @@ var WithdrawContent = ({
|
|
|
26757
26791
|
recipientAddress
|
|
26758
26792
|
);
|
|
26759
26793
|
const isRecipientBlacklisted = useIsBlacklistedWithdrawalAddress(recipientAddress);
|
|
26794
|
+
const polymarketSourceAddress = isPolymarketCustomer(apiKey) && connectedWalletAddress ? derivePolymarketProxyAddress(connectedWalletAddress) : void 0;
|
|
26795
|
+
const isWithdrawingToSourceAddress = !!polymarketSourceAddress && recipientAddress.toLowerCase() === polymarketSourceAddress.toLowerCase();
|
|
26760
26796
|
const lastTargetAssetErrorRef = useRef19(null);
|
|
26761
26797
|
const lastQuoteErrorRef = useRef19(null);
|
|
26762
26798
|
const lastRiskyRecipientRef = useRef19(null);
|
|
@@ -26833,7 +26869,8 @@ var WithdrawContent = ({
|
|
|
26833
26869
|
lastBlacklistedRecipientRef.current = warningKey;
|
|
26834
26870
|
}, [isRecipientBlacklisted, recipientAddress, selectedChainId, selectedToken]);
|
|
26835
26871
|
const bottomSectionRef = useBottomSectionRef("withdrawal");
|
|
26836
|
-
const
|
|
26872
|
+
const isRecipientInputValid = isValidAddress && !isWithdrawingToSourceAddress;
|
|
26873
|
+
const hasAddressError = !isRecipientInputValid && recipientAddress !== "";
|
|
26837
26874
|
const hasAmountError = withdrawalUSD !== "" && !isWithdrawAmountValid;
|
|
26838
26875
|
function computeCanContinue() {
|
|
26839
26876
|
const baseChecks = !!recipientAddress && !!withdrawalUSD && !hasAmountError && !hasAddressError && !isCheckingAddressRisk && !isRisky && !isRecipientBlacklisted;
|
|
@@ -26861,7 +26898,7 @@ var WithdrawContent = ({
|
|
|
26861
26898
|
return /* @__PURE__ */ React125.createElement(
|
|
26862
26899
|
WithdrawRecipientAddress,
|
|
26863
26900
|
{
|
|
26864
|
-
isValidAddress,
|
|
26901
|
+
isValidAddress: isRecipientInputValid,
|
|
26865
26902
|
recipientAddress,
|
|
26866
26903
|
config,
|
|
26867
26904
|
setRecipientAddress,
|
|
@@ -27156,7 +27193,7 @@ import {
|
|
|
27156
27193
|
RailConfigType,
|
|
27157
27194
|
getFops as getFops2
|
|
27158
27195
|
} from "@funkit/api-base";
|
|
27159
|
-
import { useQuery as
|
|
27196
|
+
import { useQuery as useQuery21 } from "@tanstack/react-query";
|
|
27160
27197
|
import { useMemo as useMemo36 } from "react";
|
|
27161
27198
|
var ENABLE_MOCK_SWAPPED_WITHDRAWAL = true;
|
|
27162
27199
|
var MOCK_SELL_URL = "https://widget.swapped.com/sell?apiKey=pk_live_eb64dc98ae0903092bc2be6e63237542&externalCustomerId=eyJjdXN0b21lcklkIjoic3U0Z25veHoxNCIsImRlcG9zaXRBZGRyZXNzIjoiMHg3NDJkMzVDYzY2MzRDMDUzMjkyNWEzYjg0NEJjOWU3NTk1ZjBiRWIxIiwicGF5bWVudFByb3ZpZGVySWQiOiJTV0FQUEVEIiwidXNlcklkIjoidXNlci0xMjMifQ%3D%3D&method=bank-transfer&baseCountry=US&userSendsFunds=false&cryptoCurrencyCode=USDC_POLYGON&cryptoCurrencyAmount=10&fiatCurrencyCode=USD&signature=%2FqliUixrZQx2NYgtf6fPfb6JZBe8wHsuuZTe9QIS9L0%3D";
|
|
@@ -27202,7 +27239,7 @@ var useWithdrawFops = (params) => {
|
|
|
27202
27239
|
const userId = userInfo.id;
|
|
27203
27240
|
const countryCode = userIpInfo?.alpha2;
|
|
27204
27241
|
const isEnabled = !ENABLE_MOCK_SWAPPED_WITHDRAWAL && !!apiKey && !!userId && !!userInfo.address && !!countryCode && !!params.sourceChainId && !!params.sourceTokenAddress && !isSwappedCurrencyCodeLoading;
|
|
27205
|
-
const query =
|
|
27242
|
+
const query = useQuery21({
|
|
27206
27243
|
queryKey: [
|
|
27207
27244
|
"withdrawFops",
|
|
27208
27245
|
userId,
|
|
@@ -33153,7 +33190,7 @@ import React204, { useEffect as useEffect52 } from "react";
|
|
|
33153
33190
|
|
|
33154
33191
|
// src/hooks/queries/useMeldCurrencies.ts
|
|
33155
33192
|
import { getMeldSupportedFiat } from "@funkit/api-base";
|
|
33156
|
-
import { useQuery as
|
|
33193
|
+
import { useQuery as useQuery22 } from "@tanstack/react-query";
|
|
33157
33194
|
var getPriority = (currencyCode) => {
|
|
33158
33195
|
if (currencyCode === "USD") {
|
|
33159
33196
|
return 0;
|
|
@@ -33165,7 +33202,7 @@ var getPriority = (currencyCode) => {
|
|
|
33165
33202
|
};
|
|
33166
33203
|
var useMeldCurrencies = (isEnabled = true) => {
|
|
33167
33204
|
const { apiKey } = useFunkitConfig();
|
|
33168
|
-
const query =
|
|
33205
|
+
const query = useQuery22({
|
|
33169
33206
|
queryKey: ["meld", "currencies"],
|
|
33170
33207
|
queryFn: async () => {
|
|
33171
33208
|
if (!apiKey) {
|
|
@@ -33191,12 +33228,12 @@ var useMeldCurrencies = (isEnabled = true) => {
|
|
|
33191
33228
|
|
|
33192
33229
|
// src/hooks/queries/useMeldDefaultCurrency.ts
|
|
33193
33230
|
import { getMeldDefaultFiat } from "@funkit/api-base";
|
|
33194
|
-
import { useQuery as
|
|
33231
|
+
import { useQuery as useQuery23 } from "@tanstack/react-query";
|
|
33195
33232
|
var useMeldDefaultCurrency = (paymentMethod) => {
|
|
33196
33233
|
const { apiKey } = useFunkitConfig();
|
|
33197
33234
|
const { userIpInfo } = useFunkitUserIp();
|
|
33198
33235
|
const enableMeld = useIsMeldEnabled();
|
|
33199
|
-
const query =
|
|
33236
|
+
const query = useQuery23({
|
|
33200
33237
|
queryKey: ["meld", "defaultCurrency", paymentMethod],
|
|
33201
33238
|
queryFn: async () => {
|
|
33202
33239
|
if (!apiKey) {
|
|
@@ -33222,7 +33259,7 @@ var useMeldDefaultCurrency = (paymentMethod) => {
|
|
|
33222
33259
|
// src/hooks/queries/useMeldLimits.ts
|
|
33223
33260
|
import { getMeldFiatLimits } from "@funkit/api-base";
|
|
33224
33261
|
import { formatCurrencyAndStringify as formatCurrencyAndStringify8 } from "@funkit/utils";
|
|
33225
|
-
import { useQuery as
|
|
33262
|
+
import { useQuery as useQuery24 } from "@tanstack/react-query";
|
|
33226
33263
|
|
|
33227
33264
|
// src/consts/meld.ts
|
|
33228
33265
|
var MELD_MIN_LIMIT_BUFFER = 5;
|
|
@@ -33268,7 +33305,7 @@ var useMeldLimits = (isEnabled = true) => {
|
|
|
33268
33305
|
const { userIpInfo } = useFunkitUserIp();
|
|
33269
33306
|
const cryptoCurrency = useMeldCryptoCurrencyCode();
|
|
33270
33307
|
const countryCode = userIpInfo?.alpha2;
|
|
33271
|
-
const query =
|
|
33308
|
+
const query = useQuery24({
|
|
33272
33309
|
queryKey: ["meld", "limits", countryCode, cryptoCurrency],
|
|
33273
33310
|
queryFn: async () => {
|
|
33274
33311
|
if (!apiKey || !countryCode) {
|
|
@@ -35733,7 +35770,7 @@ var useMeldLink = (sourceAmount, sourceCurrencyCode = "USD") => {
|
|
|
35733
35770
|
|
|
35734
35771
|
// src/modals/CheckoutModal/MeldQuotes/useMeldQuotes.tsx
|
|
35735
35772
|
import { getMeldQuotes } from "@funkit/api-base";
|
|
35736
|
-
import { useQuery as
|
|
35773
|
+
import { useQuery as useQuery25 } from "@tanstack/react-query";
|
|
35737
35774
|
import { useDebounce as useDebounce2 } from "use-debounce";
|
|
35738
35775
|
var DEBOUNCE_DELAY = 500;
|
|
35739
35776
|
var COUNTDOWN_INTERVAL_SEC = 60;
|
|
@@ -35746,7 +35783,7 @@ var useMeldQuotes = (sourceAmount, fiatCurrency, meldEnabled = true) => {
|
|
|
35746
35783
|
const destinationCurrencyCode = useMeldCryptoCurrencyCode();
|
|
35747
35784
|
const isPolymarket = isPolymarketCustomer(apiKey);
|
|
35748
35785
|
const sourceCurrencyCode = fiatCurrency || "USD";
|
|
35749
|
-
const query =
|
|
35786
|
+
const query = useQuery25({
|
|
35750
35787
|
queryKey: [
|
|
35751
35788
|
"meld",
|
|
35752
35789
|
"quotes",
|
|
@@ -44856,13 +44893,13 @@ var FunNotificationBanner = ({
|
|
|
44856
44893
|
import {
|
|
44857
44894
|
getCheckoutByDepositAddress as getCheckoutByDepositAddress2
|
|
44858
44895
|
} from "@funkit/api-base";
|
|
44859
|
-
import { useQuery as
|
|
44896
|
+
import { useQuery as useQuery26 } from "@tanstack/react-query";
|
|
44860
44897
|
var useCheckout = (depositAddress, initial) => {
|
|
44861
44898
|
const { apiKey } = useFunkitConfig();
|
|
44862
44899
|
const { itemRefresh } = useDynamicConfig(
|
|
44863
44900
|
"checkoutnotificationsrefreshinterval"
|
|
44864
44901
|
);
|
|
44865
|
-
const query =
|
|
44902
|
+
const query = useQuery26({
|
|
44866
44903
|
queryKey: ["checkouts", "checkout", depositAddress],
|
|
44867
44904
|
queryFn: () => getCheckoutByDepositAddress2({
|
|
44868
44905
|
// biome-ignore lint/style/noNonNullAssertion: already checked for null
|
|
@@ -47213,7 +47250,7 @@ var useWalletAssets = ({
|
|
|
47213
47250
|
} = {}) => {
|
|
47214
47251
|
const { address, isConnected } = useAccount();
|
|
47215
47252
|
const { apiKey } = useFunkitConfig();
|
|
47216
|
-
const { data, isLoading, isFetching } =
|
|
47253
|
+
const { data, isLoading, isFetching } = useQuery27({
|
|
47217
47254
|
queryKey: ["getWalletAssets", address, apiKey],
|
|
47218
47255
|
meta: stepQueryMeta({
|
|
47219
47256
|
name: "walletAssets",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SwappedFormOfPayment } from '@funkit/api-base';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { PaymentMethodType } from '../../../hooks/usePaymentSources';
|
|
4
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../../../modals/CheckoutModal/stepTransition';
|
|
5
|
+
export type SwappedIframeState = CheckoutModalCommonState & {
|
|
6
|
+
/** The selected payment option from the fops API */
|
|
7
|
+
selectedPaymentOption: SwappedFormOfPayment;
|
|
8
|
+
/** Payment method type filter to restore when returning to SOURCE_CHANGE */
|
|
9
|
+
paymentMethodTypeFilter?: PaymentMethodType;
|
|
10
|
+
/** Set to true when an error occurs (iframe error or load timeout) */
|
|
11
|
+
error?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type SwappedIframeNext = {
|
|
14
|
+
success?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const SwappedIframeInfo: ModalStepInfo<FunCheckoutStep.SWAPPED_IFRAME>;
|
|
17
|
+
export declare function SwappedIframeContainer({ modalState, onBack, onClose, setModalState, }: ModalStepComponentProps<FunCheckoutStep.SWAPPED_IFRAME>): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FunkitCheckoutQuoteResult } from '../../domains/quote';
|
|
3
|
+
interface WithdrawalCallbackSuccessProps {
|
|
4
|
+
bottomBarId: string;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onNewWithdrawal: () => void;
|
|
7
|
+
quote: FunkitCheckoutQuoteResult | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare const WithdrawalCallbackSuccess: ({ bottomBarId, onClose, onNewWithdrawal, quote, }: WithdrawalCallbackSuccessProps) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Hex } from 'viem';
|
|
3
|
+
import type { FunkitActiveWithdrawalItem, FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
4
|
+
import { type WithdrawalFormData } from './useWithdrawal';
|
|
5
|
+
interface WithdrawContentProps {
|
|
6
|
+
onContinue: (withdrawal: WithdrawalFormData, txHash: Hex) => void;
|
|
7
|
+
config: FunkitWithdrawalConfig;
|
|
8
|
+
withdrawalItem: FunkitActiveWithdrawalItem | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const WithdrawContent: ({ onContinue, config, withdrawalItem, }: WithdrawContentProps) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
3
|
+
export declare const WITHDRAWAL_MODAL_CONTENT_ID = "withdrawal-modal-content";
|
|
4
|
+
export interface WithdrawalModalProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
config: FunkitWithdrawalConfig;
|
|
8
|
+
}
|
|
9
|
+
export declare function WithdrawalModal({ onClose, open, config, }: WithdrawalModalProps): React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Address } from 'viem';
|
|
3
|
+
interface WithdrawSuccessProps {
|
|
4
|
+
depositAddress: Address;
|
|
5
|
+
amount: number;
|
|
6
|
+
token: string;
|
|
7
|
+
tokenIconSrc: string;
|
|
8
|
+
chainId: string;
|
|
9
|
+
txHash: string;
|
|
10
|
+
bottomBarId: string;
|
|
11
|
+
onNewWithdrawal: () => void;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const WithdrawSuccess: ({ depositAddress, bottomBarId, onNewWithdrawal, onClose, }: WithdrawSuccessProps) => React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { FunkitCheckoutQuoteResult } from '../../domains/quote';
|
|
3
|
+
import { type FunkitActiveWithdrawalItem, type FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
4
|
+
import { type CheckoutConfirmationError } from '../CheckoutModal/ConfirmationStep/useCheckoutConfirmation';
|
|
5
|
+
interface UseWithdrawalResult {
|
|
6
|
+
handleWithdrawal: (withdrawal: WithdrawalFormData) => Promise<void>;
|
|
7
|
+
isWithdrawing: boolean;
|
|
8
|
+
withdrawalError: CheckoutConfirmationError | null;
|
|
9
|
+
stepMessage: string | null;
|
|
10
|
+
}
|
|
11
|
+
export type WithdrawalFormData = {
|
|
12
|
+
destinationAddress: Address;
|
|
13
|
+
withdrawalUSD: string;
|
|
14
|
+
tokenSymbol: string;
|
|
15
|
+
tokenAddress: Address;
|
|
16
|
+
chainId: number;
|
|
17
|
+
quote: FunkitCheckoutQuoteResult;
|
|
18
|
+
};
|
|
19
|
+
export declare function useWithdrawal({ config, withdrawalItem, onSuccess, }: {
|
|
20
|
+
config: FunkitWithdrawalConfig;
|
|
21
|
+
withdrawalItem: FunkitActiveWithdrawalItem | null;
|
|
22
|
+
onSuccess: (withdrawal: WithdrawalFormData, txHash: Hex) => void;
|
|
23
|
+
}): UseWithdrawalResult;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opens an external flow (e.g. Meld, Swapped) in a centered popup.
|
|
3
|
+
*
|
|
4
|
+
* iOS and Safari block window.open() calls that don't happen synchronously
|
|
5
|
+
* inside a user-gesture handler. Because the URL often isn't known until after
|
|
6
|
+
* an async fetch, we open about:blank immediately (within the gesture), show a
|
|
7
|
+
* spinner, and then set popup.location.href once the URL resolves. This keeps
|
|
8
|
+
* us inside the trusted-event window while still supporting async URL fetching.
|
|
9
|
+
*
|
|
10
|
+
* Returns true if the popup was opened, false if it was blocked.
|
|
11
|
+
*/
|
|
12
|
+
export declare function openExternalFlowPopup(linkGetter: () => Promise<{
|
|
13
|
+
widgetUrl: string;
|
|
14
|
+
}>, options: {
|
|
15
|
+
dimensions: {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
loaderTheme: 'light' | 'dark';
|
|
20
|
+
loaderTitle: string;
|
|
21
|
+
}): Promise<boolean>;
|