@funkit/connect 9.20.0 → 9.21.1-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 +47 -0
- package/dist/__generated__/default_configs.d.ts +901 -0
- package/dist/__generated__/default_feature_gates.d.ts +20 -0
- package/dist/chunk-36KVHK22.js +252 -0
- package/dist/chunk-4YEAUICE.js +380 -0
- package/dist/chunk-67BKQQNG.js +252 -0
- package/dist/clients/chunk-25ICASD7.js +2371 -0
- package/dist/clients/{chunk-47AQXZQE.js → chunk-4HCOSF4M.js} +1 -1
- package/dist/clients/chunk-7GWX2ZS4.js +69 -0
- package/dist/clients/{chunk-CSONEKIF.js → chunk-7HNGV6JU.js} +1 -1
- package/dist/clients/chunk-EGMA6ATZ.js +2371 -0
- package/dist/clients/chunk-GGXTLJ7J.js +290 -0
- package/dist/clients/chunk-HRWCNZJA.js +230 -0
- package/dist/clients/chunk-JD3FIVZ7.js +69 -0
- package/dist/clients/chunk-JTGKAPID.js +2382 -0
- package/dist/clients/chunk-L7PABCF2.js +54 -0
- package/dist/clients/{chunk-JOM2J5WB.js → chunk-NCUPPJ2Z.js} +21 -10
- package/dist/clients/{chunk-UNCVGPTD.js → chunk-NUJ6ZM5F.js} +1 -1
- package/dist/clients/chunk-OJLDTEKB.js +54 -0
- package/dist/clients/chunk-SSSQQ32F.js +186 -0
- package/dist/clients/chunk-UVWNEQMD.js +186 -0
- package/dist/clients/chunk-YLZ7COFH.js +230 -0
- package/dist/clients/chunk-ZEFHAWRH.js +69 -0
- package/dist/clients/fanatics.css +2891 -2702
- package/dist/clients/fanatics.js +5 -5
- package/dist/clients/lighter.css +2891 -2702
- package/dist/clients/lighter.js +3 -3
- package/dist/clients/nado.d.ts +78 -0
- package/dist/clients/nado.js +107 -0
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +2909 -2717
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +4 -4
- package/dist/clients/polymarket/index.css +2909 -2717
- package/dist/clients/polymarket/index.js +4 -4
- package/dist/clients/polymarket.d.ts +161 -0
- package/dist/clients/polymarket.js +688 -0
- package/dist/components/Box/Box.d.ts +21 -21
- package/dist/components/FunButton/FunButton.css.d.ts +1 -0
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/css/sprinkles.css.d.ts +33 -21
- package/dist/hooks/useTokenTransferConfig.d.ts +7 -0
- package/dist/index.css +2909 -2717
- package/dist/index.js +227 -349
- package/dist/interfaces/logTransport.d.ts +51 -0
- package/dist/interfaces/swapped-transport.d.ts +78 -0
- package/dist/modals/CheckoutModal/SourceChange/EmptyFormOfPaymentsMessage.d.ts +4 -0
- package/dist/modals/CheckoutModal/SourceChange/useUpdateSourceAssetForCard.d.ts +4 -0
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedErrorMessage.d.ts +6 -0
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +7 -0
- package/dist/providers/FunkitThemeProvider.d.ts +18 -0
- package/dist/themes/baseTheme.d.ts +3 -1
- package/dist/themes/baseTheme.js +1 -1
- package/dist/themes/darkTheme.js +2 -2
- package/dist/themes/lightTheme.js +2 -2
- package/dist/utils/flags/resolver.d.ts +34 -0
- package/dist/utils/tokenTransfer/disabledList.d.ts +1 -14
- package/dist/utils/tokenTransfer/types.d.ts +5 -30
- package/dist/wallets/walletConnectors/chunk-2VP2F6EK.js +70 -0
- package/dist/wallets/walletConnectors/chunk-4T6ZSRJF.js +69 -0
- package/dist/wallets/walletConnectors/chunk-6BW3HLBG.js +96 -0
- package/dist/wallets/walletConnectors/chunk-CCQV2ZET.js +218 -0
- package/dist/wallets/walletConnectors/chunk-CPI4TD43.js +99 -0
- package/dist/wallets/walletConnectors/chunk-F5XEEVG6.js +98 -0
- package/dist/wallets/walletConnectors/chunk-HNRB7KJU.js +92 -0
- package/dist/wallets/walletConnectors/chunk-HTHAK6XB.js +93 -0
- package/dist/wallets/walletConnectors/chunk-MIQTHJ6X.js +66 -0
- package/dist/wallets/walletConnectors/chunk-RB3HR4R2.js +95 -0
- package/dist/wallets/walletConnectors/chunk-RVOY537T.js +100 -0
- package/dist/wallets/walletConnectors/chunk-STVVP43G.js +94 -0
- package/dist/wallets/walletConnectors/chunk-UK7C2JXW.js +87 -0
- package/dist/wallets/walletConnectors/chunk-VAPGUPHO.js +92 -0
- package/dist/wallets/walletConnectors/chunk-VTM6EECM.js +110 -0
- package/dist/wallets/walletConnectors/chunk-X6CGV36L.js +103 -0
- package/dist/wallets/walletConnectors/chunk-YEZM4CK4.js +96 -0
- package/dist/wallets/walletConnectors/chunk-ZNX4EMPB.js +106 -0
- package/dist/wallets/walletConnectors/index.js +54 -54
- package/package.json +3 -3
- package/dist/clients/chunk-JVTKIEOP.js +0 -69
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Box
|
|
4
|
+
} from "./chunk-7GWX2ZS4.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Text/Text.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
var Text = React.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
as = "div",
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
color = "primaryText",
|
|
14
|
+
display,
|
|
15
|
+
font = "body",
|
|
16
|
+
id,
|
|
17
|
+
size = "16",
|
|
18
|
+
style,
|
|
19
|
+
tabIndex,
|
|
20
|
+
title,
|
|
21
|
+
textAlign = "inherit",
|
|
22
|
+
textTransform = "none",
|
|
23
|
+
weight = "regular",
|
|
24
|
+
testId
|
|
25
|
+
}, ref) => {
|
|
26
|
+
return /* @__PURE__ */ React.createElement(
|
|
27
|
+
Box,
|
|
28
|
+
{
|
|
29
|
+
as,
|
|
30
|
+
className,
|
|
31
|
+
color: color === "inherit" ? void 0 : color,
|
|
32
|
+
display,
|
|
33
|
+
fontFamily: font,
|
|
34
|
+
fontSize: size,
|
|
35
|
+
fontWeight: weight,
|
|
36
|
+
id,
|
|
37
|
+
title,
|
|
38
|
+
ref,
|
|
39
|
+
style,
|
|
40
|
+
tabIndex,
|
|
41
|
+
textAlign,
|
|
42
|
+
textTransform,
|
|
43
|
+
testId,
|
|
44
|
+
background: { selection: "textSelection" }
|
|
45
|
+
},
|
|
46
|
+
children
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
Text.displayName = "Text";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
Text
|
|
54
|
+
};
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
} from "./chunk-4752IYY6.js";
|
|
6
6
|
import {
|
|
7
7
|
Text
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7HNGV6JU.js";
|
|
9
9
|
import {
|
|
10
10
|
Box,
|
|
11
11
|
themeVars,
|
|
12
12
|
useFunkitTranslation
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JD3FIVZ7.js";
|
|
14
14
|
import {
|
|
15
15
|
POLYGON_USDCE,
|
|
16
16
|
PUSD_TOKEN
|
|
@@ -278,6 +278,7 @@ var baseTheme = ({
|
|
|
278
278
|
customBorderWidths,
|
|
279
279
|
customBorderRadiuses = radiusScales[borderRadius],
|
|
280
280
|
customDimensions,
|
|
281
|
+
customOpacities,
|
|
281
282
|
customSpacings,
|
|
282
283
|
customTextTransforms,
|
|
283
284
|
overlayBlur = "small",
|
|
@@ -433,6 +434,10 @@ var baseTheme = ({
|
|
|
433
434
|
txSummaryBoxBorderWidth: "1px",
|
|
434
435
|
...customBorderWidths
|
|
435
436
|
},
|
|
437
|
+
opacities: {
|
|
438
|
+
buttonPrimaryDisabled: "1",
|
|
439
|
+
...customOpacities
|
|
440
|
+
},
|
|
436
441
|
spacing: {
|
|
437
442
|
confirmationStepMarginTop: "6px",
|
|
438
443
|
confirmationStepVerticalGap: "18px",
|
|
@@ -675,6 +680,7 @@ var darkTheme = ({
|
|
|
675
680
|
// option Boxes
|
|
676
681
|
optionBoxBackground: customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#000",
|
|
677
682
|
// keeps gradient in SourcePaymentMethodItem if optionBoxBackground differs from modal background
|
|
683
|
+
optionBoxBorderedBackground: customColors?.optionBoxBorderedBackground ?? customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#000",
|
|
678
684
|
optionBoxBackgroundUninteractive: customColors?.optionBoxBackgroundUninteractive ?? "transparent",
|
|
679
685
|
optionBoxBorderBase: customColors?.optionBoxBorderBase ?? customColors?.mediumStroke ?? "#333333",
|
|
680
686
|
optionBoxBorderHover: customColors?.optionBoxBorderHover ?? customColors?.mediumStroke ?? "#333333",
|
|
@@ -693,7 +699,9 @@ var darkTheme = ({
|
|
|
693
699
|
modalBackgroundCheckoutComplete: customColors?.modalBackgroundCheckoutComplete ?? customColors?.modalBackground ?? "#000",
|
|
694
700
|
counterRingColor: customColors?.counterRingColor ?? accentColor,
|
|
695
701
|
cryptoCashToggleContainerBorderColor: customColors?.cryptoCashToggleContainerBorderColor ?? "transparent",
|
|
696
|
-
cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent"
|
|
702
|
+
cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent",
|
|
703
|
+
qrCodeBackground: customColors?.qrCodeBackground ?? customColors?.modalBackground ?? "#000000",
|
|
704
|
+
qrCodeForeground: customColors?.qrCodeForeground ?? customColors?.primaryText ?? "#FFFFFF"
|
|
697
705
|
},
|
|
698
706
|
shadows: {
|
|
699
707
|
connectButton: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
@@ -916,6 +924,7 @@ var lightTheme = ({
|
|
|
916
924
|
// option Boxes
|
|
917
925
|
optionBoxBackground: customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#FFF",
|
|
918
926
|
// keeps gradient in SourcePaymentMethodItem if optionBoxBackground differs from modal background
|
|
927
|
+
optionBoxBorderedBackground: customColors?.optionBoxBorderedBackground ?? customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#FFF",
|
|
919
928
|
optionBoxBackgroundUninteractive: customColors?.optionBoxBackgroundUninteractive ?? "transparent",
|
|
920
929
|
optionBoxBorderBase: customColors?.optionBoxBorderBase ?? customColors?.mediumStroke ?? "#F0F0F0",
|
|
921
930
|
optionBoxBorderHover: customColors?.optionBoxBorderHover ?? customColors?.mediumStroke ?? "#F0F0F0",
|
|
@@ -934,7 +943,9 @@ var lightTheme = ({
|
|
|
934
943
|
modalBackgroundCheckoutComplete: customColors?.modalBackgroundCheckoutComplete ?? customColors?.modalBackground ?? "#FFF",
|
|
935
944
|
counterRingColor: customColors?.counterRingColor ?? accentColor,
|
|
936
945
|
cryptoCashToggleContainerBorderColor: customColors?.cryptoCashToggleContainerBorderColor ?? "transparent",
|
|
937
|
-
cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent"
|
|
946
|
+
cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent",
|
|
947
|
+
qrCodeBackground: customColors?.qrCodeBackground ?? customColors?.modalBackground ?? "#FFF",
|
|
948
|
+
qrCodeForeground: customColors?.qrCodeForeground ?? customColors?.primaryText ?? "#000"
|
|
938
949
|
},
|
|
939
950
|
shadows: {
|
|
940
951
|
connectButton: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
@@ -1039,12 +1050,12 @@ function FunSkeletonBlock({
|
|
|
1039
1050
|
// src/components/FunInput/FunInput.css.ts
|
|
1040
1051
|
var baseWrapperStyles = "zue0i60";
|
|
1041
1052
|
var baseWrapperStylesNoTransition = "zue0i61";
|
|
1042
|
-
var inputClass = "zue0i64
|
|
1043
|
-
var inputClassDisabled = "zue0i68
|
|
1044
|
-
var inputClassDisabledNoTransition = "zue0i6a
|
|
1045
|
-
var inputClassError = "zue0i6c
|
|
1046
|
-
var inputClassErrorNoTransition = "zue0i6f
|
|
1047
|
-
var inputClassNoTransition = "zue0i66
|
|
1053
|
+
var inputClass = "zue0i64 _1rsrm2f2qy _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
|
|
1054
|
+
var inputClassDisabled = "zue0i68 _1rsrm2f2ua _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
|
|
1055
|
+
var inputClassDisabledNoTransition = "zue0i6a _1rsrm2f2ua _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
|
|
1056
|
+
var inputClassError = "zue0i6c _1rsrm2f2qy _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
|
|
1057
|
+
var inputClassErrorNoTransition = "zue0i6f _1rsrm2f2qy _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
|
|
1058
|
+
var inputClassNoTransition = "zue0i66 _1rsrm2f2qy _1rsrm2fri _1rsrm2ftj _1rsrm2fvl _1rsrm2fpi";
|
|
1048
1059
|
var numberInputResetStyle = "zue0i62";
|
|
1049
1060
|
|
|
1050
1061
|
// src/components/FunInput/FunInput.tsx
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Box
|
|
4
|
+
} from "./chunk-ZEFHAWRH.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Text/Text.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
var Text = React.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
as = "div",
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
color = "primaryText",
|
|
14
|
+
display,
|
|
15
|
+
font = "body",
|
|
16
|
+
id,
|
|
17
|
+
size = "16",
|
|
18
|
+
style,
|
|
19
|
+
tabIndex,
|
|
20
|
+
title,
|
|
21
|
+
textAlign = "inherit",
|
|
22
|
+
textTransform = "none",
|
|
23
|
+
weight = "regular",
|
|
24
|
+
testId
|
|
25
|
+
}, ref) => {
|
|
26
|
+
return /* @__PURE__ */ React.createElement(
|
|
27
|
+
Box,
|
|
28
|
+
{
|
|
29
|
+
as,
|
|
30
|
+
className,
|
|
31
|
+
color: color === "inherit" ? void 0 : color,
|
|
32
|
+
display,
|
|
33
|
+
fontFamily: font,
|
|
34
|
+
fontSize: size,
|
|
35
|
+
fontWeight: weight,
|
|
36
|
+
id,
|
|
37
|
+
title,
|
|
38
|
+
ref,
|
|
39
|
+
style,
|
|
40
|
+
tabIndex,
|
|
41
|
+
textAlign,
|
|
42
|
+
textTransform,
|
|
43
|
+
testId,
|
|
44
|
+
background: { selection: "textSelection" }
|
|
45
|
+
},
|
|
46
|
+
children
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
Text.displayName = "Text";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
Text
|
|
54
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useFunkitTranslation
|
|
4
|
+
} from "./chunk-ZEFHAWRH.js";
|
|
5
|
+
|
|
6
|
+
// src/providers/FunkitConfigContext.tsx
|
|
7
|
+
import {
|
|
8
|
+
createContext,
|
|
9
|
+
useContext,
|
|
10
|
+
useMemo
|
|
11
|
+
} from "react";
|
|
12
|
+
var DEFAULT_TEXT_CUSTOMIZATIONS = {
|
|
13
|
+
virtualFiat: "Deposit with SEPA",
|
|
14
|
+
brokerageOrExchange: "Connect Exchange",
|
|
15
|
+
debitOrCredit: "Deposit with Card",
|
|
16
|
+
accountBalance: "Wallet",
|
|
17
|
+
selectAccount: "Select an exchange",
|
|
18
|
+
perpsTransferTitle: "Transfer",
|
|
19
|
+
sourceMethodTitle: "Your source",
|
|
20
|
+
tokensListTitle: "Your tokens",
|
|
21
|
+
transferTokens: "Transfer Crypto",
|
|
22
|
+
bitcoinLightning: "Bitcoin on Cash App",
|
|
23
|
+
receiveDropdownTitle: "",
|
|
24
|
+
// Default to empty
|
|
25
|
+
receiveDropdownLabel: "Asset to Receive",
|
|
26
|
+
confirmationScreen: {
|
|
27
|
+
payAmountLabel: "You send",
|
|
28
|
+
receiveAmountLabel: "You receive"
|
|
29
|
+
},
|
|
30
|
+
paymentMethodSubtitles: {}
|
|
31
|
+
};
|
|
32
|
+
var DEFAULT_UI_CUSTOMIZATIONS = {
|
|
33
|
+
alignTitle: "center",
|
|
34
|
+
alwaysShowTopDivider: false,
|
|
35
|
+
showModalTitle: true,
|
|
36
|
+
callToActionsUppercase: false,
|
|
37
|
+
enableCompactList: false,
|
|
38
|
+
checkoutHistory: {
|
|
39
|
+
showGetHelpAsAlert: true,
|
|
40
|
+
simplifiedUi: false
|
|
41
|
+
},
|
|
42
|
+
confirmationScreen: {
|
|
43
|
+
preferDestinationWhenSame: false,
|
|
44
|
+
showAmountSummaryAbovePaymentMethod: false,
|
|
45
|
+
showDisclaimerAsAlert: true,
|
|
46
|
+
showInstantTimeEstimate: false,
|
|
47
|
+
showLeftAlignedDollarValueWithLabel: false,
|
|
48
|
+
showPaymentAmountUsd: false,
|
|
49
|
+
showReceiveAmountUsd: false,
|
|
50
|
+
showSelectedRoute: false,
|
|
51
|
+
stepIndicatorType: "spinner",
|
|
52
|
+
showTokenAmount: true,
|
|
53
|
+
showTransactionDigest: "none"
|
|
54
|
+
},
|
|
55
|
+
sourceChangeScreen: {
|
|
56
|
+
bottomBarCloseButton: {
|
|
57
|
+
enabled: false,
|
|
58
|
+
labelKey: "common.close"
|
|
59
|
+
},
|
|
60
|
+
showTargetAssetSelection: false,
|
|
61
|
+
showWalletOnInsufficientBalance: false,
|
|
62
|
+
showWalletConnect: true,
|
|
63
|
+
showCustomTopComponentDivider: false,
|
|
64
|
+
paymentMethodIcons: {}
|
|
65
|
+
},
|
|
66
|
+
inputAmountScreen: {
|
|
67
|
+
allowTokenAmountInput: true
|
|
68
|
+
},
|
|
69
|
+
selectAssetScreen: {
|
|
70
|
+
isSecondaryTokenSymbolVisible: true,
|
|
71
|
+
navigateOnAssetClick: false
|
|
72
|
+
},
|
|
73
|
+
transferCryptoScreen: {
|
|
74
|
+
showYouSendYouReceive: false
|
|
75
|
+
},
|
|
76
|
+
withdrawalScreen: {},
|
|
77
|
+
selectBrokerageScreen: {},
|
|
78
|
+
connectExchangeScreen: {},
|
|
79
|
+
customIcons: {},
|
|
80
|
+
customFontFamily: {
|
|
81
|
+
primary: "",
|
|
82
|
+
secondary: "",
|
|
83
|
+
tertiary: ""
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var DEFAULT_FUNKIT_CONFIG = {
|
|
87
|
+
apiKey: "",
|
|
88
|
+
appName: "",
|
|
89
|
+
textCustomizations: DEFAULT_TEXT_CUSTOMIZATIONS,
|
|
90
|
+
uiCustomizations: DEFAULT_UI_CUSTOMIZATIONS
|
|
91
|
+
};
|
|
92
|
+
var FunkitConfigContext = createContext(
|
|
93
|
+
DEFAULT_FUNKIT_CONFIG
|
|
94
|
+
);
|
|
95
|
+
function useFunkitConfig() {
|
|
96
|
+
const originalFunkitConfig = useContext(FunkitConfigContext);
|
|
97
|
+
const { t } = useFunkitTranslation();
|
|
98
|
+
const translatedDefaults = useMemo(() => {
|
|
99
|
+
return {
|
|
100
|
+
virtualFiat: t("textCustomizations.virtualFiat"),
|
|
101
|
+
brokerageOrExchange: t("textCustomizations.brokerageOrExchange"),
|
|
102
|
+
debitOrCredit: t("textCustomizations.debitOrCredit"),
|
|
103
|
+
accountBalance: t("textCustomizations.accountBalance"),
|
|
104
|
+
selectAccount: t("textCustomizations.selectAccount"),
|
|
105
|
+
perpsTransferTitle: t("perpsTransfer.title"),
|
|
106
|
+
sourceMethodTitle: t("textCustomizations.sourceMethodTitle"),
|
|
107
|
+
tokensListTitle: t("textCustomizations.tokensListTitle"),
|
|
108
|
+
transferTokens: t("textCustomizations.transferTokens"),
|
|
109
|
+
bitcoinLightning: t("textCustomizations.bitcoinLightning"),
|
|
110
|
+
receiveDropdownTitle: t("textCustomizations.receiveDropdownTitle"),
|
|
111
|
+
receiveDropdownLabel: t("textCustomizations.receiveDropdownLabel"),
|
|
112
|
+
confirmationScreen: {
|
|
113
|
+
payAmountLabel: t("textCustomizations.payAmountLabel"),
|
|
114
|
+
receiveAmountLabel: t("textCustomizations.receiveAmountLabel")
|
|
115
|
+
},
|
|
116
|
+
paymentMethodSubtitles: {}
|
|
117
|
+
};
|
|
118
|
+
}, [t]);
|
|
119
|
+
const finalFunkitConfig = useMemo(() => {
|
|
120
|
+
return {
|
|
121
|
+
...DEFAULT_FUNKIT_CONFIG,
|
|
122
|
+
...originalFunkitConfig,
|
|
123
|
+
textCustomizations: {
|
|
124
|
+
...translatedDefaults,
|
|
125
|
+
...originalFunkitConfig.textCustomizations,
|
|
126
|
+
confirmationScreen: {
|
|
127
|
+
...translatedDefaults.confirmationScreen,
|
|
128
|
+
...originalFunkitConfig.textCustomizations?.confirmationScreen
|
|
129
|
+
},
|
|
130
|
+
paymentMethodSubtitles: {
|
|
131
|
+
...translatedDefaults.paymentMethodSubtitles,
|
|
132
|
+
...originalFunkitConfig.textCustomizations?.paymentMethodSubtitles
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
uiCustomizations: {
|
|
136
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations,
|
|
137
|
+
...originalFunkitConfig.uiCustomizations,
|
|
138
|
+
checkoutHistory: {
|
|
139
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.checkoutHistory,
|
|
140
|
+
...originalFunkitConfig.uiCustomizations?.checkoutHistory
|
|
141
|
+
},
|
|
142
|
+
confirmationScreen: {
|
|
143
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.confirmationScreen,
|
|
144
|
+
...originalFunkitConfig.uiCustomizations?.confirmationScreen
|
|
145
|
+
},
|
|
146
|
+
connectExchangeScreen: {
|
|
147
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.connectExchangeScreen,
|
|
148
|
+
...originalFunkitConfig.uiCustomizations?.connectExchangeScreen
|
|
149
|
+
},
|
|
150
|
+
inputAmountScreen: {
|
|
151
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.inputAmountScreen,
|
|
152
|
+
...originalFunkitConfig.uiCustomizations?.inputAmountScreen
|
|
153
|
+
},
|
|
154
|
+
selectAssetScreen: {
|
|
155
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.selectAssetScreen,
|
|
156
|
+
...originalFunkitConfig.uiCustomizations?.selectAssetScreen
|
|
157
|
+
},
|
|
158
|
+
selectBrokerageScreen: {
|
|
159
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.selectBrokerageScreen,
|
|
160
|
+
...originalFunkitConfig.uiCustomizations?.selectBrokerageScreen
|
|
161
|
+
},
|
|
162
|
+
sourceChangeScreen: {
|
|
163
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.sourceChangeScreen,
|
|
164
|
+
...originalFunkitConfig.uiCustomizations?.sourceChangeScreen,
|
|
165
|
+
bottomBarCloseButton: {
|
|
166
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.sourceChangeScreen.bottomBarCloseButton,
|
|
167
|
+
...originalFunkitConfig.uiCustomizations?.sourceChangeScreen?.bottomBarCloseButton
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
transferCryptoScreen: {
|
|
171
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.transferCryptoScreen,
|
|
172
|
+
...originalFunkitConfig.uiCustomizations?.transferCryptoScreen
|
|
173
|
+
},
|
|
174
|
+
withdrawalScreen: {
|
|
175
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.withdrawalScreen,
|
|
176
|
+
...originalFunkitConfig.uiCustomizations?.withdrawalScreen
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}, [originalFunkitConfig, translatedDefaults]);
|
|
181
|
+
return finalFunkitConfig;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export {
|
|
185
|
+
useFunkitConfig
|
|
186
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useFunkitTranslation
|
|
4
|
+
} from "./chunk-JD3FIVZ7.js";
|
|
5
|
+
|
|
6
|
+
// src/providers/FunkitConfigContext.tsx
|
|
7
|
+
import {
|
|
8
|
+
createContext,
|
|
9
|
+
useContext,
|
|
10
|
+
useMemo
|
|
11
|
+
} from "react";
|
|
12
|
+
var DEFAULT_TEXT_CUSTOMIZATIONS = {
|
|
13
|
+
virtualFiat: "Deposit with SEPA",
|
|
14
|
+
brokerageOrExchange: "Connect Exchange",
|
|
15
|
+
debitOrCredit: "Deposit with Card",
|
|
16
|
+
accountBalance: "Wallet",
|
|
17
|
+
selectAccount: "Select an exchange",
|
|
18
|
+
perpsTransferTitle: "Transfer",
|
|
19
|
+
sourceMethodTitle: "Your source",
|
|
20
|
+
tokensListTitle: "Your tokens",
|
|
21
|
+
transferTokens: "Transfer Crypto",
|
|
22
|
+
bitcoinLightning: "Bitcoin on Cash App",
|
|
23
|
+
receiveDropdownTitle: "",
|
|
24
|
+
// Default to empty
|
|
25
|
+
receiveDropdownLabel: "Asset to Receive",
|
|
26
|
+
confirmationScreen: {
|
|
27
|
+
payAmountLabel: "You send",
|
|
28
|
+
receiveAmountLabel: "You receive"
|
|
29
|
+
},
|
|
30
|
+
paymentMethodSubtitles: {}
|
|
31
|
+
};
|
|
32
|
+
var DEFAULT_UI_CUSTOMIZATIONS = {
|
|
33
|
+
alignTitle: "center",
|
|
34
|
+
alwaysShowTopDivider: false,
|
|
35
|
+
showModalTitle: true,
|
|
36
|
+
callToActionsUppercase: false,
|
|
37
|
+
enableCompactList: false,
|
|
38
|
+
checkoutHistory: {
|
|
39
|
+
showGetHelpAsAlert: true,
|
|
40
|
+
simplifiedUi: false
|
|
41
|
+
},
|
|
42
|
+
confirmationScreen: {
|
|
43
|
+
preferDestinationWhenSame: false,
|
|
44
|
+
showAmountSummaryAbovePaymentMethod: false,
|
|
45
|
+
showDisclaimerAsAlert: true,
|
|
46
|
+
showInstantTimeEstimate: false,
|
|
47
|
+
showLeftAlignedDollarValueWithLabel: false,
|
|
48
|
+
showPaymentAmountUsd: false,
|
|
49
|
+
showReceiveAmountUsd: false,
|
|
50
|
+
showSelectedRoute: false,
|
|
51
|
+
stepIndicatorType: "spinner",
|
|
52
|
+
showTokenAmount: true,
|
|
53
|
+
showTransactionDigest: "none"
|
|
54
|
+
},
|
|
55
|
+
sourceChangeScreen: {
|
|
56
|
+
bottomBarCloseButton: {
|
|
57
|
+
enabled: false,
|
|
58
|
+
labelKey: "common.close"
|
|
59
|
+
},
|
|
60
|
+
showTargetAssetSelection: false,
|
|
61
|
+
showWalletOnInsufficientBalance: false,
|
|
62
|
+
showWalletConnect: true,
|
|
63
|
+
showCustomTopComponentDivider: false,
|
|
64
|
+
paymentMethodIcons: {}
|
|
65
|
+
},
|
|
66
|
+
inputAmountScreen: {
|
|
67
|
+
allowTokenAmountInput: true
|
|
68
|
+
},
|
|
69
|
+
selectAssetScreen: {
|
|
70
|
+
isSecondaryTokenSymbolVisible: true,
|
|
71
|
+
navigateOnAssetClick: false
|
|
72
|
+
},
|
|
73
|
+
transferCryptoScreen: {
|
|
74
|
+
showYouSendYouReceive: false
|
|
75
|
+
},
|
|
76
|
+
withdrawalScreen: {},
|
|
77
|
+
selectBrokerageScreen: {},
|
|
78
|
+
connectExchangeScreen: {},
|
|
79
|
+
customIcons: {},
|
|
80
|
+
customFontFamily: {
|
|
81
|
+
primary: "",
|
|
82
|
+
secondary: "",
|
|
83
|
+
tertiary: ""
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var DEFAULT_FUNKIT_CONFIG = {
|
|
87
|
+
apiKey: "",
|
|
88
|
+
appName: "",
|
|
89
|
+
textCustomizations: DEFAULT_TEXT_CUSTOMIZATIONS,
|
|
90
|
+
uiCustomizations: DEFAULT_UI_CUSTOMIZATIONS
|
|
91
|
+
};
|
|
92
|
+
var FunkitConfigContext = createContext(
|
|
93
|
+
DEFAULT_FUNKIT_CONFIG
|
|
94
|
+
);
|
|
95
|
+
function useFunkitConfig() {
|
|
96
|
+
const originalFunkitConfig = useContext(FunkitConfigContext);
|
|
97
|
+
const { t } = useFunkitTranslation();
|
|
98
|
+
const translatedDefaults = useMemo(() => {
|
|
99
|
+
return {
|
|
100
|
+
virtualFiat: t("textCustomizations.virtualFiat"),
|
|
101
|
+
brokerageOrExchange: t("textCustomizations.brokerageOrExchange"),
|
|
102
|
+
debitOrCredit: t("textCustomizations.debitOrCredit"),
|
|
103
|
+
accountBalance: t("textCustomizations.accountBalance"),
|
|
104
|
+
selectAccount: t("textCustomizations.selectAccount"),
|
|
105
|
+
perpsTransferTitle: t("perpsTransfer.title"),
|
|
106
|
+
sourceMethodTitle: t("textCustomizations.sourceMethodTitle"),
|
|
107
|
+
tokensListTitle: t("textCustomizations.tokensListTitle"),
|
|
108
|
+
transferTokens: t("textCustomizations.transferTokens"),
|
|
109
|
+
bitcoinLightning: t("textCustomizations.bitcoinLightning"),
|
|
110
|
+
receiveDropdownTitle: t("textCustomizations.receiveDropdownTitle"),
|
|
111
|
+
receiveDropdownLabel: t("textCustomizations.receiveDropdownLabel"),
|
|
112
|
+
confirmationScreen: {
|
|
113
|
+
payAmountLabel: t("textCustomizations.payAmountLabel"),
|
|
114
|
+
receiveAmountLabel: t("textCustomizations.receiveAmountLabel")
|
|
115
|
+
},
|
|
116
|
+
paymentMethodSubtitles: {}
|
|
117
|
+
};
|
|
118
|
+
}, [t]);
|
|
119
|
+
const finalFunkitConfig = useMemo(() => {
|
|
120
|
+
return {
|
|
121
|
+
...DEFAULT_FUNKIT_CONFIG,
|
|
122
|
+
...originalFunkitConfig,
|
|
123
|
+
textCustomizations: {
|
|
124
|
+
...translatedDefaults,
|
|
125
|
+
...originalFunkitConfig.textCustomizations,
|
|
126
|
+
confirmationScreen: {
|
|
127
|
+
...translatedDefaults.confirmationScreen,
|
|
128
|
+
...originalFunkitConfig.textCustomizations?.confirmationScreen
|
|
129
|
+
},
|
|
130
|
+
paymentMethodSubtitles: {
|
|
131
|
+
...translatedDefaults.paymentMethodSubtitles,
|
|
132
|
+
...originalFunkitConfig.textCustomizations?.paymentMethodSubtitles
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
uiCustomizations: {
|
|
136
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations,
|
|
137
|
+
...originalFunkitConfig.uiCustomizations,
|
|
138
|
+
checkoutHistory: {
|
|
139
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.checkoutHistory,
|
|
140
|
+
...originalFunkitConfig.uiCustomizations?.checkoutHistory
|
|
141
|
+
},
|
|
142
|
+
confirmationScreen: {
|
|
143
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.confirmationScreen,
|
|
144
|
+
...originalFunkitConfig.uiCustomizations?.confirmationScreen
|
|
145
|
+
},
|
|
146
|
+
connectExchangeScreen: {
|
|
147
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.connectExchangeScreen,
|
|
148
|
+
...originalFunkitConfig.uiCustomizations?.connectExchangeScreen
|
|
149
|
+
},
|
|
150
|
+
inputAmountScreen: {
|
|
151
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.inputAmountScreen,
|
|
152
|
+
...originalFunkitConfig.uiCustomizations?.inputAmountScreen
|
|
153
|
+
},
|
|
154
|
+
selectAssetScreen: {
|
|
155
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.selectAssetScreen,
|
|
156
|
+
...originalFunkitConfig.uiCustomizations?.selectAssetScreen
|
|
157
|
+
},
|
|
158
|
+
selectBrokerageScreen: {
|
|
159
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.selectBrokerageScreen,
|
|
160
|
+
...originalFunkitConfig.uiCustomizations?.selectBrokerageScreen
|
|
161
|
+
},
|
|
162
|
+
sourceChangeScreen: {
|
|
163
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.sourceChangeScreen,
|
|
164
|
+
...originalFunkitConfig.uiCustomizations?.sourceChangeScreen,
|
|
165
|
+
bottomBarCloseButton: {
|
|
166
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.sourceChangeScreen.bottomBarCloseButton,
|
|
167
|
+
...originalFunkitConfig.uiCustomizations?.sourceChangeScreen?.bottomBarCloseButton
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
transferCryptoScreen: {
|
|
171
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.transferCryptoScreen,
|
|
172
|
+
...originalFunkitConfig.uiCustomizations?.transferCryptoScreen
|
|
173
|
+
},
|
|
174
|
+
withdrawalScreen: {
|
|
175
|
+
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.withdrawalScreen,
|
|
176
|
+
...originalFunkitConfig.uiCustomizations?.withdrawalScreen
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}, [originalFunkitConfig, translatedDefaults]);
|
|
181
|
+
return finalFunkitConfig;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export {
|
|
185
|
+
useFunkitConfig
|
|
186
|
+
};
|