@funkit/connect 11.4.1 → 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 (73) hide show
  1. package/CHANGELOG.md +28 -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-WCQ6HJ27.js +13 -0
  5. package/dist/clients/{chunk-BB5FHA47.js → chunk-ZEDRWRYA.js} +10 -9
  6. package/dist/clients/fanatics.js +4 -4
  7. package/dist/clients/internal/nado/withdrawalConfig.d.ts +4 -9
  8. package/dist/clients/internal/nado/withdrawalConfig.js +3 -6
  9. package/dist/clients/internal/nado/withdrawalForm.css +38 -38
  10. package/dist/clients/internal/nado/withdrawalForm.js +6 -31
  11. package/dist/clients/internal/nado/withdrawalStatus.d.ts +1 -15
  12. package/dist/clients/internal/nado/withdrawalStatus.js +8 -54
  13. package/dist/clients/lighter.css +216 -216
  14. package/dist/clients/lighter.js +1 -0
  15. package/dist/clients/nado.d.ts +1 -1
  16. package/dist/clients/nado.js +8 -6
  17. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +216 -216
  18. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +3 -3
  19. package/dist/clients/polymarket/index.css +216 -216
  20. package/dist/clients/polymarket/index.js +3 -3
  21. package/dist/consts/funkit.d.ts +2 -0
  22. package/dist/hooks/track/analytics/events.d.ts +21 -0
  23. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +24 -1
  24. package/dist/hooks/useSwappedTheme.d.ts +3 -0
  25. package/dist/index.css +49 -49
  26. package/dist/index.js +12321 -12173
  27. package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +3 -1
  28. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +3 -1
  29. package/dist/providers/FunkitProvider.d.ts +1 -0
  30. package/dist/shadow/adoptStyles.d.ts +5 -0
  31. package/dist/shadow-css.d.ts +1 -0
  32. package/dist/shadow-css.js +2 -0
  33. package/dist/utils/swapped.d.ts +8 -6
  34. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  35. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  36. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  37. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  38. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  39. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  40. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  43. package/dist/wallets/walletConnectors/index.js +41 -41
  44. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  45. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  46. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  47. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  48. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  49. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  50. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  51. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  52. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  53. package/package.json +10 -5
  54. package/shadow-css/package.json +3 -0
  55. package/dist/clients/chunk-TYG42JRZ.js +0 -40
  56. package/dist/wallets/walletConnectors/{chunk-W2LCLDPX.js → chunk-2VP2F6EK.js} +3 -3
  57. package/dist/wallets/walletConnectors/{chunk-IULPZP2Q.js → chunk-4T6ZSRJF.js} +3 -3
  58. package/dist/wallets/walletConnectors/{chunk-WAHGI5L7.js → chunk-6BW3HLBG.js} +3 -3
  59. package/dist/wallets/walletConnectors/{chunk-YO2K4MBH.js → chunk-CCQV2ZET.js} +3 -3
  60. package/dist/wallets/walletConnectors/{chunk-TKB2OY6G.js → chunk-CPI4TD43.js} +3 -3
  61. package/dist/wallets/walletConnectors/{chunk-OX37G4YT.js → chunk-F5XEEVG6.js} +3 -3
  62. package/dist/wallets/walletConnectors/{chunk-JPN6TWIT.js → chunk-HNRB7KJU.js} +3 -3
  63. package/dist/wallets/walletConnectors/{chunk-WKNQMP4A.js → chunk-HTHAK6XB.js} +3 -3
  64. package/dist/wallets/walletConnectors/{chunk-GUQM4QSL.js → chunk-MIQTHJ6X.js} +3 -3
  65. package/dist/wallets/walletConnectors/{chunk-4NV5BYRP.js → chunk-RB3HR4R2.js} +3 -3
  66. package/dist/wallets/walletConnectors/{chunk-SWFF3TWJ.js → chunk-RVOY537T.js} +3 -3
  67. package/dist/wallets/walletConnectors/{chunk-KI5Y2BBF.js → chunk-STVVP43G.js} +3 -3
  68. package/dist/wallets/walletConnectors/{chunk-OEEGYENV.js → chunk-UK7C2JXW.js} +3 -3
  69. package/dist/wallets/walletConnectors/{chunk-YQFGVZGR.js → chunk-VAPGUPHO.js} +3 -3
  70. package/dist/wallets/walletConnectors/{chunk-XCNHV3HS.js → chunk-VTM6EECM.js} +3 -3
  71. package/dist/wallets/walletConnectors/{chunk-NR2OGDHQ.js → chunk-X6CGV36L.js} +3 -3
  72. package/dist/wallets/walletConnectors/{chunk-AVDUNQUW.js → chunk-YEZM4CK4.js} +3 -3
  73. package/dist/wallets/walletConnectors/{chunk-KCRO2AGO.js → chunk-ZNX4EMPB.js} +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
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
+
3
31
  ## 11.4.1
