@funkit/connect 12.23.0 → 13.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/clients/chunk-44LV4GCX.js +83 -0
  3. package/dist/clients/{chunk-GQINBV24.js → chunk-AJGDTTRJ.js} +1 -6
  4. package/dist/clients/{chunk-QS3S2PXZ.js → chunk-D6EY2WW4.js} +1 -1
  5. package/dist/clients/{chunk-4NWQR25X.js → chunk-JXTKKLVA.js} +55 -205
  6. package/dist/clients/{chunk-JBJ5FEIA.js → chunk-NNMZMHO6.js} +3 -3
  7. package/dist/clients/{chunk-HEOTAER5.js → chunk-Q4JGDB4L.js} +2 -2
  8. package/dist/clients/{chunk-IDYAC2RY.js → chunk-T6YNXIOS.js} +1 -1
  9. package/dist/clients/{chunk-35XAIUH6.js → chunk-ZBBYOJWK.js} +1 -206
  10. package/dist/clients/{chunk-55LEL7SW.js → chunk-ZEXIDBIZ.js} +1 -1
  11. package/dist/clients/fanatics.css +0 -19
  12. package/dist/clients/fanatics.d.ts +0 -4
  13. package/dist/clients/fanatics.js +28 -244
  14. package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
  15. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  16. package/dist/clients/internal/nado/withdrawalForm.js +19 -6
  17. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  18. package/dist/clients/lighter.js +180 -28
  19. package/dist/clients/mallard.js +2 -2
  20. package/dist/clients/nado.js +4 -4
  21. package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -3
  22. package/dist/clients/polymarket/index.js +3 -3
  23. package/dist/clients/polymarket/polymarket.d.ts +2 -2
  24. package/dist/clients/polymarket/polymarket.js +2 -2
  25. package/dist/components/FunPayments/ExchangeIconCluster.d.ts +1 -1
  26. package/dist/components/FunPayments/FunPaymentMethods.d.ts +1 -12
  27. package/dist/components/FunPayments/SourceExchangeIcon.d.ts +1 -1
  28. package/dist/components/FunSelectBrokerage/FunBrokerageItem.d.ts +1 -2
  29. package/dist/components/FunSelectBrokerage/FunSelectBrokerage.d.ts +1 -1
  30. package/dist/consts/centralExchange.d.ts +18 -1
  31. package/dist/domains/asset.d.ts +1 -1
  32. package/dist/domains/convert/sourceWallet.d.ts +1 -1
  33. package/dist/domains/convert/types.d.ts +4 -5
  34. package/dist/domains/feeEstimate.d.ts +1 -3
  35. package/dist/domains/fees.d.ts +2 -16
  36. package/dist/domains/paymentMethods.d.ts +4 -16
  37. package/dist/domains/quote.d.ts +3 -5
  38. package/dist/domains/quoteMode/types.d.ts +0 -5
  39. package/dist/domains/wallet.d.ts +0 -4
  40. package/dist/hooks/track/CheckoutModalEvent.d.ts +0 -4
  41. package/dist/hooks/track/analytics/events.d.ts +11 -11
  42. package/dist/hooks/track/analytics/mappers.d.ts +1 -1
  43. package/dist/hooks/track/analytics/swappedIframeError.d.ts +3 -0
  44. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +1 -9
  45. package/dist/hooks/track/analytics/useTrackSwappedIframeError.d.ts +2 -0
  46. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +1 -1
  47. package/dist/hooks/useCheckoutDirectExecution.d.ts +2 -1
  48. package/dist/hooks/useExchangeOptions.d.ts +5 -10
  49. package/dist/hooks/usePaymentSources.d.ts +1 -1
  50. package/dist/index.d.ts +3 -3
  51. package/dist/index.js +4621 -6788
  52. package/dist/interfaces/solanaWallet.d.ts +12 -25
  53. package/dist/modals/CheckoutModal/Brokerage/SelectBrokerage.d.ts +4 -12
  54. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +0 -3
  55. package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +3 -3
  56. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -4
  57. package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +3 -4
  58. package/dist/modals/CheckoutModal/SelectAsset/SelectAssetList.d.ts +0 -2
  59. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +0 -9
  60. package/dist/modals/CheckoutModal/stepTransition.d.ts +0 -9
  61. package/dist/providers/FunkitCheckoutContext/index.d.ts +2 -2
  62. package/dist/providers/FunkitConfigContext.d.ts +1 -14
  63. package/dist/providers/SolanaWalletProvider.d.ts +5 -5
  64. package/dist/utils/checkout.d.ts +0 -7
  65. package/dist/utils/solanaRelayWallet.d.ts +2 -7
  66. package/dist/wallets/Wallet.d.ts +16 -1
  67. package/dist/wallets/solanaWithdrawal.d.ts +5 -5
  68. package/dist/wallets/walletConnectors/index.js +41 -41
  69. package/package.json +3 -16
  70. package/dist/clients/chunk-CE42WHAA.js +0 -21
  71. package/dist/clients/chunk-TKEBGMVW.js +0 -176
  72. package/dist/clients/solana-transfer.d.ts +0 -1
  73. package/dist/clients/solana-transfer.js +0 -13
  74. package/dist/consts/bluvo.d.ts +0 -61
  75. package/dist/hooks/useBluvo.d.ts +0 -1537
  76. package/dist/modals/CheckoutModal/Brokerage/BrokerageSuccessModal.d.ts +0 -10
  77. package/dist/modals/CheckoutModal/Brokerage/BrokerageTwoFA.d.ts +0 -17
  78. package/dist/modals/CheckoutModal/Brokerage/ConnectExchange.d.ts +0 -13
  79. package/dist/modals/CheckoutModal/Brokerage/components/BrokerageSuccess.d.ts +0 -8
  80. package/dist/providers/FunkitBrokerageProvider.d.ts +0 -20
  81. package/dist/utils/bluvo.d.ts +0 -153
