@funkit/connect 11.6.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/{chunk-67BKQQNG.js → chunk-2RND3WWH.js} +1 -1
  3. package/dist/{chunk-L67HP4HQ.js → chunk-53FF4ZHH.js} +1 -1
  4. package/dist/{chunk-4YEAUICE.js → chunk-DH3DS4FX.js} +1 -0
  5. package/dist/clients/chunk-27VBRE7W.js +4907 -0
  6. package/dist/clients/{chunk-UPB4JKJG.js → chunk-37Q6DUR7.js} +12 -7
  7. package/dist/clients/chunk-3DHSLLCU.js +331 -0
  8. package/dist/clients/{chunk-DUBZPIDN.js → chunk-3J2GOB5X.js} +1 -1
  9. package/dist/clients/{chunk-LYZLETOM.js → chunk-A5JW3UI6.js} +1 -1
  10. package/dist/clients/chunk-BCNE3ZKM.js +190 -0
  11. package/dist/clients/chunk-BWJC2WD7.js +4899 -0
  12. package/dist/clients/{chunk-ZQZDPRWC.js → chunk-DYV3LRSE.js} +1 -1
  13. package/dist/clients/{chunk-Y7WLUPTX.js → chunk-EQA5U4V6.js} +8 -8
  14. package/dist/clients/chunk-EYMFEWQL.js +30 -0
  15. package/dist/clients/chunk-FPOGADLJ.js +4899 -0
  16. package/dist/clients/chunk-HB7S3NDI.js +15 -0
  17. package/dist/clients/chunk-HDFCM5UL.js +15 -0
  18. package/dist/clients/{chunk-IYCZWLAF.js → chunk-IAIRECDV.js} +8 -37
  19. package/dist/clients/chunk-JVR4CX6N.js +296 -0
  20. package/dist/clients/chunk-NEKHTWTT.js +331 -0
  21. package/dist/clients/chunk-PA7WW6VC.js +296 -0
  22. package/dist/clients/chunk-R6UAC2TB.js +190 -0
  23. package/dist/clients/chunk-RHOSJED2.js +335 -0
  24. package/dist/clients/chunk-SKDFSMAO.js +30 -0
  25. package/dist/clients/chunk-TI2NG2Z6.js +30 -0
  26. package/dist/clients/chunk-TZFXFVDW.js +296 -0
  27. package/dist/clients/chunk-VE6QD5IM.js +149 -0
  28. package/dist/clients/chunk-VXX2XK5J.js +190 -0
  29. package/dist/clients/{chunk-WNZ6QV5Q.js → chunk-WXSFLUPZ.js} +79 -15
  30. package/dist/clients/chunk-XSRAZSYG.js +15 -0
  31. package/dist/clients/fanatics.css +4686 -4659
  32. package/dist/clients/fanatics.js +7 -9
  33. package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
  34. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  35. package/dist/clients/internal/nado/withdrawalForm.css +4712 -4682
  36. package/dist/clients/internal/nado/withdrawalForm.js +37 -13
  37. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  38. package/dist/clients/lighter.css +4712 -4682
  39. package/dist/clients/lighter.js +50 -30
  40. package/dist/clients/mallard.js +4 -4
  41. package/dist/clients/nado.js +3 -3
  42. package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +28 -19
  43. package/dist/clients/polymarket/createPolymarketDepositConfig.js +5 -4
  44. package/dist/clients/polymarket/index.d.ts +0 -1
  45. package/dist/clients/polymarket/index.js +4 -17
  46. package/dist/clients/polymarket/polymarket.d.ts +12 -27
  47. package/dist/clients/polymarket/polymarket.js +1 -1
  48. package/dist/components/AsyncImage/useAsyncImage.d.ts +2 -0
  49. package/dist/components/Box/Box.d.ts +15 -15
  50. package/dist/components/Dialog/Dialog.d.ts +8 -1
  51. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +3 -1
  52. package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +10 -0
  53. package/dist/components/ModalHeaderTabs/ModalHeaderTabs.d.ts +23 -0
  54. package/dist/consts/polymarket.d.ts +14 -0
  55. package/dist/css/sprinkles.css.d.ts +17 -15
  56. package/dist/domains/polymarketPerps.d.ts +14 -0
  57. package/dist/hooks/queries/useFops.d.ts +3 -1
  58. package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
  59. package/dist/hooks/track/analytics/checkout.d.ts +10 -0
  60. package/dist/hooks/track/analytics/events.d.ts +20 -1
  61. package/dist/hooks/track/analytics/quote.d.ts +3 -1
  62. package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +2 -1
  63. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +0 -16
  64. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +12 -1
  65. package/dist/hooks/useCheckoutTransferInit.d.ts +3 -1
  66. package/dist/hooks/useFittedText.d.ts +19 -0
  67. package/dist/hooks/usePolymarketAccountBalances.d.ts +13 -25
  68. package/dist/hooks/useTextMeasurer.d.ts +1 -1
  69. package/dist/hooks/useUpdateActiveFunkitCheckout.d.ts +10 -0
  70. package/dist/index.css +4712 -4682
  71. package/dist/index.js +5121 -3752
  72. package/dist/modals/CheckoutModal/CheckoutModalPrefetchedHooks.d.ts +2 -1
  73. package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +1 -0
  74. package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +6 -1
  75. package/dist/modals/PolymarketPerpsTransfer/DirectionSwapButton.d.ts +1 -11
  76. package/dist/modals/PolymarketPerpsTransfer/PerpsHeaderTabs.d.ts +29 -0
  77. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.css.d.ts +9 -0
  78. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.d.ts +15 -0
  79. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferBody.d.ts +12 -0
  80. package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsPrefetch.d.ts +7 -0
  81. package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +16 -2
  82. package/dist/modals/PolymarketPerpsTransfer/TransferAccountsCard.d.ts +12 -0
  83. package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +8 -1
  84. package/dist/modals/PolymarketPerpsTransfer/TransferPercentOptions.d.ts +13 -0
  85. package/dist/modals/PolymarketPerpsTransfer/usePerpsHeaderTabsState.d.ts +28 -0
  86. package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +31 -5
  87. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +6 -0
  88. package/dist/modals/WithdrawalModal/useWithdrawalChainPreference.d.ts +17 -0
  89. package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +2 -1
  90. package/dist/providers/FunkitCheckoutContext/index.d.ts +13 -1
  91. package/dist/providers/FunkitCheckoutContext/types.d.ts +44 -20
  92. package/dist/providers/FunkitShadowHostProvider.d.ts +31 -0
  93. package/dist/providers/FunkitThemeProvider.d.ts +3 -0
  94. package/dist/providers/FunkitThemeStyle.d.ts +12 -0
  95. package/dist/shadow/loadShadowCss.d.ts +9 -0
  96. package/dist/shadow/useMountShadowHost.d.ts +18 -0
  97. package/dist/shadow/useShadowCss.d.ts +6 -0
  98. package/dist/shadow-css.js +1 -1
  99. package/dist/themes/baseTheme.js +1 -1
  100. package/dist/themes/darkTheme.js +2 -2
  101. package/dist/themes/lightTheme.js +2 -2
  102. package/dist/wallets/walletConnectors/chunk-2VP2F6EK.js +70 -0
  103. package/dist/wallets/walletConnectors/chunk-4T6ZSRJF.js +69 -0
  104. package/dist/wallets/walletConnectors/chunk-6BW3HLBG.js +96 -0
  105. package/dist/wallets/walletConnectors/chunk-CCQV2ZET.js +218 -0
  106. package/dist/wallets/walletConnectors/chunk-CPI4TD43.js +99 -0
  107. package/dist/wallets/walletConnectors/chunk-F5XEEVG6.js +98 -0
  108. package/dist/wallets/walletConnectors/chunk-HNRB7KJU.js +92 -0
  109. package/dist/wallets/walletConnectors/chunk-HTHAK6XB.js +93 -0
  110. package/dist/wallets/walletConnectors/chunk-MIQTHJ6X.js +66 -0
  111. package/dist/wallets/walletConnectors/chunk-RB3HR4R2.js +95 -0
  112. package/dist/wallets/walletConnectors/chunk-RVOY537T.js +100 -0
  113. package/dist/wallets/walletConnectors/chunk-STVVP43G.js +94 -0
  114. package/dist/wallets/walletConnectors/chunk-UK7C2JXW.js +87 -0
  115. package/dist/wallets/walletConnectors/chunk-VAPGUPHO.js +92 -0
  116. package/dist/wallets/walletConnectors/chunk-VTM6EECM.js +110 -0
  117. package/dist/wallets/walletConnectors/chunk-X6CGV36L.js +103 -0
  118. package/dist/wallets/walletConnectors/chunk-YEZM4CK4.js +96 -0
  119. package/dist/wallets/walletConnectors/chunk-ZNX4EMPB.js +106 -0
  120. package/dist/wallets/walletConnectors/index.js +33 -33
  121. package/package.json +5 -5
  122. package/dist/clients/chunk-DSZHYQPX.js +0 -31
  123. package/dist/clients/chunk-FNB7OPJI.js +0 -1316
  124. package/dist/clients/chunk-HZP4DXIZ.js +0 -231
  125. package/dist/clients/chunk-LUHEVXPD.js +0 -109
  126. package/dist/clients/chunk-SX3CX34W.js +0 -1177
  127. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +0 -17545
  128. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.d.ts +0 -30
  129. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +0 -20
  130. package/dist/clients/polymarket/index.css +0 -17545
  131. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferRows.d.ts +0 -10
  132. package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.css.d.ts +0 -13
  133. package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.d.ts +0 -27
