@funkit/connect 11.4.0 → 11.5.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 (80) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/dist/clients/{chunk-5MY7WMEJ.js → chunk-3U55HYGJ.js} +2 -2
  3. package/dist/clients/{chunk-BPDLF2R6.js → chunk-DSZHYQPX.js} +1 -1
  4. package/dist/clients/chunk-MSLPLXR2.js +30 -0
  5. package/dist/clients/{chunk-3Y5EIONT.js → chunk-UMU5S2WF.js} +30 -39
  6. package/dist/clients/chunk-WCQ6HJ27.js +13 -0
  7. package/dist/clients/{chunk-XJTRLB7W.js → chunk-ZEDRWRYA.js} +15 -13
  8. package/dist/clients/fanatics.js +4 -4
  9. package/dist/clients/internal/nado/withdrawalCallback.js +2 -9
  10. package/dist/clients/internal/nado/withdrawalConfig.d.ts +4 -9
  11. package/dist/clients/internal/nado/withdrawalConfig.js +3 -7
  12. package/dist/clients/internal/nado/withdrawalErrors.d.ts +6 -10
  13. package/dist/clients/internal/nado/withdrawalErrors.js +1 -2
  14. package/dist/clients/internal/nado/withdrawalForm.css +82 -74
  15. package/dist/clients/internal/nado/withdrawalForm.d.ts +1 -1
  16. package/dist/clients/internal/nado/withdrawalForm.js +12 -45
  17. package/dist/clients/internal/nado/withdrawalStatus.d.ts +1 -15
  18. package/dist/clients/internal/nado/withdrawalStatus.js +11 -61
  19. package/dist/clients/lighter.css +260 -252
  20. package/dist/clients/lighter.js +6 -9
  21. package/dist/clients/nado.d.ts +2 -2
  22. package/dist/clients/nado.js +10 -16
  23. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +263 -255
  24. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +3 -3
  25. package/dist/clients/polymarket/index.css +263 -255
  26. package/dist/clients/polymarket/index.js +3 -3
  27. package/dist/components/Dropdown/BaseDropdown.css.d.ts +1 -0
  28. package/dist/components/Dropdown/BaseDropdown.d.ts +0 -1
  29. package/dist/consts/funkit.d.ts +2 -0
  30. package/dist/hooks/track/analytics/events.d.ts +35 -3
  31. package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +1 -0
  32. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +11 -3
  33. package/dist/hooks/track/analytics/useTrackExecutionProgressEvents.d.ts +1 -0
  34. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +24 -1
  35. package/dist/hooks/useBluvo.d.ts +7 -2
  36. package/dist/hooks/useSwappedTheme.d.ts +3 -0
  37. package/dist/index.css +93 -85
  38. package/dist/index.js +12822 -12797
  39. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +5 -11
  40. package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +3 -1
  41. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +3 -1
  42. package/dist/providers/FunkitCheckoutContext/types.d.ts +1 -1
  43. package/dist/providers/FunkitProvider.d.ts +1 -0
  44. package/dist/shadow/adoptStyles.d.ts +5 -0
  45. package/dist/shadow-css.d.ts +1 -0
  46. package/dist/shadow-css.js +2 -0
  47. package/dist/utils/swapped.d.ts +8 -6
  48. package/dist/wallets/walletConnectors/index.js +9 -9
  49. package/package.json +11 -6
  50. package/shadow-css/package.json +3 -0
  51. package/dist/clients/chunk-2576N7PQ.js +0 -44
  52. package/dist/clients/chunk-3P2C436B.js +0 -20
  53. package/dist/clients/chunk-63XTVHO3.js +0 -19
  54. package/dist/clients/chunk-6T6URLBM.js +0 -33
  55. package/dist/clients/chunk-EQFVPSR2.js +0 -40
  56. package/dist/clients/chunk-FM7SFGAV.js +0 -106
  57. package/dist/clients/chunk-JFDRLSYM.js +0 -42
  58. package/dist/clients/chunk-TZGKB6WY.js +0 -160
  59. package/dist/clients/chunk-VIAEAD75.js +0 -61
  60. package/dist/clients/chunk-WZRW6WUM.js +0 -112
  61. package/dist/clients/chunk-Z7HTQFEO.js +0 -69
  62. package/dist/clients/internal/nado/consts.d.ts +0 -22
  63. package/dist/clients/internal/nado/consts.js +0 -15
  64. package/dist/clients/internal/nado/encoding.d.ts +0 -25
  65. package/dist/clients/internal/nado/encoding.js +0 -11
  66. package/dist/clients/internal/nado/errors.d.ts +0 -68
  67. package/dist/clients/internal/nado/errors.js +0 -19
  68. package/dist/clients/internal/nado/fetch.d.ts +0 -15
  69. package/dist/clients/internal/nado/fetch.js +0 -9
  70. package/dist/clients/internal/nado/gateway.d.ts +0 -61
  71. package/dist/clients/internal/nado/gateway.js +0 -17
  72. package/dist/clients/internal/nado/hooks.d.ts +0 -208
  73. package/dist/clients/internal/nado/hooks.js +0 -21
  74. package/dist/clients/internal/nado/indexer.d.ts +0 -43
  75. package/dist/clients/internal/nado/indexer.js +0 -13
  76. package/dist/clients/internal/nado/typedData.d.ts +0 -80
  77. package/dist/clients/internal/nado/typedData.js +0 -10
  78. package/dist/clients/internal/nado/withdrawalTypes.d.ts +0 -49
  79. package/dist/clients/internal/nado/withdrawalTypes.js +0 -1
  80. package/dist/utils/safeBigInt.d.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 11.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8834077: Add a shadow-css export for applying funkit styles inside a shadow root.
