@funkit/connect 9.19.0 → 9.20.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 (173) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/clients/argentWallet-2WSTOUAO.js +7 -0
  3. package/dist/clients/bifrostWallet-5NQVDZ5P.js +7 -0
  4. package/dist/clients/bitgetWallet-CBQAJOIK.js +7 -0
  5. package/dist/clients/bitskiWallet-OLIYN3IU.js +7 -0
  6. package/dist/clients/bitverseWallet-AQMAJ2NN.js +7 -0
  7. package/dist/clients/bloomWallet-MJRQJYSG.js +7 -0
  8. package/dist/clients/braveWallet-T76TVZA6.js +7 -0
  9. package/dist/clients/bybitWallet-GOPAS32Q.js +7 -0
  10. package/dist/clients/chunk-4752IYY6.js +94 -0
  11. package/dist/clients/chunk-47AQXZQE.js +230 -0
  12. package/dist/clients/chunk-CSONEKIF.js +54 -0
  13. package/dist/clients/chunk-JOM2J5WB.js +2371 -0
  14. package/dist/clients/{chunk-GSK3TMI5.js → chunk-JVTKIEOP.js} +2 -223
  15. package/dist/clients/{polymarket.js → chunk-MOUTRRN3.js} +15 -27
  16. package/dist/clients/chunk-MRBN4XCA.js +96 -0
  17. package/dist/clients/chunk-UNCVGPTD.js +186 -0
  18. package/dist/clients/chunk-UUHGOBKZ.js +51 -0
  19. package/dist/clients/clvWallet-VVMLP7BK.js +7 -0
  20. package/dist/clients/coin98Wallet-I5CP5KYZ.js +7 -0
  21. package/dist/clients/coinbaseWallet-ICYEIYQD.js +7 -0
  22. package/dist/clients/coreWallet-RFVUHOVE.js +7 -0
  23. package/dist/clients/dawnWallet-QBFTQLS4.js +7 -0
  24. package/dist/clients/desigWallet-IBKYOHSY.js +7 -0
  25. package/dist/clients/enkryptWallet-ZVUZMI7H.js +7 -0
  26. package/dist/clients/fanatics.js +42 -83
  27. package/dist/clients/foxWallet-I7D5KIW4.js +7 -0
  28. package/dist/clients/frameWallet-UDD4OVZX.js +7 -0
  29. package/dist/clients/frontierWallet-5QV7ZACT.js +7 -0
  30. package/dist/clients/gateWallet-CJNGQQCV.js +7 -0
  31. package/dist/clients/imTokenWallet-UPA7ADZ2.js +7 -0
  32. package/dist/clients/injectedWallet-OIRJSVBZ.js +7 -0
  33. package/dist/clients/kresusWallet-7ROCNWAU.js +7 -0
  34. package/dist/clients/ledgerWallet-3FCEIKPD.js +7 -0
  35. package/dist/clients/lighter.js +10 -180
  36. package/dist/clients/metaMaskWallet-RMHEKBDR.js +7 -0
  37. package/dist/clients/mewWallet-ANFGVCZT.js +7 -0
  38. package/dist/clients/oktoWallet-Q5XCEOTD.js +7 -0
  39. package/dist/clients/okxWallet-GJMKZIND.js +7 -0
  40. package/dist/clients/omniWallet-YH4FEL6J.js +7 -0
  41. package/dist/clients/oneInchWallet-4S73ZPPN.js +7 -0
  42. package/dist/clients/oneKeyWallet-YVJDPHJS.js +7 -0
  43. package/dist/clients/phantomWallet-LZDJJ5XR.js +7 -0
  44. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +17293 -0
  45. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.d.ts +30 -0
  46. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +14 -0
  47. package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +54 -0
  48. package/dist/clients/polymarket/createPolymarketDepositConfig.js +15 -0
  49. package/dist/clients/polymarket/index.css +17293 -0
  50. package/dist/clients/polymarket/index.d.ts +8 -0
  51. package/dist/clients/polymarket/index.js +42 -0
  52. package/dist/clients/{polymarket.d.ts → polymarket/polymarket.d.ts} +59 -2
  53. package/dist/clients/polymarket/polymarket.js +24 -0
  54. package/dist/clients/polymarket/usePolymarketAccountBalances.d.ts +66 -0
  55. package/dist/clients/polymarket/usePolymarketAccountBalances.js +12 -0
  56. package/dist/clients/rabbyWallet-TYX2JDHU.js +7 -0
  57. package/dist/clients/rainbowWallet-MFJQCICF.js +7 -0
  58. package/dist/clients/ramperWallet-Q2XAH4WA.js +7 -0
  59. package/dist/clients/rolly.d.ts +2 -0
  60. package/dist/clients/rolly.js +6 -2
  61. package/dist/clients/roninWallet-SAB5ESVK.js +7 -0
  62. package/dist/clients/safeWallet-Y3VPODK2.js +7 -0
  63. package/dist/clients/safeheronWallet-MCFXLKO5.js +7 -0
  64. package/dist/clients/safepalWallet-7YULGM2L.js +7 -0
  65. package/dist/clients/subWallet-5WUZ4IIO.js +7 -0
  66. package/dist/clients/tahoWallet-U2VWWO76.js +7 -0
  67. package/dist/clients/talismanWallet-ZYTPIANG.js +7 -0
  68. package/dist/clients/tokenPocketWallet-FLFG3JUQ.js +7 -0
  69. package/dist/clients/tokenaryWallet-S3JS2IGK.js +7 -0
  70. package/dist/clients/trustWallet-2N5TZJGC.js +7 -0
  71. package/dist/clients/uniswapWallet-NJQBP5VM.js +7 -0
  72. package/dist/clients/walletConnectWallet-E4OQJ4DC.js +7 -0
  73. package/dist/clients/xdefiWallet-ZKBEFEOH.js +7 -0
  74. package/dist/clients/zealWallet-7VO3C4PM.js +7 -0
  75. package/dist/clients/zerionWallet-SEPREHKH.js +7 -0
  76. package/dist/components/Dropdown/AccountSelectDropdown.d.ts +45 -0
  77. package/dist/components/Dropdown/BaseDropdownItem.d.ts +3 -1
  78. package/dist/components/FreeUsdcBanner/FreeUsdcBanner.css.d.ts +15 -0
  79. package/dist/components/FreeUsdcBanner/FreeUsdcBanner.d.ts +5 -5
  80. package/dist/components/ModalHeightAnimationLayer/ModalHeightAnimationLayer.d.ts +8 -0
  81. package/dist/consts/customers.d.ts +13 -0
  82. package/dist/consts/funkit.d.ts +2 -0
  83. package/dist/consts/polymarket.d.ts +9 -0
  84. package/dist/domains/aave.d.ts +28 -0
  85. package/dist/domains/dynamicRouting.d.ts +13 -1
  86. package/dist/domains/paymentMethods.d.ts +8 -0
  87. package/dist/domains/quote.d.ts +2 -2
  88. package/dist/hooks/statsig/useDynamicConfig.d.ts +2 -5
  89. package/dist/hooks/statsig/useExperiment.d.ts +1 -33
  90. package/dist/hooks/statsig/useFeatureGate.d.ts +1 -4
  91. package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
  92. package/dist/hooks/useCheckoutTransferInit.d.ts +2 -17
  93. package/dist/hooks/useExchangeOptions.d.ts +11 -2
  94. package/dist/hooks/useTokenAndChainDropdown.d.ts +1 -1
  95. package/dist/hooks/useTokenTransfer.d.ts +3 -8
  96. package/dist/hooks/useUDAParams.d.ts +2 -10
  97. package/dist/index.css +1331 -94
  98. package/dist/index.js +4965 -5413
  99. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +2 -1
  100. package/dist/modals/CheckoutModal/InputAmount/QuickOptions.d.ts +1 -0
  101. package/dist/modals/CheckoutModal/InputAmount/aaveClient.d.ts +3 -7
  102. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +25 -1
  103. package/dist/modals/CheckoutModal/InputAmount/useAaveNativeSupply.d.ts +2 -19
  104. package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +17 -0
  105. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +1 -1
  106. package/dist/modals/CheckoutModal/SourceChange/useSourceChangeLayout.d.ts +10 -0
  107. package/dist/modals/CheckoutModal/stepTransition.d.ts +27 -1
  108. package/dist/modals/PolymarketPerpsTransfer/DirectionSwapButton.d.ts +17 -0
  109. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferBottomBar.d.ts +11 -0
  110. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferRows.d.ts +10 -0
  111. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferStep.d.ts +11 -0
  112. package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +52 -0
  113. package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +34 -0
  114. package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.css.d.ts +13 -0
  115. package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.d.ts +27 -0
  116. package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +66 -0
  117. package/dist/providers/FunkitCheckoutContext/index.d.ts +10 -1
  118. package/dist/providers/FunkitCheckoutContext/types.d.ts +63 -3
  119. package/dist/providers/FunkitConfigContext.d.ts +13 -2
  120. package/dist/providers/FunkitQuoteContext.d.ts +16 -0
  121. package/dist/providers/SwappedProvider.d.ts +1 -1
  122. package/dist/transports/iframeSwappedTransport.d.ts +1 -1
  123. package/dist/utils/consts.d.ts +1 -2
  124. package/dist/utils/datadogBrowserLogsTransport.d.ts +1 -1
  125. package/dist/utils/freeUsdcBanner.d.ts +3 -0
  126. package/dist/utils/funLogger.d.ts +1 -51
  127. package/dist/utils/statsig/checkFeatureGate.d.ts +1 -1
  128. package/dist/utils/swapped.d.ts +2 -2
  129. package/dist/utils/tokenMath.d.ts +6 -0
  130. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  131. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  132. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  133. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  134. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  135. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  136. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  137. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  138. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  139. package/dist/wallets/walletConnectors/index.js +48 -48
  140. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  141. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  142. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  143. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  144. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  145. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  146. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  147. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  148. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  149. package/package.json +8 -7
  150. package/dist/__generated__/default_configs.d.ts +0 -901
  151. package/dist/__generated__/default_feature_gates.d.ts +0 -20
  152. package/dist/clients/chunk-3QHYYLVM.js +0 -240
  153. package/dist/interfaces/logTransport.d.ts +0 -51
  154. package/dist/interfaces/swapped-transport.d.ts +0 -78
  155. package/dist/utils/flags/resolver.d.ts +0 -34
  156. package/dist/wallets/walletConnectors/{chunk-RB3HR4R2.js → chunk-4NV5BYRP.js} +3 -3
  157. package/dist/wallets/walletConnectors/{chunk-YEZM4CK4.js → chunk-AVDUNQUW.js} +3 -3
  158. package/dist/wallets/walletConnectors/{chunk-MIQTHJ6X.js → chunk-GUQM4QSL.js} +3 -3
  159. package/dist/wallets/walletConnectors/{chunk-4T6ZSRJF.js → chunk-IULPZP2Q.js} +3 -3
  160. package/dist/wallets/walletConnectors/{chunk-HNRB7KJU.js → chunk-JPN6TWIT.js} +3 -3
  161. package/dist/wallets/walletConnectors/{chunk-ZNX4EMPB.js → chunk-KCRO2AGO.js} +3 -3
  162. package/dist/wallets/walletConnectors/{chunk-STVVP43G.js → chunk-KI5Y2BBF.js} +3 -3
  163. package/dist/wallets/walletConnectors/{chunk-X6CGV36L.js → chunk-NR2OGDHQ.js} +3 -3
  164. package/dist/wallets/walletConnectors/{chunk-UK7C2JXW.js → chunk-OEEGYENV.js} +3 -3
  165. package/dist/wallets/walletConnectors/{chunk-F5XEEVG6.js → chunk-OX37G4YT.js} +3 -3
  166. package/dist/wallets/walletConnectors/{chunk-RVOY537T.js → chunk-SWFF3TWJ.js} +3 -3
  167. package/dist/wallets/walletConnectors/{chunk-CPI4TD43.js → chunk-TKB2OY6G.js} +3 -3
  168. package/dist/wallets/walletConnectors/{chunk-2VP2F6EK.js → chunk-W2LCLDPX.js} +3 -3
  169. package/dist/wallets/walletConnectors/{chunk-6BW3HLBG.js → chunk-WAHGI5L7.js} +3 -3
  170. package/dist/wallets/walletConnectors/{chunk-HTHAK6XB.js → chunk-WKNQMP4A.js} +3 -3
  171. package/dist/wallets/walletConnectors/{chunk-VTM6EECM.js → chunk-XCNHV3HS.js} +3 -3
  172. package/dist/wallets/walletConnectors/{chunk-CCQV2ZET.js → chunk-YO2K4MBH.js} +3 -3
  173. package/dist/wallets/walletConnectors/{chunk-VAPGUPHO.js → chunk-YQFGVZGR.js} +3 -3