@@ -6,18 +6,19 @@ import {
6
6
  } from "./chunk-PZSKO3BJ.js";
7
7
  import {
8
8
  useFunkitConfig
9
- } from "./chunk-GQINBV24.js";
9
+ } from "./chunk-AJGDTTRJ.js";
10
10
  import {
11
- AsyncImage,
12
11
  Box,
13
- sanitizeUrl
14
- } from "./chunk-4NWQR25X.js";
12
+ hasRemoteImageLoaded,
13
+ markRemoteImageLoaded,
14
+ useAsyncImage
15
+ } from "./chunk-JXTKKLVA.js";
15
16
  import {
16
17
  useFunkitTranslation
17
- } from "./chunk-55LEL7SW.js";
18
+ } from "./chunk-ZEXIDBIZ.js";
18
19
  import "./chunk-OODIKHYE.js";
19
20
  import "./chunk-2W2P3OS6.js";
20
- import "./chunk-35XAIUH6.js";
21
+ import "./chunk-ZBBYOJWK.js";
21
22
  import {
22
23
  logger
23
24
  } from "./chunk-B67ESBGC.js";
@@ -30,7 +31,7 @@ import {
30
31
  } from "@funkit/chains";
31
32
  import { useLogOnce as useLogOnce2 } from "@funkit/connect-core";
32
33
  import i18next from "i18next";
33
- import React7, { useMemo as useMemo3 } from "react";
34
+ import React8, { useMemo as useMemo4 } from "react";
34
35
  import { arbitrum, base, bsc, optimism } from "viem/chains";
35
36
 
36
37
  // src/components/Icons/EvmWallet.tsx
@@ -57,7 +58,7 @@ var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React.createElement(
57
58
  );
58
59
 
59
60
  // src/components/SupportedChainList/SupportedChainList.tsx
60
- import React5 from "react";
61
+ import React6 from "react";
61
62
 
62
63
  // src/hooks/useChainMetadata.ts
63
64
  import { getChainIconUrl } from "@funkit/connect-core";
@@ -137,7 +138,7 @@ function useChainMetadata() {
137
138
  }
138
139
 
139
140
  // src/components/ChainIcon/ChainIcon.tsx
140
- import React3 from "react";
141
+ import React4 from "react";
141
142
 
142
143
  // src/consts/assets.ts