4
32
 
5
33
  ### Patch 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,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
@@ -566,13 +567,13 @@ var SwitchIcon = () => {
566
567
  };
567
568
 
568
569
  // src/providers/FunkitProvider.tsx
569
- var ThemeIdContext = createContext(void 0);
570
570
  var attr = "data-rk";
571
571
  var createThemeRootProps = (id) => ({ [attr]: id || "" });
572
- var useThemeRootProps = () => {
573
- const id = useContext(ThemeIdContext);
574
- return createThemeRootProps(id);
575
- };
572
+ var ThemeRootContext = createContext({
573
+ id: void 0,
574
+ element: null
575
+ });
576
+ var useThemeRootProps = () => createThemeRootProps(useContext(ThemeRootContext).id);
576
577
 
577
578
  // src/components/Dropdown/BaseActiveDropdownItem.tsx
578
579
  import React9 from "react";
@@ -797,8 +798,8 @@ function BaseDropdown({
797
798
  const { t } = useFunkitTranslation();
798
799
  const themeRootProps = useThemeRootProps();
799
800
  const isMobileDevice = isMobile();
800
- const [isOpened, setIsOpened] = useState2(false);
801
- const [searchInput, setSearchInput] = useState2("");
801
+ const [isOpened, setIsOpened] = useState3(false);
802
+ const [searchInput, setSearchInput] = useState3("");
802
803
  const { ref: scrollRef, hasTopDivider, isAtBottom } = useScrollDivider();
803
804
  const allOptions = useMemo2(
804
805
  () => buildAllOptions(options, allowUnselect, unselectLabel),
@@ -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,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 '@funkit/connect-core/clients/nado';
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,11 +1,8 @@
1
1
  "use client";
2
2
  import {
3
- isNadoWithdrawalConfig,
4
- resolveNadoSubaccount
5
- } from "../../chunk-TYG42JRZ.js";
3
+ isNadoWithdrawalConfig
4
+ } from "../../chunk-WCQ6HJ27.js";
6
5
  import "../../chunk-B7UU2ETA.js";
7
- import "../../chunk-AHYOV7AV.js";
8
6
  export {
9
- isNadoWithdrawalConfig,
10
- resolveNadoSubaccount
7
+ isNadoWithdrawalConfig
11
8
  };
@@ -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);
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  isNadoWithdrawalConfig
4
- } from "../../chunk-TYG42JRZ.js";
4
+ } from "../../chunk-WCQ6HJ27.js";
5
5
  import "../../chunk-B7UU2ETA.js";
6
6
  import {
7
7
  useGeneralWallet
8
- } from "../../chunk-BPDLF2R6.js";
9
- import "../../chunk-5MY7WMEJ.js";
8
+ } from "../../chunk-DSZHYQPX.js";
9
+ import "../../chunk-3U55HYGJ.js";
10
10
  import "../../chunk-6EU6CXNH.js";