@@ -1,20 +0,0 @@
1
- declare const _default: {
2
- readonly 'compliance-review-blocker': false;
3
- readonly 'enable-across-wallet-flow': false;
4
- readonly 'enable-add-token-to-wallet': false;
5
- readonly 'enable-checkout-success-screen-background': false;
6
- readonly 'enable-empty-withdrawal-selection': false;
7
- readonly 'enable-free-usdc-banner': false;
8
- readonly 'enable-permit-toggle': false;
9
- readonly 'enable-polymarket-wallet-withdrawal': false;
10
- readonly 'enable-swapped-exchanges': false;
11
- readonly 'exact-in': false;
12
- readonly 'faster-notifications': false;
13
- readonly 'new-token-transfer-config': false;
14
- readonly 'new-withdrawal-config': false;
15
- readonly 'saved-card-defaults-to-fiat-tab': false;
16
- readonly 'test-feature-gate': false;
17
- readonly 'wallet-flow-enable-exact-input-with-actions': false;
18
- readonly 'you-receive-remove-swap-impact': false;
19
- };
20
- export default _default;
@@ -1,240 +0,0 @@
1
- "use client";
2
-
3
- // src/utils/funLogger.ts
4
- import { DEV_API_KEY } from "@funkit/api-base";
5
-
6
- // src/utils/datadogBrowserLogsTransport.ts
7
- import { datadogLogs } from "@datadog/browser-logs";
8
- var DDOG_CLIENT_TOKEN = "pub4f86c6be8c792cb48dc156a8c17d9a47";
9
- var DatadogBrowserLogsTransport = class {
10
- constructor() {
11
- datadogLogs.init({
12
- clientToken: DDOG_CLIENT_TOKEN,
13
- site: "datadoghq.com",
14
- forwardErrorsToLogs: false,
15
- sessionSampleRate: 100,
16
- service: "connect-sdk"
17
- });
18
- }
19
- setEnv(environment) {
20
- datadogLogs.setGlobalContextProperty("env", environment);
21
- }
22
- setTrackingConsent(consent) {
23
- datadogLogs.setTrackingConsent(consent);
24
- }
25
- log({ level, title, context, error }) {
26
- if (typeof window === "undefined") {
27
- return;
28
- }
29
- switch (level) {
30
- case "info":
31
- datadogLogs.logger.info(title, context);
32
- break;
33
- case "debug":
34
- datadogLogs.logger.debug(title, context);
35
- break;
36
- case "warn":
37
- datadogLogs.logger.warn(title, context);
38
- break;
39
- case "error":
40
- datadogLogs.logger.error(title, context, error);
41
- break;
42
- }
43
- }
44
- };
45
-
46
- // src/utils/funLogger.ts
47
- var FUN_DEV_API_KEYS = [
48
- "hnHevQR0y394nBprGrvNx4HgoZHUwMet5mXTOBhf",
49
- "MYny3w7xJh6PRlRgkJ9604sHouY2MTke6lCPpSHq",
50
- DEV_API_KEY
51
- ];
52
- var FunLogger = class {
53
- constructor(transport) {
54
- this.transport = transport;
55
- this.transport.setEnv?.("development" /* DEVELOPMENT */);
56
- this.transport.setTrackingConsent?.("granted");
57
- this.apiKey = null;
58
- this.isDebugMode = false;
59
- this.userId = null;
60
- this.userAddress = null;
61
- this.userName = null;
62
- this.userLoginType = null;
63
- this.typeLabel = null;
64
- this.sdkVersion = null;
65
- this.l2Address = null;
66
- this.isConfigured = false;
67
- this.logQueue = [];
68
- this.disableLogging = false;
69
- }
70
- getFunLogEnv() {
71
- if (!this.apiKey || FUN_DEV_API_KEYS.includes(this.apiKey)) {
72
- return "development" /* DEVELOPMENT */;
73
- }
74
- return "production" /* PRODUCTION */;
75
- }
76
- /** Merge caller data with the logger's resolved context for the transport. */
77
- buildLogContext(data) {
78
- return {
79
- data,
80
- apiKey: this.apiKey,
81
- userId: this.userId,
82
- userName: this.userName,
83
- userAddress: this.userAddress,
84
- userLoginType: this.userLoginType,
85
- typeLabel: this.typeLabel,
86
- sdkVersion: this.sdkVersion
87
- };
88
- }
89
- processLog(level, title, data, error) {
90
- if (!this.isConfigured) {
91
- this.logQueue.push({ level, title, data, error });
92
- return;
93
- }
94
- if (!this.apiKey) {
95
- console.error(
96
- "FunLogger: apiKey is not set. Please call configure() with a valid apiKey."
97
- );
98
- return;
99
- }
100
- const isProd = this.getFunLogEnv() === "production" /* PRODUCTION */;
101
- if (isProd) {
102
- this.transport.log({
103
- level,
104
- title,
105
- context: this.buildLogContext(data),
106
- error
107
- });
108
- }
109
- if (!isProd || this.isDebugMode) {
110
- const formattedData = data || "";
111
- switch (level) {
112
- case "debug":
113
- console.debug(title, formattedData);
114
- break;
115
- case "info":
116
- console.log(title, formattedData);
117
- break;
118
- case "warn":
119
- console.warn(title, formattedData);
120
- break;
121
- case "error":
122
- console.error(title, formattedData, error);
123
- break;
124
- }
125
- }
126
- }
127
- onDebug({ title, data }) {
128
- this.processLog("debug", title, data);
129
- }
130
- onInfo({ title, data }) {
131
- this.processLog("info", title, data);
132
- }
133
- onWarn({ title, data }) {
134
- this.processLog("warn", title, data);
135
- }
136
- onError({ title, error, data }) {
137
- this.processLog("error", title, data, error);
138
- }
139
- extractError(error) {
140
- if (error instanceof Error) {
141
- return error;
142
- }
143
- if (typeof error === "object" && error !== null && "error" in error && error.error instanceof Error) {
144
- return error.error;
145
- }
146
- return null;
147
- }
148
- /**========================
149
- * PUBLIC LOGGER FUNCTIONS
150
- *=========================*/
151
- log(title, data) {
152
- this.onInfo({ title, data });
153
- }
154
- info(title, data) {
155
- this.onInfo({ title, data });
156
- }
157
- debug(title, data) {
158
- this.onDebug({ title, data });
159
- }
160
- warn(title, data) {
161
- this.onWarn({ title, data });
162
- }
163
- /**
164
- * @param errorOrData -
165
- * 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.
166
- * 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.
167
- */
168
- error(title, errorOrData, _data = {}) {
169
- const error = this.extractError(errorOrData) ?? void 0;
170
- const data = {
171
- ..._data,
172
- ...typeof errorOrData === "object" && errorOrData !== null ? errorOrData : {}
173
- };
174
- this.onError({ title, error, data });
175
- }
176
- flushLogQueue() {
177
- const queueCopy = [...this.logQueue];
178
- this.logQueue = [];
179
- for (const queuedLog of queueCopy) {
180
- const { level, title, data, error } = queuedLog;
181
- switch (level) {
182
- case "debug":
183
- this.onDebug({ title, data });
184
- break;
185
- case "info":
186
- this.onInfo({ title, data });
187
- break;
188
- case "warn":
189
- this.onWarn({ title, data });
190
- break;
191
- case "error":
192
- this.onError({ title, data, error });
193
- break;
194
- }
195
- }
196
- }
197
- configure(apiKey, isDebug, sdkVersion, disableLogging = false) {
198
- this.apiKey = apiKey;
199
- this.isDebugMode = isDebug;
200
- this.sdkVersion = sdkVersion;
201
- this.disableLogging = disableLogging;
202
- this.isConfigured = true;
203
- this.transport.setEnv?.(this.getFunLogEnv());
204
- this.transport.setTrackingConsent?.(
205
- this.disableLogging ? "not-granted" : "granted"
206
- );
207
- this.flushLogQueue();
208
- }
209
- getUserId() {
210
- return this.userId;
211
- }
212
- getUserAddress() {
213
- return this.userAddress;
214
- }
215
- getUserName() {
216
- return this.userName;
217
- }
218
- getUserLoginType() {
219
- return this.userLoginType;
220
- }
221
- getTypeLabel() {
222
- return this.typeLabel;
223
- }
224
- getL2Address() {
225
- return this.l2Address;
226
- }
227
- setUserInfo(userId, userAddress, userName, userLoginType, typeLabel, l2Address) {
228
- this.userId = userId;
229
- this.userAddress = userAddress;
230
- this.userName = userName;
231
- this.userLoginType = userLoginType;
232
- this.typeLabel = typeLabel;
233
- this.l2Address = l2Address ?? null;
234
- }
235
- };
236
- var logger = new FunLogger(new DatadogBrowserLogsTransport());
237
-
238
- export {
239
- logger
240
- };
@@ -1,51 +0,0 @@
1
- /** Severity levels emitted by `FunLogger`. */
2
- export type LogLevel = 'info' | 'debug' | 'warn' | 'error';
3
- /** User tracking consent, mirroring the Datadog browser SDK's values. */
4
- export type TrackingConsent = 'granted' | 'not-granted';
5
- /**
6
- * The structured context `FunLogger` assembles for every record: the caller's
7
- * data plus the logger's resolved user/session fields. Concrete (rather than
8
- * `object`) so transport implementors get property access and autocomplete.
9
- */
10
- export interface LogContext {
11
- /** Caller-supplied structured data for this log line, if any. */
12
- data?: object;
13
- apiKey: string | null;
14
- userId: string | null;
15
- userName: string | null;
16
- userAddress: string | null;
17
- userLoginType: string | null;
18
- typeLabel: string | null;
19
- sdkVersion: string | null;
20
- }
21
- /** A single fully-assembled log record handed to a transport. */
22
- export interface LogRecord {
23
- level: LogLevel;
24
- title: string;
25
- /** Assembled by `FunLogger` so transports stay dumb sinks. */
26
- context: LogContext;
27
- /** Present only for `error`-level records. */
28
- error?: Error;
29
- }
30
- /**
31
- * Platform sink for `FunLogger`. The logger (queueing, env detection, level
32
- * routing, console fallback, context tracking) is platform-agnostic; everything
33
- * platform-specific about *emitting* lives behind this interface.
34
- *
35
- * Part of the React Native split (see docs/connect-rn-architecture.md): web
36
- * implements it with `DatadogBrowserLogsTransport`, React Native will implement
37
- * it with a Datadog React Native transport (`@datadog/mobile-react-native`).
38
- * Kept free of DOM/`@datadog/browser-logs` types so it can move to
39
- * `@funkit/connect-core` untouched.
40
- */
41
- export interface LogTransport {
42
- /** Emit one record to the platform sink. */
43
- log(record: LogRecord): void;
44
- /**
45
- * Reflect the resolved environment (e.g. `'development'` | `'production'`).
46
- * Optional — sinks that don't segment by environment can omit it.
47
- */
48
- setEnv?(environment: string): void;
49
- /** Reflect user tracking consent. Optional. */
50
- setTrackingConsent?(consent: TrackingConsent): void;
51
- }
@@ -1,78 +0,0 @@
1
- import type { PaymentGroupType } from '@funkit/api-base';
2
- import type { SwappedTheme } from '../utils/swapped';
3
- /**
4
- * Typed contract for the message bridge between the SDK and the embedded
5
- * Swapped flow. On web this is bridged over an `<iframe>` + `window.postMessage`
6
- * (see {@link createIframeSwappedTransport}); React Native will bridge the same
7
- * messages over a `WebView`. Freezing the event catalog here lets both
8
- * platforms share the `SwappedProvider` state machine and turns any drift in
9
- * the message shapes into a compile-time error.
10
- *
11
- * Reference: the inbound switch in `SwappedIframeController` and the sends in
12
- * `SwappedProvider`.
13
- *
14
- * This module is platform-agnostic and is slated to move to
15
- * `@funkit/connect-core/interfaces/` during the RN extraction.
16
- */
17
- /**
18
- * Navigation steps reported by the Swapped embed. Open-ended — the embed may
19
- * emit steps we don't enumerate, which fall through to the default handler.
20
- */
21
- export type SwappedStep = 'EMPTY' | 'KYC_ADDRESS' | 'KYC_AWAITING_IDENTITY' | 'KYC_IDENTITY' | 'KYC_PERSONAL' | 'KYC_SUMSUB' | 'LOGIN_EMAIL' | 'LOGIN_EMAIL_VERIFICATION' | 'PAYMENT' | 'ORDER_CONFIRMATION' | (string & {});
22
- /**
23
- * Opaque payloads — the SDK never introspects these, it only forwards them to
24
- * analytics via `JSON.stringify`. Typed as `unknown` so callers must stringify
25
- * rather than read fields.
26
- */
27
- export type SwappedErrorPayload = unknown;
28
- export type SwappedTxPayload = unknown;
29
- /** embed → parent */
30
- export type SwappedInboundMessage = {
31
- type: 'SWAPPED_READY';
32
- } | {
33
- type: 'SWAPPED_GO_BACK';
34
- } | {
35
- type: 'SWAPPED_CLOSE';
36
- } | {
37
- type: 'SWAPPED_NEW_DEPOSIT';
38
- } | {
39
- type: 'SWAPPED_ERROR';
40
- data?: SwappedErrorPayload;
41
- } | {
42
- type: 'SWAPPED_NAVIGATION';
43
- data?: {
44
- step?: SwappedStep;
45
- };
46
- } | {
47
- type: 'SWAPPED_ORDER_DATA';
48
- data?: unknown;
49
- } | {
50
- type: 'SWAPPED_TRANSACTION_SUCCESSFUL';
51
- data?: SwappedTxPayload;
52
- } | {
53
- type: 'SWAPPED_LOGOUT';
54
- };
55
- /** parent → embed */
56
- export type SwappedOutboundMessage = {
57
- type: 'SWAPPED_METHOD';
58
- method: PaymentGroupType;
59
- } | {
60
- type: 'SWAPPED_THEME';
61
- data: SwappedTheme;
62
- } | {
63
- type: 'SWAPPED_FOCUS';
64
- };
65
- export interface SwappedTransport {
66
- /**
67
- * Send a message to the embed. Returns `true` if the message was dispatched,
68
- * `false` if the embed isn't reachable yet (so callers can mirror today's
69
- * behavior of logging only on a successful send).
70
- */
71
- send(msg: SwappedOutboundMessage): boolean;
72
- /**
73
- * Subscribe to messages from the embed. The handler is only invoked for
74
- * messages whose origin has already been validated by the transport. Returns
75
- * an unsubscribe function.
76
- */
77
- onMessage(handler: (msg: SwappedInboundMessage) => void): () => void;
78
- }
@@ -1,34 +0,0 @@
1
- type BaseCondition = {
2
- type: 'country';
3
- countryCodes: string[];
4
- };
5
- type Condition = BaseCondition | {
6
- type: 'all';
7
- conditions: Condition[];
8
- } | {
9
- type: 'any';
10
- conditions: Condition[];
11
- };
12
- interface Variant<T> {
13
- condition?: Condition;
14
- value: T;
15
- }
16
- interface VariantConfig<T> {
17
- variants: Variant<T>[];
18
- value: T;
19
- }
20
- interface EvaluationContext {
21
- countryCode?: string;
22
- }
23
- /**
24
- * Type guard to check if a value is a VariantConfig
25
- * (used to distinguish from simple static configs)
26
- */
27
- export declare function isVariantConfig<T>(value: unknown): value is VariantConfig<T>;
28
- /**
29
- * Resolves the appropriate value from a VariantConfig based on runtime context.
30
- * Evaluates variants in order and returns the first matching variant's value.
31
- * Falls back to default value if no variants match.
32
- */
33
- export declare function resolveValue<T>(config: VariantConfig<T>, ctx: EvaluationContext): T;
34
- export {};
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/coreWallet/coreWallet.ts
11
11
  var coreWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/frontierWallet/frontierWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/foxWallet/foxWallet.ts
