@tuwaio/nova-connect 0.6.0 → 0.7.1

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 (63) hide show
  1. package/README.md +93 -155
  2. package/dist/chunk-3LWAAUG4.js +1 -0
  3. package/dist/chunk-6EDQ7JRZ.js +1 -0
  4. package/dist/chunk-AGE6EFTV.js +1 -0
  5. package/dist/chunk-ENXSDTRV.js +2 -0
  6. package/dist/chunk-Q4FCNEIJ.cjs +2 -0
  7. package/dist/chunk-R5V3K52O.cjs +1 -0
  8. package/dist/chunk-YJRNNNR6.cjs +1 -0
  9. package/dist/chunk-ZVUCC2QP.cjs +1 -0
  10. package/dist/components/index.cjs +1 -1
  11. package/dist/components/index.d.cts +5140 -2914
  12. package/dist/components/index.d.ts +5140 -2914
  13. package/dist/components/index.js +1 -1
  14. package/dist/evm/index.cjs +1 -1
  15. package/dist/evm/index.d.cts +15 -9
  16. package/dist/evm/index.d.ts +15 -9
  17. package/dist/evm/index.js +1 -1
  18. package/dist/hooks/index.cjs +1 -1
  19. package/dist/hooks/index.d.cts +76 -51
  20. package/dist/hooks/index.d.ts +76 -51
  21. package/dist/hooks/index.js +1 -1
  22. package/dist/i18n/index.cjs +1 -1
  23. package/dist/i18n/index.d.cts +1 -1
  24. package/dist/i18n/index.d.ts +1 -1
  25. package/dist/i18n/index.js +1 -1
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.css +0 -22
  28. package/dist/index.d.cts +271 -879
  29. package/dist/index.d.ts +271 -879
  30. package/dist/index.js +1 -1
  31. package/dist/satellite/index.cjs +1 -1
  32. package/dist/satellite/index.d.cts +1 -1
  33. package/dist/satellite/index.d.ts +1 -1
  34. package/dist/satellite/index.js +1 -1
  35. package/dist/solana/index.cjs +1 -1
  36. package/dist/solana/index.d.cts +16 -9
  37. package/dist/solana/index.d.ts +16 -9
  38. package/dist/solana/index.js +1 -1
  39. package/dist/types-CnOiSyvZ.d.cts +400 -0
  40. package/dist/types-CnOiSyvZ.d.ts +400 -0
  41. package/dist/useWalletNativeBalance-CPK-PoXG.d.ts +918 -0
  42. package/dist/useWalletNativeBalance-DMPPRldX.d.cts +918 -0
  43. package/package.json +28 -68
  44. package/dist/chunk-5MOVHUHI.js +0 -2
  45. package/dist/chunk-7K4ENNWO.cjs +0 -2
  46. package/dist/chunk-7TYZT7ZD.cjs +0 -1
  47. package/dist/chunk-ARBYH7CW.js +0 -1
  48. package/dist/chunk-K44IHM6B.cjs +0 -1
  49. package/dist/chunk-MGBN4EIT.cjs +0 -1
  50. package/dist/chunk-NQ5AECZQ.js +0 -1
  51. package/dist/chunk-S3IRVZMG.js +0 -1
  52. package/dist/evm-DUQXCW22.js +0 -1
  53. package/dist/evm-KSA7PJIK.cjs +0 -1
  54. package/dist/getChainsListByConnectorType-QCNOPM6I.cjs +0 -1
  55. package/dist/getChainsListByConnectorType-YZZUYC6D.js +0 -1
  56. package/dist/solana-CVUSQUPL.cjs +0 -1
  57. package/dist/solana-GDE2KIT6.js +0 -1
  58. package/dist/types-DxUn8qmU.d.cts +0 -108
  59. package/dist/types-DxUn8qmU.d.ts +0 -108
  60. package/dist/useWalletNativeBalance-BuiJip3d.d.cts +0 -743
  61. package/dist/useWalletNativeBalance-DrgdoQa-.d.ts +0 -743
  62. /package/dist/{chunk-V6XDFRWV.cjs → chunk-EGATOYHY.cjs} +0 -0
  63. /package/dist/{chunk-EYP534IS.js → chunk-ZVADGOGQ.js} +0 -0
@@ -1 +1 @@
1
- export{u as AboutWallets,a as BalanceDisplay,b as ChainListRenderer,g as ChainSelector,l as ConnectButton,w as ConnectCard,G as ConnectModal,j as ConnectedContent,t as ConnectedModal,m as ConnectedModalFooter,q as ConnectedModalMainContent,n as ConnectedModalNameAndBalance,r as ConnectedModalTxHistory,x as Connecting,s as ConnectionsContent,y as ConnectorsBlock,A as ConnectorsSelections,z as Disclaimer,B as GetWallet,p as IconButton,C as ImpersonateForm,D as LegalDisclaimer,E as NetworkSelections,F as NetworkTabs,v as RecentBadge,f as ScrollableChainList,e as SelectContentAnimated,i as StatusIcon,c as ToBottomButton,d as ToTopButton,H as ToastError,k as WaitForConnectionContent,h as WalletAvatar,o as WalletIcon}from'../chunk-5MOVHUHI.js';import'../chunk-ARBYH7CW.js';import'../chunk-S3IRVZMG.js';import'../chunk-NQ5AECZQ.js';import'../chunk-EYP534IS.js';
1
+ export{u as AboutWallets,a as BalanceDisplay,b as ChainListRenderer,g as ChainSelector,l as ConnectButton,w as ConnectCard,G as ConnectModal,j as ConnectedContent,t as ConnectedModal,m as ConnectedModalFooter,q as ConnectedModalMainContent,n as ConnectedModalNameAndBalance,r as ConnectedModalTxHistory,x as Connecting,s as ConnectionsContent,y as ConnectorsBlock,A as ConnectorsSelections,z as Disclaimer,B as GetWallet,p as IconButton,C as ImpersonateForm,D as LegalDisclaimer,E as NetworkSelections,F as NetworkTabs,v as RecentBadge,f as ScrollableChainList,e as SelectContentAnimated,i as StatusIcon,c as ToBottomButton,d as ToTopButton,H as ToastError,k as WaitForConnectionContent,h as WalletAvatar,o as WalletIcon}from'../chunk-ENXSDTRV.js';import'../chunk-AGE6EFTV.js';import'../chunk-6EDQ7JRZ.js';import'../chunk-ZVADGOGQ.js';import'../chunk-3LWAAUG4.js';
@@ -1 +1 @@
1
- 'use strict';var evm=require('@tuwaio/satellite-react/evm');async function a(){try{let r=await new Function('return import("@tuwaio/satellite-react/evm").catch(error => { console.warn("Failed to load EVM exports:", error); return null; })')();if(!r)return {available:!1,error:"Failed to load EVM exports"};let o=r.EVMConnectorsWatcher;return {...r,available:!0,EVMConnectorsWatcher:o}}catch(e){return console.warn("Failed to load EVM exports:",e),{available:false,error:e instanceof Error?e.message:"Unknown error loading EVM exports"}}}Object.defineProperty(exports,"EVMConnectorsWatcher",{enumerable:true,get:function(){return evm.EVMConnectorsWatcher}});exports.getEvmExports=a;
1
+ 'use strict';var chunkYJRNNNR6_cjs=require('../chunk-YJRNNNR6.cjs'),orbitCore=require('@tuwaio/orbit-core'),evm=require('@tuwaio/satellite-react/evm'),orbitEvm=require('@tuwaio/orbit-evm');var t={getChains:({appChains:n})=>orbitEvm.getEvmChains(n),isChainList:orbitEvm.isEvmChainList};chunkYJRNNNR6_cjs.a(orbitCore.OrbitAdapter.EVM,t);Object.defineProperty(exports,"EVMConnectorsWatcher",{enumerable:true,get:function(){return evm.EVMConnectorsWatcher}});
@@ -1,17 +1,25 @@
1
+ import { Chain } from 'viem/chains';
1
2
  export { Chain } from 'viem/chains';
2
3
  import { OrbitAdapter } from '@tuwaio/orbit-core';
3
4
  import { EVMConnection, ConnectorEVM } from '@tuwaio/satellite-evm';
4
5
  export { ConnectorEVM, EVMConnection } from '@tuwaio/satellite-evm';
5
6
  export { EVMConnectorsWatcher } from '@tuwaio/satellite-react/evm';
6
7
 