8
+
9
+ ### Patch Changes
10
+
11
+ - ace6823: Connect-brokerage copy now says "Fun" instead of "Fun.xyz".
12
+ - db6edb4: No consumer facing changes.
13
+ - db6edb4: No consumer facing changes.
14
+ - db6edb4: No consumer facing changes.
15
+ - 87d5708: Add XAUT (Tether Gold) as a Lighter spot asset for deposits and Secure withdrawals.
16
+ - e671988: Automatically fill the withdrawal recipient with the connected wallet address when eligible.
17
+ - 7e62bd9: The shadow-css stylesheet now carries its own CSS reset, since a shadow root gets no reset from the host page.
18
+ - fc940b9: Custom-theme CSS variables now resolve for the Swapped embed even when defined on a wrapper element instead of `:root`.
19
+ - 65ad747: Fire the `onClose` callback when a withdrawal closes.
20
+ - 6aa78b7: Track withdrawal transfer interactions in analytics.
21
+ - Updated dependencies [db6edb4]
22
+ - Updated dependencies [c8a547b]
23
+ - Updated dependencies [b2148be]
24
+ - Updated dependencies [87d5708]
25
+ - Updated dependencies [e671988]
26
+ - Updated dependencies [d0fb831]
27
+ - @funkit/connect-core@4.1.0
28
+ - @funkit/fun-relay@2.14.0
29
+ - @funkit/api-base@7.1.2
30
+
31
+ ## 11.4.1
32
+
33
+ ### Patch Changes
34
+
35
+ - 1116a3c: Track brokerage account connection lifecycle events in analytics.
36
+ - 530d664: Dedupe `react-remove-scroll` to a single copy, and allow pinch-zoom over an open modal.
37
+ - 6c051e7: No consumer facing changes.
38
+ - 84683ff: No consumer facing changes.
39
+ - df95715: No consumer facing changes.
40
+ - d46284d: No consumer facing changes.
41
+ - 2522e00: No consumer facing changes.
42
+ - 1e6df43: Lighter Fast's unstaked withdrawal fee is now always accurate to the account's current stake, and the quote waits for it before pricing.
43
+ - b28ba34: Brace every `if`/`else`/loop body — formatting only, no behaviour change.
44
+ - dae8c51: Append EIP-681 `@<chainId>` suffix to EVM deposit QR code URIs so MetaMask mobile's scanner can resolve the network
45
+ - 1116a3c: Add sanitized error context to failed account connection analytics events.
46
+ - 5b8f4ff: Prevent dropdown animation styles from colliding with host-page styles, and ensure the withdrawal source-token dropdown uses the configured modal stacking order.
47
+ - 2ad0cd5: fix: keep dropdowns open when selecting their own items in shadow DOM
48
+ - b0cb492: fix: animate the correct notification banner icon when more than one is on screen
49
+ - Updated dependencies [4b25619]
50
+ - Updated dependencies [84683ff]
51
+ - Updated dependencies [df95715]
52
+ - Updated dependencies [d46284d]
53
+ - Updated dependencies [1e6df43]
54
+ - Updated dependencies [1e6df43]
55
+ - Updated dependencies [1e6df43]
56
+ - Updated dependencies [b28ba34]
57
+ - Updated dependencies [dae8c51]
58
+ - Updated dependencies [e75b048]
59
+ - Updated dependencies [2522e00]
60
+ - Updated dependencies [2ad0cd5]
61
+ - @funkit/utils@4.0.1
62
+ - @funkit/api-base@7.1.1
63
+ - @funkit/connect-core@4.0.0
64
+ - @funkit/fun-relay@2.13.0
65
+
3
66
  ## 11.4.0
4
67
 
5
68
  ### Minor Changes
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/consts/funkit.ts
4
4
  import { FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS } from "@funkit/chains";
5
- var FUN_ORG_NAME = "Fun.xyz";
5
+ var FUN_BRAND_NAME = "Fun";
6
6
  var PLACEHOLDER_FUNKIT_USER_INFO = {
7
7
  id: "0x",
8
8
  address: "0x",
@@ -15,6 +15,6 @@ var PLACEHOLDER_FUNKIT_USER_INFO = {
15
15
  };
16
16
 
17
17
  export {
18
- FUN_ORG_NAME,
18
+ FUN_BRAND_NAME,
19
19
  PLACEHOLDER_FUNKIT_USER_INFO
20
20
  };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  PLACEHOLDER_FUNKIT_USER_INFO
4
- } from "./chunk-5MY7WMEJ.js";
4
+ } from "./chunk-3U55HYGJ.js";
5
5
 
6
6
  // src/providers/GeneralWalletProvider.tsx
7
7
  import React, {
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import {
3
+ i18n_default
4
+ } from "./chunk-C45VNQXY.js";
5
+
6
+ // src/clients/internal/nado/withdrawalErrors.ts
7
+ import {
8
+ toNadoWithdrawalFailure
9
+ } from "@funkit/connect-core/clients/nado";
10
+ import { isExpectedNadoWithdrawalFailure } from "@funkit/connect-core/clients/nado";
11
+ var MESSAGE_FOR = {
12
+ generic: () => i18n_default.t("withdrawal.nado.errorGeneric"),
13
+ network: () => i18n_default.t("withdrawal.nado.errorNetwork"),
14
+ rateLimited: () => i18n_default.t("withdrawal.nado.errorRateLimited"),
15
+ exceedsBorrowLimit: () => i18n_default.t("withdrawal.nado.errorExceedsBorrowLimit"),
16
+ invalidNonce: () => i18n_default.t("withdrawal.nado.errorInvalidNonce"),
17
+ noPriorDeposit: () => i18n_default.t("withdrawal.nado.errorNoPriorDeposit"),
18
+ withdrawRisk: () => i18n_default.t("withdrawal.nado.errorWithdrawRisk"),
19
+ // Never says "try again" — a fresh nonce on an unconfirmed withdrawal is the
20
+ // one retry that can pay out twice.
21
+ unconfirmed: () => i18n_default.t("withdrawal.nado.errorUnconfirmed")
22
+ };
23
+ function toNadoWithdrawalErrorMessage(error) {
24
+ return MESSAGE_FOR[toNadoWithdrawalFailure(error)]();
25
+ }
26
+
27
+ export {
28
+ toNadoWithdrawalErrorMessage,
29
+ isExpectedNadoWithdrawalFailure
30
+ };
@@ -1,33 +1,11 @@
1
1
  "use client";
2
- import {
3
- buildWithdrawCollateralV2TypedData
4
- } from "./chunk-2576N7PQ.js";
5
2
  import {
6
3
  isExpectedNadoWithdrawalFailure,
7
4
  toNadoWithdrawalErrorMessage
8
- } from "./chunk-VIAEAD75.js";
9
- import {
10
- safeBigInt
11
- } from "./chunk-63XTVHO3.js";
5
+ } from "./chunk-MSLPLXR2.js";
12
6
  import {
13
7
  toWithdrawalAmountBaseUnit
14
8
  } from "./chunk-B7UU2ETA.js";