11
11
  var foxWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/bifrostWallet/bifrostWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/gateWallet/gateWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/trustWallet/trustWallet.ts
11
11
  import { isMobile } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/okxWallet/okxWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/subWallet/subWallet.ts
11
11
  var subWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/clvWallet/clvWallet.ts
11
11
  var clvWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/bybitWallet/bybitWallet.ts
11
11
  var bybitWallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/zerionWallet/zerionWallet.ts
11
11
  import { isIOS } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/bitgetWallet/bitgetWallet.ts
11
11
  import { isAndroid } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/rainbowWallet/rainbowWallet.ts
11
11
  import { isAndroid, isIOS } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/coin98Wallet/coin98Wallet.ts
11
11
  var coin98Wallet = ({
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.ts
11
11
  import { isMobile } from "@funkit/utils";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
+ import {
3
+ getWalletConnectConnector
4
+ } from "./chunk-N4IJLYFY.js";
2
5
  import {
3
6
  getInjectedConnector,
4
7
  hasInjectedProvider
5
8
  } from "./chunk-OLZ7626J.js";
6
- import {
7
- getWalletConnectConnector
8
- } from "./chunk-N4IJLYFY.js";
9
9
 
10
10
  // src/wallets/walletConnectors/safepalWallet/safepalWallet.ts
11
11
  var safepalWallet = ({