7
- declare function getEvmExports(): Promise<any>;
8
+ /**
9
+ * The EVM watcher of Satellite Connect and the EVM types, imported from `@tuwaio/nova-connect/evm`. Import this entry
10
+ * point in an app with EVM wallets; the root entry point never imports the EVM packages. Importing it:
11
+ *
12
+ * - registers the EVM chain helpers of `@tuwaio/orbit-evm` for the chain lists of Nova Connect;
13
+ * - types `appChains` of `NovaConnectProvider` as the viem chains of your wagmi config (`readonly [Chain, ...Chain[]]`);
14
+ * - adds `EVMConnection` and `ConnectorEVM` from `@tuwaio/satellite-evm` to `AllConnections` and `AllConnectors` of
15
+ * `@tuwaio/satellite-react`.
16
+ *
17
+ * @module evm
18
+ */
19
+
8
20
  declare module '@tuwaio/nova-connect' {
9
- interface AllChainConfigs {
10
- /**
11
- * EVM chains configuration - enhanced from default any type
12
- * @override Replaces default `any` with specific Chain typing when viem is available
13
- */
14
- appChains?: readonly [Chain, ...Chain[]];
21
+ interface NovaConnectChainConfigTypes {
22
+ appChains: readonly [Chain, ...Chain[]];
15
23
  }
16
24
  }
17
25
  declare module '@tuwaio/satellite-react' {
@@ -22,5 +30,3 @@ declare module '@tuwaio/satellite-react' {
22
30
  [OrbitAdapter.EVM]: ConnectorEVM;
23
31
  }
24
32
  }
25
-
26
- export { getEvmExports };
@@ -1,17 +1,25 @@
1
+ import { Chain } from 'viem/chains';
1
2
  export { Chain } from 'viem/chains';
2
3
  import { OrbitAdapter } from '@tuwaio/orbit-core';
3
4
  import { EVMConnection, ConnectorEVM } from '@tuwaio/satellite-evm';
4
5
  export { ConnectorEVM, EVMConnection } from '@tuwaio/satellite-evm';
5
6
  export { EVMConnectorsWatcher } from '@tuwaio/satellite-react/evm';
6
7
 
7
- declare function getEvmExports(): Promise<any>;
8
+ /**
9
+ * The EVM watcher of Satellite Connect and the EVM types, imported from `@tuwaio/nova-connect/evm`. Import this entry
10
+ * point in an app with EVM wallets; the root entry point never imports the EVM packages. Importing it:
11
+ *
12
+ * - registers the EVM chain helpers of `@tuwaio/orbit-evm` for the chain lists of Nova Connect;
13
+ * - types `appChains` of `NovaConnectProvider` as the viem chains of your wagmi config (`readonly [Chain, ...Chain[]]`);
14
+ * - adds `EVMConnection` and `ConnectorEVM` from `@tuwaio/satellite-evm` to `AllConnections` and `AllConnectors` of
15
+ * `@tuwaio/satellite-react`.
16
+ *
17
+ * @module evm
18
+ */
19
+
8
20
  declare module '@tuwaio/nova-connect' {
9
- interface AllChainConfigs {
10
- /**
11
- * EVM chains configuration - enhanced from default any type
12
- * @override Replaces default `any` with specific Chain typing when viem is available
13
- */
14
- appChains?: readonly [Chain, ...Chain[]];
21
+ interface NovaConnectChainConfigTypes {
22
+ appChains: readonly [Chain, ...Chain[]];
15
23
  }
16
24
  }
17
25
  declare module '@tuwaio/satellite-react' {
@@ -22,5 +30,3 @@ declare module '@tuwaio/satellite-react' {
22
30
  [OrbitAdapter.EVM]: ConnectorEVM;
23
31
  }
24
32
  }
25
-
26
- export { getEvmExports };
package/dist/evm/index.js CHANGED
@@ -1 +1 @@
1
- export{EVMConnectorsWatcher}from'@tuwaio/satellite-react/evm';async function a(){try{let r=await new Function('return import("@tuwaio/satellite-react/evm").catch(error => { console.warn("Failed to load EVM exports:", error); return null; })')();if(!r)return {available:!1,error:"Failed to load EVM exports"};let o=r.EVMConnectorsWatcher;return {...r,available:!0,EVMConnectorsWatcher:o}}catch(e){return console.warn("Failed to load EVM exports:",e),{available:false,error:e instanceof Error?e.message:"Unknown error loading EVM exports"}}}export{a as getEvmExports};
1
+ import {a}from'../chunk-3LWAAUG4.js';import {OrbitAdapter}from'@tuwaio/orbit-core';export{EVMConnectorsWatcher}from'@tuwaio/satellite-react/evm';import {isEvmChainList,getEvmChains}from'@tuwaio/orbit-evm';var t={getChains:({appChains:n})=>getEvmChains(n),isChainList:isEvmChainList};a(OrbitAdapter.EVM,t);
@@ -1 +1 @@
1
- 'use strict';var chunk7TYZT7ZD_cjs=require('../chunk-7TYZT7ZD.cjs');require('../chunk-K44IHM6B.cjs'),require('../chunk-MGBN4EIT.cjs'),require('../chunk-V6XDFRWV.cjs');Object.defineProperty(exports,"NovaConnectLabelsContext",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.g}});Object.defineProperty(exports,"NovaConnectProviderContext",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.c}});Object.defineProperty(exports,"NovaConnectProviderError",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.b}});Object.defineProperty(exports,"createLabelsSubset",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.o}});Object.defineProperty(exports,"getLabelWithFallback",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.n}});Object.defineProperty(exports,"hasLabel",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.k}});Object.defineProperty(exports,"isDefaultLabels",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.m}});Object.defineProperty(exports,"useGetWalletNameAndAvatar",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.a}});Object.defineProperty(exports,"useHasNovaConnectContext",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.e}});Object.defineProperty(exports,"useLabelsByCategory",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.l}});Object.defineProperty(exports,"useNovaConnect",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.d}});Object.defineProperty(exports,"useNovaConnectLabel",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.i}});Object.defineProperty(exports,"useNovaConnectLabels",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.h}});Object.defineProperty(exports,"useNovaConnectLabelsSubset",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.j}});Object.defineProperty(exports,"useNovaConnectOptional",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.f}});Object.defineProperty(exports,"useNovaSiwx",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.p}});Object.defineProperty(exports,"useWalletChainsList",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.y}});Object.defineProperty(exports,"useWalletNativeBalance",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.z}});
1
+ 'use strict';var chunkZVUCC2QP_cjs=require('../chunk-ZVUCC2QP.cjs');require('../chunk-R5V3K52O.cjs'),require('../chunk-EGATOYHY.cjs'),require('../chunk-YJRNNNR6.cjs');Object.defineProperty(exports,"NovaConnectLabelsContext",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.g}});Object.defineProperty(exports,"NovaConnectProviderContext",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.c}});Object.defineProperty(exports,"NovaConnectProviderError",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.b}});Object.defineProperty(exports,"createLabelsSubset",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.o}});Object.defineProperty(exports,"getLabelWithFallback",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.n}});Object.defineProperty(exports,"hasLabel",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.k}});Object.defineProperty(exports,"isDefaultLabels",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.m}});Object.defineProperty(exports,"useGetWalletNameAndAvatar",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.a}});Object.defineProperty(exports,"useHasNovaConnectContext",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.e}});Object.defineProperty(exports,"useLabelsByCategory",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.l}});Object.defineProperty(exports,"useNovaConnect",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.d}});Object.defineProperty(exports,"useNovaConnectLabel",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.i}});Object.defineProperty(exports,"useNovaConnectLabels",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.h}});Object.defineProperty(exports,"useNovaConnectLabelsSubset",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.j}});Object.defineProperty(exports,"useNovaConnectOptional",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.f}});Object.defineProperty(exports,"useNovaSiwx",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.p}});Object.defineProperty(exports,"useWalletChainsList",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.A}});Object.defineProperty(exports,"useWalletNativeBalance",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.B}});
@@ -1,14 +1,17 @@
1
- import { I as InitialChains } from '../useWalletNativeBalance-BuiJip3d.cjs';
2
- export { B as ButtonTxStatus, C as ConnectContentType, a as ConnectedContentType, L as LabelCategory, c as LegalConfig, d as NativeBalanceResult, e as NovaConnectLabelsContext, f as NovaConnectProviderContext, g as NovaConnectProviderError, N as NovaConnectProviderProps, b as NovaConnectProviderType, W as WalletBalance, j as createLabelsSubset, k as getLabelWithFallback, l as hasLabel, m as isDefaultLabels, u as useHasNovaConnectContext, n as useLabelsByCategory, o as useNovaConnect, p as useNovaConnectLabel, q as useNovaConnectLabels, r as useNovaConnectLabelsSubset, s as useNovaConnectOptional, t as useWalletNativeBalance } from '../useWalletNativeBalance-BuiJip3d.cjs';
1
+ import { I as InitialChains } from '../useWalletNativeBalance-DMPPRldX.cjs';
2
+ export { B as ButtonTxStatus, C as ConnectContentType, a as ConnectedContentType, L as LabelCategory, c as LegalConfig, d as NativeBalanceResult, g as NovaConnectLabelsContext, h as NovaConnectProviderContext, i as NovaConnectProviderError, N as NovaConnectProviderProps, b as NovaConnectProviderType, U as UseWalletNativeBalanceData, m as UseWalletNativeBalanceState, W as WalletBalance, n as createLabelsSubset, o as getLabelWithFallback, p as hasLabel, q as isDefaultLabels, u as useHasNovaConnectContext, r as useLabelsByCategory, s as useNovaConnect, t as useNovaConnectLabel, v as useNovaConnectLabels, w as useNovaConnectLabelsSubset, x as useNovaConnectOptional, y as useWalletNativeBalance } from '../useWalletNativeBalance-DMPPRldX.cjs';
3
3
  import * as _tuwaio_satellite_core from '@tuwaio/satellite-core';
4
- import * as _tuwaio_satellite_react from '@tuwaio/satellite-react';
4
+ import { BaseConnector } from '@tuwaio/satellite-core';
5
5
  import { SatelliteSiwxFieldOptions, UseSiwxSignInOptions } from '@tuwaio/siwx-react';
6
6
  import 'react';
7
7
  import '@tuwaio/orbit-core';
8
8
  import '@tuwaio/pulsar-core';
9
- import '../types-DxUn8qmU.cjs';
9
+ import '../types-CnOiSyvZ.cjs';
10
10
  import 'framer-motion';
11
11
 