143
144
  import {
@@ -146,6 +147,157 @@ import {
146
147
  getAssetLogoSrc
147
148
  } from "@funkit/fun-relay";
148
149
 
150
+ // src/components/AsyncImage/AsyncImage.tsx
151
+ import React3, { useMemo as useMemo2, useState } from "react";
152
+
153
+ // src/utils/sanitizeUrl.ts
154
+ var SAFE_URL_PROTOCOLS = /* @__PURE__ */ new Set(["https:", "http:"]);
155
+ function sanitizeUrl(url) {
156
+ if (!url) {
157
+ return void 0;
158
+ }
159
+ try {
160
+ const parsed = new URL(url);
161
+ if (SAFE_URL_PROTOCOLS.has(parsed.protocol)) {
162
+ return parsed.href;
163
+ }
164
+ return void 0;
165
+ } catch {
166
+ return void 0;
167
+ }
168
+ }
169
+ function sanitizeCssUrl(url) {
170
+ const safeUrl = sanitizeUrl(url);
171
+ if (!safeUrl) {
172
+ return void 0;
173
+ }
174
+ return safeUrl.replace(/['()\\]/g, (char) => {
175
+ return `%${char.charCodeAt(0).toString(16).padStart(2, "0")}`;
176
+ });
177
+ }
178
+
179
+ // src/components/AsyncImage/AsyncImage.tsx
180
+ function AsyncImage({
181
+ alt,
182
+ background,
183
+ borderColor,
184
+ borderRadius,
185
+ boxShadow,
186
+ height,
187
+ useAsImage,
188
+ src: srcProp,
189
+ fallbackSrc,
190
+ fallbackElement,
191
+ width,
192
+ testId
193
+ }) {
194
+ const src = useAsyncImage(srcProp || fallbackSrc);
195
+ const isRemoteImage = src !== void 0 && /^(https?|data):/.test(src);
196
+ const [hasLoadedHere, setHasLoadedHere] = useState(false);
197
+ const isRemoteImageLoaded = hasLoadedHere || hasRemoteImageLoaded(src);
198
+ const [hasError, setHasError] = useState(
199
+ srcProp === void 0 && fallbackSrc === void 0
200
+ );
201
+ const { asyncStyle, imgProps } = useMemo2(() => {
202
+ const asyncStyle2 = !useAsImage ? getRemoteImageStyles(isRemoteImage, isRemoteImageLoaded, src) : {};
203
+ if (useAsImage || isRemoteImage) {
204
+ const imgProps2 = {
205
+ as: "img",
206
+ src,
207
+ "aria-hidden": true,
208
+ onError: ({
209
+ currentTarget
210
+ }) => {
211
+ currentTarget.onerror = null;
212
+ if (fallbackSrc !== void 0) {
213
+ currentTarget.src = fallbackSrc;
214
+ } else {
215
+ setHasError(true);
216
+ }
217
+ },
218
+ onLoad: isRemoteImage ? ({ currentTarget }) => {
219
+ if (currentTarget.src === src) {
220
+ markRemoteImageLoaded(src);
221
+ }
222
+ setHasLoadedHere(true);
223
+ } : void 0
224
+ };
225
+ return { imgProps: imgProps2, asyncStyle: asyncStyle2 };
226
+ }
227
+ return {
228
+ imgProps: {
229
+ backgroundSize: "cover"
230
+ },
231
+ asyncStyle: {
232
+ ...asyncStyle2,
233
+ // has to be added as a inline style because vanilla-extract doesn't recognize this as a valid style
234
+ backgroundPosition: "center"
235
+ }
236
+ };
237
+ }, [fallbackSrc, isRemoteImage, isRemoteImageLoaded, src, useAsImage]);
238
+ const mainElement = hasError && fallbackElement || /* @__PURE__ */ React3.createElement(
239
+ Box,
240
+ {
241
+ ...imgProps,
242
+ height: "full",
243
+ position: "absolute",
244
+ style: {
245
+ WebkitTouchCallout: "none",
246
+ transition: "opacity .15s linear",
247
+ userSelect: "none",
248
+ ...asyncStyle
249
+ },
250
+ width: "full"
251
+ }
252
+ );
253
+ return /* @__PURE__ */ React3.createElement(
254
+ Box,
255
+ {
256
+ "aria-label": alt,
257
+ borderRadius,
258
+ boxShadow,
259
+ height: typeof height === "string" ? height : void 0,
260
+ overflow: "hidden",
261
+ position: "relative",
262
+ role: "img",
263
+ style: {
264
+ background,
265
+ height: typeof height === "number" ? height : void 0,
266
+ width: typeof width === "number" ? width : void 0
267
+ },
268
+ width: typeof width === "string" ? width : void 0,
269
+ testId
270
+ },
271
+ mainElement,
272
+ borderColor ? /* @__PURE__ */ React3.createElement(
273
+ Box,
274
+ {
275
+ ...typeof borderColor === "object" && "custom" in borderColor ? { style: { borderColor: borderColor.custom } } : { borderColor },
276
+ borderRadius,
277
+ borderStyle: "solid",
278
+ borderWidth: "1",
279
+ height: "full",
280
+ position: "relative",
281
+ width: "full"
282
+ }
283
+ ) : null
284
+ );
285
+ }
286
+ var getRemoteImageStyles = (isRemoteImage, isRemoteImageLoaded, src) => {
287
+ if (isRemoteImage) {
288
+ return {
289
+ opacity: isRemoteImageLoaded ? 1 : 0
290
+ };
291
+ }
292
+ const safeSrc = sanitizeCssUrl(src);
293
+ return {
294
+ // note the url must have quotation, see https://github.com/evanw/esbuild/issues/1843#issuecomment-1370108070
295
+ backgroundImage: safeSrc ? `url('${safeSrc}')` : void 0,
296
+ backgroundRepeat: "no-repeat",
297
+ opacity: src ? 1 : 0
298
+ };
299
+ };
300
+
149
301
  // src/components/ChainIcon/ChainIcon.tsx
150
302
  function ChainIcon({
151
303
  chainId,
@@ -159,7 +311,7 @@ function ChainIcon({
159
311
  if (!chainMetadata) {
160
312
  return null;
161
313
  }
162
- return /* @__PURE__ */ React3.createElement(
314
+ return /* @__PURE__ */ React4.createElement(
163
315
  AsyncImage,
164
316
  {
165
317
  alt: chainMetadata.name,
@@ -177,7 +329,7 @@ function ChainIcon({
177
329
 
178
330
  // src/components/IconCluster/IconCluster.tsx
179
331
  import { assignInlineVars } from "@vanilla-extract/dynamic";
180
- import React4, { Children } from "react";
332
+ import React5, { Children } from "react";
181
333
 
182
334
  // src/components/IconCluster/IconCluster.css.ts
183
335
  var iconCluster = "_1i3yi6y2";
@@ -195,7 +347,7 @@ function IconCluster({
195
347
  style
196
348
  }) {
197
349
  const items = Children.toArray(children);
198
- return /* @__PURE__ */ React4.createElement(
350
+ return /* @__PURE__ */ React5.createElement(
199
351
  Box,
200
352
  {
201
353
  className: iconCluster,
@@ -207,7 +359,7 @@ function IconCluster({
207
359
  ...style
208
360
  }
209
361
  },
210
- Children.map(items, (child, index) => /* @__PURE__ */ React4.createElement(
362
+ Children.map(items, (child, index) => /* @__PURE__ */ React5.createElement(
211
363
  Box,
212
364
  {
213
365
  className: iconClusterItem,
@@ -221,7 +373,7 @@ function MoreIconsIndicator({
221
373
  size = CLUSTER_ICON_SIZE
222
374
  }) {
223
375
  const glyphSize = Math.round(size * PLUS_GLYPH_RATIO);
224
- return /* @__PURE__ */ React4.createElement(
376
+ return /* @__PURE__ */ React5.createElement(
225
377
  Box,
226
378
  {
227
379
  alignItems: "center",
@@ -234,7 +386,7 @@ function MoreIconsIndicator({
234
386
  style: { width: size, height: size },
235
387
  testId: "more-icons-indicator"
236
388
  },
237
- /* @__PURE__ */ React4.createElement(
389
+ /* @__PURE__ */ React5.createElement(
238
390
  "svg",
239
391
  {
240
392
  "aria-hidden": "true",
@@ -243,7 +395,7 @@ function MoreIconsIndicator({
243
395
  viewBox: "0 0 11 11",
244
396
  width: glyphSize
245
397
  },
246
- /* @__PURE__ */ React4.createElement(
398
+ /* @__PURE__ */ React5.createElement(
247
399
  "path",
248
400
  {
249
401
  d: "M5.5 2.29167V8.70833M2.29167 5.5H8.70833",
@@ -271,15 +423,15 @@ function SupportedChainList({
271
423
  );
272
424
  const visibleChains = resolvedChains.slice(0, MAX_VISIBLE_CHAINS);
273
425
  const hasMore = resolvedChains.length > 0 && (showMore || resolvedChains.length > MAX_VISIBLE_CHAINS);
274
- return /* @__PURE__ */ React5.createElement(
426
+ return /* @__PURE__ */ React6.createElement(
275
427
  IconCluster,
276
428
  {
277
429
  iconCount: visibleChains.length,
278
430
  iconSize,
279
431
  style
280
432
  },
281
- visibleChains.map((chainId) => /* @__PURE__ */ React5.createElement(ChainIcon, { key: chainId, chainId: Number(chainId), size: iconSize })),
282
- hasMore && /* @__PURE__ */ React5.createElement(MoreIconsIndicator, { size: iconSize })
433
+ visibleChains.map((chainId) => /* @__PURE__ */ React6.createElement(ChainIcon, { key: chainId, chainId: Number(chainId), size: iconSize })),
434
+ hasMore && /* @__PURE__ */ React6.createElement(MoreIconsIndicator, { size: iconSize })
283
435
  );
284
436
  }
285
437
 
@@ -307,12 +459,12 @@ import {
307
459
  } from "@funkit/chains";
308
460
  import { formatAddress, formatCryptoAndStringify } from "@funkit/utils";
309
461
  import { v4 as uuid } from "uuid";
310
- import React6, {
462
+ import React7, {
311
463
  useCallback as useCallback2,
312
464
  useEffect,
313
- useMemo as useMemo2,
465
+ useMemo as useMemo3,
314
466
  useRef,
315
- useState
467
+ useState as useState2
316
468
  } from "react";
317
469
  import { createPortal } from "react-dom";
318
470
  import { numberToHex, pad, parseUnits } from "viem";
@@ -656,16 +808,16 @@ function buildLighterMultiMethodConfig({
656
808
  }) : t("withdrawal.fastDisclaimer", {
657
809
  symbol: LIGHTER_INSTANCES2[chainId].perpsCollateral.symbol
658
810
  }),
659
- icon: /* @__PURE__ */ React7.createElement(EvmWallet, { size: 20 }),
660
- valueIcon: /* @__PURE__ */ React7.createElement(SupportedChainList, { chainIdList: LIGHTER_FAST_PREVIEW_CHAIN_IDS }),
811
+ icon: /* @__PURE__ */ React8.createElement(EvmWallet, { size: 20 }),
812
+ valueIcon: /* @__PURE__ */ React8.createElement(SupportedChainList, { chainIdList: LIGHTER_FAST_PREVIEW_CHAIN_IDS }),
661
813
  config: fastConfig
662
814
  };
663
815
  const secure = {
664
816
  id: LIGHTER_SECURE_METHOD_ID,
665
817
  keyText: t("withdrawal.methodSecure"),
666
818
  subtitleText: LIGHTER_SECURE_DISCLAIMER[chainId](t, secureDelayText),
667
- icon: /* @__PURE__ */ React7.createElement(EvmWallet, { size: 20 }),
668
- valueIcon: /* @__PURE__ */ React7.createElement(
819
+ icon: /* @__PURE__ */ React8.createElement(EvmWallet, { size: 20 }),
820
+ valueIcon: /* @__PURE__ */ React8.createElement(
669
821
  SupportedChainList,
670
822
  {
671
823
  chainIdList: [LIGHTER_INSTANCES2[chainId].secureL1Chain.id.toString()]
@@ -694,8 +846,8 @@ function useLighterWithdrawalConfig(config) {
694
846
  // The query validates it as numeric, so the template-literal narrowing holds.
695
847
  accountIndex ? { by: "index", value: accountIndex, chainId } : null
696
848
  );
697
- const assets = useMemo3(() => account?.assets ?? [], [account]);
698
- const multiMethodConfig = useMemo3(() => {
849
+ const assets = useMemo4(() => account?.assets ?? [], [account]);
850
+ const multiMethodConfig = useMemo4(() => {
699
851
  if (!config || !accountIndex) {
700
852
  return null;
701
853
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useFunkitTranslation
4
- } from "./chunk-55LEL7SW.js";
4
+ } from "./chunk-ZEXIDBIZ.js";
5
5
  import {
6
6
  getAccount,
7
7
  sendTransaction,
@@ -14,7 +14,7 @@ import {
14
14
  useAccount,
15
15
  useConfig
16
16
  } from "./chunk-2W2P3OS6.js";
17
- import "./chunk-35XAIUH6.js";
17
+ import "./chunk-ZBBYOJWK.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-B67ESBGC.js";
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  createNadoWithdrawalCallback
4
- } from "./chunk-JBJ5FEIA.js";
5
- import "./chunk-TKEBGMVW.js";
6
- import "./chunk-QS3S2PXZ.js";
4
+ } from "./chunk-NNMZMHO6.js";
5
+ import "./chunk-44LV4GCX.js";
6
+ import "./chunk-D6EY2WW4.js";
7
7
  import "./chunk-LICTGZXW.js";
8
8
  import "./chunk-OODIKHYE.js";
9
9
  import {
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-2W2P3OS6.js";
13
13
  import {
14
14
  i18n_default
15
- } from "./chunk-35XAIUH6.js";
15
+ } from "./chunk-ZBBYOJWK.js";
16
16
  import {
17
17
  logger
18
18
  } from "./chunk-B67ESBGC.js";
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  createPolymarketDepositConfig,
4
4
  createPredictionsGenerateActionParams
5
- } from "../chunk-IDYAC2RY.js";
5
+ } from "../chunk-T6YNXIOS.js";
6
6
  import {
7
7
  POLYMARKET_PERPS_ROUTING_ID,
8
8
  POLYMARKET_PREDICTIONS_ROUTING_ID
9
- } from "../chunk-HEOTAER5.js";
10
- import "../chunk-TKEBGMVW.js";
9
+ } from "../chunk-Q4JGDB4L.js";
10
+ import "../chunk-44LV4GCX.js";
11
11
  import "../chunk-B67ESBGC.js";
12
12
  export {
13
13
  POLYMARKET_PERPS_ROUTING_ID,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createPolymarketDepositConfig,
4
4
  createPredictionsGenerateActionParams
5
- } from "../chunk-IDYAC2RY.js";
5
+ } from "../chunk-T6YNXIOS.js";
6
6
  import {
7
7
  AMOUNT_PLACEHOLDER,
8
8
  COLLATERAL_ONRAMP_ABI,
@@ -15,8 +15,8 @@ import {
15
15
  VAULT_DEPOSITOR_POLYGON,
16
16
  createPerpsGenerateActionParams,
17
17
  createPolymarketWithdrawalConfig
18
- } from "../chunk-HEOTAER5.js";
19
- import "../chunk-TKEBGMVW.js";
18
+ } from "../chunk-Q4JGDB4L.js";
19
+ import "../chunk-44LV4GCX.js";
20
20
  import "../chunk-B67ESBGC.js";
21
21
  export {
22
22
  AMOUNT_PLACEHOLDER,
@@ -19,7 +19,7 @@ import { type Address, type PublicClient, type TransactionReceipt } from 'viem';
19
19
  import { POLYGON_USDCE, PUSD_TOKEN } from '../../consts/polymarket';
20
20
  import type { AllowedRecipient } from '../../domains/withdrawalAllowlist';
21
21
  import type { CustomWithdrawalConfig, FunkitCheckoutActionParams, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext/types';
22
- import type { WithdrawalTransaction } from '../../wallets/Wallet';
22
+ import type { WithdrawalSignContext, WithdrawalTransaction } from '../../wallets/Wallet';
23
23
  export { POLYGON_USDCE, PUSD_TOKEN };
24
24
  export interface PolymarketWithdrawalCallbackConfig {
25
25
  userId: string;
@@ -60,7 +60,7 @@ export interface PolymarketWithdrawalCallbackConfig {
60
60
  * broadcast them atomically in a single user signature and return a tx hash
61
61
  * that {@link WithdrawalClient.confirmTransaction} can wait on.
62
62
  */
63
- export type PolymarketSendTransactions = (txs: WithdrawalTransaction[]) => Promise<string>;
63
+ export type PolymarketSendTransactions = (txs: WithdrawalTransaction[], signContext?: WithdrawalSignContext) => Promise<string>;
64
64
  export interface PolymarketWalletUnwrapWithdrawalConfig {
65
65
  /** Polymarket proxy that holds pUSD and signs the batched tx. */
66
66
  proxyAddress: Address;
@@ -9,8 +9,8 @@ import {
9
9
  VAULT_DEPOSITOR_POLYGON,
10
10
  createPerpsGenerateActionParams,
11
11
  createPolymarketWithdrawalConfig
12
- } from "../chunk-HEOTAER5.js";
13
- import "../chunk-TKEBGMVW.js";
12
+ } from "../chunk-Q4JGDB4L.js";
13
+ import "../chunk-44LV4GCX.js";
14
14
  import "../chunk-B67ESBGC.js";
15
15
  export {
16
16
  AMOUNT_PLACEHOLDER,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type BrokerageOption } from '../../consts/bluvo';
2
+ import { type BrokerageOption } from '../../consts/centralExchange';
3
3
  export declare function ExchangeIconCluster({ options, }: {
4
4
  options: BrokerageOption[];
5
5
  }): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { type SwappedFormOfPayment } from '@funkit/api-base';
2
2
  import React, { type ReactNode } from 'react';
3
3
  import { type FunkitPaymentMethodIconsConfig } from '../../providers/FunkitConfigContext';
4
- import { PaymentMethod, type PaymentMethodBrokerageInfo, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
4
+ import { PaymentMethod, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
5
5
  import type { AssetHoldingsItem } from '../../domains/wallet';
6
6
  /**
7
7
  * Get a custom icon passed in from UI customization config
@@ -20,17 +20,6 @@ export declare function PaymentMethodIcon({ paymentIcon, keyIconSize, }: {
20
20
  paymentIcon: ReactNode;
21
21
  keyIconSize: number;
22
22
  }): React.JSX.Element;
23
- interface ConnectedBluvoPaymentMethodItemProps extends ConnectedPaymentMethodItemProps {
24
- paymentMethodInfo: PaymentMethodBrokerageInfo;
25
- onBrokerageError?: () => void;
26
- disabled?: boolean;
27
- }
28
- /**
29
- * Note: This is different from `BrokeragePaymentMethodItem`, which is used as a
30
- * button to initiate connecting a new brokerage account.
31
- * This is for connected Bluvo brokerage like coinbase etc.
32
- */
33
- export declare const ConnectedBluvoPaymentMethodItem: ({ paymentMethodInfo, isSelected, onSelect, onBrokerageError, showSelectedCheckmark, disabled, }: ConnectedBluvoPaymentMethodItemProps) => React.JSX.Element;
34
23
  interface ConnectedPaymentMethodItemProps {
35
24
  isSelected: boolean;
36
25
  showSelectedCheckmark?: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type BrokerageOption } from '../../consts/bluvo';
2
+ import { type BrokerageOption } from '../../consts/centralExchange';
3
3
  export declare function SourceExchangeIcon({ option }: {
4
4
  option: BrokerageOption;
5
5
  }): React.JSX.Element;
@@ -3,10 +3,9 @@ import { type TextProps } from '../Text/Text';
3
3
  export interface FunBrokerageItemProps {
4
4
  exchangeName: string;
5
5
  exchangeIcon: React.ReactNode;
6
- hasActiveConnection: boolean;
7
6
  badgeText?: string;
8
7
  disabled?: boolean;
9
8
  fontSize?: TextProps['size'];
10
9
  fontWeight?: TextProps['weight'];
11
10
  }
12
- export declare const FunBrokerageItem: ({ exchangeName, exchangeIcon, hasActiveConnection, badgeText, disabled, fontSize, fontWeight, }: FunBrokerageItemProps) => React.JSX.Element;
11
+ export declare const FunBrokerageItem: ({ exchangeName, exchangeIcon, badgeText, disabled, fontSize, fontWeight, }: FunBrokerageItemProps) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type BrokerageOption } from '../../consts/bluvo';
2
+ import { type BrokerageOption } from '../../consts/centralExchange';
3
3
  interface FunSelectBrokerageProps {
4
4
  isDisabled?: boolean;
5
5
  options: ReadonlyArray<BrokerageOption>;
@@ -1,2 +1,19 @@
1
- import { type BrokerageOption } from '../consts/bluvo';
1
+ import { type GenericFormOfPayment } from '@funkit/api-base';
2
+ import React from 'react';
3
+ export declare enum BrokerageKind {
4
+ SWAPPED = "swapped",
5
+ COMING_SOON = "coming_soon"
6
+ }
7
+ export type BrokerageOption = {
8
+ name: string;
9
+ icon: React.ReactNode;
10
+ } & ({
11
+ kind: BrokerageKind.SWAPPED;
12
+ fop: GenericFormOfPayment;
13
+ } | {
14
+ kind: BrokerageKind.COMING_SOON;
15
+ id: string;
16
+ });
17
+ export declare function fopToBrokerageOption(fop: GenericFormOfPayment, iconSize: number): BrokerageOption;
18
+ export declare function brokerageOptionKey(option: BrokerageOption): string;
2
19
  export declare function getExchangesComingSoon(iconSize: number): BrokerageOption[];
@@ -8,7 +8,7 @@ import { PaymentMethod } from '../domains/paymentMethods';
8
8
  * Calculates the minimum USD value an asset must have to be considered usable for checkout.
9
9
  * Accounts for the customer's configured minimum deposit and a global floor.
10
10
  */
11
- export declare function getMinValueThreshold(config: FunkitCheckoutConfig | undefined, minUsdRequired?: number): number;
11
+ export declare function getMinValueThreshold(config: FunkitCheckoutConfig | undefined): number;
12
12
  export declare function isPreferredChain(chainId: number, additionalChains?: number[]): boolean;
13
13
  export { isNativeTokenAddress };
14
14
  export declare function isDefaultToken(asset: AssetHoldingsItem, checkoutConfig: FunkitCheckoutConfig): boolean;
@@ -5,7 +5,7 @@ import type { ConvertResolvedAsset, ConvertSourceWallet, ConvertVm, GetConvertSo
5
5
  * chain list, icons, explorers), which is what keeps Arc out for now.
6
6
  */
7
7
  export declare function resolveConvertVm(chainId: string): ConvertVm | undefined;
8
- export type ConvertSourceUnavailableReason = 'unsupportedChain' | 'vmMismatch' | 'invalidWalletAddress' | 'resolverFailed';
8
+ export type ConvertSourceUnavailableReason = 'unsupportedChain' | 'vmMismatch' | 'invalidWalletAddress' | 'noSignMethod' | 'resolverFailed';
9
9
  export type ConvertSourceWalletSelection = {
10
10
  status: 'available';
11
11
  vm: ConvertVm;
@@ -1,5 +1,5 @@
1
1
  import type { HypercoreSigner } from '@funkit/connect-core/clients/hypercore';
2
- import type { SolanaWalletSigner } from '../../interfaces/solanaWallet';
2
+ import type { FunkitSolanaAdapter } from '@funkit/fun-relay';
3
3
  import type { WithdrawalClient } from '../../wallets/Wallet';
4
4
  /** Relay's names for the VMs a Convert source or destination can live on. */
5
5
  export type ConvertVm = 'evm' | 'svm' | 'hypevm';
@@ -36,9 +36,8 @@ export interface ConvertResolvedAsset extends ConvertAsset {
36
36
  * on-chain hash; `sendTransactions` is opt-in and must also return a tx hash,
37
37
  * never a wallet calls id. Its `adaptedWallet` isn't read: Solana and
38
38
  * Hypercore sources use their own entries below.
39
- * - `svm`: a {@link SolanaWalletSigner}. `signAndSendTransaction` resolves the
40
- * 64-byte signature; when both signing methods are supplied the SDK uses
41
- * `signTransaction` and submits itself.
39
+ * - `svm`: a {@link FunkitSolanaAdapter} from `@funkit/solana-kit` or
40
+ * `@funkit/solana-web3`.
42
41
  * - `hypevm`: a {@link HypercoreSigner}; the SDK builds the Relay action wallet
43
42
  * from it.
44
43
  * @experimental
@@ -48,7 +47,7 @@ export type ConvertSourceWallet = {
48
47
  wallet: Omit<WithdrawalClient, 'adaptedWallet'>;
49
48
  } | {
50
49
  vm: 'svm';
51
- signer: SolanaWalletSigner;
50
+ adapter: FunkitSolanaAdapter;
52
51
  } | {
53
52
  vm: 'hypevm';
54
53
  signer: HypercoreSigner;
@@ -1,8 +1,6 @@
1
- import { PaymentMethod } from './paymentMethods';
2
1
  export declare const L1_FEES_ESTIMATE = 1;
3
2
  export declare const L2_FEES_ESTIMATE = 1;
4
- export declare const BROKERAGE_FEES_ESTIMATE = 0;
5
3
  /**
6
4
  * Estimating overall fees
7
5
  */
8
- export declare const getFeesUsdEstimate: (targetChainId: string, assetChainId: string, paymentMethod: PaymentMethod | undefined) => number;
6
+ export declare const getFeesUsdEstimate: (targetChainId: string, assetChainId: string) => number;
@@ -1,16 +1,9 @@
1
1
  import { type FeeBreakdownV2 } from '@funkit/api-base';
2
2
  import type { CheckoutQuoteResponse } from '@funkit/utils';
3
- import type { BluvoBrokerageQuote } from '../hooks/useBluvo';
4
3
  import { LoginType } from '../providers/GeneralWalletProvider';
5
4
  import type { Config } from '../wagmi/hooks';
6
5
  import type { FunkitActiveCheckoutItem } from '../providers/FunkitCheckoutContext';
7
6
  import { PaymentMethod, type PaymentMethodInfo } from './paymentMethods';
8
- export interface BrokerageDetails {
9
- isAboveMaximum: boolean;
10
- isBelowMinimum: boolean;
11
- maximumAmount: number | undefined | null;
12
- minimumAmount: number;
13
- }
14
7
  interface BaseCheckoutFees {
15
8
  paymentMethod: PaymentMethod;
16
9
  marketMakerFeeUsd: number;
@@ -31,11 +24,7 @@ interface CardCheckoutFees extends BaseCheckoutFees {
31
24
  cardProcessingFeeUsd: number;
32
25
  moonpayCostUsd: number;
33
26
  }
34
- interface BrokerageCheckoutFees extends BaseCheckoutFees {
35
- paymentMethod: PaymentMethod.BROKERAGE;
36
- exchangeFeeUsd: number;
37
- }
38
- export type CheckoutFees = WalletCheckoutFees | CardCheckoutFees | BrokerageCheckoutFees;
27
+ export type CheckoutFees = WalletCheckoutFees | CardCheckoutFees;
39
28
  interface EvaluateFeeBreakdownItem {
40
29
  baseQuote: CheckoutQuoteResponse;
41
30
  selectedSourceAssetInfo: FunkitActiveCheckoutItem['selectedSourceAssetInfo'];
@@ -45,11 +34,8 @@ interface EvaluateFeeBreakdownItem {
45
34
  loginType: LoginType;
46
35
  isWithdrawal?: boolean;
47
36
  }
48
- export declare function evaluateFeeBreakdown(evalItem: EvaluateFeeBreakdownItem & {
49
- brokerageQuote?: BluvoBrokerageQuote;
50
- }): Promise<{
37
+ export declare function evaluateFeeBreakdown(evalItem: EvaluateFeeBreakdownItem): Promise<{
51
38
  fees: CheckoutFees;
52
- brokerage?: BrokerageDetails;
53
39
  }>;
54
40
  /**
55
41
  * The quote's expected loss in percent, when it exceeds `thresholdPercent`;