@funkit/connect 9.7.2-next.0 → 9.8.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/__generated__/default_configs.d.ts +1 -1
  3. package/dist/__generated__/default_feature_gates.d.ts +1 -0
  4. package/dist/clients/chunk-LMEQD56M.js +289 -0
  5. package/dist/clients/fanatics.css +1 -1
  6. package/dist/clients/fanatics.js +55 -329
  7. package/dist/clients/lighter.css +14393 -0
  8. package/dist/clients/lighter.d.ts +30 -34
  9. package/dist/clients/lighter.js +657 -0
  10. package/dist/components/Dropdown/BaseDropdown.d.ts +7 -21
  11. package/dist/components/Dropdown/BaseDropdown.utils.d.ts +23 -0
  12. package/dist/components/Dropdown/ChainDropdown.d.ts +2 -1
  13. package/dist/components/Dropdown/TokenAndChainDropdown.d.ts +9 -3
  14. package/dist/components/Dropdown/TokenDropdown.d.ts +7 -3
  15. package/dist/domains/asset.d.ts +0 -1
  16. package/dist/domains/quoteMode/exactOut.d.ts +2 -1
  17. package/dist/domains/quoteMode/resolveQuoteMode.d.ts +3 -1
  18. package/dist/hooks/queries/useWithdrawalQuote.d.ts +2 -8
  19. package/dist/hooks/useCheckoutDirectExecution.d.ts +1 -1
  20. package/dist/hooks/useIsStablecoin.d.ts +2 -0
  21. package/dist/hooks/useTokenAndChainDropdown.d.ts +13 -7
  22. package/dist/hooks/useTokenTransfer.d.ts +2 -2
  23. package/dist/index.css +99 -99
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +5691 -4823
  26. package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +2 -1
  27. package/dist/modals/CheckoutModal/TransferToken/useTransferTokenTracking.d.ts +2 -2
  28. package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +11 -1
  29. package/dist/modals/WithdrawalModal/useWithdrawal.d.ts +5 -1
  30. package/dist/providers/FunkitCheckoutContext/types.d.ts +60 -2
  31. package/dist/providers/FunkitHistoryContext.d.ts +2 -2
  32. package/dist/utils/withdrawal.d.ts +6 -1
  33. package/dist/wallets/Wallet.d.ts +11 -0
  34. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  35. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  36. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  37. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  38. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  39. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  40. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  43. package/dist/wallets/walletConnectors/index.js +42 -42
  44. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  45. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  46. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  47. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  48. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  49. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  50. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  51. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  52. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  53. package/package.json +6 -5
  54. package/dist/chunk-64NZSUGQ.js +0 -368
  55. package/dist/chunk-B2B6HDIE.js +0 -238
  56. package/dist/chunk-OQNN7EMQ.js +0 -238
  57. package/dist/chunk-S65TG73G.js +0 -247
  58. package/dist/chunk-VLAOBEJN.js +0 -247
  59. package/dist/clients/chunk-SBQ2UUPK.js +0 -214
  60. package/dist/components/Dropdown/TokenAndChainDropdown.css.d.ts +0 -1
  61. package/dist/hooks/track/CheckoutTrackingContext.d.ts +0 -60
  62. package/dist/hooks/useTokenChain.d.ts +0 -21
  63. package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeContainer.d.ts +0 -17
  64. package/dist/modals/WithdrwalModal/WithdrawalCallbackSuccess.d.ts +0 -10
  65. package/dist/modals/WithdrwalModal/WithdrawalContent.d.ts +0 -11
  66. package/dist/modals/WithdrwalModal/WithdrawalModal.d.ts +0 -9
  67. package/dist/modals/WithdrwalModal/WithdrawalSuccess.d.ts +0 -15
  68. package/dist/modals/WithdrwalModal/types.d.ts +0 -5
  69. package/dist/modals/WithdrwalModal/useWithdrawal.d.ts +0 -24
  70. package/dist/wallets/walletConnectors/chunk-34HACM5U.js +0 -110
  71. package/dist/wallets/walletConnectors/chunk-4C7ER452.js +0 -93
  72. package/dist/wallets/walletConnectors/chunk-53VYSPXK.js +0 -66
  73. package/dist/wallets/walletConnectors/chunk-5TN5Z2WY.js +0 -87
  74. package/dist/wallets/walletConnectors/chunk-6DRCY52E.js +0 -69
  75. package/dist/wallets/walletConnectors/chunk-6UCI7GM6.js +0 -98
  76. package/dist/wallets/walletConnectors/chunk-6YO27XOM.js +0 -96
  77. package/dist/wallets/walletConnectors/chunk-7OARWILZ.js +0 -92
  78. package/dist/wallets/walletConnectors/chunk-7V33VJAL.js +0 -218
  79. package/dist/wallets/walletConnectors/chunk-APHCF4DT.js +0 -103
  80. package/dist/wallets/walletConnectors/chunk-CJJT7LMT.js +0 -96
  81. package/dist/wallets/walletConnectors/chunk-DEFRRPXB.js +0 -98
  82. package/dist/wallets/walletConnectors/chunk-EKJHJFRN.js +0 -69
  83. package/dist/wallets/walletConnectors/chunk-FG2LDVXL.js +0 -92
  84. package/dist/wallets/walletConnectors/chunk-GH4M6FTK.js +0 -95
  85. package/dist/wallets/walletConnectors/chunk-GSHSWVEG.js +0 -70
  86. package/dist/wallets/walletConnectors/chunk-GVOQTORD.js +0 -87
  87. package/dist/wallets/walletConnectors/chunk-HETS3KKI.js +0 -218
  88. package/dist/wallets/walletConnectors/chunk-HOPH3TQ3.js +0 -99
  89. package/dist/wallets/walletConnectors/chunk-HRDPUW3V.js +0 -94
  90. package/dist/wallets/walletConnectors/chunk-HXWUH73P.js +0 -93
  91. package/dist/wallets/walletConnectors/chunk-IICWJWGZ.js +0 -110
  92. package/dist/wallets/walletConnectors/chunk-KO56HCTI.js +0 -106
  93. package/dist/wallets/walletConnectors/chunk-KWX2SYU2.js +0 -100
  94. package/dist/wallets/walletConnectors/chunk-LCIPVVH5.js +0 -70
  95. package/dist/wallets/walletConnectors/chunk-LI6QY2B5.js +0 -94
  96. package/dist/wallets/walletConnectors/chunk-PKMAPNN6.js +0 -92
  97. package/dist/wallets/walletConnectors/chunk-T4ROGPMF.js +0 -106
  98. package/dist/wallets/walletConnectors/chunk-TTHM3WUR.js +0 -100
  99. package/dist/wallets/walletConnectors/chunk-UDTBQV4Q.js +0 -96
  100. package/dist/wallets/walletConnectors/chunk-V6UOWTEZ.js +0 -95
  101. package/dist/wallets/walletConnectors/chunk-VJZWNQOF.js +0 -92
  102. package/dist/wallets/walletConnectors/chunk-XBLHZICW.js +0 -103
  103. package/dist/wallets/walletConnectors/chunk-XVBSJCW5.js +0 -96
  104. package/dist/wallets/walletConnectors/chunk-YIEASHLS.js +0 -99
  105. package/dist/wallets/walletConnectors/chunk-ZPSPK6LH.js +0 -66