@@ -1,28 +1,22 @@
1
1
  "use client";
2
- import {
3
- AsyncImage,
4
- sanitizeUrl
5
- } from "./chunk-HZP4DXIZ.js";
6
- import "./chunk-OODIKHYE.js";
7
- import {
8
- chainMetadataById,
9
- useFunkitConnectChainsById
10
- } from "./chunk-FNB7OPJI.js";
11
2
  import {
12
3
  useLighterAccountQuery,
13
4
  useLighterAccountsQuery
14
5
  } from "./chunk-6EU6CXNH.js";
15
6
  import {
16
7
  useFunkitConfig
17
- } from "./chunk-DUBZPIDN.js";
8
+ } from "./chunk-R6UAC2TB.js";
18
9
  import {
19
- Box
20
- } from "./chunk-LUHEVXPD.js";
10
+ AsyncImage,
11
+ Box,
12
+ sanitizeUrl
13
+ } from "./chunk-RHOSJED2.js";
21
14
  import {
22
15
  useFunkitTranslation
23
- } from "./chunk-LYZLETOM.js";
16
+ } from "./chunk-A5JW3UI6.js";
17
+ import "./chunk-OODIKHYE.js";
24
18
  import "./chunk-UPZNKPYU.js";
25
- import "./chunk-WNZ6QV5Q.js";
19
+ import "./chunk-27VBRE7W.js";
26
20
  import {
27
21
  logger
28
22
  } from "./chunk-AHYOV7AV.js";