11
11
  import {
12
12
  useFunkitConfig
@@ -21,15 +21,13 @@ import {
21
21
  } from "../../chunk-AHYOV7AV.js";
22
22
 
23
23
  // src/clients/internal/nado/withdrawalForm.ts
24
- import { safeBigInt } from "@funkit/connect-core";
25
24
  import {
25
+ getMaxEnterableAmount,
26
+ getSequencerFee,
26
27
  useNadoFeeRates,
27
- useNadoMaxWithdrawable,
28
- x18ToRawBaseUnit,
29
- x18ToTokenUnits
28
+ useNadoMaxWithdrawable
30
29
  } from "@funkit/connect-core/clients/nado";
31
30
  import { useEffect, useMemo, useState } from "react";
32
- import { formatUnits } from "viem";
33
31
 
34
32
  // src/hooks/useAssetPrice.ts
35
33
  import { getAssetPriceInfoWithFallback } from "@funkit/connect-core";
@@ -106,29 +104,6 @@ function isNadoSourceToken(option) {
106
104
  const decimals = option.asset?.decimals;
107
105
  return option.customData?.type === "nado" && typeof decimals === "number" && Number.isInteger(decimals) && decimals >= 0;
108
106
  }
109
- function getMaxEnterableAmount({
110
- maxWithdrawableX18,
111
- sequencerFee,
112
- decimals
113
- }) {
114
- const max = safeBigInt(maxWithdrawableX18, 0n);
115
- if (max <= 0n || decimals === void 0) {
116
- return "0";
117
- }
118
- const maxRaw = x18ToRawBaseUnit(max, decimals);
119
- const feeRaw = x18ToRawBaseUnit(sequencerFee, decimals);
120
- return formatUnits(maxRaw + feeRaw, decimals);
121
- }
122
- function getSequencerFee(feeRates, option) {
123
- if (!option) {
124
- return { x18: 0n, tokenAmount: 0 };
125
- }
126
- const x18 = safeBigInt(
127
- feeRates?.withdraw_sequencer_fees?.[option.productId],
128
- 0n
129
- );
130
- return { x18, tokenAmount: Number(x18ToTokenUnits(x18, option.decimals)) };
131
- }
132
107
  function useNadoWithdrawalForm(config, selectedSourceToken) {
133
108
  const nadoConfig = isNadoWithdrawalConfig(config) ? config : void 0;
134
109
  const isNado = !!nadoConfig;
@@ -6,8 +6,7 @@
6
6
  * address, so this finds that DE in the wallet's recent list and follows its
7
7
  * relay status.
8
8
  */
9
- import { type MergedMultiStepDirectExecution } from '@funkit/connect-core';
10
- import { type Address } from 'viem';
9
+ import type { Address } from 'viem';
11
10
  export type NadoWithdrawalStatus = 'pending' | 'completed' | 'failed';
12
11
  /** The destination-chain transaction that delivered the funds. */
13
12
  export interface NadoWithdrawalCompletionTx {
@@ -26,16 +25,3 @@ export declare function useNadoWithdrawalStatus({ depositAddress, pollIntervalMs
26
25
  depositAddress: Address | undefined;
27
26
  pollIntervalMs: number;
28
27
  }): NadoWithdrawalTracking;
29
- /**
30
- * Ours is the direct execution at this UDA that appeared after we started
31
- * watching.
32
- *
33
- * - The scanner stamps the address it saw the transfer at into `sourceOfFund`
34
- * (`eoa_scanner|eoa|0x…`), the only field on a DE carrying the full UDA —
35
- * `clientMetadata.depositAddress` comes back null.
36
- * - `knownTxHashes` excludes earlier withdrawals that reused the same UDA. With
37
- * one withdrawal in flight per destination that identifies ours exactly; two
38
- * concurrent ones to the same destination can't be told apart by any field a
39
- * DE carries.
40
- */
41
- export declare function findDirectExecutionForDepositAddress(directExecutions: MergedMultiStepDirectExecution[] | undefined, depositAddress: Address | undefined, knownTxHashes: ReadonlySet<string>): MergedMultiStepDirectExecution | undefined;
@@ -14,13 +14,11 @@ import {
14
14
  // src/clients/internal/nado/withdrawalStatus.ts
15
15
  import {
16
16
  getCompletionTxInfo,
17
- processRecentDepositsForNotifications,
18
- useLogOnce,
19
- useRecentDepositsApiQuery
17
+ resolveOnChainCompletionTxHash,
18
+ useDirectExecutionForDepositAddress,
19
+ useLogOnce
20
20
  } from "@funkit/connect-core";
21
- import { isEVMAddressEquivalent } from "@funkit/utils";
22
21
  import { useEffect, useMemo, useState } from "react";
23
- import { zeroHash } from "viem";
24
22
 
25
23
  // src/hooks/useCheckoutDirectExecutionHistory.ts
26
24
  import {
@@ -123,7 +121,6 @@ function useCheckoutDirectExecutionHistory({
123
121
  }
124
122
 
125
123
  // src/clients/internal/nado/withdrawalStatus.ts
126
- var RECENT_DIRECT_EXECUTION_SCAN_SIZE = 5;
127
124
  function useNadoWithdrawalStatus({
128
125
  depositAddress,
129
126
  pollIntervalMs
@@ -131,33 +128,14 @@ function useNadoWithdrawalStatus({
131
128
  const { apiKey } = useFunkitConfig();
132
129
  const { address: walletAddress } = useAccount();
133
130
  const [hasSettled, setHasSettled] = useState(false);
134
- const { data: recentDirectExecutions } = useRecentDepositsApiQuery({
135
- isVisible: !hasSettled && !!depositAddress,
136
- fetchSize: RECENT_DIRECT_EXECUTION_SCAN_SIZE,
131
+ const { latestStep, isFinalStep } = useDirectExecutionForDepositAddress({
132
+ depositAddress,
137
133
  apiKey,
138
- userId: walletAddress ?? "",
139
- refreshIntervalMs: pollIntervalMs,
134
+ walletAddress: walletAddress ?? "",
135
+ pollIntervalMs,
136
+ hasSettled,
140
137
  logger
141
138
  });
142
- const mergedDirectExecutions = useMemo(
143
- () => processRecentDepositsForNotifications(recentDirectExecutions),
144
- [recentDirectExecutions]
145
- );
146
- const [knownTxHashes, setKnownTxHashes] = useState();
147
- useEffect(() => {
148
- if (!knownTxHashes && mergedDirectExecutions) {
149
- setKnownTxHashes(
150
- new Set(mergedDirectExecutions.map(({ txHash }) => txHash))
151
- );
152
- }
153
- }, [knownTxHashes, mergedDirectExecutions]);
154
- const ourDirectExecution = knownTxHashes ? findDirectExecutionForDepositAddress(
155
- mergedDirectExecutions,
156
- depositAddress,
157
- knownTxHashes
158
- ) : void 0;
159
- const latestStep = ourDirectExecution?.latestStep ?? ourDirectExecution;
160
- const isFinalStep = !!latestStep && !latestStep.isIntermediaryPhase;
161
139
  const { isCompleted, isFailed } = useCheckoutDirectExecutionHistory({
162
140
  initDirectExecution: latestStep,
163
141
  disabled: !latestStep
@@ -189,29 +167,6 @@ function useNadoWithdrawalStatus({
189
167
  }, [status, latestStep]);
190
168
  return { status, completionTx };
191
169
  }
192
- function resolveOnChainCompletionTxHash(directExecution, completionTxHash) {
193
- const hasDestinationTx = !!completionTxHash && completionTxHash !== directExecution.txHash && completionTxHash !== zeroHash;
194
- if (directExecution.fromChainId !== directExecution.toChainId) {
195
- return hasDestinationTx ? completionTxHash : void 0;
196
- }
197
- return hasDestinationTx ? completionTxHash : directExecution.onChainTxHash ?? directExecution.txHash;
198
- }
199
- function findDirectExecutionForDepositAddress(directExecutions, depositAddress, knownTxHashes) {
200
- if (!depositAddress) {
201
- return void 0;
202
- }
203
- return directExecutions?.find((directExecution) => {
204
- if (knownTxHashes.has(directExecution.txHash)) {
205
- return false;
206
- }
207
- const sourceSegments = directExecution.sourceOfFund?.split("|") ?? [];
208
- const sourceAddress = sourceSegments[sourceSegments.length - 1];
209
- return !!sourceAddress && isEVMAddressEquivalent({
210
- firstAddress: sourceAddress,
211
- secondAddress: depositAddress
212
- });
213
- });
214
- }
215
170
  function toNadoWithdrawalStatus({
216
171
  isCompleted,
217
172
  isFailed
@@ -222,6 +177,5 @@ function toNadoWithdrawalStatus({
222
177
  return isFailed ? "failed" : "pending";
223
178
  }
224
179
  export {
225
- findDirectExecutionForDepositAddress,
226
180
  useNadoWithdrawalStatus
227
181
  };