@@ -1,247 +0,0 @@
1
- "use client";
2
- import {
3
- baseTheme
4
- } from "./chunk-O35RTEEF.js";
5
-
6
- // src/themes/lightTheme.ts
7
- var accentColors = {
8
- blue: { accentColor: "#31A3F8", accentColorForeground: "#31A3F859" },
9
- green: { accentColor: "#66CC00", accentColorForeground: "#FFF" },
10
- orange: { accentColor: "#F6851B", accentColorForeground: "#FFF" },
11
- pink: { accentColor: "#FF5CA0", accentColorForeground: "#FFF" },
12
- purple: { accentColor: "#5F5AFA", accentColorForeground: "#FFF" },
13
- red: { accentColor: "#F34126", accentColorForeground: "#FFF" },
14
- white: { accentColor: "#000000", accentColorForeground: "#FFF" }
15
- };
16
- var defaultAccentColor = accentColors.white;
17
- var lightTheme = ({
18
- accentColor = defaultAccentColor.accentColor,
19
- accentColorForeground = defaultAccentColor.accentColorForeground,
20
- customColors,
21
- customShadows,
22
- ...baseThemeOptions
23
- // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: just a bunch of ?? defaults
24
- } = {}) => ({
25
- ...baseTheme(baseThemeOptions),
26
- colors: {
27
- accentColor,
28
- accentColorForeground,
29
- actionButtonBorder: "rgba(0, 0, 0, 0.04)",
30
- connectButtonBackground: "#FFF",
31
- connectButtonBackgroundError: "#C60000",
32
- connectButtonText: "#25292E",
33
- connectButtonTextError: "#FFF",
34
- connectionIndicator: "#30E000",
35
- error: accentColors.red.accentColor,
36
- errorBackground: "#F2E6E4",
37
- errorBorder: "rgba(243, 65, 38, 0.2)",
38
- generalBorder: "#F7F7F7",
39
- // strokeColor in figma
40
- generalBorderDim: "rgba(0, 0, 0, 0.03)",
41
- menuItemBackground: "#FCFCFC",
42
- selectedOptionBorder: "#F7F7F7",
43
- focusedOptionBorder: "#737373",
44
- standby: "#F6851B",
45
- success: "#66CC00",
46
- delayedStatusIcon: customColors?.secondaryText ?? "#737373",
47
- // backward compatibility
48
- chainIconBorder: "#fff",
49
- // FUNKIT COLORS
50
- // modal backgrounds
51
- modalBackdrop: "rgba(0, 0, 0, 0.2)",
52
- modalTopbarIcon: "#000",
53
- modalTopbarIconBackground: customColors?.modalTopbarIconBackground ?? "transparent",
54
- modalTopbarIconBackgroundHover: customColors?.modalTopbarIconBackgroundHover ?? customColors?.buttonIconBackgroundHover ?? "#F7F7F7",
55
- modalTopbarIconBackgroundPressed: customColors?.modalTopbarIconBackgroundPressed ?? customColors?.buttonIconBackgroundPressed ?? "#F0F0F0",
56
- modalTopbarIconStroke: customColors?.modalTopbarIconStroke ?? customColors?.buttonIconStroke ?? "rgba(0, 0, 0, 0.35)",
57
- modalBackground: "#FFF",
58
- modalBorder: "#F7F7F7",
59
- offBackground: "#F7F7F7",
60
- offBackgroundInverse: "#333333",
61
- hoverState: "#F0F0F0",
62
- lightStroke: "#F7F7F7",
63
- mediumStroke: "#F0F0F0",
64
- heavyStroke: "#E5E5E5",
65
- strokeColor: "#E8E8E8",
66
- //Text
67
- primaryText: "#000",
68
- secondaryText: "#737373",
69
- tertiaryText: "rgba(0, 0, 0, 0.35)",
70
- textSelection: "rgba(0, 0, 0, 0.10)",
71
- selectedDropdownItemText: customColors?.primaryText ?? "#000",
72
- copyButtonBackgroundBase: customColors?.offBackground ?? "#F7F7F7",
73
- copyButtonBackgroundHover: customColors?.hoverState ?? "#F0F0F0",
74
- copyButtonBackgroundActive: customColors?.inputBorderHover ?? "#E5E5E5",
75
- useConnectedBackgroundBase: customColors?.mediumStroke ?? "#F0F0F0",
76
- useConnectedBackgroundHover: customColors?.mediumStroke ?? "#F0F0F0",
77
- copyButtonBorderBase: customColors?.mediumStroke ?? "#F0F0F0",
78
- copyButtonBorderHover: customColors?.mediumStroke ?? "#F0F0F0",
79
- funFeatureListBackgroundBase: customColors?.offBackground ?? "#F7F7F7",
80
- funFeatureListBackgroundHover: customColors?.hoverState ?? "#F0F0F0",
81
- funFeatureListBorderColor: "transparent",
82
- funFeatureListBorderColorHover: "transparent",
83
- selectedDropdownItemBackground: "transparent",
84
- alwaysVisibleLabelBackgroundHover: "transparent",
85
- // input
86
- inputLabel: customColors?.primaryText ?? "#000",
87
- inputBackground: "#FFFFFF",
88
- inputBackgroundHover: customColors?.offBackground ?? "#F7F7F7",
89
- inputBorderBase: "#F0F0F0",
90
- inputBorderHover: "#E5E5E5",
91
- // tab
92
- activeTabBorderColor: "#F7F7F7",
93
- activeTabBackground: "#F7F7F7",
94
- inactiveTabBorderColor: "transparent",
95
- inactiveTabBackgroundBase: "transparent",
96
- inactiveTabBackgroundHover: "transparent",
97
- inactiveTabBackgroundActive: "transparent",
98
- activeTabText: customColors?.primaryText ?? "#000",
99
- inactiveTabTextBase: customColors?.secondaryText ?? "#737373",
100
- inactiveTabHover: customColors?.primaryText ?? "#000",
101
- // button
102
- actionColor: "#000",
103
- actionColorHover: "rgba(0, 0, 0, 0.7)",
104
- actionColorDisabled: "rgba(0, 0, 0, 0.50)",
105
- buttonPrimary: accentColor,
106
- buttonDisabled: "#31A3F826",
107
- buttonWarning: accentColors.red.accentColor,
108
- buttonSuccess: "#2EA200",
109
- buttonTextPrimary: "#FFFFFF",
110
- buttonTextHover: "#FFF",
111
- buttonTextDisabled: "#FFF",
112
- transparent: "transparent",
113
- buttonBackgroundTertiary: "#F7F7F7",
114
- buttonBackgroundHoverTertiary: "#F0F0F0",
115
- buttonBackgroundDisabledTertiary: "transparent",
116
- buttonTextTertiary: "#000",
117
- buttonTextDisabledTertiary: "rgba(0, 0, 0, 0.5)",
118
- buttonBackground: "#000",
119
- buttonBackgroundHover: "#333333",
120
- buttonBackgroundPressed: "#000",
121
- buttonBackgroundDisabled: "rgba(0, 0, 0, 0.5)",
122
- buttonTextSecondaryDisabled: "rgba(0, 0, 0, 0.5)",
123
- buttonTextSecondary: "#000000",
124
- buttonIconBackgroundHover: "#F7F7F7",
125
- buttonIconBackgroundPressed: "#F0F0F0",
126
- buttonIconStroke: "rgba(0, 0, 0, 0.35)",
127
- buttonBorderTertiary: "transparent",
128
- buttonBorderFocusedTertiary: "rgba(0, 0, 0, 0.35)",
129
- buttonFocusedOutline: "none",
130
- buttonBorderGradient: "none",
131
- buttonHoverBorderGradient: "none",
132
- buttonDisabledBorderGradient: "none",
133
- // TODO: Make common colors when refactoring the design system
134
- inputAmountQuickOptionBaseBackground: "#F7F7F7",
135
- inputAmountQuickOptionHoverBackground: "#F0F0F0",
136
- inputAmountQuickOptionActiveBackground: "#F0F0F0",
137
- inputAmountQuickOptionDisabledBackground: "#F7F7F7",
138
- inputAmountQuickOptionBaseBorder: "#F7F7F7",
139
- inputAmountQuickOptionHoverBorder: "rgba(0, 0, 0, 0.35)",
140
- inputAmountQuickOptionActiveBorder: "rgba(0, 0, 0, 0.35)",
141
- inputAmountQuickOptionFocusedBorder: "rgba(0, 0, 0, 0.35)",
142
- inputAmountFiatDecimalsColor: customColors?.inputAmountFiatDecimalsColor ?? "none",
143
- youPayYouReceiveBackground: "#FFF",
144
- // modalBackground
145
- youPayYouReceiveBorder: "#F0F0F0",
146
- // mediumStroke
147
- youPayYouReceivePrimaryText: "#000",
148
- // primaryText
149
- youPayYouReceiveSecondaryText: "#737373",
150
- // secondaryText
151
- withdrawalYouWillReceiveLabel: customColors?.withdrawalYouWillReceiveLabel ?? customColors?.primaryText ?? "#000",
152
- withdrawalYouWillReceiveValueCrypto: customColors?.withdrawalYouWillReceiveValueCrypto ?? customColors?.primaryText ?? "#000",
153
- withdrawalYouWillReceiveValueUsd: customColors?.withdrawalYouWillReceiveValueUsd ?? customColors?.secondaryText ?? "#737373",
154
- // badges
155
- badgeBackgroundSuccess: "rgba(124, 242, 136, 0.1)",
156
- badgeBorderSuccess: "rgba(124, 242, 136, 0.2)",
157
- badgeTextSuccess: "rgb(124, 242, 136)",
158
- newBadgeBackground: "linear-gradient(180deg, #ECFFEA 0%, #E4FFE9 100%)",
159
- newBadgeBorder: "rgba(122, 221, 122, 0.5)",
160
- newBadgeText: "#028320",
161
- approvedBadgeBackground: "linear-gradient(180deg, #ECFFEA 0%, #E4FFE9 100%)",
162
- approvedBadgeBorder: "rgba(109, 216, 109, 0.5)",
163
- approvedBadgeText: "#028320",
164
- failedBadgeBackground: "rgba(255, 61, 61, 0.08)",
165
- failedBadgeBorder: "rgba(0, 0, 0, 0.03)",
166
- failedBadgeText: "#C2341E",
167
- announceGradientFrom: "#595959",
168
- announceGradientTo: "#9C9C9C",
169
- fiatPendingGradientFrom: "#454545",
170
- fiatPendingGradientTo: "#747474",
171
- fiatSuccessBackgroundFill: "rgba(102, 204, 0, 0.16)",
172
- fiatFailedBackgroundFill: "rgba(255, 61, 61, 0.12)",
173
- fiatStatusIconBorder: "rgba(0, 0, 0, 0.03)",
174
- fiatAccountIconFill: "#E7F3FE",
175
- fiatAccountGradientFrom: "#055DF5",
176
- fiatAccountGradientTo: "#4C8DFD",
177
- modalHeaderDivider: "#F7F7F7",
178
- // lightStroke
179
- modalFooterDivider: "#F7F7F7",
180
- // lightStroke
181
- spinnerBackground: customColors?.mediumStroke ?? "rgba(255, 255, 255, 0.3)",
182
- // 30% buttonTextPrimary
183
- spinnerIndicator: customColors?.primaryText ?? "#FFF",
184
- // 100% buttonTextPrimary
185
- spinnerBackgroundVerifyAccount: "rgba(255, 255, 255, 0.3)",
186
- // 30% buttonTextPrimary
187
- spinnerIndicatorVerifyAccount: customColors?.primaryText ?? "#FFF",
188
- // 100% buttonTextPrimary
189
- // Override colors
190
- ...customColors || {},
191
- // option Boxes
192
- optionBoxBackground: customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#FFF",
193
- // keeps gradient in SourcePaymentMethodItem if optionBoxBackground differs from modal background
194
- optionBoxBackgroundUninteractive: customColors?.optionBoxBackgroundUninteractive ?? "transparent",
195
- optionBoxBorderBase: customColors?.optionBoxBorderBase ?? customColors?.mediumStroke ?? "#F0F0F0",
196
- optionBoxBorderHover: customColors?.optionBoxBorderHover ?? customColors?.mediumStroke ?? "#F0F0F0",
197
- optionBoxDefaultModeNotActiveBorderBase: customColors?.optionBoxDefaultModeNotActiveBorderBase ?? "transparent",
198
- optionBoxDefaultModeNotActiveBorderHover: customColors?.optionBoxDefaultModeNotActiveBorderHover ?? "transparent",
199
- dropdownActiveItemBackgroundBase: customColors?.dropdownActiveItemBackgroundBase ?? customColors?.modalBackground ?? "#FFF",
200
- openDropdownBackgroundColor: customColors?.openDropdownBackgroundColor ?? customColors?.optionBoxBackground ?? customColors?.modalBackground ?? "#FFF",
201
- dropdownActiveItemBackgroundHover: customColors?.dropdownActiveItemBackgroundHover ?? customColors?.offBackground ?? "#F7F7F7",
202
- dropdownActiveItemBackgroundDisabled: customColors?.dropdownActiveItemBackgroundDisabled ?? "transparent",
203
- dropdownActiveItemBorderBase: customColors?.dropdownActiveItemBorderBase ?? customColors?.mediumStroke ?? "#F0F0F0",
204
- dropdownActiveItemBorderHover: customColors?.dropdownActiveItemBorderHover ?? customColors?.mediumStroke ?? "#F0F0F0",
205
- dropdownGroupHeader: customColors?.dropdownGroupHeader ?? customColors?.primaryText ?? "#000",
206
- // primaryText
207
- txSummaryBoxBackground: customColors?.txSummaryBoxBackground ?? customColors?.modalBackground ?? "#FFF",
208
- txSummaryBoxBorder: customColors?.txSummaryBoxBorder ?? customColors?.lightStroke ?? "#F7F7F7",
209
- counterRingColor: customColors?.counterRingColor ?? accentColor,
210
- cryptoCashToggleContainerBorderColor: customColors?.cryptoCashToggleContainerBorderColor ?? "transparent",
211
- cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent"
212
- },
213
- shadows: {
214
- connectButton: "0px 4px 12px rgba(0, 0, 0, 0.1)",
215
- dialog: "0px 8px 32px rgba(0, 0, 0, 0.32)",
216
- selectedOption: "0px 2px 6px rgba(0, 0, 0, 0.24)",
217
- selectedWallet: "0px 2px 6px rgba(0, 0, 0, 0.12)",
218
- dropdown: "0px 0px 0px 1px rgba(0, 0, 0, 0.05), 0px 2px 6px 0px rgba(0, 0, 0, 0.03), 0px 4px 42px 0px rgba(0, 0, 0, 0.06)",
219
- notification: "0px 0px 0px 1px rgba(0, 0, 0, 0.06), 0px 2px 6px 0px rgba(0, 0, 0, 0.05), 0px 4px 42px 0px rgba(0, 0, 0, 0.06)",
220
- qrCode: "0px 0px 0px 1px rgba(0, 0, 0, 0.10), 0px 1px 4px 0px rgba(0, 0, 0, 0.04), 0px 4px 24px 0px rgba(8, 7, 7, 0.10)",
221
- buttonShadow: "none",
222
- buttonShadowTertiary: customShadows?.buttonShadow ?? "none",
223
- buttonFocusedShadow: "0px 0px 0px 2px rgba(0, 0, 0, 0.25)",
224
- buttonFocusedShadowTertiary: "0px 0px 0px 2px rgba(0, 0, 0, 0.25)",
225
- buttonHoverShadow: "none",
226
- buttonHoverShadowTertiary: "none",
227
- buttonDisabledShadow: "none",
228
- buttonDisabledShadowTertiary: customShadows?.buttonDisabledShadow ?? "none",
229
- buttonInnerShadow: "none",
230
- buttonInnerShadowTertiary: customShadows?.buttonInnerShadow ?? "none",
231
- buttonFocusedInnerShadow: "none",
232
- buttonFocusedInnerShadowTertiary: customShadows?.buttonFocusedInnerShadow ?? "none",
233
- buttonHoverInnerShadow: "none",
234
- buttonHoverInnerShadowTertiary: customShadows?.buttonHoverInnerShadow ?? "none",
235
- buttonDisabledInnerShadow: "none",
236
- buttonDisabledInnerShadowTertiary: customShadows?.buttonDisabledInnerShadow ?? "none",
237
- selectedDropdownItem: "none",
238
- // Override shadows
239
- ...customShadows || {}
240
- },
241
- moonpayTheme: "light"
242
- });
243
- lightTheme.accentColors = accentColors;
244
-
245
- export {
246
- lightTheme
247
- };
@@ -1,214 +0,0 @@
1
- "use client";
2
-
3
- // src/utils/funLogger.ts
4
- import { datadogLogs } from "@datadog/browser-logs";
5
- import { DEV_API_KEY } from "@funkit/api-base";
6
- var DDOG_CLIENT_TOKEN = "pub4f86c6be8c792cb48dc156a8c17d9a47";
7
- var FUN_DEV_API_KEYS = [
8
- "hnHevQR0y394nBprGrvNx4HgoZHUwMet5mXTOBhf",
9
- "MYny3w7xJh6PRlRgkJ9604sHouY2MTke6lCPpSHq",
10
- DEV_API_KEY
11
- ];
12
- function setDdogEnv(environment) {
13
- datadogLogs.setGlobalContextProperty("env", environment);
14
- }
15
- function setDdogTrackingConsent(consent) {
16
- datadogLogs.setTrackingConsent(consent);
17
- }
18
- var FunLogger = class {
19
- constructor() {
20
- setDdogEnv("development" /* DEVELOPMENT */);
21
- setDdogTrackingConsent("granted");
22
- this.apiKey = null;
23
- this.isDebugMode = false;
24
- this.userId = null;
25
- this.userAddress = null;
26
- this.userName = null;
27
- this.userLoginType = null;
28
- this.sdkVersion = null;
29
- this.l2Address = null;
30
- this.isConfigured = false;
31
- this.logQueue = [];
32
- this.disableLogging = false;
33
- }
34
- getFunLogEnv() {
35
- if (!this.apiKey || FUN_DEV_API_KEYS.includes(this.apiKey)) {
36
- return "development" /* DEVELOPMENT */;
37
- }
38
- return "production" /* PRODUCTION */;
39
- }
40
- logDataDog(level, title, data, error) {
41
- if (typeof window === "undefined") {
42
- return;
43
- }
44
- const datadogData = {
45
- data,
46
- apiKey: this.apiKey,
47
- userId: this.userId,
48
- userName: this.userName,
49
- userAddress: this.userAddress,
50
- userLoginType: this.userLoginType,
51
- sdkVersion: this.sdkVersion
52
- };
53
- switch (level) {
54
- case "info":
55
- datadogLogs.logger.info(title, datadogData);
56
- break;
57
- case "debug":
58
- datadogLogs.logger.debug(title, datadogData);
59
- break;
60
- case "warn":
61
- datadogLogs.logger.warn(title, datadogData);
62
- break;
63
- case "error":
64
- datadogLogs.logger.error(title, datadogData, error);
65
- }
66
- }
67
- processLog(level, title, data, error) {
68
- if (!this.isConfigured) {
69
- this.logQueue.push({ level, title, data, error });
70
- return;
71
- }
72
- if (!this.apiKey) {
73
- console.error(
74
- "FunLogger: apiKey is not set. Please call configure() with a valid apiKey."
75
- );
76
- return;
77
- }
78
- const isProd = this.getFunLogEnv() === "production" /* PRODUCTION */;
79
- if (isProd) {
80
- this.logDataDog(level, title, data, error);
81
- }
82
- if (!isProd || this.isDebugMode) {
83
- const formattedData = data || "";
84
- switch (level) {
85
- case "debug":
86
- console.debug(title, formattedData);
87
- break;
88
- case "info":
89
- console.log(title, formattedData);
90
- break;
91
- case "warn":
92
- console.warn(title, formattedData);
93
- break;
94
- case "error":
95
- console.error(title, formattedData, error);
96
- break;
97
- }
98
- }
99
- }
100
- onDebug({ title, data }) {
101
- this.processLog("debug", title, data);
102
- }
103
- onInfo({ title, data }) {
104
- this.processLog("info", title, data);
105
- }
106
- onWarn({ title, data }) {
107
- this.processLog("warn", title, data);
108
- }
109
- onError({ title, error, data }) {
110
- this.processLog("error", title, data, error);
111
- }
112
- extractError(error) {
113
- if (error instanceof Error) {
114
- return error;
115
- }
116
- if (typeof error === "object" && error !== null && "error" in error && error.error instanceof Error) {
117
- return error.error;
118
- }
119
- return null;
120
- }
121
- /**========================
122
- * PUBLIC LOGGER FUNCTIONS
123
- *=========================*/
124
- log(title, data) {
125
- this.onInfo({ title, data });
126
- }
127
- info(title, data) {
128
- this.onInfo({ title, data });
129
- }
130
- debug(title, data) {
131
- this.onDebug({ title, data });
132
- }
133
- warn(title, data) {
134
- this.onWarn({ title, data });
135
- }
136
- /**
137
- * @param errorOrData -
138
- * Previously was called "error" but since in the {@link Logger} interface, error is defined as object (which is the same thing as "any"), we treat it as of unknown type here for safety.
139
- * In a lot of places it's actually being used as a "data" prop, which also usually has an `.error` property representing an actual {@link Error} object.
140
- */
141
- error(title, errorOrData, _data = {}) {
142
- const error = this.extractError(errorOrData) ?? void 0;
143
- const data = {
144
- ..._data,
145
- ...typeof errorOrData === "object" && errorOrData !== null ? errorOrData : {}
146
- };
147
- this.onError({ title, error, data });
148
- }
149
- flushLogQueue() {
150
- const queueCopy = [...this.logQueue];
151
- this.logQueue = [];
152
- for (const queuedLog of queueCopy) {
153
- const { level, title, data, error } = queuedLog;
154
- switch (level) {
155
- case "debug":
156
- this.onDebug({ title, data });
157
- break;
158
- case "info":
159
- this.onInfo({ title, data });
160
- break;
161
- case "warn":
162
- this.onWarn({ title, data });
163
- break;
164
- case "error":
165
- this.onError({ title, data, error });
166
- break;
167
- }
168
- }
169
- }
170
- configure(apiKey, isDebug, sdkVersion, disableLogging = false) {
171
- this.apiKey = apiKey;
172
- this.isDebugMode = isDebug;
173
- this.sdkVersion = sdkVersion;
174
- this.disableLogging = disableLogging;
175
- this.isConfigured = true;
176
- setDdogEnv(this.getFunLogEnv());
177
- setDdogTrackingConsent(this.disableLogging ? "not-granted" : "granted");
178
- this.flushLogQueue();
179
- }
180
- getUserId() {
181
- return this.userId;
182
- }
183
- getUserAddress() {
184
- return this.userAddress;
185
- }
186
- getUserName() {
187
- return this.userName;
188
- }
189
- getUserLoginType() {
190
- return this.userLoginType;
191
- }
192
- getL2Address() {
193
- return this.l2Address;
194
- }
195
- setUserInfo(userId, userAddress, userName, userLoginType, l2Address) {
196
- this.userId = userId;
197
- this.userAddress = userAddress;
198
- this.userName = userName;
199
- this.userLoginType = userLoginType;
200
- this.l2Address = l2Address ?? null;
201
- }
202
- };
203
- datadogLogs.init({
204
- clientToken: DDOG_CLIENT_TOKEN,
205
- site: "datadoghq.com",
206
- forwardErrorsToLogs: false,
207
- sessionSampleRate: 100,
208
- service: "connect-sdk"
209
- });
210
- var logger = new FunLogger();
211
-
212
- export {
213
- logger
214
- };
@@ -1 +0,0 @@
1
- export declare const hideOnXsmallScreenSize: string;
@@ -1,60 +0,0 @@
1
- import React, { type ReactNode } from 'react';
2
- import type { FunCheckoutStep } from '../../modals/CheckoutModal/FunCheckoutStep';
3
- /**
4
- * Read-only per-session metadata auto-attached by {@link useTrack} to every
5
- * Statsig event emitted inside the checkout modal tree. All three fields
6
- * already exist on the state machine — this context just surfaces them:
7
- *
8
- * - `checkoutId` — `modalState.checkoutId` (client-generated UUID from
9
- * `initNewCheckout`). Joins Statsig events to
10
- * `analytics.checkouts` in Redshift.
11
- * - `step` — `modalState.step` (current `FunCheckoutStep`).
12
- * - `modalOpenedAt` — `checkoutItem.startTimestampMs`. `useTrack` derives
13
- * `time_since_modal_ms` = `Date.now() - modalOpenedAt`
14
- * at emission time.
15
- *
16
- * Outside the provider (e.g. `useTrack` called from a non-checkout surface)
17
- * every field is `null` and `useTrack` elides the attachment.
18
- */
19
- export interface CheckoutTrackingContextValue {
20
- checkoutId: string | null;
21
- step: FunCheckoutStep | null;
22
- modalOpenedAt: number | null;
23
- }
24
- interface CheckoutTrackingProviderProps extends CheckoutTrackingContextValue {
25
- children: ReactNode;
26
- }
27
- /**
28
- * Root provider. Memoizes `value` against the three primitive fields so
29
- * consumers only re-render when one of them actually changes (not on
30
- * every parent render). The three fields are already-derived state owned
31
- * by `FunCheckoutModal` / `useCheckoutModalTransition`; we surface them
32
- * here rather than duplicating storage.
33
- */
34
- export declare function CheckoutTrackingProvider({ children, checkoutId, step, modalOpenedAt, }: CheckoutTrackingProviderProps): React.JSX.Element;
35
- export declare function useCheckoutTrackingContext(): CheckoutTrackingContextValue;
36
- /**
37
- * Build the shared-metadata fields (`checkoutId`, `step`,
38
- * `time_since_modal_ms`) inline at emission sites that run *outside* this
39
- * provider and therefore can't use `useTrack`'s auto-attach.
40
- *
41
- * Those sites are:
42
- * - `FunkitCheckoutContext.initNewCheckout` — modal not mounted yet
43
- * - `FunkitCheckoutContext.confirmCheckout` — app-level, above the modal
44
- * - `useCheckoutModalTransition.{trackNextState,onBack,onCloseWrapper}` —
45
- * the hook that *produces* the provider's value; it cannot also
46
- * consume it
47
- *
48
- * Keep this as a pure helper — no hooks. The three fields mirror the
49
- * contract in {@link CheckoutTrackingContextValue}; any new auto-attached
50
- * field should be added to both in the same commit.
51
- */
52
- export declare function buildCheckoutSessionMetadata(checkoutItem: {
53
- id: string;
54
- startTimestampMs: number;
55
- }, step: FunCheckoutStep): {
56
- checkoutId: string;
57
- step: FunCheckoutStep;
58
- time_since_modal_ms: string;
59
- };
60
- export {};
@@ -1,21 +0,0 @@
1
- import type { CheckoutInitTokenTransferResponse } from '@funkit/api-base';
2
- import type { TokenTransferSourceChainsAndAssets } from '../modals/CheckoutModal/TransferToken/TransferToken';
3
- export type TransferTokenDefault = {
4
- token: string;
5
- chainId: number;
6
- };
7
- interface UseTokenChainResult {
8
- assets: TokenTransferSourceChainsAndAssets;
9
- selectedChainId: number;
10
- handleChainChange: (chainId?: number, autoUpdate?: boolean) => void;
11
- selectedToken: string;
12
- selectedChainName: string;
13
- handleTokenChange: (token: string, chainId?: number, autoUpdate?: boolean) => void;
14
- }
15
- /**
16
- * Semi reusable hook (tied into token transfer configuration)
17
- * ensures token&chain dropdown preselection logic is reusable
18
- * @param transferInit - used for chain&token solana filtering, can be omitted if not needed
19
- */
20
- export declare const useTokenAndChainSelection: (transferInit: CheckoutInitTokenTransferResponse | undefined, defaultValues?: TransferTokenDefault, isWithdrawal?: boolean) => UseTokenChainResult;
21
- export {};
@@ -1,17 +0,0 @@
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;
@@ -1,10 +0,0 @@
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 {};
@@ -1,11 +0,0 @@
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 {};
@@ -1,9 +0,0 @@
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;
@@ -1,15 +0,0 @@
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 {};
@@ -1,5 +0,0 @@
1
- export declare enum WithdrawalModalStep {
2
- ENTER_AMOUNT = "ENTER_AMOUNT",
3
- SUCCESS = "SUCCESS",
4
- PENDING_CALLBACK = "PENDING_CALLBACK"
5
- }
@@ -1,24 +0,0 @@
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 {};