15
- import {
16
- x18ToRawBaseUnit
17
- } from "./chunk-6T6URLBM.js";
18
- import {
19
- executeNadoWithdrawCollateralV2,
20
- getNadoMaxWithdrawable,
21
- getNadoTxNonce
22
- } from "./chunk-TZGKB6WY.js";
23
- import {
24
- INK_CHAIN_ID,
25
- NADO_WITHDRAWAL_ACTION_TYPE
26
- } from "./chunk-3P2C436B.js";
27
- import {
28
- NadoGatewayError,
29
- NadoWithdrawalUnconfirmedError
30
- } from "./chunk-Z7HTQFEO.js";
31
9
  import {
32
10
  getAccount,
33
11
  signTypedData,
@@ -48,7 +26,18 @@ import {
48
26
  NADO_API_KEY,
49
27
  initializeCheckoutTokenTransferAddress
50
28
  } from "@funkit/api-base";
51
- import { deductFlatFee } from "@funkit/connect-core";
29
+ import { deductFlatFee, safeBigInt } from "@funkit/connect-core";
30
+ import {
31
+ INK_CHAIN_ID,
32
+ NADO_WITHDRAWAL_ACTION_TYPE,
33
+ NadoGatewayError,
34
+ NadoWithdrawalUnconfirmedError,
35
+ buildWithdrawCollateralV2TypedData,
36
+ executeNadoWithdrawCollateralV2,
37
+ getNadoMaxWithdrawable,
38
+ getNadoTxNonce,
39
+ x18ToRawBaseUnit
40
+ } from "@funkit/connect-core/clients/nado";
52
41
  import { isEVMAddressEquivalent } from "@funkit/utils";
53
42
 
54
43
  // src/utils/signature.ts
@@ -143,7 +132,7 @@ function createNadoWithdrawalCallback({
143
132
  destinationAddress
144
133
  });
145
134
  step = "sign";
146
- const nonce = await getNadoTxNonce(walletAddress);
135
+ const nonce = await getNadoTxNonce(walletAddress, { logger });
147
136
  const signature = await signTypedData(wagmiConfig, {
148
137
  ...buildWithdrawCollateralV2TypedData({
149
138
  sender: subaccount,
@@ -160,15 +149,18 @@ function createNadoWithdrawalCallback({
160
149
  productId
161
150
  });
162
151
  step = "execute";
163
- await executeNadoWithdrawCollateralV2({
164
- sender: subaccount,
165
- productId,
166
- amount: netRawAmount,
167
- nonce,
168
- sendTo: depositAddr,
169
- signature,
170
- spotLeverage
171
- });
152
+ await executeNadoWithdrawCollateralV2(
153
+ {
154
+ sender: subaccount,
155
+ productId,
156
+ amount: netRawAmount,
157
+ nonce,
158
+ sendTo: depositAddr,
159
+ signature,
160
+ spotLeverage
161
+ },
162
+ { logger }
163
+ );
172
164
  logger.info("nado:withdrawal:executeSubmitted", {
173
165
  nonce: nonce.toString(),
174
166
  depositAddr,
@@ -194,11 +186,10 @@ async function assertWithinMaxWithdrawable({
194
186
  spotLeverage,
195
187
  netRawAmount
196
188
  }) {
197
- const maxWithdrawableX18 = await getNadoMaxWithdrawable({
198
- productId,
199
- sender: subaccount,
200
- spotLeverage
201
- });
189
+ const maxWithdrawableX18 = await getNadoMaxWithdrawable(
190
+ { productId, sender: subaccount, spotLeverage },
191
+ { logger }
192
+ );
202
193
  const maxRawAmount = x18ToRawBaseUnit(
203
194
  safeBigInt(maxWithdrawableX18, 0n),
204
195
  decimals
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import {
3
+ isCustomWithdrawalConfig
4
+ } from "./chunk-B7UU2ETA.js";
5
+
6
+ // src/clients/internal/nado/withdrawalConfig.ts
7
+ function isNadoWithdrawalConfig(config) {
8
+ return !!config && isCustomWithdrawalConfig(config) && config.customerConfig?.customerName === "nado";
9
+ }
10
+
11
+ export {
12
+ isNadoWithdrawalConfig
13
+ };
@@ -35,7 +35,7 @@ import React11, { useEffect as useEffect4 } from "react";
35
35
  // src/components/Dropdown/BaseDropdown.tsx
36
36
  import { isMobile } from "@funkit/utils";
37
37
  import * as DropdownMenu2 from "@radix-ui/react-dropdown-menu";
38
- import React10, { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
38
+ import React10, { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
39
39
 
40
40
  // src/hooks/useScrollDivider.ts
41
41
  import { useCallback, useEffect, useState } from "react";
@@ -103,7 +103,8 @@ import React8, {
103
103
  useContext,
104
104
  useEffect as useEffect2,
105
105
  useMemo,
106
- useRef
106
+ useRef,
107
+ useState as useState2
107
108
  } from "react";
108
109
 
109
110
  // src/utils/tokenMath.ts
@@ -241,9 +242,10 @@ var BaseDropdownItem_default = BaseDropdownItem;
241
242
 
242
243
  // src/components/Dropdown/BaseDropdown.css.ts
243
244
  var BORDER_RADIUS = "dropdown";
244
- var baseDropdownItemWrapperStyles = "_1nns6ys3 _1rsrm2f17";
245
- var scrollGradientWrapperStyles = "_1nns6ys1";
246
- var scrollableDropdownStyles = "_1nns6ys0";
245
+ var baseDropdownItemWrapperStyles = "_1nns6ys6 _1rsrm2f17";
246
+ var dropdownContentAnimationStyles = "_1nns6ys2";
247
+ var scrollGradientWrapperStyles = "_1nns6ys4";
248
+ var scrollableDropdownStyles = "_1nns6ys3";
247
249
 
248
250
  // src/components/Icons/CaretDownIcon.tsx
249
251
  import clsx2 from "clsx";
@@ -565,13 +567,13 @@ var SwitchIcon = () => {
565
567
  };
566
568
 
567
569
  // src/providers/FunkitProvider.tsx
568
- var ThemeIdContext = createContext(void 0);
569
570
  var attr = "data-rk";
570
571
  var createThemeRootProps = (id) => ({ [attr]: id || "" });
571
- var useThemeRootProps = () => {
572
- const id = useContext(ThemeIdContext);
573
- return createThemeRootProps(id);
574
- };
572
+ var ThemeRootContext = createContext({
573
+ id: void 0,
574
+ element: null
575
+ });
576
+ var useThemeRootProps = () => createThemeRootProps(useContext(ThemeRootContext).id);
575
577
 
576
578
  // src/components/Dropdown/BaseActiveDropdownItem.tsx
577
579
  import React9 from "react";
@@ -796,8 +798,8 @@ function BaseDropdown({
796
798
  const { t } = useFunkitTranslation();
797
799
  const themeRootProps = useThemeRootProps();
798
800
  const isMobileDevice = isMobile();
799
- const [isOpened, setIsOpened] = useState2(false);
800
- const [searchInput, setSearchInput] = useState2("");
801
+ const [isOpened, setIsOpened] = useState3(false);
802
+ const [searchInput, setSearchInput] = useState3("");
801
803
  const { ref: scrollRef, hasTopDivider, isAtBottom } = useScrollDivider();
802
804
  const allOptions = useMemo2(
803
805
  () => buildAllOptions(options, allowUnselect, unselectLabel),
@@ -889,7 +891,7 @@ function BaseDropdown({
889
891
  side: dropdownSide,
890
892
  sideOffset: dropdownSide === "top" ? 8 : 6,
891
893
  align: dropdownAlign,
892
- className: "funkit-dropdown-content",
894
+ className: dropdownContentAnimationStyles,
893
895
  style: {
894
896
  zIndex: `calc(${themeVars.modalZIndex} + 1)`,
895
897
  width: dropdownWidth ? `${dropdownWidth}px` : openDropdownFullWidth ? "var(--radix-dropdown-menu-trigger-width)" : void 0,
@@ -4,8 +4,8 @@ import {
4
4
  preloadRemoteImages
5
5
  } from "./chunk-HZP4DXIZ.js";
6
6
  import {
7
- FUN_ORG_NAME
8
- } from "./chunk-5MY7WMEJ.js";
7
+ FUN_BRAND_NAME
8
+ } from "./chunk-3U55HYGJ.js";
9
9
  import {
10
10
  Box,
11
11
  Text
@@ -244,7 +244,7 @@ function FanaticsCustomConnectBrokerageScreen({
244
244
  {
245
245
  title: t("brokerage.credentialsNeverStored"),
246
246
  description: t("brokerage.dataEncrypted", {
247
- appName: FUN_ORG_NAME,
247
+ appName: FUN_BRAND_NAME,
248
248
  exchangeName
249
249
  }),
250
250
  icon: /* @__PURE__ */ React4.createElement(
@@ -369,7 +369,7 @@ function FanaticsCustomConnectBrokerageScreen({
369
369
  textAlign: "center",
370
370
  weight: "regular"
371
371
  },
372
- t("brokerage.dataEncryptedFooter", { appName: FUN_ORG_NAME })
372
+ t("brokerage.dataEncryptedFooter", { appName: FUN_BRAND_NAME })
373
373
  ));
374
374
  }
375
375
  function FanaticsWalletIcon() {
@@ -1,16 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  createNadoWithdrawalCallback
4
- } from "../../chunk-3Y5EIONT.js";
5
- import "../../chunk-2576N7PQ.js";
6
- import "../../chunk-VIAEAD75.js";
7
- import "../../chunk-63XTVHO3.js";
4
+ } from "../../chunk-UMU5S2WF.js";
5
+ import "../../chunk-MSLPLXR2.js";
8
6
  import "../../chunk-B7UU2ETA.js";
9
- import "../../chunk-6T6URLBM.js";
10
- import "../../chunk-TZGKB6WY.js";
11
- import "../../chunk-3P2C436B.js";
12
- import "../../chunk-WZRW6WUM.js";
13
- import "../../chunk-Z7HTQFEO.js";
14
7
  import "../../chunk-OODIKHYE.js";
15
8
  import "../../chunk-C45VNQXY.js";
16
9
  import "../../chunk-PENJ5JGH.js";
@@ -1,18 +1,13 @@
1
1
  /**
2
- * Nado withdrawal config: its type, its guard, and the subaccount id it's
3
- * built around. All SDK-private (the `clients/internal/*` exports map blocks
4
- * consumer imports) except the config type, which reaches integrators via the
5
- * `clients/nado` re-export.
2
+ * Nado withdrawal config: its type and its guard. All SDK-private (the
3
+ * `clients/internal/*` exports map blocks consumer imports) except the config
4
+ * type, which reaches integrators via the `clients/nado` re-export.
6
5
  */
7
- import type { Address, Hex } from 'viem';
6
+ import type { NadoWithdrawalCustomerConfig } from '@funkit/connect-core/clients/nado';
8
7
  import type { CustomWithdrawalConfig, FunkitWithdrawalConfig } from '../../../providers/FunkitCheckoutContext';
9
- import type { NadoWithdrawalCustomerConfig } from './withdrawalTypes';
10
8
  export interface NadoWithdrawalConfig extends CustomWithdrawalConfig {
11
9
  customerConfig: NadoWithdrawalCustomerConfig;
12
10
  /** Initial state of the borrow (spot leverage) toggle; the user may still flip it. */
13
11
  defaultSpotLeverage?: boolean;
14
12
  }
15
13
  export declare function isNadoWithdrawalConfig(config: FunkitWithdrawalConfig | null | undefined): config is NadoWithdrawalConfig;
16
- /** Packed subaccount id, or undefined when one can't be built — the caller
17
- * disables the config rather than crashing the render. */
18
- export declare function resolveNadoSubaccount(walletAddress: Address | undefined, subaccountName: string | undefined): Hex | undefined;
@@ -1,12 +1,8 @@
1
1
  "use client";
2
2
  import {
3
- isNadoWithdrawalConfig,
4
- resolveNadoSubaccount
5
- } from "../../chunk-EQFVPSR2.js";
3
+ isNadoWithdrawalConfig
4
+ } from "../../chunk-WCQ6HJ27.js";
6
5
  import "../../chunk-B7UU2ETA.js";
7
- import "../../chunk-6T6URLBM.js";
8
- import "../../chunk-AHYOV7AV.js";
9
6
  export {
10
- isNadoWithdrawalConfig,
11
- resolveNadoSubaccount
7
+ isNadoWithdrawalConfig
12
8
  };
@@ -1,14 +1,10 @@
1
1
  /**
2
- * Nado gateway failure → user-facing withdrawal message.
2
+ * Nado failure → the copy web shows for it.
3
3
  *
4
- * - Lives apart from `errors.ts`, which stays flow-agnostic (the codes are
5
- * shared across every Nado execute and query).
6
- * - Messages are surfaced verbatim by `useWithdrawal`'s custom-callback path,
7
- * so unmapped codes get the generic line and the raw Nado string is logged.
4
+ * Core classifies *which* failure it is (the part with the nonce-revert
5
+ * subtlety); this file owns web's wording. The map is exhaustive over
6
+ * `NadoWithdrawalFailure`, so a new failure code fails the build here until it
7
+ * has a line.
8
8
  */
9
- /**
10
- * Whether the failure is one we have specific copy for. Shares the code set with
11
- * {@link toNadoWithdrawalErrorMessage} so severity and messaging can't drift.
12
- */
13
- export declare function isExpectedNadoWithdrawalFailure(error: unknown): boolean;
9
+ export { isExpectedNadoWithdrawalFailure } from '@funkit/connect-core/clients/nado';
14
10
  export declare function toNadoWithdrawalErrorMessage(error: unknown): string;
@@ -2,8 +2,7 @@
2
2
  import {
3
3
  isExpectedNadoWithdrawalFailure,
4
4
  toNadoWithdrawalErrorMessage
5
- } from "../../chunk-VIAEAD75.js";
6
- import "../../chunk-Z7HTQFEO.js";
5
+ } from "../../chunk-MSLPLXR2.js";
7
6
  import "../../chunk-C45VNQXY.js";
8
7
  export {
9
8
  isExpectedNadoWithdrawalFailure,
@@ -14674,6 +14674,44 @@
14674
14674
  }
14675
14675
  }
14676
14676
 
14677
+ /* vanilla-extract-css-ns:src/components/Icons/Icons.css.ts.vanilla.css?source=QGtleWZyYW1lcyBxZTIyMWEwIHsKICAwJSB7CiAgICB0cmFuc2Zvcm06IHJvdGF0ZSgwZGVnKTsKICB9CiAgMTAwJSB7CiAgICB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOwogIH0KfQpAa2V5ZnJhbWVzIHFlMjIxYTEgewogIDAlIHsKICAgIHRyYW5zZm9ybTogcm90YXRlKDBkZWcpOwogIH0KICAxMDAlIHsKICAgIHRyYW5zZm9ybTogcm90YXRlKDM2MGRlZyk7CiAgfQp9Ci5xZTIyMWEyIHsKICBhbmltYXRpb246IHFlMjIxYTAgMC44cyBsaW5lYXIgaW5maW5pdGU7Cn0KLnFlMjIxYTMgewogIGFuaW1hdGlvbjogcWUyMjFhMCAzMDAwbXMgbGluZWFyIGluZmluaXRlOwp9Ci5xZTIyMWE0IHsKICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgYm9yZGVyLXJhZGl1czogNTAlOwogIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICBhbmltYXRpb246IHFlMjIxYTEgMC44cyBsaW5lYXIgaW5maW5pdGU7CiAgYXNwZWN0LXJhdGlvOiAxIC8gMTsKfQoucWUyMjFhNSB7CiAgcG9zaXRpb246IGFic29sdXRlOwogIHRvcDogNTAlOwogIGxlZnQ6IDUwJTsKICB0cmFuc2Zvcm06IHRyYW5zbGF0ZSgtNTAlLCAtNTAlKTsKICBib3JkZXItcmFkaXVzOiA1MCU7Cn0 */
14678
+ @keyframes qe221a0 {
14679
+ 0% {
14680
+ transform: rotate(0deg);
14681
+ }
14682
+ 100% {
14683
+ transform: rotate(360deg);
14684
+ }
14685
+ }
14686
+ @keyframes qe221a1 {
14687
+ 0% {
14688
+ transform: rotate(0deg);
14689
+ }
14690
+ 100% {
14691
+ transform: rotate(360deg);
14692
+ }
14693
+ }
14694
+ [data-rk] .qe221a2 {
14695
+ animation: qe221a0 0.8s linear infinite;
14696
+ }
14697
+ [data-rk] .qe221a3 {
14698
+ animation: qe221a0 3000ms linear infinite;
14699
+ }
14700
+ [data-rk] .qe221a4 {
14701
+ position: relative;
14702
+ border-radius: 50%;
14703
+ display: inline-block;
14704
+ animation: qe221a1 0.8s linear infinite;
14705
+ aspect-ratio: 1 / 1;
14706
+ }
14707
+ [data-rk] .qe221a5 {
14708
+ position: absolute;
14709
+ top: 50%;
14710
+ left: 50%;
14711
+ transform: translate(-50%, -50%);
14712
+ border-radius: 50%;
14713
+ }
14714
+
14677
14715
  /* vanilla-extract-css-ns:src/components/Dialog/Dialog.css.ts.vanilla.css?source=Ll8xcjhmNTcxIHsKICBib3R0b206IC0yMDBweDsKICBsZWZ0OiAtMjAwcHg7CiAgcGFkZGluZzogMjAwcHg7CiAgcmlnaHQ6IC0yMDBweDsKICB0b3A6IC0yMDBweDsKICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVooMCk7CiAgei1pbmRleDogdmFyKC0tcmstbW9kYWxaSW5kZXgpOwp9Cjp3aGVyZSguXzFyOGY1NzEpIDp3aGVyZShhdWRpbywgY2FudmFzLCBlbWJlZCwgaWZyYW1lLCBpbWcsIG9iamVjdCwgc3ZnLCB2aWRlbykgewogIGRpc3BsYXk6IGJsb2NrOwogIHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7Cn0KLl8xcjhmNTczIHsKICBtYXgtd2lkdGg6IDEwMHZ3Owp9Ci5fMXI4ZjU3NCB7CiAgZGlzcGxheTogZmxleDsKICBhbGlnbi1pdGVtczogY2VudGVyOwogIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjsKICB3aWR0aDogMTAwJTsKICBmbGV4LXNocmluazogMDsKICBtaW4taGVpZ2h0OiB2YXIoLS1yay1kaW1lbnNpb25zLW1vZGFsVG9wQmFySGVpZ2h0KTsKfQouXzFyOGY1NzYgewogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICBsZWZ0OiAwOwogIHJpZ2h0OiAwOwogIHotaW5kZXg6IDE7Cn0KLl8xcjhmNTc3IHsKICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgei1pbmRleDogMjsKfQouXzFyOGY1NzkgewogIGJvdHRvbTogMDsKICBsZWZ0OiAwOwogIHJpZ2h0OiAwOwogIHRvcDogMDsKICB6LWluZGV4OiAtMTsKfQouXzFyOGY1N2EgewogIGFsaWduLWl0ZW1zOiBjZW50ZXI7Cn0KLl8xcjhmNTdiIHsKICBhbGlnbi1pdGVtczogZmxleC1lbmQ7Cn0 */
14678
14716
  [data-rk] ._1r8f571 {
14679
14717
  bottom: -200px;
@@ -16489,44 +16527,6 @@
16489
16527
  transition: background-color 0s linear 100ms;
16490
16528
  }
16491
16529
 
16492
- /* vanilla-extract-css-ns:src/components/Icons/Icons.css.ts.vanilla.css?source=QGtleWZyYW1lcyBxZTIyMWEwIHsKICAwJSB7CiAgICB0cmFuc2Zvcm06IHJvdGF0ZSgwZGVnKTsKICB9CiAgMTAwJSB7CiAgICB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOwogIH0KfQpAa2V5ZnJhbWVzIHFlMjIxYTEgewogIDAlIHsKICAgIHRyYW5zZm9ybTogcm90YXRlKDBkZWcpOwogIH0KICAxMDAlIHsKICAgIHRyYW5zZm9ybTogcm90YXRlKDM2MGRlZyk7CiAgfQp9Ci5xZTIyMWEyIHsKICBhbmltYXRpb246IHFlMjIxYTAgMC44cyBsaW5lYXIgaW5maW5pdGU7Cn0KLnFlMjIxYTMgewogIGFuaW1hdGlvbjogcWUyMjFhMCAzMDAwbXMgbGluZWFyIGluZmluaXRlOwp9Ci5xZTIyMWE0IHsKICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgYm9yZGVyLXJhZGl1czogNTAlOwogIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICBhbmltYXRpb246IHFlMjIxYTEgMC44cyBsaW5lYXIgaW5maW5pdGU7CiAgYXNwZWN0LXJhdGlvOiAxIC8gMTsKfQoucWUyMjFhNSB7CiAgcG9zaXRpb246IGFic29sdXRlOwogIHRvcDogNTAlOwogIGxlZnQ6IDUwJTsKICB0cmFuc2Zvcm06IHRyYW5zbGF0ZSgtNTAlLCAtNTAlKTsKICBib3JkZXItcmFkaXVzOiA1MCU7Cn0 */
16493
- @keyframes qe221a0 {
16494
- 0% {
16495
- transform: rotate(0deg);
16496
- }
16497
- 100% {
16498
- transform: rotate(360deg);
16499
- }
16500
- }
16501
- @keyframes qe221a1 {
16502
- 0% {
16503
- transform: rotate(0deg);
16504
- }
16505
- 100% {
16506
- transform: rotate(360deg);
16507
- }
16508
- }
16509
- [data-rk] .qe221a2 {
16510
- animation: qe221a0 0.8s linear infinite;
16511
- }
16512
- [data-rk] .qe221a3 {
16513
- animation: qe221a0 3000ms linear infinite;
16514
- }
16515
- [data-rk] .qe221a4 {
16516
- position: relative;
16517
- border-radius: 50%;
16518
- display: inline-block;
16519
- animation: qe221a1 0.8s linear infinite;
16520
- aspect-ratio: 1 / 1;
16521
- }
16522
- [data-rk] .qe221a5 {
16523
- position: absolute;
16524
- top: 50%;
16525
- left: 50%;
16526
- transform: translate(-50%, -50%);
16527
- border-radius: 50%;
16528
- }
16529
-
16530
16530
  /* vanilla-extract-css-ns:src/components/FunInput/FunInput.css.ts.vanilla.css?source=#H4sIAAAAAAAAA9VUzU7DMAy-7yl8QRpSU6X8TCgTF8aBB-CGOLipt0VrncpNgQ7x7qgdbGXTEGIIxDHJ5-_Hjhwva9JupOF5ABAEuXLBeTaAeQ7JuS4qsHXqrEpp6UiGOj6NQEegYz2KIDkeD14G8Yoj2eFgz9QDnBijHilduKB8HUhUVTpWaR2C5wh2QY75I6gTKFBmjg3o8QDgHYplSSjIlnZV70JT0iXXRUpy31Gowi8_KznrUCnaxUx8zZmyPvdiVtlKFOLQiqdeMpL3agBfh9wxbS4eXRbmBhKtj9rj1HNQUyxc3hhwPCdxHc9hbT8zpszR0tznGUnn_M3uA8pQKVms7FeqIus5Q2lu6Sn0KUa_mXejerjxi38wKABfonWhMaDj8775L-dH22pO2sO1qzDNKet3AX-3C3vi4E_Fsf9gqBuzh3_i7Ed2716yrd2mzdw_kKzx68WbbD3smcJ2rLqiiWcmGyi7WqNvWqq-wemfrJjp96fzCplzuQIZBwAA */
16531
16531
  [data-rk] .zue0i60 {
16532
16532
  transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
@@ -16825,19 +16825,42 @@
16825
16825
  transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
16826
16826
  }
16827
16827
 
16828
- /* vanilla-extract-css-ns:src/components/Dropdown/BaseDropdown.css.ts.vanilla.css?source=#H4sIAAAAAAAAA9WTwW7bMAyG73kKIqcEsAIb3YpBxi5r36IYBtqiYyGqKFB03HTouw92mjQZVmAodtmNBPX_Ij9Kmx9VjPn2kEv4uQDgPUkXeDQHCzgo1wuA3AqH0KCY0TvtLUSOVC9eFpuz1lozUrPzas6HZzvncwp4-IOkmuuJs1fP0YJQQPV7qi-asNB75yheC61tqGOh2aDlqBTVwnJZX_lhkzkMOvspJwvlFAXq9DUUv-1PcU_H5NOX9DTlDba7rfAQnYXgI6GYraDzFHWlDA2r8mMBe5SVMbIzLQeWbDhRvBdOjsf47WxxNxXXBahgzAmFoq6PvfqoJIb2FDWfEAFwwtbr4bW1WXWaKQSoPpePGdqh8a1p6NmTrMrNTQFlAeWmvC2gms2fjY-OnixUv8PDTkn-nt1x1n-KTzn9l-weHCqaDh0Z5fR1qTLQ8vvVczzf_770CPRN_baPd8Q3c_FDs1y62B7z6gHFo3E-YxPInZpY2376cvM9l7vz0avHMDFpB8ksE2g1GAKP5OrFyy9ESovqPQQAAA */
16829
- [data-rk] ._1nns6ys0 {
16828
+ /* vanilla-extract-css-ns:src/components/Dropdown/BaseDropdown.css.ts.vanilla.css?source=#H4sIAAAAAAAAA9VVYWvbMBD9nl8hAoMEomC3XbcpFMq2f1HKOFvnRETWmdM5aTr634dlp03ahnZjH7ZPlji9d-_eneTrNe4qhhqj-pGHEC93MVM_R0plH9JHKWqgdLIzKlukvTCEWBHXRsUSPE6y-ZdP0y72MFIqz14C8xPAfEA9jK5fqshPqHiL7HUJ79D-MJrvc5_dWBDQvL7tF1FA8Gpceopox7eJvCEXBFnjBoNEowIFXBySnKdjtEGuPG31zihohbpcsWTyvgDWW2dl9RrWGL3FYu1EPx5OdNbFxsPuFcjFoCo6cRSMYvQgboOLAxFGrZy1GI6BxhRYEWMiKCkIBjFqPF4c8UERybeS-ISawVKPlQxLdsvVfr3CfnPxubnr9gWU6yVTG6xR3gUE1ksG6zDIREgVJEL1TG2AJ1rzWpfkiaOmBsN3psbSNnx9pPjWBaezvpkNMAaZLk525PkQJNS-Ju9V_jGroyrbwpW6wHuHPMnm5zOVzVQ2zy5nqh-se-2Cxbs0f8fmQSXI7_eur_Wv2ifU_Jfe9ZerAotaqLkaC7c4vj0ax8NrfwLaG_qEfurHCfBlCv5RLYcsZgVxcgPsQFsXofBo9yKmZtVduZTnsHcuOHHgO0_KliNxZ7Ro8J62aDv66xqtAzVpGCvkqBltW6LVNfVKA-k-hKHEaUrw1qvVDcLwZikFwdXQUWnbMvScqfLFs7C42oWlrtpQ9qeeOXMxOHO2b_IhuHLe65osGlURb4HtC_4ANZqnX87-7f6tJ_ifLScf_ii_AJ3ZdB5dBwAA */
16829
+ @keyframes _1nns6ys0 {
16830
+ 0% {
16831
+ opacity: 0;
16832
+ transform: scale(0.97);
16833
+ }
16834
+ 100% {
16835
+ opacity: 1;
16836
+ transform: scale(1);
16837
+ }
16838
+ }
16839
+ @keyframes _1nns6ys1 {
16840
+ 0% {
16841
+ opacity: 1;
16842
+ transform: scale(1);
16843
+ }
16844
+ 100% {
16845
+ opacity: 0;
16846
+ transform: scale(0.97);
16847
+ }
16848
+ }
16849
+ ._1nns6ys2[data-rk][data-state=closed] {
16850
+ pointer-events: none;
16851
+ }
16852
+ [data-rk] ._1nns6ys3 {
16830
16853
  overflow-y: auto;
16831
16854
  scrollbar-width: none;
16832
16855
  }
16833
- [data-rk] ._1nns6ys0::-webkit-scrollbar {
16856
+ [data-rk] ._1nns6ys3::-webkit-scrollbar {
16834
16857
  display: none;
16835
16858
  }
16836
- [data-rk] ._1nns6ys1 {
16859
+ [data-rk] ._1nns6ys4 {
16837
16860
  position: relative;
16838
16861
  overflow: hidden;
16839
16862
  }
16840
- [data-rk] ._1nns6ys1::before {
16863
+ [data-rk] ._1nns6ys4::before {
16841
16864
  content: "";
16842
16865
  position: absolute;
16843
16866
  top: 0;
@@ -16854,7 +16877,7 @@
16854
16877
  transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
16855
16878
  z-index: 1;
16856
16879
  }
16857
- [data-rk] ._1nns6ys1::after {
16880
+ [data-rk] ._1nns6ys4::after {
16858
16881
  content: "";
16859
16882
  position: absolute;
16860
16883
  bottom: 0;
@@ -16871,48 +16894,33 @@
16871
16894
  transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
16872
16895
  z-index: 1;
16873
16896
  }
16874
- [data-rk] ._1nns6ys1[data-fade-top=true]::before {
16897
+ [data-rk] ._1nns6ys4[data-fade-top=true]::before {
16875
16898
  opacity: 1;
16876
16899
  }
16877
- [data-rk] ._1nns6ys1[data-fade-bottom=true]::after {
16900
+ [data-rk] ._1nns6ys4[data-fade-bottom=true]::after {
16878
16901
  opacity: 1;
16879
16902
  }
16880
- [data-rk] ._1nns6ys3 {
16903
+ [data-rk] ._1nns6ys6 {
16881
16904
  transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
16882
16905
  }
16883
- [data-rk] ._1nns6ys3:has([aria-disabled=true]):hover {
16906
+ [data-rk] ._1nns6ys6:has([aria-disabled=true]):hover {
16884
16907
  background: initial;
16885
16908
  cursor: not-allowed;
16886
16909
  }
16887
-
16888
- /* src/components/Dropdown/BaseDropdownAnimation.css */
16889
- @keyframes funkit-dropdown-fade-in {
16890
- 0% {
16891
- opacity: 0;
16892
- transform: scale(0.97);
16893
- }
16894
- 100% {
16895
- opacity: 1;
16896
- transform: scale(1);
16897
- }
16898
- }
16899
- @keyframes funkit-dropdown-fade-out {
16900
- 0% {
16901
- opacity: 1;
16902
- transform: scale(1);
16910
+ @media (prefers-reduced-motion: no-preference) {
16911
+ ._1nns6ys2[data-rk][data-state=open] {
16912
+ animation-duration: 150ms;
16913
+ animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
16914
+ animation-fill-mode: forwards;
16915
+ animation-name: _1nns6ys0;
16903
16916
  }
16904
- 100% {
16905
- opacity: 0;
16906
- transform: scale(0.97);
16917
+ ._1nns6ys2[data-rk][data-state=closed] {
16918
+ animation-duration: 150ms;
16919
+ animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
16920
+ animation-fill-mode: forwards;
16921
+ animation-name: _1nns6ys1;
16907
16922
  }
16908
16923
  }
16909
- .funkit-dropdown-content[data-state=open] {
16910
- animation: funkit-dropdown-fade-in 150ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
16911
- }
16912
- .funkit-dropdown-content[data-state=closed] {
16913
- animation: funkit-dropdown-fade-out 150ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
16914
- pointer-events: none;
16915
- }
16916
16924
 
16917
16925
  /* vanilla-extract-css-ns:src/components/Dropdown/BaseDropdownItem.css.ts.vanilla.css?source=Ll8xOGhodzNrMSB7CiAgY3Vyc29yOiBwb2ludGVyOwp9Ci5fMThoaHczazMgewogIGN1cnNvcjogbm90LWFsbG93ZWQ7CiAgb3BhY2l0eTogMC41Owp9 */
16918
16926
  [data-rk] ._18hhw3k1 {
@@ -7,8 +7,8 @@
7
7
  * these outputs onto its own props.
8
8
  * - Every react-query call is a no-op (zero traffic) when the config isn't Nado.
9
9
  */
10
+ import { type NadoWithdrawalCustomerData } from '@funkit/connect-core/clients/nado';
10
11
  import type { FunkitWithdrawalConfig } from '../../../providers/FunkitCheckoutContext';
11
- import type { NadoWithdrawalCustomerData } from './withdrawalTypes';
12
12
  /** Structurally matches the shared flow's `clientAmountToggle` (no modals import). */
13
13
  export interface NadoAmountToggle {
14
14
  label: string;