@funkit/connect 11.7.0 → 12.0.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 +40 -0
- package/dist/{chunk-67BKQQNG.js → chunk-2RND3WWH.js} +1 -1
- package/dist/{chunk-L67HP4HQ.js → chunk-53FF4ZHH.js} +1 -1
- package/dist/{chunk-4YEAUICE.js → chunk-DH3DS4FX.js} +1 -0
- package/dist/clients/chunk-27VBRE7W.js +4907 -0
- package/dist/clients/{chunk-44USAVWK.js → chunk-37Q6DUR7.js} +2 -2
- package/dist/clients/chunk-3DHSLLCU.js +331 -0
- package/dist/clients/{chunk-I4B5AKZC.js → chunk-3J2GOB5X.js} +1 -1
- package/dist/clients/{chunk-OASVWVSV.js → chunk-A5JW3UI6.js} +1 -1
- package/dist/clients/chunk-BCNE3ZKM.js +190 -0
- package/dist/clients/chunk-BWJC2WD7.js +4899 -0
- package/dist/clients/{chunk-FGUMPXTO.js → chunk-DYV3LRSE.js} +1 -1
- package/dist/clients/{chunk-Y7WLUPTX.js → chunk-EQA5U4V6.js} +8 -8
- package/dist/clients/chunk-EYMFEWQL.js +30 -0
- package/dist/clients/chunk-FPOGADLJ.js +4899 -0
- package/dist/clients/chunk-HB7S3NDI.js +15 -0
- package/dist/clients/chunk-HDFCM5UL.js +15 -0
- package/dist/clients/{chunk-IYCZWLAF.js → chunk-IAIRECDV.js} +8 -37
- package/dist/clients/chunk-JVR4CX6N.js +296 -0
- package/dist/clients/chunk-NEKHTWTT.js +331 -0
- package/dist/clients/chunk-PA7WW6VC.js +296 -0
- package/dist/clients/chunk-R6UAC2TB.js +190 -0
- package/dist/clients/chunk-RHOSJED2.js +335 -0
- package/dist/clients/chunk-SKDFSMAO.js +30 -0
- package/dist/clients/chunk-TI2NG2Z6.js +30 -0
- package/dist/clients/chunk-TZFXFVDW.js +296 -0
- package/dist/clients/chunk-VE6QD5IM.js +149 -0
- package/dist/clients/chunk-VXX2XK5J.js +190 -0
- package/dist/clients/{chunk-SG4ZS447.js → chunk-WXSFLUPZ.js} +63 -15
- package/dist/clients/chunk-XSRAZSYG.js +15 -0
- package/dist/clients/fanatics.css +4686 -4659
- package/dist/clients/fanatics.js +7 -9
- package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
- package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
- package/dist/clients/internal/nado/withdrawalForm.css +4712 -4682
- package/dist/clients/internal/nado/withdrawalForm.js +37 -13
- package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
- package/dist/clients/lighter.css +4712 -4682
- package/dist/clients/lighter.js +50 -30
- package/dist/clients/mallard.js +4 -4
- package/dist/clients/nado.js +3 -3
- package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +28 -19
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +5 -4
- package/dist/clients/polymarket/index.d.ts +0 -1
- package/dist/clients/polymarket/index.js +4 -17
- package/dist/clients/polymarket/polymarket.d.ts +12 -27
- package/dist/clients/polymarket/polymarket.js +1 -1
- package/dist/components/AsyncImage/useAsyncImage.d.ts +2 -0
- package/dist/components/Box/Box.d.ts +15 -15
- package/dist/components/Dialog/Dialog.d.ts +8 -1
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +3 -1
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +10 -0
- package/dist/components/ModalHeaderTabs/ModalHeaderTabs.d.ts +23 -0
- package/dist/consts/polymarket.d.ts +14 -0
- package/dist/css/sprinkles.css.d.ts +17 -15
- package/dist/domains/polymarketPerps.d.ts +14 -0
- package/dist/hooks/queries/useFops.d.ts +3 -1
- package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
- package/dist/hooks/track/analytics/events.d.ts +18 -0
- package/dist/hooks/track/analytics/quote.d.ts +3 -1
- package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +12 -1
- package/dist/hooks/useCheckoutTransferInit.d.ts +3 -1
- package/dist/hooks/useFittedText.d.ts +19 -0
- package/dist/hooks/usePolymarketAccountBalances.d.ts +13 -25
- package/dist/hooks/useUpdateActiveFunkitCheckout.d.ts +10 -0
- package/dist/index.css +4712 -4682
- package/dist/index.js +3271 -2247
- package/dist/modals/CheckoutModal/CheckoutModalPrefetchedHooks.d.ts +2 -1
- package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +1 -0
- package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +6 -1
- package/dist/modals/PolymarketPerpsTransfer/DirectionSwapButton.d.ts +1 -11
- package/dist/modals/PolymarketPerpsTransfer/PerpsHeaderTabs.d.ts +29 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.css.d.ts +9 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.d.ts +15 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferBody.d.ts +12 -0
- package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsPrefetch.d.ts +7 -0
- package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +16 -2
- package/dist/modals/PolymarketPerpsTransfer/TransferAccountsCard.d.ts +12 -0
- package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +8 -1
- package/dist/modals/PolymarketPerpsTransfer/TransferPercentOptions.d.ts +13 -0
- package/dist/modals/PolymarketPerpsTransfer/usePerpsHeaderTabsState.d.ts +28 -0
- package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +31 -5
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +6 -0
- package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +0 -5
- package/dist/modals/WithdrawalModal/useWithdrawalChainPreference.d.ts +17 -0
- package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +2 -1
- package/dist/providers/FunkitCheckoutContext/index.d.ts +13 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +30 -3
- package/dist/providers/FunkitThemeProvider.d.ts +3 -0
- package/dist/shadow-css.js +1 -1
- package/dist/themes/baseTheme.js +1 -1
- package/dist/themes/darkTheme.js +2 -2
- package/dist/themes/lightTheme.js +2 -2
- package/dist/wallets/walletConnectors/chunk-2VP2F6EK.js +70 -0
- package/dist/wallets/walletConnectors/chunk-4T6ZSRJF.js +69 -0
- package/dist/wallets/walletConnectors/chunk-6BW3HLBG.js +96 -0
- package/dist/wallets/walletConnectors/chunk-CCQV2ZET.js +218 -0
- package/dist/wallets/walletConnectors/chunk-CPI4TD43.js +99 -0
- package/dist/wallets/walletConnectors/chunk-F5XEEVG6.js +98 -0
- package/dist/wallets/walletConnectors/chunk-HNRB7KJU.js +92 -0
- package/dist/wallets/walletConnectors/chunk-HTHAK6XB.js +93 -0
- package/dist/wallets/walletConnectors/chunk-MIQTHJ6X.js +66 -0
- package/dist/wallets/walletConnectors/chunk-RB3HR4R2.js +95 -0
- package/dist/wallets/walletConnectors/chunk-RVOY537T.js +100 -0
- package/dist/wallets/walletConnectors/chunk-STVVP43G.js +94 -0
- package/dist/wallets/walletConnectors/chunk-UK7C2JXW.js +87 -0
- package/dist/wallets/walletConnectors/chunk-VAPGUPHO.js +92 -0
- package/dist/wallets/walletConnectors/chunk-VTM6EECM.js +110 -0
- package/dist/wallets/walletConnectors/chunk-X6CGV36L.js +103 -0
- package/dist/wallets/walletConnectors/chunk-YEZM4CK4.js +96 -0
- package/dist/wallets/walletConnectors/chunk-ZNX4EMPB.js +106 -0
- package/dist/wallets/walletConnectors/index.js +37 -37
- package/package.json +5 -5
- package/dist/clients/chunk-AXLGZ5XX.js +0 -1325
- package/dist/clients/chunk-DSZHYQPX.js +0 -31
- package/dist/clients/chunk-HZP4DXIZ.js +0 -231
- package/dist/clients/chunk-LUHEVXPD.js +0 -109
- package/dist/clients/chunk-NM2NAKI3.js +0 -1195
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +0 -17545
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.d.ts +0 -30
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +0 -20
- package/dist/clients/polymarket/index.css +0 -17545
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferRows.d.ts +0 -10
- package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.css.d.ts +0 -13
- package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.d.ts +0 -27
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
PLACEHOLDER_FUNKIT_USER_INFO
|
|
4
|
-
} from "./chunk-3U55HYGJ.js";
|
|
5
|
-
|
|
6
|
-
// src/providers/GeneralWalletProvider.tsx
|
|
7
|
-
import React, {
|
|
8
|
-
createContext,
|
|
9
|
-
useCallback,
|
|
10
|
-
useContext,
|
|
11
|
-
useEffect,
|
|
12
|
-
useMemo,
|
|
13
|
-
useRef,
|
|
14
|
-
useState
|
|
15
|
-
} from "react";
|
|
16
|
-
var GeneralWalletContext = createContext({
|
|
17
|
-
walletAddress: "",
|
|
18
|
-
isUserLoggedIn: false,
|
|
19
|
-
loginType: "guest" /* Guest */,
|
|
20
|
-
connectorId: void 0,
|
|
21
|
-
userInfo: PLACEHOLDER_FUNKIT_USER_INFO,
|
|
22
|
-
handleLogout: () => void 0,
|
|
23
|
-
logoutSymbol: void 0
|
|
24
|
-
});
|
|
25
|
-
var useGeneralWallet = () => {
|
|
26
|
-
return useContext(GeneralWalletContext);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
useGeneralWallet
|
|
31
|
-
};
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
Box
|
|
4
|
-
} from "./chunk-LUHEVXPD.js";
|
|
5
|
-
import {
|
|
6
|
-
logger
|
|
7
|
-
} from "./chunk-AHYOV7AV.js";
|
|
8
|
-
|
|
9
|
-
// src/components/AsyncImage/useAsyncImage.ts
|
|
10
|
-
import { useEffect, useReducer } from "react";
|
|
11
|
-
var cachedUrls = /* @__PURE__ */ new Map();
|
|
12
|
-
var cachedRequestPromises = /* @__PURE__ */ new Map();
|
|
13
|
-
async function loadAsyncImage(asyncImage) {
|
|
14
|
-
const cachedRequestPromise = cachedRequestPromises.get(asyncImage);
|
|
15
|
-
if (cachedRequestPromise) {
|
|
16
|
-
return cachedRequestPromise;
|
|
17
|
-
}
|
|
18
|
-
const load = async () => asyncImage().then(async (url) => {
|
|
19
|
-
cachedUrls.set(asyncImage, url);
|
|
20
|
-
return url;
|
|
21
|
-
});
|
|
22
|
-
const requestPromise = load().catch(async () => {
|
|
23
|
-
return load().catch(() => {
|
|
24
|
-
cachedRequestPromises.delete(asyncImage);
|
|
25
|
-
return void 0;
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
cachedRequestPromises.set(asyncImage, requestPromise);
|
|
29
|
-
return requestPromise;
|
|
30
|
-
}
|
|
31
|
-
function useForceUpdate() {
|
|
32
|
-
const [, forceUpdate] = useReducer((x) => x + 1, 0);
|
|
33
|
-
return forceUpdate;
|
|
34
|
-
}
|
|
35
|
-
function useAsyncImage(url) {
|
|
36
|
-
const cachedUrl = typeof url === "function" ? cachedUrls.get(url) : void 0;
|
|
37
|
-
const forceUpdate = useForceUpdate();
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (typeof url === "function" && !cachedUrl) {
|
|
40
|
-
loadAsyncImage(url).then(forceUpdate);
|
|
41
|
-
}
|
|
42
|
-
}, [url, cachedUrl, forceUpdate]);
|
|
43
|
-
return typeof url === "function" ? cachedUrl : url;
|
|
44
|
-
}
|
|
45
|
-
var REMOTE_IMG_CACHE = /* @__PURE__ */ new Set();
|
|
46
|
-
function preloadRemoteImages(...imageUrls) {
|
|
47
|
-
for (const imageUrl of imageUrls) {
|
|
48
|
-
try {
|
|
49
|
-
const { protocol } = new URL(imageUrl);
|
|
50
|
-
if (protocol !== "https:" && protocol !== "http:") {
|
|
51
|
-
logger.warn("preloadRemoteImages:invalidUrl", {
|
|
52
|
-
message: "Invalid protocol",
|
|
53
|
-
imageUrl
|
|
54
|
-
});
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (!REMOTE_IMG_CACHE.has(imageUrl)) {
|
|
58
|
-
REMOTE_IMG_CACHE.add(imageUrl);
|
|
59
|
-
const preloadImage = new Image();
|
|
60
|
-
preloadImage.src = imageUrl;
|
|
61
|
-
}
|
|
62
|
-
} catch (error) {
|
|
63
|
-
logger.warn("preloadRemoteImages:error", {
|
|
64
|
-
message: "Unable to preload image",
|
|
65
|
-
imageUrl,
|
|
66
|
-
error
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// src/components/AsyncImage/AsyncImage.tsx
|
|
73
|
-
import React, { useMemo, useReducer as useReducer2, useState } from "react";
|
|
74
|
-
|
|
75
|
-
// src/utils/sanitizeUrl.ts
|
|
76
|
-
var SAFE_URL_PROTOCOLS = /* @__PURE__ */ new Set(["https:", "http:"]);
|
|
77
|
-
function sanitizeUrl(url) {
|
|
78
|
-
if (!url) {
|
|
79
|
-
return void 0;
|
|
80
|
-
}
|
|
81
|
-
try {
|
|
82
|
-
const parsed = new URL(url);
|
|
83
|
-
if (SAFE_URL_PROTOCOLS.has(parsed.protocol)) {
|
|
84
|
-
return parsed.href;
|
|
85
|
-
}
|
|
86
|
-
return void 0;
|
|
87
|
-
} catch {
|
|
88
|
-
return void 0;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function sanitizeCssUrl(url) {
|
|
92
|
-
const safeUrl = sanitizeUrl(url);
|
|
93
|
-
if (!safeUrl) {
|
|
94
|
-
return void 0;
|
|
95
|
-
}
|
|
96
|
-
return safeUrl.replace(/['()\\]/g, (char) => {
|
|
97
|
-
return `%${char.charCodeAt(0).toString(16).padStart(2, "0")}`;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// src/components/AsyncImage/AsyncImage.tsx
|
|
102
|
-
function useTriggeredOnce() {
|
|
103
|
-
return useReducer2(() => true, false);
|
|
104
|
-
}
|
|
105
|
-
function AsyncImage({
|
|
106
|
-
alt,
|
|
107
|
-
background,
|
|
108
|
-
borderColor,
|
|
109
|
-
borderRadius,
|
|
110
|
-
boxShadow,
|
|
111
|
-
height,
|
|
112
|
-
useAsImage,
|
|
113
|
-
src: srcProp,
|
|
114
|
-
fallbackSrc,
|
|
115
|
-
fallbackElement,
|
|
116
|
-
width,
|
|
117
|
-
testId
|
|
118
|
-
}) {
|
|
119
|
-
const src = useAsyncImage(srcProp || fallbackSrc);
|
|
120
|
-
const isRemoteImage = src !== void 0 && /^(https?|data):/.test(src);
|
|
121
|
-
const [isRemoteImageLoaded, setRemoteImageLoaded] = useTriggeredOnce();
|
|
122
|
-
const [hasError, setHasError] = useState(
|
|
123
|
-
srcProp === void 0 && fallbackSrc === void 0
|
|
124
|
-
);
|
|
125
|
-
const { asyncStyle, imgProps } = useMemo(() => {
|
|
126
|
-
const asyncStyle2 = !useAsImage ? getRemoteImageStyles(isRemoteImage, isRemoteImageLoaded, src) : {};
|
|
127
|
-
if (useAsImage || isRemoteImage) {
|
|
128
|
-
const imgProps2 = {
|
|
129
|
-
as: "img",
|
|
130
|
-
src,
|
|
131
|
-
"aria-hidden": true,
|
|
132
|
-
onError: ({
|
|
133
|
-
currentTarget
|
|
134
|
-
}) => {
|
|
135
|
-
currentTarget.onerror = null;
|
|
136
|
-
if (fallbackSrc !== void 0) {
|
|
137
|
-
currentTarget.src = fallbackSrc;
|
|
138
|
-
} else {
|
|
139
|
-
setHasError(true);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
onLoad: isRemoteImage ? setRemoteImageLoaded : void 0
|
|
143
|
-
};
|
|
144
|
-
return { imgProps: imgProps2, asyncStyle: asyncStyle2 };
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
imgProps: {
|
|
148
|
-
backgroundSize: "cover"
|
|
149
|
-
},
|
|
150
|
-
asyncStyle: {
|
|
151
|
-
...asyncStyle2,
|
|
152
|
-
// has to be added as a inline style because vanilla-extract doesn't recognize this as a valid style
|
|
153
|
-
backgroundPosition: "center"
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
}, [
|
|
157
|
-
fallbackSrc,
|
|
158
|
-
isRemoteImage,
|
|
159
|
-
isRemoteImageLoaded,
|
|
160
|
-
src,
|
|
161
|
-
useAsImage,
|
|
162
|
-
setRemoteImageLoaded
|
|
163
|
-
]);
|
|
164
|
-
const mainElement = hasError && fallbackElement || /* @__PURE__ */ React.createElement(
|
|
165
|
-
Box,
|
|
166
|
-
{
|
|
167
|
-
...imgProps,
|
|
168
|
-
height: "full",
|
|
169
|
-
position: "absolute",
|
|
170
|
-
style: {
|
|
171
|
-
WebkitTouchCallout: "none",
|
|
172
|
-
transition: "opacity .15s linear",
|
|
173
|
-
userSelect: "none",
|
|
174
|
-
...asyncStyle
|
|
175
|
-
},
|
|
176
|
-
width: "full"
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
return /* @__PURE__ */ React.createElement(
|
|
180
|
-
Box,
|
|
181
|
-
{
|
|
182
|
-
"aria-label": alt,
|
|
183
|
-
borderRadius,
|
|
184
|
-
boxShadow,
|
|
185
|
-
height: typeof height === "string" ? height : void 0,
|
|
186
|
-
overflow: "hidden",
|
|
187
|
-
position: "relative",
|
|
188
|
-
role: "img",
|
|
189
|
-
style: {
|
|
190
|
-
background,
|
|
191
|
-
height: typeof height === "number" ? height : void 0,
|
|
192
|
-
width: typeof width === "number" ? width : void 0
|
|
193
|
-
},
|
|
194
|
-
width: typeof width === "string" ? width : void 0,
|
|
195
|
-
testId
|
|
196
|
-
},
|
|
197
|
-
mainElement,
|
|
198
|
-
borderColor ? /* @__PURE__ */ React.createElement(
|
|
199
|
-
Box,
|
|
200
|
-
{
|
|
201
|
-
...typeof borderColor === "object" && "custom" in borderColor ? { style: { borderColor: borderColor.custom } } : { borderColor },
|
|
202
|
-
borderRadius,
|
|
203
|
-
borderStyle: "solid",
|
|
204
|
-
borderWidth: "1",
|
|
205
|
-
height: "full",
|
|
206
|
-
position: "relative",
|
|
207
|
-
width: "full"
|
|
208
|
-
}
|
|
209
|
-
) : null
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
var getRemoteImageStyles = (isRemoteImage, isRemoteImageLoaded, src) => {
|
|
213
|
-
if (isRemoteImage) {
|
|
214
|
-
return {
|
|
215
|
-
opacity: isRemoteImageLoaded ? 1 : 0
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
const safeSrc = sanitizeCssUrl(src);
|
|
219
|
-
return {
|
|
220
|
-
// note the url must have quotation, see https://github.com/evanw/esbuild/issues/1843#issuecomment-1370108070
|
|
221
|
-
backgroundImage: safeSrc ? `url('${safeSrc}')` : void 0,
|
|
222
|
-
backgroundRepeat: "no-repeat",
|
|
223
|
-
opacity: src ? 1 : 0
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
export {
|
|
228
|
-
sanitizeUrl,
|
|
229
|
-
preloadRemoteImages,
|
|
230
|
-
AsyncImage
|
|
231
|
-
};
|