@@ -32,11 +26,11 @@ import { LIGHTERXYZ_API_KEY } from "@funkit/api-base";
32
26
  import { SOLANA_MAINNET_CHAIN_ID } from "@funkit/chains";
33
27
  import { RELAY_LIGHTER_CHAIN_ID as RELAY_LIGHTER_CHAIN_ID2 } from "@funkit/fun-relay";
34
28
  import i18next from "i18next";
35
- import React4, { useMemo as useMemo2 } from "react";
29
+ import React5, { useMemo as useMemo3 } from "react";
36
30
  import { arbitrum, base, bsc, mainnet as mainnet2, optimism } from "viem/chains";
37
31
 
38
32
  // src/components/ChainIcon/ChainIcon.tsx
39
- import React from "react";
33
+ import React2 from "react";
40
34
 
41
35
  // src/consts/assets.ts
42
36
  import {
@@ -49,6 +43,32 @@ import {
49
43
  import { getChainIconUrl } from "@funkit/connect-core";
50
44
  import { useCallback } from "react";
51
45
 
46
+ // src/providers/FunkitConnectChainContext.tsx
47
+ import React, {
48
+ createContext,
49
+ useContext,
50
+ useMemo
51
+ } from "react";
52
+
53
+ // src/providers/provideFunkitConnectChains.ts
54
+ import { chainMetadataById } from "@funkit/chains";
55
+ var groupChainsById = (chains) => {
56
+ const chainsById = {};
57
+ for (const chainItem of chains) {
58
+ chainsById[chainItem.id] = chainItem;
59
+ }
60
+ return chainsById;
61
+ };
62
+
63
+ // src/providers/FunkitConnectChainContext.tsx
64
+ var FunkitConnectChainContext = createContext(
65
+ {
66
+ chains: []
67
+ }
68
+ );
69
+ var useFunkitConnectChains = () => useContext(FunkitConnectChainContext).chains;
70
+ var useFunkitConnectChainsById = () => groupChainsById(useFunkitConnectChains());
71
+
52
72
  // src/hooks/useSupportedAssets.ts
53
73
  import {
54
74
  getSupportedAssets
@@ -109,7 +129,7 @@ function ChainIcon({
109
129
  if (!chainMetadata) {
110
130
  return null;
111
131
  }
112
- return /* @__PURE__ */ React.createElement(
132
+ return /* @__PURE__ */ React2.createElement(
113
133
  AsyncImage,
114
134
  {
115
135
  alt: chainMetadata.name,
@@ -126,8 +146,8 @@ function ChainIcon({
126
146
  }
127
147
 
128
148
  // src/components/Icons/EvmWallet.tsx
129
- import React2 from "react";
130
- var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React2.createElement(
149
+ import React3 from "react";
150
+ var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React3.createElement(
131
151
  "svg",
132
152
  {
133
153
  width: size,
@@ -136,7 +156,7 @@ var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React2.createElement(
136
156
  fill: "none",
137
157
  xmlns: "http://www.w3.org/2000/svg"
138
158
  },
139
- /* @__PURE__ */ React2.createElement(
159
+ /* @__PURE__ */ React3.createElement(
140
160
  "path",
141
161
  {
142
162
  d: "M13.3333 6.66628V3.75016C13.3333 3.05704 13.3333 2.71048 13.1873 2.49751C13.0598 2.31143 12.8622 2.18503 12.6398 2.14718C12.3852 2.10386 12.0706 2.24909 11.4413 2.53955L4.04918 5.95127C3.48792 6.21031 3.20729 6.33984 3.00175 6.54071C2.82005 6.71829 2.68135 6.93507 2.59625 7.17447C2.5 7.44527 2.5 7.75435 2.5 8.3725V12.4996M13.75 12.0829H13.7583M2.5 9.33295L2.5 14.8329C2.5 15.7664 2.5 16.2331 2.68166 16.5896C2.84144 16.9032 3.09641 17.1582 3.41002 17.318C3.76654 17.4996 4.23325 17.4996 5.16667 17.4996H14.8333C15.7668 17.4996 16.2335 17.4996 16.59 17.318C16.9036 17.1582 17.1586 16.9032 17.3183 16.5896C17.5 16.2331 17.5 15.7664 17.5 14.8329V9.33295C17.5 8.39953 17.5 7.93282 17.3183 7.5763C17.1586 7.26269 16.9036 7.00773 16.59 6.84794C16.2335 6.66628 15.7668 6.66628 14.8333 6.66628L5.16667 6.66628C4.23325 6.66628 3.76654 6.66628 3.41002 6.84793C3.09641 7.00772 2.84144 7.26269 2.68166 7.57629C2.5 7.93281 2.5 8.39952 2.5 9.33295ZM14.1667 12.0829C14.1667 12.3131 13.9801 12.4996 13.75 12.4996C13.5199 12.4996 13.3333 12.3131 13.3333 12.0829C13.3333 11.8528 13.5199 11.6663 13.75 11.6663C13.9801 11.6663 14.1667 11.8528 14.1667 12.0829Z",
@@ -167,10 +187,10 @@ import {
167
187
  import { RELAY_LIGHTER_CHAIN_ID } from "@funkit/fun-relay";
168
188
  import { formatAddress, formatCryptoAndStringify } from "@funkit/utils";
169
189
  import { v4 as uuid } from "uuid";
170
- import React3, {
190
+ import React4, {
171
191
  useCallback as useCallback2,
172
192
  useEffect,
173
- useMemo,
193
+ useMemo as useMemo2,
174
194
  useRef,
175
195
  useState
176
196
  } from "react";
@@ -422,14 +442,14 @@ function buildLighterFastWalletWithdrawalConfig({
422
442
  };
423
443
  }
424
444
  function ChainIconStack({ chainIds }) {
425
- return /* @__PURE__ */ React4.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end" }, chainIds.map((chainId, index) => /* @__PURE__ */ React4.createElement(
445
+ return /* @__PURE__ */ React5.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end" }, chainIds.map((chainId, index) => /* @__PURE__ */ React5.createElement(
426
446
  Box,
427
447
  {
428
448
  key: chainId,
429
449
  position: "relative",
430
450
  style: { right: `${(chainIds.length - index - 1) * -2}px` }
431
451
  },
432
- /* @__PURE__ */ React4.createElement(ChainIcon, { chainId, size: 16 })
452
+ /* @__PURE__ */ React5.createElement(ChainIcon, { chainId, size: 16 })
433
453
  )));
434
454
  }
435
455
  var LIGHTER_FAST_PREVIEW_CHAIN_IDS = [
@@ -483,8 +503,8 @@ function buildLighterMultiMethodConfig({
483
503
  id: LIGHTER_FAST_METHOD_ID,
484
504
  keyText: t("withdrawal.methodFast"),
485
505
  subtitleText: isUnifiedTradingMode ? t("withdrawal.fastDisclaimerUnified") : t("withdrawal.fastDisclaimer"),
486
- icon: /* @__PURE__ */ React4.createElement(EvmWallet, { size: 20 }),
487
- valueIcon: /* @__PURE__ */ React4.createElement(ChainIconStack, { chainIds: LIGHTER_FAST_PREVIEW_CHAIN_IDS }),
506
+ icon: /* @__PURE__ */ React5.createElement(EvmWallet, { size: 20 }),
507
+ valueIcon: /* @__PURE__ */ React5.createElement(ChainIconStack, { chainIds: LIGHTER_FAST_PREVIEW_CHAIN_IDS }),
488
508
  config: fastConfig
489
509
  };
490
510
  const secure = {
@@ -496,8 +516,8 @@ function buildLighterMultiMethodConfig({
496
516
  // so it doesn't bleed into live values, which are exact.
497
517
  delay: secureDelayText ?? t("withdrawal.secureFallbackDelay")
498
518
  }),
499
- icon: /* @__PURE__ */ React4.createElement(EvmWallet, { size: 20 }),
500
- valueIcon: /* @__PURE__ */ React4.createElement(ChainIconStack, { chainIds: LIGHTER_SECURE_PREVIEW_CHAIN_IDS }),
519
+ icon: /* @__PURE__ */ React5.createElement(EvmWallet, { size: 20 }),
520
+ valueIcon: /* @__PURE__ */ React5.createElement(ChainIconStack, { chainIds: LIGHTER_SECURE_PREVIEW_CHAIN_IDS }),
501
521
  config: secureConfig
502
522
  };
503
523
  return {
@@ -514,8 +534,8 @@ function useLighterWithdrawalConfig(config) {
514
534
  // The query validates it as numeric, so the template-literal narrowing holds.
515
535
  accountIndex ? { by: "index", value: accountIndex } : null
516
536
  );
517
- const assets = useMemo2(() => account?.assets ?? [], [account]);
518
- return useMemo2(() => {
537
+ const assets = useMemo3(() => account?.assets ?? [], [account]);
538
+ return useMemo3(() => {
519
539
  if (!config || !accountIndex) {
520
540
  return null;
521
541
  }
@@ -1,4 +1,7 @@
1
1
  "use client";
2
+ import {
3
+ useFunkitTranslation
4
+ } from "./chunk-A5JW3UI6.js";
2
5
  import {
3
6
  getAccount,
4
7
  sendTransaction,
@@ -7,14 +10,11 @@ import {
7
10
  switchChain,
8
11
  waitForTransactionReceipt
9
12
  } from "./chunk-OODIKHYE.js";
10
- import {
11
- useFunkitTranslation
12
- } from "./chunk-LYZLETOM.js";
13
13
  import {
14
14
  useAccount,
15
15
  useConfig
16
16
  } from "./chunk-UPZNKPYU.js";
17
- import "./chunk-WNZ6QV5Q.js";
17
+ import "./chunk-27VBRE7W.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-AHYOV7AV.js";
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  createNadoWithdrawalCallback
4
- } from "./chunk-UPB4JKJG.js";
5
- import "./chunk-ZQZDPRWC.js";
4
+ } from "./chunk-JVR4CX6N.js";
6
5
  import "./chunk-B7UU2ETA.js";
6
+ import "./chunk-DYV3LRSE.js";
7
7
  import "./chunk-OODIKHYE.js";
8
8
  import {
9
9
  useAccount,
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-UPZNKPYU.js";
12
12
  import {
13
13
  i18n_default
14
- } from "./chunk-WNZ6QV5Q.js";
14
+ } from "./chunk-27VBRE7W.js";
15
15
  import "./chunk-PENJ5JGH.js";
16
16
  import {
17
17
  logger
@@ -1,13 +1,7 @@
1
- import type { FunkitCheckoutActionParams, FunkitCheckoutConfig, PolymarketTransferAccount } from '../../providers/FunkitCheckoutContext/types';
1
+ import { POLYMARKET_PERPS_ROUTING_ID, POLYMARKET_PREDICTIONS_ROUTING_ID } from '../../consts/polymarket';
2
+ import type { DepositAccess, FunkitCheckoutActionParams, FunkitCheckoutConfig, PolymarketPerpsTransferPending, PolymarketTransferAccount } from '../../providers/FunkitCheckoutContext/types';
2
3
  import { type PolymarketPerpsDepositConfig } from './polymarket';
3
- /**
4
- * Routing ids that select the deposit destination. The deposit dropdown writes
5
- * the chosen id to `config.dynamicRoutingId`; the combined
6
- * {@link createPolymarketDepositConfig} reads it to build the right deposit
7
- * (predictions vs perps) within a single checkout.
8
- */
9
- export declare const POLYMARKET_PREDICTIONS_ROUTING_ID = "POLYMARKET_PREDICTIONS";
10
- export declare const POLYMARKET_PERPS_ROUTING_ID = "POLYMARKET_PERPS";
4
+ export { POLYMARKET_PERPS_ROUTING_ID, POLYMARKET_PREDICTIONS_ROUTING_ID };
11
5
  /**
12
6
  * Builds the `generateActionsParams` for a Polymarket *Predictions* deposit:
13
7
  * wrap USDC.e → pUSD into the predictions proxy via the CollateralOnramp,
@@ -28,7 +22,7 @@ export type PolymarketAccount = PolymarketTransferAccount;
28
22
  * reaching outside this entry point — returning the rail's id is what lets a
29
23
  * transfer record be joined to Polymarket's side of the same transfer.
30
24
  */
31
- export type { PolymarketTransferResult } from '../../providers/FunkitCheckoutContext/types';
25
+ export type { PolymarketPerpsTransferPending, DepositAccess, PolymarketTransferResult, } from '../../providers/FunkitCheckoutContext/types';
32
26
  export interface CreatePolymarketDepositConfigParams {
33
27
  /** Predictions account (the user's predictions proxy). */
34
28
  predictions: PolymarketAccount;
@@ -37,24 +31,39 @@ export interface CreatePolymarketDepositConfigParams {
37
31
  /** Optional subtitle under the modal title, e.g. a balance line. */
38
32
  modalTitleMeta?: string;
39
33
  /**
40
- * Optional per-destination modal title overrides. When omitted, the title
41
- * follows the selected destination: "Deposit (Predictions)" /
42
- * "Deposit (Perps)".
34
+ * Optional per-destination modal title overrides. When omitted, both
35
+ * destinations title the modal "Deposit" — the header tabs already name the
36
+ * selected account.
43
37
  */
44
38
  modalTitles?: {
45
39
  predictions?: string;
46
40
  perps?: string;
47
41
  };
48
42
  /**
49
- * Account preselected in the "Deposit to" dropdown when the modal opens.
50
- * The user can still switch via the dropdown. Defaults to `'predictions'`.
43
+ * Account selected when the modal opens. Falls back to the accessible account
44
+ * when the requested default is unavailable. Defaults to `'predictions'`.
51
45
  */
52
46
  defaultAccount?: 'predictions' | 'perps';
47
+ /**
48
+ * In-flight perps transfers at the time the modal opens. While a deposit or
49
+ * withdrawal is pending the transfer step disables Transfer and shows a
50
+ * pending state. Keep it current after opening with
51
+ * `useUpdateActiveFunkitCheckout().updatePolymarketPerpsTransferPending`.
52
+ */
53
+ pendingTransfers?: PolymarketPerpsTransferPending;
54
+ /**
55
+ * Geo eligibility per product; omit to preserve access to both. Reflects
56
+ * location restrictions only — a false flag surfaces as "Unavailable in your
57
+ * location".
58
+ */
59
+ access?: DepositAccess;
53
60
  }
54
61
  /**
55
62
  * Builds the entire Polymarket deposit checkout config from the two accounts.
56
- * The "Deposit to" dropdown switches `dynamicRoutingId`; modal title, min
57
- * deposit, recipient and on-chain deposit actions are derived per account.
58
- * Integrators call this and render {@link PolymarketDepositAccountDropdown}.
63
+ * Because `polymarketPerpsTransfer` is set, the checkout modal enters its
64
+ * perps header-tabs state (Predictions | Perps | Transfer) on the deposit and
65
+ * transfer screens — the tabs switch `dynamicRoutingId` or open the transfer
66
+ * step; modal title, min deposit, recipient and on-chain deposit actions are
67
+ * derived per account. Supersedes the "Deposit to" dropdown.
59
68
  */
60
- export declare function createPolymarketDepositConfig({ predictions, perps, modalTitleMeta, modalTitles, defaultAccount, }: CreatePolymarketDepositConfigParams): FunkitCheckoutConfig;
69
+ export declare function createPolymarketDepositConfig({ predictions, perps, modalTitleMeta, modalTitles, defaultAccount, pendingTransfers, access, }: CreatePolymarketDepositConfigParams): FunkitCheckoutConfig;
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import {
3
- POLYMARKET_PERPS_ROUTING_ID,
4
- POLYMARKET_PREDICTIONS_ROUTING_ID,
5
3
  createPolymarketDepositConfig,
6
4
  createPredictionsGenerateActionParams
7
- } from "../chunk-Y7WLUPTX.js";
8
- import "../chunk-IYCZWLAF.js";
5
+ } from "../chunk-VE6QD5IM.js";
6
+ import {
7
+ POLYMARKET_PERPS_ROUTING_ID,
8
+ POLYMARKET_PREDICTIONS_ROUTING_ID
9
+ } from "../chunk-IAIRECDV.js";
9
10
  import "../chunk-PENJ5JGH.js";
10
11
  import "../chunk-AHYOV7AV.js";
11
12
  export {
@@ -5,4 +5,3 @@
5
5
  */
6
6
  export * from './createPolymarketDepositConfig';
7
7
  export * from './polymarket';
8
- export * from './PolymarketDepositAccountDropdown';
@@ -1,33 +1,21 @@
1
1
  "use client";
2
2
  import {
3
- PolymarketDepositAccountDropdown
4
- } from "../chunk-SX3CX34W.js";
5
- import "../chunk-DSZHYQPX.js";
6
- import "../chunk-3U55HYGJ.js";
7
- import "../chunk-FNB7OPJI.js";
8
- import "../chunk-6EU6CXNH.js";
9
- import "../chunk-DUBZPIDN.js";
10
- import "../chunk-LUHEVXPD.js";
11
- import "../chunk-LYZLETOM.js";
12
- import "../chunk-UPZNKPYU.js";
13
- import "../chunk-WNZ6QV5Q.js";
14
- import {
15
- POLYMARKET_PERPS_ROUTING_ID,
16
- POLYMARKET_PREDICTIONS_ROUTING_ID,
17
3
  createPolymarketDepositConfig,
18
4
  createPredictionsGenerateActionParams
19
- } from "../chunk-Y7WLUPTX.js";
5
+ } from "../chunk-VE6QD5IM.js";
20
6
  import {
21
7
  AMOUNT_PLACEHOLDER,
22
8
  COLLATERAL_ONRAMP_ABI,
23
9
  COLLATERAL_ONRAMP_ADDRESS,
24
10
  POLYGON_USDCE,
11
+ POLYMARKET_PERPS_ROUTING_ID,
12
+ POLYMARKET_PREDICTIONS_ROUTING_ID,
25
13
  PUSD_TOKEN,
26
14
  VAULT_DEPOSITOR_ABI,
27
15
  VAULT_DEPOSITOR_POLYGON,
28
16
  createPerpsGenerateActionParams,
29
17
  createPolymarketWithdrawalConfig
30
- } from "../chunk-IYCZWLAF.js";
18
+ } from "../chunk-IAIRECDV.js";
31
19
  import "../chunk-PENJ5JGH.js";
32
20
  import "../chunk-AHYOV7AV.js";
33
21
  export {
@@ -38,7 +26,6 @@ export {
38
26
  POLYMARKET_PERPS_ROUTING_ID,
39
27
  POLYMARKET_PREDICTIONS_ROUTING_ID,
40
28
  PUSD_TOKEN,
41
- PolymarketDepositAccountDropdown,
42
29
  VAULT_DEPOSITOR_ABI,
43
30
  VAULT_DEPOSITOR_POLYGON,
44
31
  createPerpsGenerateActionParams,
@@ -16,16 +16,10 @@
16
16
  * {@link WalletWithdrawalConfig}.
17
17
  */
18
18
  import { type Address, type PublicClient, type TransactionReceipt } from 'viem';
19
- import type { CustomWithdrawalConfig, FunkitCheckoutActionParams, FunkitWithdrawalConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext/types';
19
+ import { POLYGON_USDCE, PUSD_TOKEN } from '../../consts/polymarket';
20
+ import type { CustomWithdrawalConfig, FunkitCheckoutActionParams, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext/types';
20
21
  import type { WithdrawalTransaction } from '../../wallets/Wallet';
21
- /** Polygon USDCe — used as sourceTokenAddress for withdrawals */
22
- export declare const POLYGON_USDCE: Address;
23
- /** Polymarket pUSD on Polygon — the integrator-held source token in the wallet-unwrap flow. */
24
- export declare const PUSD_TOKEN: {
25
- readonly address: `0x${string}`;
26
- readonly symbol: "pUSD";
27
- readonly iconSrc: "https://sdk-cdn.fun.xyz/images/pusd.svg";
28
- };
22
+ export { POLYGON_USDCE, PUSD_TOKEN };
29
23
  export interface PolymarketWithdrawalCallbackConfig {
30
24
  userId: string;
31
25
  modalTitle?: string;
@@ -79,17 +73,18 @@ export interface PolymarketWalletUnwrapWithdrawalConfig {
79
73
  iconSrc?: string;
80
74
  }
81
75
  /**
82
- * Combined input — supplies params for both flows. The runtime path is
83
- * chosen at call time via the `enable-polymarket-wallet-withdrawal`
84
- * Statsig gate (read synchronously through {@link checkFeatureGate}, so
85
- * this stays a regular function callable from event handlers).
76
+ * Combined input — supplies params for both flows.
77
+ *
78
+ * @deprecated The `enable-polymarket-wallet-withdrawal` rollout is complete,
79
+ * so this always resolves to the wallet-unwrap flow and the UDA params
80
+ * (`userId`, `sendPmctTransfer`) are ignored. Pass
81
+ * {@link PolymarketWalletUnwrapWithdrawalConfig} instead.
86
82
  */
87
83
  export interface PolymarketWithdrawalConfig extends PolymarketWithdrawalCallbackConfig, PolymarketWalletUnwrapWithdrawalConfig {
88
84
  }
89
85
  /**
90
- * Combined / gated entry point. Returns a {@link CustomWithdrawalConfig}
91
- * (UDA path) or {@link WalletWithdrawalConfig} (wallet-unwrap path)
92
- * depending on the gate value at call time.
86
+ * Combined entry point. Always returns the wallet-unwrap
87
+ * {@link WalletWithdrawalConfig} — see {@link PolymarketWithdrawalConfig}.
93
88
  *
94
89
  * ```ts
95
90
  * const withdrawalConfig = createPolymarketWithdrawalConfig({
@@ -101,15 +96,10 @@ export interface PolymarketWithdrawalConfig extends PolymarketWithdrawalCallback
101
96
  * })
102
97
  * ```
103
98
  */
104
- export declare function createPolymarketWithdrawalConfig(config: PolymarketWithdrawalConfig): FunkitWithdrawalConfig;
99
+ export declare function createPolymarketWithdrawalConfig(config: PolymarketWithdrawalConfig): WalletWithdrawalConfig;
105
100
  /**
106
101
  * Legacy UDA / PMCT transfer flow. Returns a {@link CustomWithdrawalConfig}.
107
102
  *
108
- * @deprecated Pass the combined {@link PolymarketWithdrawalConfig} instead so
109
- * the wallet-unwrap rollout can be staged via the
110
- * `enable-polymarket-wallet-withdrawal` Statsig gate. Direct callers of this
111
- * single-flow overload bypass the gate.
112
- *
113
103
  * ```ts
114
104
  * const withdrawalConfig = createPolymarketWithdrawalConfig({
115
105
  * userId: walletAddress,
@@ -124,11 +114,6 @@ export declare function createPolymarketWithdrawalConfig(config: PolymarketWithd
124
114
  * coordinate via a closure-scoped queue, so the integrator only sees the
125
115
  * batched `sendTransactions` primitive.
126
116
  *
127
- * @deprecated Pass the combined {@link PolymarketWithdrawalConfig} instead so
128
- * the wallet-unwrap rollout can be staged via the
129
- * `enable-polymarket-wallet-withdrawal` Statsig gate. Direct callers of this
130
- * single-flow overload bypass the gate.
131
- *
132
117
  * ```ts
133
118
  * const withdrawalConfig = createPolymarketWithdrawalConfig({
134
119
  * proxyAddress,
@@ -9,7 +9,7 @@ import {
9
9
  VAULT_DEPOSITOR_POLYGON,
10
10
  createPerpsGenerateActionParams,
11
11
  createPolymarketWithdrawalConfig
12
- } from "../chunk-IYCZWLAF.js";
12
+ } from "../chunk-IAIRECDV.js";
13
13
  import "../chunk-PENJ5JGH.js";
14
14
  import "../chunk-AHYOV7AV.js";
15
15
  export {
@@ -1,5 +1,7 @@
1
1
  export type AsyncImageSrc = () => Promise<string>;
2
2
  export declare function loadImages(...urls: (string | AsyncImageSrc)[]): Promise<(string | undefined)[]>;
3
3
  export declare function useAsyncImage(url?: string | AsyncImageSrc): string | undefined;
4
+ export declare function markRemoteImageLoaded(url: string): void;
5
+ export declare function hasRemoteImageLoaded(url: string | undefined): boolean;
4
6
  /** Preload remote images by triggering browser fetches via Image(). */
5
7
  export declare function preloadRemoteImages(...imageUrls: string[]): void;