@tuwaio/satellite-react 0.3.5 → 0.3.7
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 +30 -32
- package/dist/evm/index.d.cts +2 -2
- package/dist/evm/index.d.ts +2 -2
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/solana/index.d.cts +2 -2
- package/dist/solana/index.d.ts +2 -2
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
[](https://github.com/TuwaIO/satellite-connect/actions)
|
|
6
6
|
|
|
7
|
-
React
|
|
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`
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
116
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
|
package/dist/evm/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrbitAdapter } from '@tuwaio/orbit-core';
|
|
2
2
|
import { EVMConnection, ConnectorEVM } from '@tuwaio/satellite-evm';
|
|
3
|
-
import * as
|
|
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):
|
|
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/evm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrbitAdapter } from '@tuwaio/orbit-core';
|
|
2
2
|
import { EVMConnection, ConnectorEVM } from '@tuwaio/satellite-evm';
|
|
3
|
-
import * as
|
|
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):
|
|
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):
|
|
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):
|
|
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/solana/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrbitAdapter } from '@tuwaio/orbit-core';
|
|
2
2
|
import { SolanaConnection, ConnectorSolana } from '@tuwaio/satellite-solana';
|
|
3
|
-
import * as
|
|
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():
|
|
11
|
+
declare function SolanaConnectorsWatcher(): react.JSX.Element | null;
|
|
12
12
|
|
|
13
13
|
declare module '@tuwaio/satellite-react' {
|
|
14
14
|
interface AllConnections {
|
package/dist/solana/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrbitAdapter } from '@tuwaio/orbit-core';
|
|
2
2
|
import { SolanaConnection, ConnectorSolana } from '@tuwaio/satellite-solana';
|
|
3
|
-
import * as
|
|
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():
|
|
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.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"description": "
|
|
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.
|
|
119
|
-
"@tuwaio/orbit-core": "^0.2.
|
|
120
|
-
"@tuwaio/orbit-evm": "^0.2.
|
|
121
|
-
"@tuwaio/orbit-solana": "^0.2.
|
|
122
|
-
"@wagmi/core": "^3.5.
|
|
123
|
-
"@wallet-standard/react": "^1.0.
|
|
124
|
-
"@wallet-standard/app": "^1.1.
|
|
125
|
-
"@wallet-standard/base": "^1.1.
|
|
126
|
-
"@wallet-standard/features": "^1.1.
|
|
127
|
-
"@wallet-standard/core": "^1.1.
|
|
128
|
-
"@wallet-standard/ui": "^1.0.
|
|
129
|
-
"@wallet-standard/ui-registry": "^1.1.
|
|
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.
|
|
132
|
+
"react": "^19.2.7",
|
|
133
133
|
"tsup": "^8.5.1",
|
|
134
|
-
"viem": "^2.
|
|
134
|
+
"viem": "^2.53.1",
|
|
135
135
|
"typescript": "^6.0.3",
|
|
136
|
-
"zustand": "^5.0.
|
|
137
|
-
"@tuwaio/satellite-
|
|
138
|
-
"@tuwaio/satellite-solana": "^0.3.
|
|
139
|
-
"@tuwaio/satellite-
|
|
136
|
+
"zustand": "^5.0.14",
|
|
137
|
+
"@tuwaio/satellite-core": "^0.3.5",
|
|
138
|
+
"@tuwaio/satellite-solana": "^0.3.8",
|
|
139
|
+
"@tuwaio/satellite-evm": "^0.3.6"
|
|
140
140
|
},
|
|
141
141
|
"scripts": {
|
|
142
142
|
"start": "tsup src/index.ts --watch",
|