@funkit/connect 9.7.2-next.1 → 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.
- package/CHANGELOG.md +74 -0
- package/dist/__generated__/default_configs.d.ts +1 -1
- package/dist/clients/chunk-LMEQD56M.js +289 -0
- package/dist/clients/fanatics.css +1 -1
- package/dist/clients/fanatics.js +55 -329
- package/dist/clients/lighter.css +4775 -4775
- package/dist/clients/lighter.d.ts +30 -34
- package/dist/clients/lighter.js +163 -69
- package/dist/components/Dropdown/BaseDropdown.d.ts +7 -21
- package/dist/components/Dropdown/BaseDropdown.utils.d.ts +23 -0
- package/dist/components/Dropdown/ChainDropdown.d.ts +2 -1
- package/dist/components/Dropdown/TokenAndChainDropdown.d.ts +9 -3
- package/dist/components/Dropdown/TokenDropdown.d.ts +7 -3
- package/dist/domains/asset.d.ts +0 -1
- package/dist/domains/quoteMode/exactOut.d.ts +2 -1
- package/dist/domains/quoteMode/resolveQuoteMode.d.ts +3 -1
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +2 -8
- package/dist/hooks/useCheckoutDirectExecution.d.ts +1 -1
- package/dist/hooks/useIsStablecoin.d.ts +2 -0
- package/dist/hooks/useTokenAndChainDropdown.d.ts +13 -7
- package/dist/hooks/useTokenTransfer.d.ts +2 -2
- package/dist/index.css +99 -99
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5682 -4822
- package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +2 -1
- package/dist/modals/CheckoutModal/TransferToken/useTransferTokenTracking.d.ts +2 -2
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +11 -1
- package/dist/modals/WithdrawalModal/useWithdrawal.d.ts +5 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +60 -2
- package/dist/providers/FunkitHistoryContext.d.ts +2 -2
- package/dist/utils/withdrawal.d.ts +6 -1
- package/dist/wallets/Wallet.d.ts +11 -0
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +52 -52
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +6 -5
- package/dist/chunk-64NZSUGQ.js +0 -368
- package/dist/chunk-B2B6HDIE.js +0 -238
- package/dist/chunk-OQNN7EMQ.js +0 -238
- package/dist/chunk-S65TG73G.js +0 -247
- package/dist/chunk-VLAOBEJN.js +0 -247
- package/dist/clients/chunk-3LSYVQXK.js +0 -289
- package/dist/clients/chunk-SBQ2UUPK.js +0 -214
- package/dist/clients/chunk-V526Q43Z.js +0 -271
- package/dist/components/Dropdown/TokenAndChainDropdown.css.d.ts +0 -1
- package/dist/hooks/track/CheckoutTrackingContext.d.ts +0 -60
- package/dist/hooks/useTokenChain.d.ts +0 -21
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeContainer.d.ts +0 -17
- package/dist/modals/WithdrwalModal/WithdrawalCallbackSuccess.d.ts +0 -10
- package/dist/modals/WithdrwalModal/WithdrawalContent.d.ts +0 -11
- package/dist/modals/WithdrwalModal/WithdrawalModal.d.ts +0 -9
- package/dist/modals/WithdrwalModal/WithdrawalSuccess.d.ts +0 -15
- package/dist/modals/WithdrwalModal/types.d.ts +0 -5
- package/dist/modals/WithdrwalModal/useWithdrawal.d.ts +0 -24
- package/dist/wallets/walletConnectors/chunk-34HACM5U.js +0 -110
- package/dist/wallets/walletConnectors/chunk-4C7ER452.js +0 -93
- package/dist/wallets/walletConnectors/chunk-53VYSPXK.js +0 -66
- package/dist/wallets/walletConnectors/chunk-5TN5Z2WY.js +0 -87
- package/dist/wallets/walletConnectors/chunk-6DRCY52E.js +0 -69
- package/dist/wallets/walletConnectors/chunk-6UCI7GM6.js +0 -98
- package/dist/wallets/walletConnectors/chunk-6YO27XOM.js +0 -96
- package/dist/wallets/walletConnectors/chunk-7OARWILZ.js +0 -92
- package/dist/wallets/walletConnectors/chunk-7V33VJAL.js +0 -218
- package/dist/wallets/walletConnectors/chunk-APHCF4DT.js +0 -103
- package/dist/wallets/walletConnectors/chunk-CJJT7LMT.js +0 -96
- package/dist/wallets/walletConnectors/chunk-DEFRRPXB.js +0 -98
- package/dist/wallets/walletConnectors/chunk-EKJHJFRN.js +0 -69
- package/dist/wallets/walletConnectors/chunk-FG2LDVXL.js +0 -92
- package/dist/wallets/walletConnectors/chunk-GH4M6FTK.js +0 -95
- package/dist/wallets/walletConnectors/chunk-GSHSWVEG.js +0 -70
- package/dist/wallets/walletConnectors/chunk-GVOQTORD.js +0 -87
- package/dist/wallets/walletConnectors/chunk-HETS3KKI.js +0 -218
- package/dist/wallets/walletConnectors/chunk-HOPH3TQ3.js +0 -99
- package/dist/wallets/walletConnectors/chunk-HRDPUW3V.js +0 -94
- package/dist/wallets/walletConnectors/chunk-HXWUH73P.js +0 -93
- package/dist/wallets/walletConnectors/chunk-IICWJWGZ.js +0 -110
- package/dist/wallets/walletConnectors/chunk-KO56HCTI.js +0 -106
- package/dist/wallets/walletConnectors/chunk-KWX2SYU2.js +0 -100
- package/dist/wallets/walletConnectors/chunk-LCIPVVH5.js +0 -70
- package/dist/wallets/walletConnectors/chunk-LI6QY2B5.js +0 -94
- package/dist/wallets/walletConnectors/chunk-PKMAPNN6.js +0 -92
- package/dist/wallets/walletConnectors/chunk-T4ROGPMF.js +0 -106
- package/dist/wallets/walletConnectors/chunk-TTHM3WUR.js +0 -100
- package/dist/wallets/walletConnectors/chunk-UDTBQV4Q.js +0 -96
- package/dist/wallets/walletConnectors/chunk-V6UOWTEZ.js +0 -95
- package/dist/wallets/walletConnectors/chunk-VJZWNQOF.js +0 -92
- package/dist/wallets/walletConnectors/chunk-XBLHZICW.js +0 -103
- package/dist/wallets/walletConnectors/chunk-XVBSJCW5.js +0 -96
- package/dist/wallets/walletConnectors/chunk-YIEASHLS.js +0 -99
- package/dist/wallets/walletConnectors/chunk-ZPSPK6LH.js +0 -66
|
@@ -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,271 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/domains/paymentMethods.ts
|
|
4
|
-
import { exhaustiveCheck, formatAddress } from "@funkit/utils";
|
|
5
|
-
|
|
6
|
-
// src/consts/bluvo.tsx
|
|
7
|
-
import { ETHEREAL_API_KEY } from "@funkit/api-base";
|
|
8
|
-
import React6 from "react";
|
|
9
|
-
|
|
10
|
-
// src/components/Icons/BinanceIcon.tsx
|
|
11
|
-
import React from "react";
|
|
12
|
-
var BinanceIcon = ({ size = 24 }) => {
|
|
13
|
-
return /* @__PURE__ */ React.createElement(
|
|
14
|
-
"svg",
|
|
15
|
-
{
|
|
16
|
-
width: size,
|
|
17
|
-
height: size,
|
|
18
|
-
viewBox: "0 0 20 20",
|
|
19
|
-
fill: "none",
|
|
20
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
21
|
-
},
|
|
22
|
-
/* @__PURE__ */ React.createElement("rect", { width: "20", height: "20", rx: "4", fill: "#F3BA2F" }),
|
|
23
|
-
/* @__PURE__ */ React.createElement(
|
|
24
|
-
"path",
|
|
25
|
-
{
|
|
26
|
-
d: "M7.67 9.04 10 6.71l2.33 2.34 1.36-1.36L10 4 6.31 7.69zM4 10l1.36-1.36L6.7 10l-1.35 1.36zm3.67.96L10 13.29l2.33-2.33 1.36 1.35-3.69 3.7-3.69-3.7zm5.62-.96 1.35-1.35L16 10l-1.36 1.36z",
|
|
27
|
-
fill: "#fff"
|
|
28
|
-
}
|
|
29
|
-
),
|
|
30
|
-
/* @__PURE__ */ React.createElement(
|
|
31
|
-
"path",
|
|
32
|
-
{
|
|
33
|
-
d: "M11.38 10 10 8.62 8.98 9.64l-.11.12-.25.24L10 11.38z",
|
|
34
|
-
fill: "#fff"
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// src/components/Icons/CoinbaseIcon.tsx
|
|
41
|
-
import React2 from "react";
|
|
42
|
-
var CoinbaseIcon = ({ size = 24 }) => {
|
|
43
|
-
return /* @__PURE__ */ React2.createElement(
|
|
44
|
-
"svg",
|
|
45
|
-
{
|
|
46
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
-
width: size,
|
|
48
|
-
height: size,
|
|
49
|
-
viewBox: "0 0 20 20",
|
|
50
|
-
fill: "none"
|
|
51
|
-
},
|
|
52
|
-
/* @__PURE__ */ React2.createElement("rect", { width: "20", height: "20", rx: "4", fill: "#2C5FF6" }),
|
|
53
|
-
/* @__PURE__ */ React2.createElement(
|
|
54
|
-
"path",
|
|
55
|
-
{
|
|
56
|
-
d: "M9.99 13.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5c1.76 0 3.22 1.305 3.46 3h3.52A7.005 7.005 0 0 0 9.99 3c-3.86 0-7 3.14-7 7s3.14 7 7 7c3.69 0 6.725-2.87 6.98-6.5h-3.52c-.24 1.695-1.7 3-3.46 3Z",
|
|
57
|
-
fill: "#fff"
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// src/components/Icons/GateIoIcon.tsx
|
|
64
|
-
import React3 from "react";
|
|
65
|
-
var GateIoIcon = ({ size = 24 }) => {
|
|
66
|
-
return /* @__PURE__ */ React3.createElement(
|
|
67
|
-
"svg",
|
|
68
|
-
{
|
|
69
|
-
width: size,
|
|
70
|
-
height: size,
|
|
71
|
-
viewBox: "0 0 25 25",
|
|
72
|
-
fill: "none",
|
|
73
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
74
|
-
},
|
|
75
|
-
/* @__PURE__ */ React3.createElement("rect", { width: "25", height: "25", rx: "5.357", fill: "#fff" }),
|
|
76
|
-
/* @__PURE__ */ React3.createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ React3.createElement(
|
|
77
|
-
"mask",
|
|
78
|
-
{
|
|
79
|
-
id: "b",
|
|
80
|
-
maskUnits: "userSpaceOnUse",
|
|
81
|
-
x: "5",
|
|
82
|
-
y: "5",
|
|
83
|
-
width: "15",
|
|
84
|
-
height: "15",
|
|
85
|
-
style: { maskType: "luminance" }
|
|
86
|
-
},
|
|
87
|
-
/* @__PURE__ */ React3.createElement("path", { d: "M5 5h15v15H5V5Z", fill: "#fff" })
|
|
88
|
-
), /* @__PURE__ */ React3.createElement("g", { mask: "url(#b)" }, /* @__PURE__ */ React3.createElement(
|
|
89
|
-
"path",
|
|
90
|
-
{
|
|
91
|
-
fillRule: "evenodd",
|
|
92
|
-
clipRule: "evenodd",
|
|
93
|
-
d: "M12.5 16.625a4.125 4.125 0 0 1 0-8.25V5a7.5 7.5 0 1 0 7.5 7.5h-3.375a4.125 4.125 0 0 1-4.125 4.125Z",
|
|
94
|
-
fill: "#2354E6"
|
|
95
|
-
}
|
|
96
|
-
)), /* @__PURE__ */ React3.createElement(
|
|
97
|
-
"path",
|
|
98
|
-
{
|
|
99
|
-
fillRule: "evenodd",
|
|
100
|
-
clipRule: "evenodd",
|
|
101
|
-
d: "M12.5 12.5h4.125V8.375H12.5V12.5Z",
|
|
102
|
-
fill: "#17E6A1"
|
|
103
|
-
}
|
|
104
|
-
)),
|
|
105
|
-
/* @__PURE__ */ React3.createElement("defs", null, /* @__PURE__ */ React3.createElement("clipPath", { id: "a" }, /* @__PURE__ */ React3.createElement("path", { fill: "#fff", transform: "translate(5 5)", d: "M0 0h15v15H0z" })))
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// src/components/Icons/GeminiIcon.tsx
|
|
110
|
-
import React4 from "react";
|
|
111
|
-
var GeminiIcon = ({ size = 24 }) => {
|
|
112
|
-
return /* @__PURE__ */ React4.createElement(
|
|
113
|
-
"svg",
|
|
114
|
-
{
|
|
115
|
-
width: size,
|
|
116
|
-
height: size,
|
|
117
|
-
viewBox: "0 0 20 20",
|
|
118
|
-
fill: "none",
|
|
119
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
120
|
-
},
|
|
121
|
-
/* @__PURE__ */ React4.createElement(
|
|
122
|
-
"path",
|
|
123
|
-
{
|
|
124
|
-
d: "M16 0H4a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V4a4 4 0 0 0-4-4",
|
|
125
|
-
fill: "#58C8E6"
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
/* @__PURE__ */ React4.createElement(
|
|
129
|
-
"path",
|
|
130
|
-
{
|
|
131
|
-
d: "M15.025 7.686H8.661a3.21 3.21 0 0 1 3.182-2.746 3.21 3.21 0 0 1 3.182 2.746m-3.653.94v2.746H8.626V8.626zm-.035 3.686a3.21 3.21 0 0 1-3.182 2.746 3.21 3.21 0 0 1-3.183-2.746zm-6.365-.94A3.23 3.23 0 0 1 7.686 8.66v2.71zm10.053-2.746a3.23 3.23 0 0 1-2.711 2.71v-2.71zM11.843 4C9.734 4 7.937 5.624 7.712 7.712A4.18 4.18 0 0 0 4 11.843 4.16 4.16 0 0 0 8.157 16c2.109 0 3.909-1.624 4.131-3.712C14.376 12.063 16 10.266 16 8.157A4.16 4.16 0 0 0 11.843 4",
|
|
132
|
-
fill: "#fff"
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
// src/components/Icons/KrakenIcon.tsx
|
|
139
|
-
import React5 from "react";
|
|
140
|
-
var KrakenIcon = ({ size = 24 }) => {
|
|
141
|
-
return /* @__PURE__ */ React5.createElement(
|
|
142
|
-
"svg",
|
|
143
|
-
{
|
|
144
|
-
width: size,
|
|
145
|
-
height: size,
|
|
146
|
-
viewBox: "0 0 20 20",
|
|
147
|
-
fill: "none",
|
|
148
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
149
|
-
},
|
|
150
|
-
/* @__PURE__ */ React5.createElement(
|
|
151
|
-
"path",
|
|
152
|
-
{
|
|
153
|
-
d: "M16 0H4a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V4a4 4 0 0 0-4-4",
|
|
154
|
-
fill: "#5741D9"
|
|
155
|
-
}
|
|
156
|
-
),
|
|
157
|
-
/* @__PURE__ */ React5.createElement(
|
|
158
|
-
"path",
|
|
159
|
-
{
|
|
160
|
-
d: "M4 11.78v-.67a6.4 6.4 0 0 1 .83-3.26 6 6 0 0 1 2.64-2.3A6 6 0 0 1 9.89 5q1.84-.02 3.4.96a5.6 5.6 0 0 1 2.64 4.18q.1.9.07 1.82l-.01.98q0 .22-.05.43c-.15.54-.8.8-1.27.49a.8.8 0 0 1-.35-.57l-.04-.48v-1.98q0-.4-.26-.68a.83.83 0 0 0-1.17-.04 1 1 0 0 0-.32.65v.28l-.01 2.19c0 .41-.33.73-.76.76a1 1 0 0 1-.56-.17.8.8 0 0 1-.3-.48l-.03-.33v-2.2a1 1 0 0 0-.26-.65.84.84 0 0 0-1.25.02 1 1 0 0 0-.24.64V13q0 .28-.1.54a1 1 0 0 1-.32.34.8.8 0 0 1-1.17-.4 1 1 0 0 1-.07-.38V11q.01-.24-.05-.47a.9.9 0 0 0-.72-.62c-.37-.06-.65.11-.85.4q-.14.22-.14.46v2q.02.3-.04.59a.84.84 0 0 1-.87.63.9.9 0 0 1-.74-.63A1 1 0 0 1 4 13z",
|
|
161
|
-
fill: "#fff"
|
|
162
|
-
}
|
|
163
|
-
)
|
|
164
|
-
);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// src/consts/bluvo.tsx
|
|
168
|
-
var BLUVO_MIN_DEPOSIT_BY_CUSTOMER = {
|
|
169
|
-
[ETHEREAL_API_KEY]: 15
|
|
170
|
-
};
|
|
171
|
-
var BLUVO_EXCHANGES = {
|
|
172
|
-
coinbase: {
|
|
173
|
-
icon: (size) => /* @__PURE__ */ React6.createElement(CoinbaseIcon, { size }),
|
|
174
|
-
name: "Coinbase"
|
|
175
|
-
},
|
|
176
|
-
binance: {
|
|
177
|
-
icon: (size) => /* @__PURE__ */ React6.createElement(BinanceIcon, { size }),
|
|
178
|
-
name: "Binance"
|
|
179
|
-
},
|
|
180
|
-
gemini: {
|
|
181
|
-
icon: (size) => /* @__PURE__ */ React6.createElement(GeminiIcon, { size }),
|
|
182
|
-
name: "Gemini"
|
|
183
|
-
},
|
|
184
|
-
kraken: {
|
|
185
|
-
icon: (size) => /* @__PURE__ */ React6.createElement(KrakenIcon, { size }),
|
|
186
|
-
name: "Kraken"
|
|
187
|
-
},
|
|
188
|
-
gate: {
|
|
189
|
-
icon: (size) => /* @__PURE__ */ React6.createElement(GateIoIcon, { size }),
|
|
190
|
-
name: "Gate"
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
function getExchangeName(brokerType) {
|
|
194
|
-
return BLUVO_EXCHANGES[brokerType].name;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// src/domains/paymentMethods.ts
|
|
198
|
-
function createPaymentMethodInfo(params) {
|
|
199
|
-
switch (params.paymentMethod) {
|
|
200
|
-
case "card" /* CARD */:
|
|
201
|
-
return {
|
|
202
|
-
paymentMethod: "card" /* CARD */,
|
|
203
|
-
title: params.titleCustomization,
|
|
204
|
-
description: ""
|
|
205
|
-
};
|
|
206
|
-
case "balance" /* ACCOUNT_BALANCE */:
|
|
207
|
-
return {
|
|
208
|
-
paymentMethod: "balance" /* ACCOUNT_BALANCE */,
|
|
209
|
-
title: "Your Wallet",
|
|
210
|
-
description: formatAddress(params.walletAddress || "")
|
|
211
|
-
};
|
|
212
|
-
case "brokerage" /* BROKERAGE */:
|
|
213
|
-
return {
|
|
214
|
-
paymentMethod: "brokerage" /* BROKERAGE */,
|
|
215
|
-
title: getExchangeName(params.exchange),
|
|
216
|
-
description: "",
|
|
217
|
-
deviceId: params.deviceId,
|
|
218
|
-
exchange: params.exchange
|
|
219
|
-
};
|
|
220
|
-
case "token_transfer" /* TOKEN_TRANSFER */:
|
|
221
|
-
return {
|
|
222
|
-
// this is an arbitrary value for Polymarket.
|
|
223
|
-
paymentMethod: "token_transfer" /* TOKEN_TRANSFER */,
|
|
224
|
-
title: "QR Code Transfer",
|
|
225
|
-
description: ""
|
|
226
|
-
};
|
|
227
|
-
case "virtual_bank" /* VIRTUAL_BANK */:
|
|
228
|
-
return {
|
|
229
|
-
paymentMethod: "virtual_bank" /* VIRTUAL_BANK */,
|
|
230
|
-
title: "Fiat Account",
|
|
231
|
-
description: "",
|
|
232
|
-
matchingFiatAccount: params.matchingFiatAccount,
|
|
233
|
-
bridgeCustomer: params.bridgeCustomer
|
|
234
|
-
};
|
|
235
|
-
default:
|
|
236
|
-
exhaustiveCheck(params);
|
|
237
|
-
return {};
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// src/domains/clientMetadata.ts
|
|
242
|
-
function generateClientMetadataForTokenTransfer() {
|
|
243
|
-
return {
|
|
244
|
-
id: "",
|
|
245
|
-
startTimestampMs: 0,
|
|
246
|
-
finalDollarValue: 0,
|
|
247
|
-
latestQuote: null,
|
|
248
|
-
depositAddress: null,
|
|
249
|
-
initSettings: {
|
|
250
|
-
config: {
|
|
251
|
-
targetAsset: "0x",
|
|
252
|
-
targetChain: "",
|
|
253
|
-
targetAssetTicker: "",
|
|
254
|
-
checkoutItemTitle: ""
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
selectedSourceAssetInfo: {
|
|
258
|
-
address: "0x",
|
|
259
|
-
symbol: "",
|
|
260
|
-
chainId: "",
|
|
261
|
-
iconSrc: null
|
|
262
|
-
},
|
|
263
|
-
selectedPaymentMethodInfo: createPaymentMethodInfo({
|
|
264
|
-
paymentMethod: "token_transfer" /* TOKEN_TRANSFER */
|
|
265
|
-
})
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
export {
|
|
270
|
-
generateClientMetadataForTokenTransfer
|
|
271
|
-
};
|
|
@@ -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,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 {};
|