12
+ /**
13
+ * Result of {@link useGetWalletNameAndAvatar}.
14
+ */
12
15
  interface WalletNameAndAvatarData {
13
16
  /** The resolved name from the Name Service (e.g., ENS, like "alice.eth"), or null if not found. */
14
17
  ensName: string | null;
@@ -23,6 +26,9 @@ interface WalletNameAndAvatarData {
23
26
  /** Function to retry the name resolution manually. */
24
27
  retry: () => void;
25
28
  }
29
+ /**
30
+ * Options of {@link useGetWalletNameAndAvatar}.
31
+ */
26
32
  interface UseGetWalletNameAndAvatarOptions {
27
33
  /** Number of characters to show on each side when abbreviating (default: 12) */
28
34
  abbreviateSymbols?: number;
@@ -34,39 +40,28 @@ interface UseGetWalletNameAndAvatarOptions {
34
40
  retryDelay?: number;
35
41
  }
36
42
  /**
37
- * A custom hook to fetch the Name Service (e.g., ENS) name and avatar
38
- * for the currently active wallet.
39
- *
40
- * This hook automatically detects the active wallet and its corresponding
41
- * adapter via the `useSatelliteConnectStore` and attempts to resolve the
42
- * wallet address to a human-readable name and avatar.
43
+ * Resolves the name (ENS on EVM, SNS on Solana) and its avatar for the active wallet with `getName` and `getAvatar`
44
+ * of its Satellite adapter, which send requests to the name service. It resolves again when the address or the
45
+ * adapter changes, and cancels the previous lookup. Without a name it returns the shortened address.
43
46
  *
44
- * @param options Configuration options for the hook
45
- * @returns An object containing the resolved name, avatar, loading state, and utility functions
47
+ * @param options - See {@link UseGetWalletNameAndAvatarOptions}.
48
+ * @returns See {@link WalletNameAndAvatarData}.
46
49
  *
47
50
  * @example
48
- * ```typescript
49
- * import { useGetWalletNameAndAvatar } from './useGetWalletNameAndAvatar';
50
- *
51
- * function DisplayWalletInfo() {
52
- * const { ensName, ensAvatar, isLoading, ensNameAbbreviated, error, retry } = useGetWalletNameAndAvatar({
53
- * abbreviateSymbols: 8,
54
- * maxNameLength: 25
55
- * });
51
+ * ```tsx
52
+ * import { useGetWalletNameAndAvatar } from '@tuwaio/nova-connect/hooks';
56
53
  *
57
- * if (isLoading) {
58
- * return <div>Resolving name...</div>;
59
- * }
54
+ * export function WalletInfo() {
55
+ * const { ensAvatar, ensNameAbbreviated, isLoading, error, retry } = useGetWalletNameAndAvatar({});
60
56
  *
61
- * if (error) {
62
- * return <div>Error: {error} <button onClick={retry}>Retry</button></div>;
63
- * }
57
+ * if (isLoading) return <p>Resolving name...</p>;
58
+ * if (error) return <button onClick={retry}>Retry</button>;
64
59
  *
65
60
  * return (
66
- * <div className="wallet-info">
67
- * {ensAvatar && <img src={ensAvatar} alt="Wallet Avatar" />}
68
- * <p title={ensName || ''}>{ensNameAbbreviated || 'No Name Found'}</p>
69
- * </div>
61
+ * <p>
62
+ * {ensAvatar && <img src={ensAvatar} alt="" width={24} height={24} />}
63
+ * {ensNameAbbreviated}
64
+ * </p>
70
65
  * );
71
66
  * }
72
67
  * ```
@@ -74,51 +69,81 @@ interface UseGetWalletNameAndAvatarOptions {
74
69
  declare function useGetWalletNameAndAvatar(options: UseGetWalletNameAndAvatarOptions): WalletNameAndAvatarData;
75
70
 
76
71
  /**
77
- * Options for the `useNovaSiwx` hook.
72
+ * Options of {@link useNovaSiwx}: the verifier, the destroyer and the SIWX message fields of `getSatelliteSiwxFields`
73
+ * from `@tuwaio/siwx-react` (`domain`, `uri`, `statement`, and so on).
78
74
  */
79
75
  interface UseNovaSiwxOptions extends SatelliteSiwxFieldOptions {
80
- /** Optional backend verification callback */
76
+ /** Sends the signed message to your backend for verification (required unless passed to `signIn`) */
81
77
  verifier?: UseSiwxSignInOptions['verifier'];
82
- /**
83
- * Optional callback triggered when `signOut` is called.
84
- * Useful for hitting a `/logout` endpoint to clear the backend cookie.
85
- */
78
+ /** Called by `signOut` after the session is cleared, for example to call a `/logout` endpoint of your backend */
86
79
  destroyer?: () => Promise<void>;
87
80
  }
88
81
  /**
89
- * React hook that exposes SIWX authentication controls within NovaConnect applications.
82
+ * Signs the active wallet in and out with SIWX on demand (for a "Sign in" button; `NovaConnectProvider` with `siwx`
83
+ * does it automatically on connect).
84
+ *
85
+ * - `signIn(connection?, verifier?)` builds the SIWX message for the active connection (or `connection`), asks the
86
+ * wallet to sign it and sends it to `verifier` (the argument, or `options.verifier`), through `signIn` of `useSiwx`
87
+ * from `@tuwaio/siwx-react`. It rejects without a connection, without `signMessage` or without a verifier.
88
+ * - `signOut()` clears the SIWX session and then calls `options.destroyer` (a failure is logged).
90
89
  *
91
- * @param options - Default SIWX field options and verifier callback.
92
- * @returns Object containing `signIn` and `signOut` handlers.
90
+ * @param options - See {@link UseNovaSiwxOptions}.
91
+ * @returns The `signIn` and `signOut` actions.
93
92
  *
94
93
  * @example
95
94
  * ```tsx
96
- * const { signIn, signOut } = useNovaSiwx({ verifier: myVerifier, destroyer: myDestroyer });
97
- * await signIn();
95
+ * import { useNovaSiwx, type UseNovaSiwxOptions } from '@tuwaio/nova-connect/hooks';
96
+ *
97
+ * export function SignInButtons({ verifier }: Pick<UseNovaSiwxOptions, 'verifier'>) {
98
+ * const { signIn, signOut } = useNovaSiwx({ verifier, statement: 'Sign in to the app.' });
99
+ *
100
+ * return (
101
+ * <>
102
+ * <button onClick={() => signIn()}>Sign in</button>
103
+ * <button onClick={() => signOut()}>Sign out</button>
104
+ * </>
105
+ * );
106
+ * }
98
107
  * ```
99
108
  */
100
109
  declare function useNovaSiwx(options?: UseNovaSiwxOptions): {
101
- signIn: (overrideConnection?: _tuwaio_satellite_core.Connector<_tuwaio_satellite_react.Connection> | undefined, customVerifier?: UseSiwxSignInOptions["verifier"]) => Promise<void>;
110
+ signIn: (overrideConnection?: _tuwaio_satellite_core.BaseConnector | undefined, customVerifier?: UseSiwxSignInOptions["verifier"]) => Promise<void>;
102
111
  signOut: () => Promise<void>;
103
112
  };
104
113
 
105
114
  /**
106
- * Props for the useWalletChainsList hook
115
+ * Props of {@link useWalletChainsList}.
107
116
  */
108
117
  interface UseWalletChainsListProps extends InitialChains {
109
- /** The active connection object from the store */
110
- activeConnection: any;
118
+ /** The active connection of the Satellite store, or `undefined` when no wallet is connected */
119
+ activeConnection: Pick<BaseConnector, 'connectorType'> | undefined;
111
120
  }
112
121
  /**
113
- * Custom hook to asynchronously fetch the list of available chains for the active wallet.
114
- * Handles the loading state and updates when the active connection or configuration changes.
122
+ * Returns the chains of the app for the network of the active connection (see `getChainsListByConnectorType`): the EVM
123
+ * chain IDs of `appChains`, or the Solana clusters of `solanaRPCUrls` that the connected wallet supports. Without a
124
+ * connection, the EVM chains.
125
+ *
126
+ * @param props - See {@link UseWalletChainsListProps}.
127
+ * @returns `chainsList`, recomputed when the connection or the chain configuration changes.
128
+ *
129
+ * @example
130
+ * ```tsx
131
+ * import { useWalletChainsList } from '@tuwaio/nova-connect/hooks';
132
+ * import { useSatelliteConnectStore } from '@tuwaio/nova-connect/satellite';
133
+ * import { mainnet, polygon } from 'viem/chains';
134
+ *
135
+ * const appChains = [mainnet, polygon] as const;
115
136
  *
116
- * @param props - Hook properties
117
- * @returns Object containing the chains list and loading state
137
+ * export function ChainCount() {
138
+ * const activeConnection = useSatelliteConnectStore((store) => store.activeConnection);
139
+ * const { chainsList } = useWalletChainsList({ activeConnection, appChains });
140
+ * return <span>{chainsList.length} chains</span>;
141
+ * }
142
+ * ```
118
143
  */
119
144
  declare function useWalletChainsList({ activeConnection, appChains, solanaRPCUrls }: UseWalletChainsListProps): {
145
+ /** Chain IDs (EVM) or cluster monikers (Solana) */
120
146
  chainsList: (string | number)[];
121
- isLoading: boolean;
122
147
  };
123
148
 
124
- export { type UseNovaSiwxOptions, type WalletNameAndAvatarData, useGetWalletNameAndAvatar, useNovaSiwx, useWalletChainsList };
149
+ export { type UseGetWalletNameAndAvatarOptions, type UseNovaSiwxOptions, type UseWalletChainsListProps, type WalletNameAndAvatarData, useGetWalletNameAndAvatar, useNovaSiwx, useWalletChainsList };
@@ -1,14 +1,17 @@
1
- import { I as InitialChains } from '../useWalletNativeBalance-DrgdoQa-.js';
2
- export { B as ButtonTxStatus, C as ConnectContentType, a as ConnectedContentType, L as LabelCategory, c as LegalConfig, d as NativeBalanceResult, e as NovaConnectLabelsContext, f as NovaConnectProviderContext, g as NovaConnectProviderError, N as NovaConnectProviderProps, b as NovaConnectProviderType, W as WalletBalance, j as createLabelsSubset, k as getLabelWithFallback, l as hasLabel, m as isDefaultLabels, u as useHasNovaConnectContext, n as useLabelsByCategory, o as useNovaConnect, p as useNovaConnectLabel, q as useNovaConnectLabels, r as useNovaConnectLabelsSubset, s as useNovaConnectOptional, t as useWalletNativeBalance } from '../useWalletNativeBalance-DrgdoQa-.js';
1
+ import { I as InitialChains } from '../useWalletNativeBalance-CPK-PoXG.js';
2
+ export { B as ButtonTxStatus, C as ConnectContentType, a as ConnectedContentType, L as LabelCategory, c as LegalConfig, d as NativeBalanceResult, g as NovaConnectLabelsContext, h as NovaConnectProviderContext, i as NovaConnectProviderError, N as NovaConnectProviderProps, b as NovaConnectProviderType, U as UseWalletNativeBalanceData, m as UseWalletNativeBalanceState, W as WalletBalance, n as createLabelsSubset, o as getLabelWithFallback, p as hasLabel, q as isDefaultLabels, u as useHasNovaConnectContext, r as useLabelsByCategory, s as useNovaConnect, t as useNovaConnectLabel, v as useNovaConnectLabels, w as useNovaConnectLabelsSubset, x as useNovaConnectOptional, y as useWalletNativeBalance } from '../useWalletNativeBalance-CPK-PoXG.js';
3
3
  import * as _tuwaio_satellite_core from '@tuwaio/satellite-core';
4
- import * as _tuwaio_satellite_react from '@tuwaio/satellite-react';
4
+ import { BaseConnector } from '@tuwaio/satellite-core';
5
5
  import { SatelliteSiwxFieldOptions, UseSiwxSignInOptions } from '@tuwaio/siwx-react';
6
6
  import 'react';
7
7
  import '@tuwaio/orbit-core';
8
8
  import '@tuwaio/pulsar-core';
9
- import '../types-DxUn8qmU.js';
9
+ import '../types-CnOiSyvZ.js';
10
10
  import 'framer-motion';
11
11
 
12
+ /**
13
+ * Result of {@link useGetWalletNameAndAvatar}.
14
+ */
12
15
  interface WalletNameAndAvatarData {
13
16
  /** The resolved name from the Name Service (e.g., ENS, like "alice.eth"), or null if not found. */
14
17
  ensName: string | null;
@@ -23,6 +26,9 @@ interface WalletNameAndAvatarData {
23
26
  /** Function to retry the name resolution manually. */
24
27
  retry: () => void;
25
28
  }
29
+ /**
30
+ * Options of {@link useGetWalletNameAndAvatar}.
31
+ */
26
32
  interface UseGetWalletNameAndAvatarOptions {
27
33
  /** Number of characters to show on each side when abbreviating (default: 12) */
28
34
  abbreviateSymbols?: number;
@@ -34,39 +40,28 @@ interface UseGetWalletNameAndAvatarOptions {
34
40
  retryDelay?: number;
35
41
  }
36
42
  /**
37
- * A custom hook to fetch the Name Service (e.g., ENS) name and avatar
38
- * for the currently active wallet.
39
- *
40
- * This hook automatically detects the active wallet and its corresponding
41
- * adapter via the `useSatelliteConnectStore` and attempts to resolve the
42
- * wallet address to a human-readable name and avatar.
43
+ * Resolves the name (ENS on EVM, SNS on Solana) and its avatar for the active wallet with `getName` and `getAvatar`
44
+ * of its Satellite adapter, which send requests to the name service. It resolves again when the address or the
45
+ * adapter changes, and cancels the previous lookup. Without a name it returns the shortened address.
43
46
  *
44
- * @param options Configuration options for the hook
45
- * @returns An object containing the resolved name, avatar, loading state, and utility functions
47
+ * @param options - See {@link UseGetWalletNameAndAvatarOptions}.
48
+ * @returns See {@link WalletNameAndAvatarData}.
46
49
  *
47
50
  * @example
48
- * ```typescript
49
- * import { useGetWalletNameAndAvatar } from './useGetWalletNameAndAvatar';
50
- *
51
- * function DisplayWalletInfo() {
52
- * const { ensName, ensAvatar, isLoading, ensNameAbbreviated, error, retry } = useGetWalletNameAndAvatar({
53
- * abbreviateSymbols: 8,
54
- * maxNameLength: 25
55
- * });
51
+ * ```tsx
52
+ * import { useGetWalletNameAndAvatar } from '@tuwaio/nova-connect/hooks';
56
53
  *
57
- * if (isLoading) {
58
- * return <div>Resolving name...</div>;
59
- * }
54
+ * export function WalletInfo() {
55
+ * const { ensAvatar, ensNameAbbreviated, isLoading, error, retry } = useGetWalletNameAndAvatar({});
60
56
  *
61
- * if (error) {
62
- * return <div>Error: {error} <button onClick={retry}>Retry</button></div>;
63
- * }
57
+ * if (isLoading) return <p>Resolving name...</p>;
58
+ * if (error) return <button onClick={retry}>Retry</button>;
64
59
  *
65
60
  * return (
66
- * <div className="wallet-info">
67
- * {ensAvatar && <img src={ensAvatar} alt="Wallet Avatar" />}
68
- * <p title={ensName || ''}>{ensNameAbbreviated || 'No Name Found'}</p>
69
- * </div>
61
+ * <p>
62
+ * {ensAvatar && <img src={ensAvatar} alt="" width={24} height={24} />}
63
+ * {ensNameAbbreviated}
64
+ * </p>
70
65
  * );
71
66
  * }
72
67
  * ```
@@ -74,51 +69,81 @@ interface UseGetWalletNameAndAvatarOptions {
74
69
  declare function useGetWalletNameAndAvatar(options: UseGetWalletNameAndAvatarOptions): WalletNameAndAvatarData;
75
70
 
76
71
  /**
77
- * Options for the `useNovaSiwx` hook.
72
+ * Options of {@link useNovaSiwx}: the verifier, the destroyer and the SIWX message fields of `getSatelliteSiwxFields`
73
+ * from `@tuwaio/siwx-react` (`domain`, `uri`, `statement`, and so on).
78
74
  */
79
75
  interface UseNovaSiwxOptions extends SatelliteSiwxFieldOptions {
80
- /** Optional backend verification callback */
76
+ /** Sends the signed message to your backend for verification (required unless passed to `signIn`) */
81
77
  verifier?: UseSiwxSignInOptions['verifier'];
82
- /**
83
- * Optional callback triggered when `signOut` is called.
84
- * Useful for hitting a `/logout` endpoint to clear the backend cookie.
85
- */
78
+ /** Called by `signOut` after the session is cleared, for example to call a `/logout` endpoint of your backend */
86
79
  destroyer?: () => Promise<void>;
87
80
  }
88
81
  /**
89
- * React hook that exposes SIWX authentication controls within NovaConnect applications.
82
+ * Signs the active wallet in and out with SIWX on demand (for a "Sign in" button; `NovaConnectProvider` with `siwx`
83
+ * does it automatically on connect).
84
+ *
85
+ * - `signIn(connection?, verifier?)` builds the SIWX message for the active connection (or `connection`), asks the
86
+ * wallet to sign it and sends it to `verifier` (the argument, or `options.verifier`), through `signIn` of `useSiwx`
87
+ * from `@tuwaio/siwx-react`. It rejects without a connection, without `signMessage` or without a verifier.
88
+ * - `signOut()` clears the SIWX session and then calls `options.destroyer` (a failure is logged).
90
89
  *
91
- * @param options - Default SIWX field options and verifier callback.
92
- * @returns Object containing `signIn` and `signOut` handlers.
90
+ * @param options - See {@link UseNovaSiwxOptions}.
91
+ * @returns The `signIn` and `signOut` actions.
93
92
  *
94
93
  * @example
95
94
  * ```tsx
96
- * const { signIn, signOut } = useNovaSiwx({ verifier: myVerifier, destroyer: myDestroyer });
97
- * await signIn();
95
+ * import { useNovaSiwx, type UseNovaSiwxOptions } from '@tuwaio/nova-connect/hooks';
96
+ *
97
+ * export function SignInButtons({ verifier }: Pick<UseNovaSiwxOptions, 'verifier'>) {
98
+ * const { signIn, signOut } = useNovaSiwx({ verifier, statement: 'Sign in to the app.' });
99
+ *
100
+ * return (
101
+ * <>
102
+ * <button onClick={() => signIn()}>Sign in</button>
103
+ * <button onClick={() => signOut()}>Sign out</button>
104
+ * </>
105
+ * );
106
+ * }
98
107
  * ```
99
108
  */
100
109
  declare function useNovaSiwx(options?: UseNovaSiwxOptions): {
101
- signIn: (overrideConnection?: _tuwaio_satellite_core.Connector<_tuwaio_satellite_react.Connection> | undefined, customVerifier?: UseSiwxSignInOptions["verifier"]) => Promise<void>;
110
+ signIn: (overrideConnection?: _tuwaio_satellite_core.BaseConnector | undefined, customVerifier?: UseSiwxSignInOptions["verifier"]) => Promise<void>;
102
111
  signOut: () => Promise<void>;
103
112
  };
104
113
 
105
114
  /**
106
- * Props for the useWalletChainsList hook
115
+ * Props of {@link useWalletChainsList}.
107
116
  */
108
117
  interface UseWalletChainsListProps extends InitialChains {
109
- /** The active connection object from the store */
110
- activeConnection: any;
118
+ /** The active connection of the Satellite store, or `undefined` when no wallet is connected */
119
+ activeConnection: Pick<BaseConnector, 'connectorType'> | undefined;
111
120
  }
112
121
  /**
113
- * Custom hook to asynchronously fetch the list of available chains for the active wallet.
114
- * Handles the loading state and updates when the active connection or configuration changes.
122
+ * Returns the chains of the app for the network of the active connection (see `getChainsListByConnectorType`): the EVM
123
+ * chain IDs of `appChains`, or the Solana clusters of `solanaRPCUrls` that the connected wallet supports. Without a
124
+ * connection, the EVM chains.
125
+ *
126
+ * @param props - See {@link UseWalletChainsListProps}.
127
+ * @returns `chainsList`, recomputed when the connection or the chain configuration changes.
128
+ *
129
+ * @example
130
+ * ```tsx
131
+ * import { useWalletChainsList } from '@tuwaio/nova-connect/hooks';
132
+ * import { useSatelliteConnectStore } from '@tuwaio/nova-connect/satellite';
133
+ * import { mainnet, polygon } from 'viem/chains';
134
+ *
135
+ * const appChains = [mainnet, polygon] as const;
115
136
  *
116
- * @param props - Hook properties
117
- * @returns Object containing the chains list and loading state
137
+ * export function ChainCount() {
138
+ * const activeConnection = useSatelliteConnectStore((store) => store.activeConnection);
139
+ * const { chainsList } = useWalletChainsList({ activeConnection, appChains });
140
+ * return <span>{chainsList.length} chains</span>;
141
+ * }
142
+ * ```
118
143
  */
119
144
  declare function useWalletChainsList({ activeConnection, appChains, solanaRPCUrls }: UseWalletChainsListProps): {
145
+ /** Chain IDs (EVM) or cluster monikers (Solana) */
120
146
  chainsList: (string | number)[];
121
- isLoading: boolean;
122
147
  };
123
148
 
124
- export { type UseNovaSiwxOptions, type WalletNameAndAvatarData, useGetWalletNameAndAvatar, useNovaSiwx, useWalletChainsList };
149
+ export { type UseGetWalletNameAndAvatarOptions, type UseNovaSiwxOptions, type UseWalletChainsListProps, type WalletNameAndAvatarData, useGetWalletNameAndAvatar, useNovaSiwx, useWalletChainsList };
@@ -1 +1 @@
1
- export{g as NovaConnectLabelsContext,c as NovaConnectProviderContext,b as NovaConnectProviderError,o as createLabelsSubset,n as getLabelWithFallback,k as hasLabel,m as isDefaultLabels,a as useGetWalletNameAndAvatar,e as useHasNovaConnectContext,l as useLabelsByCategory,d as useNovaConnect,i as useNovaConnectLabel,h as useNovaConnectLabels,j as useNovaConnectLabelsSubset,f as useNovaConnectOptional,p as useNovaSiwx,y as useWalletChainsList,z as useWalletNativeBalance}from'../chunk-ARBYH7CW.js';import'../chunk-S3IRVZMG.js';import'../chunk-NQ5AECZQ.js';import'../chunk-EYP534IS.js';
1
+ export{g as NovaConnectLabelsContext,c as NovaConnectProviderContext,b as NovaConnectProviderError,o as createLabelsSubset,n as getLabelWithFallback,k as hasLabel,m as isDefaultLabels,a as useGetWalletNameAndAvatar,e as useHasNovaConnectContext,l as useLabelsByCategory,d as useNovaConnect,i as useNovaConnectLabel,h as useNovaConnectLabels,j as useNovaConnectLabelsSubset,f as useNovaConnectOptional,p as useNovaSiwx,A as useWalletChainsList,B as useWalletNativeBalance}from'../chunk-AGE6EFTV.js';import'../chunk-6EDQ7JRZ.js';import'../chunk-ZVADGOGQ.js';import'../chunk-3LWAAUG4.js';
@@ -1 +1 @@
1
- 'use strict';var chunkMGBN4EIT_cjs=require('../chunk-MGBN4EIT.cjs');Object.defineProperty(exports,"defaultLabels",{enumerable:true,get:function(){return chunkMGBN4EIT_cjs.a}});Object.defineProperty(exports,"ukrainianLabels",{enumerable:true,get:function(){return chunkMGBN4EIT_cjs.b}});
1
+ 'use strict';var chunkR5V3K52O_cjs=require('../chunk-R5V3K52O.cjs');Object.defineProperty(exports,"defaultLabels",{enumerable:true,get:function(){return chunkR5V3K52O_cjs.a}});Object.defineProperty(exports,"ukrainianLabels",{enumerable:true,get:function(){return chunkR5V3K52O_cjs.b}});
@@ -1,4 +1,4 @@
1
- import { N as NovaConnectLabels } from '../types-DxUn8qmU.cjs';
1
+ import { N as NovaConnectLabels } from '../types-CnOiSyvZ.cjs';
2
2
 
3
3
  /**
4
4
  * Default English translations for NovaConnect component
@@ -1,4 +1,4 @@
1
- import { N as NovaConnectLabels } from '../types-DxUn8qmU.js';
1
+ import { N as NovaConnectLabels } from '../types-CnOiSyvZ.js';
2
2
 
3
3
  /**
4
4
  * Default English translations for NovaConnect component
@@ -1 +1 @@
1
- export{a as defaultLabels,b as ukrainianLabels}from'../chunk-NQ5AECZQ.js';
1
+ export{a as defaultLabels,b as ukrainianLabels}from'../chunk-6EDQ7JRZ.js';
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunk7K4ENNWO_cjs=require('./chunk-7K4ENNWO.cjs'),chunk7TYZT7ZD_cjs=require('./chunk-7TYZT7ZD.cjs'),chunkK44IHM6B_cjs=require('./chunk-K44IHM6B.cjs'),chunkMGBN4EIT_cjs=require('./chunk-MGBN4EIT.cjs'),chunkV6XDFRWV_cjs=require('./chunk-V6XDFRWV.cjs'),orbitCore=require('@tuwaio/orbit-core'),novaCore=require('@tuwaio/nova-core'),react=require('react'),reactToastify=require('react-toastify'),jsxRuntime=require('react/jsx-runtime'),siwxReact=require('@tuwaio/siwx-react');var Ie=({title:e,rawError:o,onCopyComplete:r,errorType:c,isConnected:n,...u})=>jsxRuntime.jsx(chunk7K4ENNWO_cjs.H,{title:e,rawError:o,onCopyComplete:r,customization:u.customization}),We=e=>{let o=chunk7TYZT7ZD_cjs.h();return jsxRuntime.jsx(reactToastify.ToastContainer,{...e,role:"alert","aria-live":"assertive","aria-label":o.somethingWentWrong})},ze=(e,o)=>{e(o.title,o.rawError,o.errorKey);},He=e=>{e();},Ue=(e,o)=>{if(e&&process.env.NODE_ENV==="development"){let r=typeof o=="string"?o:o.message;console.log("Error copied to clipboard:",r.substring(0,100));}},Ve=e=>e,Fe=e=>e;function ie({containerId:e="nova-connect-errors",position:o="top-center",autoClose:r=7e3,draggable:c=false,customization:n}){let u=chunk7TYZT7ZD_cjs.h(),M=chunkV6XDFRWV_cjs.d(i=>i.switchNetworkError),B=chunkV6XDFRWV_cjs.d(i=>i.activeConnection),L=chunkV6XDFRWV_cjs.d(i=>i.connectionError),{ToastError:O=Ie,Container:A=We}=n?.components??{},{showError:R=ze,dismissError:S=He,onCopyComplete:d=Ue}=n?.handlers??{},{errorTitle:k=Ve,errorHash:t=Fe}=n??{},m=react.useRef(new Set),E=react.useRef(null),P=!!L,l=!!M,p=!!B?.isConnected,g=P||l,b=L||M||null,s=P?"wallet":l?"switch":null,a={hasWalletError:P,hasSwitchError:l,isConnected:p,hasAnyError:g,primaryError:b,errorType:s},N=u.somethingWentWrong;switch(a.errorType){case "wallet":N=u.connectionError;break;case "switch":N=u.errorWhenChainSwitching;break}let T=k(N,{errorType:a.errorType}),I=a.primaryError?`${a.errorType}-${a.primaryError.message.substring(0,50)}`:null,h=t(I,{primaryError:a.primaryError,errorType:a.errorType}),x=react.useCallback(()=>{S(()=>{E.current&&(reactToastify.toast.dismiss(E.current),E.current=null),reactToastify.toast.dismiss({containerId:e});});},[e,S]),W=react.useCallback((i,C)=>{d(i,C,s);},[d,s]),K=react.useCallback((i,C,w)=>{if(x(),!m.current.has(w))try{let V={containerId:e,toastId:w,onClose:()=>{m.current.delete(w),E.current=null;}},J=n?.toastOptions?.error?.({title:i,rawError:C,errorType:a.errorType,isConnected:a.isConnected}),F={...V,...J};reactToastify.toast.error(jsxRuntime.jsx(O,{title:i,rawError:C,errorType:a.errorType,isConnected:a.isConnected,onCopyComplete:Q=>W(Q,C),customization:n?.toastErrorCustomization}),F),m.current.add(w),E.current=w;}catch(V){console.error("Failed to show error toast:",V);}},[x,e,n?.toastOptions?.error,n?.toastErrorCustomization,O,a.errorType,a.isConnected,W]),z=react.useCallback((i,C,w)=>{R(K,{title:i,rawError:C,errorKey:w,errorType:s});},[K,R,s]);react.useEffect(()=>{if(p&&!g){x(),m.current.clear();return}if(g&&b&&h){if(p&&s!=="switch")return;z(T,b,h);}},[g,p,b,s,T,h,z,x]),react.useEffect(()=>()=>{x(),m.current.clear();},[x]);let _=n?.classNames?.container?n.classNames.container({hasErrors:a.hasAnyError,errorType:a.errorType}):"novacon:p-0 novacon:bg-transparent",U=react.useMemo(()=>{let i=n?.toastCloseButton;return i?({closeToast:C})=>jsxRuntime.jsx(novaCore.ToastCloseButton,{closeToast:C,...i}):novaCore.ToastCloseButton},[n?.toastCloseButton]),j={...{containerId:e,position:o,closeOnClick:false,icon:false,closeButton:U,autoClose:r,hideProgressBar:false,newestOnTop:false,pauseOnFocusLoss:false,draggable:c,pauseOnHover:true,theme:"light",transition:reactToastify.Bounce},...n?.containerProps,className:_};return jsxRuntime.jsx(A,{...j})}ie.displayName="ErrorsProvider";function ce({labels:e,children:o}){let r=react.useMemo(()=>e,[e]);if(process.env.NODE_ENV==="development"){(!e||typeof e!="object")&&console.warn("NovaConnectLabelsProvider: labels prop should be an object");let n=["connectWallet","disconnect","connecting","connected","error","success"].filter(u=>!(u in e));n.length>0&&console.warn(`NovaConnectLabelsProvider: Missing required labels: ${n.join(", ")}`);}return jsxRuntime.jsx(chunk7TYZT7ZD_cjs.g.Provider,{value:r,children:o})}ce.displayName="NovaConnectLabelsProvider";function de(e){let{enabled:o=true,getNonce:r,verifier:c,destroyer:n,domain:u,uri:M,statement:B,expirationTime:L,expirationSeconds:O,notBefore:A,requestId:R,resources:S,onSuccess:d,onError:k}=e,t=chunkV6XDFRWV_cjs.d(s=>s.activeConnection),m=chunkV6XDFRWV_cjs.d(s=>s.disconnect),{signIn:E}=siwxReact.useSiwx(),P=siwxReact.useSiwxSessionStore(s=>s.session),l=siwxReact.useSiwxSessionStore(s=>s.status),p=siwxReact.useSiwxSessionStore(s=>s.reset),g=react.useRef(null),b=react.useRef(false);return react.useEffect(()=>{(!t?.isConnected||!t?.address)&&(g.current=null,(l==="authenticated"||P)&&(p(),n&&n().catch(s=>{console.warn("[NovaSiwxWatcher] Failed to execute session destroyer:",s);})));},[t?.isConnected,t?.address,l,P,p,n]),react.useEffect(()=>{if(!(!o||!t?.isConnected||!t?.address||!t?.chainId)&&t.signMessage&&!b.current&&!(l==="building"||l==="signing"||l==="verifying"))try{let s={address:String(t.address),chainId:t.chainId,signMessage:t.signMessage,isConnected:t.isConnected},a=siwxReact.getSatelliteSiwxFields(s,{domain:u,uri:M,statement:B,expirationTime:L,expirationSeconds:O,notBefore:A,requestId:R,resources:S});if(l==="authenticated"&&P?.address===a.address||g.current===a.address)return;if(g.current=a.address,!c){console.warn("[NovaSiwxWatcher] Verifier not provided, skipping SIWX auto-authentication.");return}let N=T=>{let I=T instanceof Error?T.message:String(T);console.warn("[NovaSiwxWatcher] SIWX authentication rejected or failed:",I);let h=t.address;t.connectorType&&h===t.address&&m(t.connectorType),p(),k?.(I);};b.current=!0,E({signer:t.signMessage,verifier:c,getNonce:r,fields:a,onSuccess:d,onError:N}).catch(N).finally(()=>{b.current=!1;});}catch(s){console.warn("[NovaSiwxWatcher] Failed to build SIWX fields:",s);}},[t?.isConnected,t?.address,t?.chainId,t?.signMessage,t?.connectorType,m,o,l,P?.address,r,c,u,M,B,L,O,A,R,S,E,p,d,k]),null}var $e=({labels:e,children:o})=>jsxRuntime.jsx(ce,{labels:e,children:o}),_e=({customization:e})=>jsxRuntime.jsx(ie,{customization:e}),je=(e,o)=>novaCore.deepMerge(e,o||{}),Je=e=>e,Qe=e=>e,Ye=(e,o,r)=>e;function Ze({labels:e,children:o,appChains:r,solanaRPCUrls:c,transactionPool:n,pulsarAdapter:u,withImpersonated:M,withBalance:B,withChain:L,popularConnectors:O,customConnectorGroups:A,legal:R,siwx:S,customization:d,pagination:k}){let t=chunkV6XDFRWV_cjs.d(te=>te.activeConnection),m=chunkV6XDFRWV_cjs.d(te=>te.connectionError),{LabelsProvider:E=$e,ErrorsProvider:P=_e}=d?.components??{},{merge:l=je,transform:p=Je}=d?.labels??{},{transform:g=Qe}=d?.contextValue??{},{providerTree:b=Ye}=d?.rendering??{},s=react.useMemo(()=>l(chunkMGBN4EIT_cjs.a,e||{}),[e,l]),[a,N]=react.useState(false),[T,I]=react.useState(false),[h,x]=react.useState(false),[W,K]=react.useState(false),[z,_]=react.useState("idle"),[U,me]=react.useState("connectors"),[j,i]=react.useState(void 0),[C,w]=react.useState(void 0),[V,J]=react.useState(""),[F,Q]=react.useState(false),[Y,Ne]=react.useState("main"),xe={appChains:r,solanaRPCUrls:c,withImpersonated:M,popularConnectors:O,customConnectorGroups:A,withBalance:B,withChain:L,isConnectModalOpen:a,setIsConnectModalOpen:N,isConnectedModalOpen:T,setIsConnectedModalOpen:I,isChainsListOpen:h,setIsChainsListOpen:x,isChainsListOpenMobile:W,setIsChainsListOpenMobile:K,connectedButtonStatus:z,setConnectedButtonStatus:_,connectedModalContentType:Y,setConnectedModalContentType:Ne,connectModalContentType:U,setConnectModalContentType:me,selectedAdapter:j,setSelectedAdapter:i,activeConnector:C,setActiveConnector:w,impersonatedAddress:V,setImpersonatedAddress:J,isConnected:F,setIsConnected:Q,legal:R},q=react.useMemo(()=>({isConnected:F,activeConnection:t,connectionError:m,modalStates:{isConnectModalOpen:a,isConnectedModalOpen:T,isChainsListOpen:h,isChainsListOpenMobile:W},contentTypes:{connectModal:U,connectedModal:Y},statuses:{connectedButton:z}}),[F,t,m,a,T,h,W,U,Y,z]),Me=react.useMemo(()=>p(s,q),[s,p,q]),Ce=g(xe,q),Z=jsxRuntime.jsx(P,{customization:d?.errors}),ee=jsxRuntime.jsx(E,{labels:Me,children:o}),oe=r||c?jsxRuntime.jsx(chunk7K4ENNWO_cjs.G,{solanaRPCUrls:c,appChains:r,customization:d?.modals?.connectModal}):null,re=r||c?jsxRuntime.jsx(chunk7K4ENNWO_cjs.t,{solanaRPCUrls:c,appChains:r,transactionPool:n,pulsarAdapter:u,customization:d?.modals?.connectedModal,pagination:k}):null,Le=jsxRuntime.jsxs(chunk7TYZT7ZD_cjs.c.Provider,{value:Ce,children:[jsxRuntime.jsx(de,{...S}),Z,ee,oe,re]}),Oe=jsxRuntime.jsxs(chunk7TYZT7ZD_cjs.c.Provider,{value:Ce,children:[jsxRuntime.jsx(de,{...S}),Z,ee,oe,re]}),Re=b(Oe,{ErrorsProvider:Z,LabelsProvider:ee,MainContent:Le,ConnectModal:oe||jsxRuntime.jsx(jsxRuntime.Fragment,{}),ConnectedModal:re||jsxRuntime.jsx(jsxRuntime.Fragment,{})},q);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Re})}Ze.displayName="NovaConnectProvider";async function kr(){let{getAllAdaptersStatus:e}=await import('./getChainsListByConnectorType-QCNOPM6I.cjs');return {hasEvmUtils:await X(),hasSolanaUtils:await $(),adaptersStatus:e()}}async function X(){try{return await import('viem'),await import('@tuwaio/orbit-evm'),!0}catch{return false}}async function $(){try{return await import('@solana/kit'),await import('@tuwaio/orbit-solana'),!0}catch{return false}}async function Ir(){try{if(!await X())return {available:!1,error:"EVM packages (viem, @tuwaio/orbit-evm) not available"};let o=await import('./evm/index.cjs'),r=await o.getEvmExports();return r.available?{...o,...r}:{available:!1,error:r.error||"Failed to load EVM exports"}}catch(e){return {available:false,error:e instanceof Error?e.message:"EVM utilities not available"}}}async function Wr(){try{if(!await $())return {available:!1,error:"Solana packages (@solana/kit, @tuwaio/orbit-solana) not available"};let o=await import('./solana/index.cjs'),r=await o.getSolanaExports();return r.available?{...o,...r}:{available:!1,error:r.error||"Failed to load Solana exports"}}catch(e){return {available:false,error:e instanceof Error?e.message:"Solana utilities not available"}}}async function zr(){let e={evm:false,solana:false,errors:[]};try{let o=await X(),r=await $();if(o||r){let{preloadChainAdapters:c}=await import('./getChainsListByConnectorType-QCNOPM6I.cjs'),n=[];o&&n.push(orbitCore.OrbitAdapter.EVM),r&&n.push(orbitCore.OrbitAdapter.SOLANA),await c(n),e.evm=o,e.solana=r;}else e.errors.push("No blockchain packages available for initialization");}catch(o){let r=o instanceof Error?o.message:"Unknown initialization error";e.errors.push(r);}return e}async function Hr(e){return e===orbitCore.OrbitAdapter.Starknet||e!==orbitCore.OrbitAdapter.EVM&&e!==orbitCore.OrbitAdapter.SOLANA?false:e===orbitCore.OrbitAdapter.EVM?X():$()}Object.defineProperty(exports,"NovaConnectLabelsContext",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.g}});Object.defineProperty(exports,"NovaConnectProviderContext",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.c}});Object.defineProperty(exports,"NovaConnectProviderError",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.b}});Object.defineProperty(exports,"createLabelsSubset",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.o}});Object.defineProperty(exports,"getAvailableChainIds",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.r}});Object.defineProperty(exports,"getAvailableSolanaClusters",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.w}});Object.defineProperty(exports,"getConnectChainId",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.q}});Object.defineProperty(exports,"getFilteredConnectors",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.u}});Object.defineProperty(exports,"getGroupedConnectors",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.s}});Object.defineProperty(exports,"getLabelWithFallback",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.n}});Object.defineProperty(exports,"hasAvailableConnectors",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.t}});Object.defineProperty(exports,"hasConnectorsForAdapter",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.v}});Object.defineProperty(exports,"hasLabel",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.k}});Object.defineProperty(exports,"isDefaultLabels",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.m}});Object.defineProperty(exports,"isValidSolanaCluster",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.x}});Object.defineProperty(exports,"useGetWalletNameAndAvatar",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.a}});Object.defineProperty(exports,"useHasNovaConnectContext",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.e}});Object.defineProperty(exports,"useLabelsByCategory",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.l}});Object.defineProperty(exports,"useNovaConnect",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.d}});Object.defineProperty(exports,"useNovaConnectLabel",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.i}});Object.defineProperty(exports,"useNovaConnectLabels",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.h}});Object.defineProperty(exports,"useNovaConnectLabelsSubset",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.j}});Object.defineProperty(exports,"useNovaConnectOptional",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.f}});Object.defineProperty(exports,"useNovaSiwx",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.p}});Object.defineProperty(exports,"useWalletChainsList",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.y}});Object.defineProperty(exports,"useWalletNativeBalance",{enumerable:true,get:function(){return chunk7TYZT7ZD_cjs.z}});Object.defineProperty(exports,"getAdapterStatus",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.k}});Object.defineProperty(exports,"getAllAdaptersStatus",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.l}});Object.defineProperty(exports,"getAvailableSolanaClustersAsync",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.g}});Object.defineProperty(exports,"getChainsListByConnectorType",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.b}});Object.defineProperty(exports,"getChainsListByConnectorTypeAsync",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.a}});Object.defineProperty(exports,"getChainsListByConnectorTypeSync",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.b}});Object.defineProperty(exports,"getWalletChains",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.i}});Object.defineProperty(exports,"isEvmChainList",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.e}});Object.defineProperty(exports,"isEvmChainListAsync",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.c}});Object.defineProperty(exports,"isEvmChainListSync",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.e}});Object.defineProperty(exports,"isSolanaChainList",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.f}});Object.defineProperty(exports,"isSolanaChainListAsync",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.d}});Object.defineProperty(exports,"isSolanaChainListSync",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.f}});Object.defineProperty(exports,"isValidSolanaClusterAsync",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.h}});Object.defineProperty(exports,"preloadChainAdapters",{enumerable:true,get:function(){return chunkK44IHM6B_cjs.j}});exports.ErrorsProvider=ie;exports.NovaConnectLabelsProvider=ce;exports.NovaConnectProvider=Ze;exports.NovaSiwxWatcher=de;exports.getBlockchainUtilities=kr;exports.getEvmUtils=Ir;exports.getSolanaUtils=Wr;exports.initializeBlockchainSupport=zr;exports.isAdapterSupported=Hr;
1
+ 'use strict';var chunkQ4FCNEIJ_cjs=require('./chunk-Q4FCNEIJ.cjs'),chunkZVUCC2QP_cjs=require('./chunk-ZVUCC2QP.cjs'),chunkR5V3K52O_cjs=require('./chunk-R5V3K52O.cjs'),chunkEGATOYHY_cjs=require('./chunk-EGATOYHY.cjs');require('./chunk-YJRNNNR6.cjs');var novaCore=require('@tuwaio/nova-core'),react=require('react'),reactToastify=require('react-toastify'),jsxRuntime=require('react/jsx-runtime'),siwxReact=require('@tuwaio/siwx-react');var ze=({title:e,rawError:r,onCopyComplete:i,errorType:u,isConnected:n,...m})=>jsxRuntime.jsx(chunkQ4FCNEIJ_cjs.H,{title:e,rawError:r,onCopyComplete:i,customization:m.customization}),He=e=>{let r=chunkZVUCC2QP_cjs.h();return jsxRuntime.jsx(reactToastify.ToastContainer,{...e,role:"alert","aria-live":"assertive","aria-label":r.somethingWentWrong})},Ie=(e,r)=>{e(r.title,r.rawError,r.errorKey);},Ae=e=>{e();},Fe=(e,r)=>{if(e&&process.env.NODE_ENV==="development"){let i=typeof r=="string"?r:r.message;console.log("Error copied to clipboard:",i.substring(0,100));}},Ve=e=>e,De=e=>e;function ne({containerId:e="nova-connect-errors",position:r="top-center",autoClose:i=7e3,draggable:u=false,customization:n}){let m=chunkZVUCC2QP_cjs.h(),B=chunkEGATOYHY_cjs.d(a=>a.switchNetworkError),A=chunkEGATOYHY_cjs.d(a=>a.activeConnection),W=chunkEGATOYHY_cjs.d(a=>a.connectionError),{ToastError:z=ze,Container:F=He}=n?.components??{},{showError:H=Ie,dismissError:L=Ae,onCopyComplete:p=Fe}=n?.handlers??{},{errorTitle:V=Ve,errorHash:o=De}=n??{},T=react.useRef(new Set),g=react.useRef(null),M=!!W,v=!!B,c=!!A?.isConnected,w=M||v,y=W||B||null,l=M?"wallet":v?"switch":null,s={hasWalletError:M,hasSwitchError:v,isConnected:c,hasAnyError:w,primaryError:y,errorType:l},O=m.somethingWentWrong;switch(s.errorType){case "wallet":O=m.connectionError;break;case "switch":O=m.errorWhenChainSwitching;break}let S=V(O,{errorType:s.errorType}),t=s.primaryError?`${s.errorType}-${s.primaryError.message.substring(0,50)}`:null,d=o(t,{primaryError:s.primaryError,errorType:s.errorType}),C=react.useCallback(()=>{L(()=>{g.current&&(reactToastify.toast.dismiss(g.current),g.current=null),reactToastify.toast.dismiss({containerId:e});});},[e,L]),x=react.useCallback((a,f)=>{p(a,f,l);},[p,l]),R=react.useCallback((a,f,h)=>{if(C(),!T.current.has(h))try{let k={containerId:e,toastId:h,onClose:()=>{T.current.delete(h),g.current=null;}},U=n?.toastOptions?.error?.({title:a,rawError:f,errorType:s.errorType,isConnected:s.isConnected}),K={...k,...U};reactToastify.toast.error(jsxRuntime.jsx(z,{title:a,rawError:f,errorType:s.errorType,isConnected:s.isConnected,onCopyComplete:_=>x(_,f),customization:n?.toastErrorCustomization}),K),T.current.add(h),g.current=h;}catch(k){console.error("Failed to show error toast:",k);}},[C,e,n?.toastOptions?.error,n?.toastErrorCustomization,z,s.errorType,s.isConnected,x]),N=react.useCallback((a,f,h)=>{H(R,{title:a,rawError:f,errorKey:h,errorType:l});},[R,H,l]);react.useEffect(()=>{if(c&&!w){C(),T.current.clear();return}if(w&&y&&d){if(c&&l!=="switch")return;N(S,y,d);}},[w,c,y,l,S,d,N,C]),react.useEffect(()=>()=>{C(),T.current.clear();},[C]);let I=n?.classNames?.container?n.classNames.container({hasErrors:s.hasAnyError,errorType:s.errorType}):"novacon:p-0 novacon:bg-transparent",D=react.useMemo(()=>{let a=n?.toastCloseButton;return a?({closeToast:f})=>jsxRuntime.jsx(novaCore.ToastCloseButton,{closeToast:f,...a}):novaCore.ToastCloseButton},[n?.toastCloseButton]),$={...{containerId:e,position:r,closeOnClick:false,icon:false,closeButton:D,autoClose:i,hideProgressBar:false,newestOnTop:false,pauseOnFocusLoss:false,draggable:u,pauseOnHover:true,theme:"light",transition:reactToastify.Bounce},...n?.containerProps,className:I};return jsxRuntime.jsx(F,{...$})}ne.displayName="ErrorsProvider";function se({labels:e,children:r}){let i=react.useMemo(()=>e,[e]);if(process.env.NODE_ENV==="development"){(!e||typeof e!="object")&&console.warn("NovaConnectLabelsProvider: labels prop should be an object");let n=["connectWallet","disconnect","connecting","connected","error","success"].filter(m=>!(m in e));n.length>0&&console.warn(`NovaConnectLabelsProvider: Missing required labels: ${n.join(", ")}`);}return jsxRuntime.jsx(chunkZVUCC2QP_cjs.g.Provider,{value:i,children:r})}se.displayName="NovaConnectLabelsProvider";function be(e){let{enabled:r=true,getNonce:i,verifier:u,destroyer:n,domain:m,uri:B,statement:A,expirationTime:W,expirationSeconds:z,notBefore:F,requestId:H,resources:L,onSuccess:p,onError:V}=e,o=chunkEGATOYHY_cjs.d(t=>t.activeConnection),T=chunkEGATOYHY_cjs.d(t=>t.disconnect),g=chunkEGATOYHY_cjs.d(t=>t.isAutoConnectFinished),{signIn:M}=siwxReact.useSiwx(),v=siwxReact.useSiwxSessionStore(t=>t.session),c=siwxReact.useSiwxSessionStore(t=>t.status),w=siwxReact.useSiwxSessionStore(t=>t.reset),y=react.useRef(null),l=react.useRef(false),s=react.useEffectEvent(()=>{w(),n&&n().catch(t=>{console.warn("[NovaSiwxWatcher] Failed to execute session destroyer:",t);});});react.useEffect(()=>{if(!o?.isConnected||!o?.address){if(y.current=null,g===false)return;(c==="authenticated"||v)&&s();}},[o?.isConnected,o?.address,g,c,v]);let O=react.useEffectEvent((t,d)=>o?.connectorType===t&&o.address===d),S=react.useEffectEvent(()=>{if(!(!o?.isConnected||!o.address||!o.signMessage))try{let t={address:String(o.address),chainId:o.chainId,signMessage:o.signMessage,isConnected:o.isConnected},d=siwxReact.getSatelliteSiwxFields(t,{domain:m,uri:B,statement:A,expirationTime:W,expirationSeconds:z,notBefore:F,requestId:H,resources:L});if(c==="authenticated"&&v?.address===d.address||y.current===d.address)return;if(y.current=d.address,!u){console.warn("[NovaSiwxWatcher] Verifier not provided, skipping SIWX auto-authentication.");return}let{connectorType:C,address:x}=o,R=N=>{let I=N instanceof Error?N.message:String(N);console.warn("[NovaSiwxWatcher] SIWX authentication rejected or failed:",I),C&&O(C,x)&&T(C),w(),V?.(I);};l.current=!0,M({signer:o.signMessage,verifier:u,getNonce:i,fields:d,onSuccess:p,onError:R}).catch(R).finally(()=>{l.current=!1;});}catch(t){console.warn("[NovaSiwxWatcher] Failed to build SIWX fields:",t);}});return react.useEffect(()=>{!r||!o?.isConnected||!o?.address||!o?.chainId||o.signMessage&&(l.current||c==="building"||c==="signing"||c==="verifying"||S());},[o?.isConnected,o?.address,o?.chainId,o?.signMessage,o?.connectorType,r,c,v?.address]),null}var $e=({labels:e,children:r})=>jsxRuntime.jsx(se,{labels:e,children:r}),Ue=({customization:e})=>jsxRuntime.jsx(ne,{customization:e}),_e=(e,r)=>novaCore.deepMerge(e,r||{}),je=e=>e,Je=e=>e,Qe=(e,r,i)=>e;function Ye({labels:e,children:r,appChains:i,solanaRPCUrls:u,transactionPool:n,pulsarAdapter:m,withImpersonated:B,withBalance:A,withChain:W,popularConnectors:z,customConnectorGroups:F,legal:H,siwx:L,customization:p,pagination:V}){let o=chunkEGATOYHY_cjs.d(ee=>ee.activeConnection),T=chunkEGATOYHY_cjs.d(ee=>ee.connectionError),{LabelsProvider:g=$e,ErrorsProvider:M=Ue}=p?.components??{},{merge:v=_e,transform:c=je}=p?.labels??{},{transform:w=Je}=p?.contextValue??{},{providerTree:y=Qe}=p?.rendering??{},l=react.useMemo(()=>v(chunkR5V3K52O_cjs.a,e||{}),[e,v]),[s,O]=react.useState(false),[S,t]=react.useState(false),[d,C]=react.useState(false),[x,R]=react.useState(false),[N,I]=react.useState("idle"),[D,de]=react.useState("connectors"),[$,a]=react.useState(void 0),[f,h]=react.useState(void 0),[k,U]=react.useState(""),[K,_]=react.useState(false),[j,he]=react.useState("main"),Se={appChains:i,solanaRPCUrls:u,withImpersonated:B,popularConnectors:z,customConnectorGroups:F,withBalance:A,withChain:W,isConnectModalOpen:s,setIsConnectModalOpen:O,isConnectedModalOpen:S,setIsConnectedModalOpen:t,isChainsListOpen:d,setIsChainsListOpen:C,isChainsListOpenMobile:x,setIsChainsListOpenMobile:R,connectedButtonStatus:N,setConnectedButtonStatus:I,connectedModalContentType:j,setConnectedModalContentType:he,connectModalContentType:D,setConnectModalContentType:de,selectedAdapter:$,setSelectedAdapter:a,activeConnector:f,setActiveConnector:h,impersonatedAddress:k,setImpersonatedAddress:U,isConnected:K,setIsConnected:_,legal:H},G=react.useMemo(()=>({isConnected:K,activeConnection:o,connectionError:T,modalStates:{isConnectModalOpen:s,isConnectedModalOpen:S,isChainsListOpen:d,isChainsListOpenMobile:x},contentTypes:{connectModal:D,connectedModal:j},statuses:{connectedButton:N}}),[K,o,T,s,S,d,x,D,j,N]),xe=react.useMemo(()=>c(l,G),[l,c,G]),ue=w(Se,G),J=jsxRuntime.jsx(M,{customization:p?.errors}),Q=jsxRuntime.jsx(g,{labels:xe,children:r}),Y=i||u?jsxRuntime.jsx(chunkQ4FCNEIJ_cjs.G,{solanaRPCUrls:u,appChains:i,customization:p?.modals?.connectModal}):null,Z=i||u?jsxRuntime.jsx(chunkQ4FCNEIJ_cjs.t,{solanaRPCUrls:u,appChains:i,transactionPool:n,pulsarAdapter:m,customization:p?.modals?.connectedModal,pagination:V}):null,pe=L?jsxRuntime.jsx(be,{...L}):null,Le=jsxRuntime.jsxs(chunkZVUCC2QP_cjs.c.Provider,{value:ue,children:[pe,J,Q,Y,Z]}),Me=jsxRuntime.jsxs(chunkZVUCC2QP_cjs.c.Provider,{value:ue,children:[pe,J,Q,Y,Z]}),Oe=y(Me,{ErrorsProvider:J,LabelsProvider:Q,MainContent:Le,ConnectModal:Y||jsxRuntime.jsx(jsxRuntime.Fragment,{}),ConnectedModal:Z||jsxRuntime.jsx(jsxRuntime.Fragment,{})},G);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Oe})}Ye.displayName="NovaConnectProvider";Object.defineProperty(exports,"NovaConnectLabelsContext",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.g}});Object.defineProperty(exports,"NovaConnectProviderContext",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.c}});Object.defineProperty(exports,"NovaConnectProviderError",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.b}});Object.defineProperty(exports,"createLabelsSubset",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.o}});Object.defineProperty(exports,"getAvailableChainIds",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.v}});Object.defineProperty(exports,"getChainsListByConnectorType",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.q}});Object.defineProperty(exports,"getConnectChainId",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.u}});Object.defineProperty(exports,"getFilteredConnectors",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.y}});Object.defineProperty(exports,"getGroupedConnectors",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.w}});Object.defineProperty(exports,"getLabelWithFallback",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.n}});Object.defineProperty(exports,"getWalletChains",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.t}});Object.defineProperty(exports,"hasAvailableConnectors",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.x}});Object.defineProperty(exports,"hasConnectorsForAdapter",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.z}});Object.defineProperty(exports,"hasLabel",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.k}});Object.defineProperty(exports,"isDefaultLabels",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.m}});Object.defineProperty(exports,"isEvmChainList",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.r}});Object.defineProperty(exports,"isSolanaChainList",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.s}});Object.defineProperty(exports,"useGetWalletNameAndAvatar",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.a}});Object.defineProperty(exports,"useHasNovaConnectContext",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.e}});Object.defineProperty(exports,"useLabelsByCategory",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.l}});Object.defineProperty(exports,"useNovaConnect",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.d}});Object.defineProperty(exports,"useNovaConnectLabel",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.i}});Object.defineProperty(exports,"useNovaConnectLabels",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.h}});Object.defineProperty(exports,"useNovaConnectLabelsSubset",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.j}});Object.defineProperty(exports,"useNovaConnectOptional",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.f}});Object.defineProperty(exports,"useNovaSiwx",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.p}});Object.defineProperty(exports,"useWalletChainsList",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.A}});Object.defineProperty(exports,"useWalletNativeBalance",{enumerable:true,get:function(){return chunkZVUCC2QP_cjs.B}});exports.ErrorsProvider=ne;exports.NovaConnectLabelsProvider=se;exports.NovaConnectProvider=Ye;exports.NovaSiwxWatcher=be;