@tuwaio/satellite-react 0.3.5 → 0.3.6

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.
package/README.md CHANGED
@@ -4,13 +4,15 @@
4
4
  [![License](https://img.shields.io/npm/l/@tuwaio/satellite-react.svg)](./LICENSE)
5
5
  [![Build Status](https://img.shields.io/github/actions/workflow/status/TuwaIO/satellite-connect/release.yml?branch=main)](https://github.com/TuwaIO/satellite-connect/actions)
6
6
 
7
- React components and hooks for the Satellite Connect ecosystem, providing an easy-to-use interface for integrating Web3 wallet functionality into React applications.
7
+ React state hooks and context providers for orchestrating framework-agnostic Satellite wallet connector instances.
8
8
 
9
9
  ---
10
10
 
11
11
  ## 🏛️ What is `@tuwaio/satellite-react`?
12
12
 
13
- `@tuwaio/satellite-react` is the React integration layer for the Satellite Connect ecosystem. It provides a collection of React hooks and components that make it easy to integrate Web3 wallet functionality into your React applications.
13
+ `@tuwaio/satellite-react` provides the React integration layer for the Satellite framework. It exposes optimized state hooks and context providers to orchestrate and watch framework-agnostic Satellite wallet connector instances.
14
+
15
+ By mapping underlying Zustand store mutations to React's rendering lifecycle, it enables developers to maintain a synchronized, multi-chain connection state.
14
16
 
15
17
  Built on top of `@tuwaio/satellite-core`, this package offers a seamless developer experience for React applications requiring Web3 wallet integration.
16
18
 
@@ -59,40 +61,36 @@ import { injected } from '@wagmi/connectors';
59
61
  import { mainnet, sepolia } from 'viem/chains';
60
62
  import type { Chain } from 'viem/chains';
61
63
 
62
- export const appEVMChains = [
63
- mainnet,
64
- sepolia,
65
- ] as readonly [Chain, ...Chain[]];
64
+ export const appEVMChains = [mainnet, sepolia] as readonly [Chain, ...Chain[]];
66
65
 
67
66
  export const wagmiConfig = createConfig({
68
- connectors: [injected()],
69
- transports: createDefaultTransports(appEVMChains), // Automatically creates http transports
70
- chains: appEVMChains,
71
- ssr: true, // Enable SSR support if needed (e.g., in Next.js)
67
+ connectors: [injected()],
68
+ transports: createDefaultTransports(appEVMChains), // Automatically creates http transports
69
+ chains: appEVMChains,
70
+ ssr: true, // Enable SSR support if needed (e.g., in Next.js)
72
71
  });
73
72
 
74
73
  export const solanaRPCUrls = {
75
- devnet: 'https://api.devnet.solana.com',
74
+ devnet: 'https://api.devnet.solana.com',
76
75
  };
77
76
 
78
-
79
77
  const queryClient = new QueryClient();
80
78
 
81
79
  export function Providers({ children }: { children: ReactNode }) {
82
- return (
83
- <WagmiProvider config={wagmiConfig}>
84
- <QueryClientProvider client={queryClient}>
85
- <SatelliteConnectProvider
86
- adapter={[satelliteEVMAdapter(wagmiConfig, appEVMChains), satelliteSolanaAdapter({ rpcUrls: solanaRPCUrls })]}
87
- autoConnect={true}
88
- >
89
- <EVMConnectorsWatcher wagmiConfig={wagmiConfig} />
90
- <SolanaConnectorsWatcher />
91
- {children}
92
- </SatelliteConnectProvider>
93
- </QueryClientProvider>
94
- </WagmiProvider>
95
- );
80
+ return (
81
+ <WagmiProvider config={wagmiConfig}>
82
+ <QueryClientProvider client={queryClient}>
83
+ <SatelliteConnectProvider
84
+ adapter={[satelliteEVMAdapter(wagmiConfig, appEVMChains), satelliteSolanaAdapter({ rpcUrls: solanaRPCUrls })]}
85
+ autoConnect={true}
86
+ >
87
+ <EVMConnectorsWatcher wagmiConfig={wagmiConfig} />
88
+ <SolanaConnectorsWatcher />
89
+ {children}
90
+ </SatelliteConnectProvider>
91
+ </QueryClientProvider>
92
+ </WagmiProvider>
93
+ );
96
94
  }
97
95
  ```
98
96
 
@@ -103,7 +101,7 @@ import { useSatelliteConnectStore } from '@tuwaio/satellite-react';
103
101
 
104
102
  function ExampleGettingActiveWalletFromStore() {
105
103
  const activeConnection = useSatelliteConnectStore((state) => state.activeConnection);
106
- return <div>{activeConnection?.address}</div>
104
+ return <div>{activeConnection?.address}</div>;
107
105
  }
108
106
  ```
109
107
 
@@ -112,13 +110,13 @@ function ExampleGettingActiveWalletFromStore() {
112
110
  ### Core Components
113
111
 
114
112
  1. **Store Access**
115
- - `useSatelliteConnectStore`: Access to satellite connect store with full type safety
116
- - Provides access to wallet state, connection methods, and chain management
113
+ - `useSatelliteConnectStore`: Access to satellite connect store with full type safety
114
+ - Provides access to wallet state, connection methods, and chain management
117
115
 
118
116
  2. **Provider Components**
119
- - `SatelliteConnectProvider`: Global context provider with all necessary configurations
120
- - `EVMConnectorsWatcher`: EVM connection state management
121
- - `SolanaConnectorsWatcher`: Solana connection state management
117
+ - `SatelliteConnectProvider`: Global context provider with all necessary configurations
118
+ - `EVMConnectorsWatcher`: EVM connection state management
119
+ - `SolanaConnectorsWatcher`: Solana connection state management
122
120
 
123
121
  ---
124
122
 
@@ -1,6 +1,6 @@
1
1
  import { OrbitAdapter } from '@tuwaio/orbit-core';
2
2
  import { EVMConnection, ConnectorEVM } from '@tuwaio/satellite-evm';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as react from 'react';
4
4
 
5
5
  /**
6
6
  * Props for the {@link EVMConnectorsWatcher} component.
@@ -38,7 +38,7 @@ interface EVMConnectorsWatcherProps {
38
38
  * @param props - The component's props. See {@link EVMConnectorsWatcherProps} for details.
39
39
  * @returns {null} This component does not render any UI.
40
40
  */
41
- declare function EVMConnectorsWatcher(props: EVMConnectorsWatcherProps): react_jsx_runtime.JSX.Element | null;
41
+ declare function EVMConnectorsWatcher(props: EVMConnectorsWatcherProps): react.JSX.Element | null;
42
42
 
43
43
  declare module '@tuwaio/satellite-react' {
44
44
  interface AllConnections {
@@ -1,6 +1,6 @@
1
1
  import { OrbitAdapter } from '@tuwaio/orbit-core';
2
2
  import { EVMConnection, ConnectorEVM } from '@tuwaio/satellite-evm';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as react from 'react';
4
4
 
5
5
  /**
6
6
  * Props for the {@link EVMConnectorsWatcher} component.
@@ -38,7 +38,7 @@ interface EVMConnectorsWatcherProps {
38
38
  * @param props - The component's props. See {@link EVMConnectorsWatcherProps} for details.
39
39
  * @returns {null} This component does not render any UI.
40
40
  */
41
- declare function EVMConnectorsWatcher(props: EVMConnectorsWatcherProps): react_jsx_runtime.JSX.Element | null;
41
+ declare function EVMConnectorsWatcher(props: EVMConnectorsWatcherProps): react.JSX.Element | null;
42
42
 
43
43
  declare module '@tuwaio/satellite-react' {
44
44
  interface AllConnections {
package/dist/index.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ISatelliteConnectStore, SatelliteConnectStoreInitialParameters } from '@tuwaio/satellite-core';
3
3
  import { StoreApi } from 'zustand';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
4
 
6
5
  /**
7
6
  * @description
@@ -137,6 +136,6 @@ interface SatelliteConnectProviderProps extends SatelliteConnectStoreInitialPara
137
136
  * </SatelliteConnectProvider>
138
137
  * ```
139
138
  */
140
- declare function SatelliteConnectProvider({ children, autoConnect, ...parameters }: SatelliteConnectProviderProps): react_jsx_runtime.JSX.Element;
139
+ declare function SatelliteConnectProvider({ children, autoConnect, ...parameters }: SatelliteConnectProviderProps): react.JSX.Element;
141
140
 
142
141
  export { type AllConnections, type AllConnectors, type Connection, type Connector, SatelliteConnectProvider, type SatelliteConnectProviderProps, SatelliteStoreContext, useInitializeAutoConnect, useSatelliteConnectStore };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ISatelliteConnectStore, SatelliteConnectStoreInitialParameters } from '@tuwaio/satellite-core';
3
3
  import { StoreApi } from 'zustand';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
4
 
6
5
  /**
7
6
  * @description
@@ -137,6 +136,6 @@ interface SatelliteConnectProviderProps extends SatelliteConnectStoreInitialPara
137
136
  * </SatelliteConnectProvider>
138
137
  * ```
139
138
  */
140
- declare function SatelliteConnectProvider({ children, autoConnect, ...parameters }: SatelliteConnectProviderProps): react_jsx_runtime.JSX.Element;
139
+ declare function SatelliteConnectProvider({ children, autoConnect, ...parameters }: SatelliteConnectProviderProps): react.JSX.Element;
141
140
 
142
141
  export { type AllConnections, type AllConnectors, type Connection, type Connector, SatelliteConnectProvider, type SatelliteConnectProviderProps, SatelliteStoreContext, useInitializeAutoConnect, useSatelliteConnectStore };
@@ -1,6 +1,6 @@
1
1
  import { OrbitAdapter } from '@tuwaio/orbit-core';
2
2
  import { SolanaConnection, ConnectorSolana } from '@tuwaio/satellite-solana';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as react from 'react';
4
4
 
5
5
  /**
6
6
  * A dynamic version of the SolanaConnectorsWatcher component that avoids static imports.
@@ -8,7 +8,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
8
8
  *
9
9
  * @returns null - This is a headless component
10
10
  */
11
- declare function SolanaConnectorsWatcher(): react_jsx_runtime.JSX.Element | null;
11
+ declare function SolanaConnectorsWatcher(): react.JSX.Element | null;
12
12
 
13
13
  declare module '@tuwaio/satellite-react' {
14
14
  interface AllConnections {
@@ -1,6 +1,6 @@
1
1
  import { OrbitAdapter } from '@tuwaio/orbit-core';
2
2
  import { SolanaConnection, ConnectorSolana } from '@tuwaio/satellite-solana';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as react from 'react';
4
4
 
5
5
  /**
6
6
  * A dynamic version of the SolanaConnectorsWatcher component that avoids static imports.
@@ -8,7 +8,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
8
8
  *
9
9
  * @returns null - This is a headless component
10
10
  */
11
- declare function SolanaConnectorsWatcher(): react_jsx_runtime.JSX.Element | null;
11
+ declare function SolanaConnectorsWatcher(): react.JSX.Element | null;
12
12
 
13
13
  declare module '@tuwaio/satellite-react' {
14
14
  interface AllConnections {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tuwaio/satellite-react",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",
7
- "description": "An provider and hook with for React for satellite based connectors.",
7
+ "description": "React state hooks and context providers for orchestrating framework-agnostic Satellite wallet connector instances.",
8
8
  "type": "module",
9
9
  "main": "./dist/index.cjs",
10
10
  "module": "./dist/index.js",
@@ -115,28 +115,28 @@
115
115
  }
116
116
  },
117
117
  "devDependencies": {
118
- "@types/react": "^19.2.15",
119
- "@tuwaio/orbit-core": "^0.2.8",
120
- "@tuwaio/orbit-evm": "^0.2.13",
121
- "@tuwaio/orbit-solana": "^0.2.6",
122
- "@wagmi/core": "^3.5.0",
123
- "@wallet-standard/react": "^1.0.2",
124
- "@wallet-standard/app": "^1.1.0",
125
- "@wallet-standard/base": "^1.1.0",
126
- "@wallet-standard/features": "^1.1.0",
127
- "@wallet-standard/core": "^1.1.1",
128
- "@wallet-standard/ui": "^1.0.2",
129
- "@wallet-standard/ui-registry": "^1.1.0",
118
+ "@types/react": "^19.2.17",
119
+ "@tuwaio/orbit-core": "^0.2.12",
120
+ "@tuwaio/orbit-evm": "^0.2.17",
121
+ "@tuwaio/orbit-solana": "^0.2.10",
122
+ "@wagmi/core": "^3.5.1",
123
+ "@wallet-standard/react": "^1.0.3",
124
+ "@wallet-standard/app": "^1.1.1",
125
+ "@wallet-standard/base": "^1.1.1",
126
+ "@wallet-standard/features": "^1.1.1",
127
+ "@wallet-standard/core": "^1.1.2",
128
+ "@wallet-standard/ui": "^1.0.3",
129
+ "@wallet-standard/ui-registry": "^1.1.1",
130
130
  "gill": "^0.14.0",
131
131
  "immer": "^11.1.8",
132
- "react": "^19.2.6",
132
+ "react": "^19.2.7",
133
133
  "tsup": "^8.5.1",
134
- "viem": "^2.51.3",
134
+ "viem": "^2.53.1",
135
135
  "typescript": "^6.0.3",
136
- "zustand": "^5.0.13",
137
- "@tuwaio/satellite-evm": "^0.3.4",
138
- "@tuwaio/satellite-solana": "^0.3.6",
139
- "@tuwaio/satellite-core": "^0.3.3"
136
+ "zustand": "^5.0.14",
137
+ "@tuwaio/satellite-evm": "^0.3.5",
138
+ "@tuwaio/satellite-core": "^0.3.4",
139
+ "@tuwaio/satellite-solana": "^0.3.7"
140
140
  },
141
141
  "scripts": {
142
142
  "start": "tsup src/index.ts --watch",