@tuwaio/satellite-react 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,4 +87,5 @@ declare module '@tuwaio/satellite-react' {
87
87
  }
88
88
  }
89
89
 
90
- export { EVMConnectorsWatcher, type EVMConnectorsWatcherProps };
90
+ export { EVMConnectorsWatcher };
91
+ export type { EVMConnectorsWatcherProps };
@@ -87,4 +87,5 @@ declare module '@tuwaio/satellite-react' {
87
87
  }
88
88
  }
89
89
 
90
- export { EVMConnectorsWatcher, type EVMConnectorsWatcherProps };
90
+ export { EVMConnectorsWatcher };
91
+ export type { EVMConnectorsWatcherProps };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkHEG6FP5Z_cjs=require('./chunk-HEG6FP5Z.cjs'),react=require('react'),satelliteCore=require('@tuwaio/satellite-core'),jsxRuntime=require('react/jsx-runtime');var a=({initializeAutoConnect:n,onError:r})=>{let e=react.useEffectEvent(async()=>n()),t=react.useEffectEvent(o=>{(r??(s=>console.error("Failed to initialize auto connect:",s)))(o);});react.useEffect(()=>{e().catch(o=>t(o));},[]);};function g({children:n,autoConnect:r,adapter:e,callbackAfterConnected:t}){let o=react.useMemo(()=>satelliteCore.createSatelliteConnectStore({adapter:e,callbackAfterConnected:t}),[]);return react.useEffect(()=>{o.getState().updateParameters({adapter:e,callbackAfterConnected:t});},[o,e,t]),a({initializeAutoConnect:()=>o.getState().initializeAutoConnect(r??false)}),jsxRuntime.jsx(chunkHEG6FP5Z_cjs.a.Provider,{value:o,children:n})}Object.defineProperty(exports,"SatelliteStoreContext",{enumerable:true,get:function(){return chunkHEG6FP5Z_cjs.a}});Object.defineProperty(exports,"useSatelliteConnectStore",{enumerable:true,get:function(){return chunkHEG6FP5Z_cjs.b}});exports.SatelliteConnectProvider=g;exports.useInitializeAutoConnect=a;
1
+ 'use strict';var chunkHEG6FP5Z_cjs=require('./chunk-HEG6FP5Z.cjs'),react=require('react'),satelliteCore=require('@tuwaio/satellite-core'),jsxRuntime=require('react/jsx-runtime');var s=({initializeAutoConnect:r,onError:i})=>{let o=react.useEffectEvent(async()=>r()),e=react.useEffectEvent(t=>{(i??(C=>console.error("Failed to initialize auto connect:",C)))(t);});react.useEffect(()=>{o().catch(t=>e(t));},[]);};function g({children:r,autoConnect:i,adapter:o,callbackAfterConnected:e,rememberWallet:t}){let n=react.useMemo(()=>satelliteCore.createSatelliteConnectStore({adapter:o,callbackAfterConnected:e,rememberWallet:t}),[]);return react.useEffect(()=>{n.getState().updateParameters({adapter:o,callbackAfterConnected:e});},[n,o,e]),s({initializeAutoConnect:()=>n.getState().initializeAutoConnect(i??false)}),jsxRuntime.jsx(chunkHEG6FP5Z_cjs.a.Provider,{value:n,children:r})}Object.defineProperty(exports,"SatelliteStoreContext",{enumerable:true,get:function(){return chunkHEG6FP5Z_cjs.a}});Object.defineProperty(exports,"useSatelliteConnectStore",{enumerable:true,get:function(){return chunkHEG6FP5Z_cjs.b}});exports.SatelliteConnectProvider=g;exports.useInitializeAutoConnect=s;
package/dist/index.d.cts CHANGED
@@ -112,8 +112,8 @@ declare const useInitializeAutoConnect: ({ initializeAutoConnect, onError }: Ini
112
112
 
113
113
  /**
114
114
  * Props of {@link SatelliteConnectProvider}: the store parameters (`adapter`, one adapter or an array, and the optional
115
- * `callbackAfterConnected`, see `SatelliteConnectStoreInitialParameters` from `@tuwaio/satellite-core`) plus the
116
- * fields below.
115
+ * `callbackAfterConnected` and `rememberWallet`, see `SatelliteConnectStoreInitialParameters` from
116
+ * `@tuwaio/satellite-core`) plus the fields below.
117
117
  */
118
118
  interface SatelliteConnectProviderProps extends SatelliteConnectStoreInitialParameters<Connector, Connection> {
119
119
  /** Components that can read the store. */
@@ -128,11 +128,13 @@ interface SatelliteConnectProviderProps extends SatelliteConnectStoreInitialPara
128
128
  * Creates the Satellite Connect store (`createSatelliteConnectStore` from `@tuwaio/satellite-core`) and provides it to
129
129
  * its children through {@link SatelliteStoreContext}. Read it with {@link useSatelliteConnectStore}.
130
130
  *
131
- * The store is created once, on the first render. When `adapter` or `callbackAfterConnected` changes, the new value
131
+ * The store is created once, on the first render, with `rememberWallet` (read once: change it later with the store's
132
+ * `setRememberWallet`). When `adapter` or `callbackAfterConnected` changes, the new value
132
133
  * is passed to the store's `updateParameters`; the state is kept. Define adapters outside the component (or memoize
133
134
  * them), so a render does not create new adapter objects. After mount the provider
134
135
  * calls the store's `initializeAutoConnect(autoConnect ?? false)` once, which disconnects the wallets of every adapter,
135
- * cleans the recently connected list in `localStorage` and, with `autoConnect`, reconnects the last connected wallet.
136
+ * cleans the recently connected list and, with `autoConnect`, reconnects the last connected wallet (a wallet saved without
137
+ * `rememberWallet` only until the tab closes).
136
138
  * Inside Safe{Wallet} it connects the Safe connector instead, with or without `autoConnect`. The store's
137
139
  * `isAutoConnectFinished` turns `true` when this is done.
138
140
  * Render the chain watchers (`EVMConnectorsWatcher` from `@tuwaio/satellite-react/evm`, `SolanaConnectorsWatcher`
@@ -164,6 +166,7 @@ interface SatelliteConnectProviderProps extends SatelliteConnectStoreInitialPara
164
166
  * }
165
167
  * ```
166
168
  */
167
- declare function SatelliteConnectProvider({ children, autoConnect, adapter, callbackAfterConnected, }: SatelliteConnectProviderProps): react.JSX.Element;
169
+ declare function SatelliteConnectProvider({ children, autoConnect, adapter, callbackAfterConnected, rememberWallet, }: SatelliteConnectProviderProps): react.JSX.Element;
168
170
 
169
- export { type AllConnections, type AllConnectors, type Connection, type Connector, type InitializeAutoConnectProps, SatelliteConnectProvider, type SatelliteConnectProviderProps, type SatelliteContextType, SatelliteStoreContext, useInitializeAutoConnect, useSatelliteConnectStore };
171
+ export { SatelliteConnectProvider, SatelliteStoreContext, useInitializeAutoConnect, useSatelliteConnectStore };
172
+ export type { AllConnections, AllConnectors, Connection, Connector, InitializeAutoConnectProps, SatelliteConnectProviderProps, SatelliteContextType };
package/dist/index.d.ts CHANGED
@@ -112,8 +112,8 @@ declare const useInitializeAutoConnect: ({ initializeAutoConnect, onError }: Ini
112
112
 
113
113
  /**
114
114
  * Props of {@link SatelliteConnectProvider}: the store parameters (`adapter`, one adapter or an array, and the optional
115
- * `callbackAfterConnected`, see `SatelliteConnectStoreInitialParameters` from `@tuwaio/satellite-core`) plus the
116
- * fields below.
115
+ * `callbackAfterConnected` and `rememberWallet`, see `SatelliteConnectStoreInitialParameters` from
116
+ * `@tuwaio/satellite-core`) plus the fields below.
117
117
  */
118
118
  interface SatelliteConnectProviderProps extends SatelliteConnectStoreInitialParameters<Connector, Connection> {
119
119
  /** Components that can read the store. */
@@ -128,11 +128,13 @@ interface SatelliteConnectProviderProps extends SatelliteConnectStoreInitialPara
128
128
  * Creates the Satellite Connect store (`createSatelliteConnectStore` from `@tuwaio/satellite-core`) and provides it to
129
129
  * its children through {@link SatelliteStoreContext}. Read it with {@link useSatelliteConnectStore}.
130
130
  *
131
- * The store is created once, on the first render. When `adapter` or `callbackAfterConnected` changes, the new value
131
+ * The store is created once, on the first render, with `rememberWallet` (read once: change it later with the store's
132
+ * `setRememberWallet`). When `adapter` or `callbackAfterConnected` changes, the new value
132
133
  * is passed to the store's `updateParameters`; the state is kept. Define adapters outside the component (or memoize
133
134
  * them), so a render does not create new adapter objects. After mount the provider
134
135
  * calls the store's `initializeAutoConnect(autoConnect ?? false)` once, which disconnects the wallets of every adapter,
135
- * cleans the recently connected list in `localStorage` and, with `autoConnect`, reconnects the last connected wallet.
136
+ * cleans the recently connected list and, with `autoConnect`, reconnects the last connected wallet (a wallet saved without
137
+ * `rememberWallet` only until the tab closes).
136
138
  * Inside Safe{Wallet} it connects the Safe connector instead, with or without `autoConnect`. The store's
137
139
  * `isAutoConnectFinished` turns `true` when this is done.
138
140
  * Render the chain watchers (`EVMConnectorsWatcher` from `@tuwaio/satellite-react/evm`, `SolanaConnectorsWatcher`
@@ -164,6 +166,7 @@ interface SatelliteConnectProviderProps extends SatelliteConnectStoreInitialPara
164
166
  * }
165
167
  * ```
166
168
  */
167
- declare function SatelliteConnectProvider({ children, autoConnect, adapter, callbackAfterConnected, }: SatelliteConnectProviderProps): react.JSX.Element;
169
+ declare function SatelliteConnectProvider({ children, autoConnect, adapter, callbackAfterConnected, rememberWallet, }: SatelliteConnectProviderProps): react.JSX.Element;
168
170
 
169
- export { type AllConnections, type AllConnectors, type Connection, type Connector, type InitializeAutoConnectProps, SatelliteConnectProvider, type SatelliteConnectProviderProps, type SatelliteContextType, SatelliteStoreContext, useInitializeAutoConnect, useSatelliteConnectStore };
171
+ export { SatelliteConnectProvider, SatelliteStoreContext, useInitializeAutoConnect, useSatelliteConnectStore };
172
+ export type { AllConnections, AllConnectors, Connection, Connector, InitializeAutoConnectProps, SatelliteConnectProviderProps, SatelliteContextType };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import {a}from'./chunk-4A4PSLAK.js';export{a as SatelliteStoreContext,b as useSatelliteConnectStore}from'./chunk-4A4PSLAK.js';import {useEffectEvent,useEffect,useMemo}from'react';import {createSatelliteConnectStore}from'@tuwaio/satellite-core';import {jsx}from'react/jsx-runtime';var s=({initializeAutoConnect:n,onError:r})=>{let e=useEffectEvent(async()=>n()),t=useEffectEvent(o=>{(r??(C=>console.error("Failed to initialize auto connect:",C)))(o);});useEffect(()=>{e().catch(o=>t(o));},[]);};function h({children:n,autoConnect:r,adapter:e,callbackAfterConnected:t}){let o=useMemo(()=>createSatelliteConnectStore({adapter:e,callbackAfterConnected:t}),[]);return useEffect(()=>{o.getState().updateParameters({adapter:e,callbackAfterConnected:t});},[o,e,t]),s({initializeAutoConnect:()=>o.getState().initializeAutoConnect(r??false)}),jsx(a.Provider,{value:o,children:n})}export{h as SatelliteConnectProvider,s as useInitializeAutoConnect};
1
+ import {a}from'./chunk-4A4PSLAK.js';export{a as SatelliteStoreContext,b as useSatelliteConnectStore}from'./chunk-4A4PSLAK.js';import {useEffectEvent,useEffect,useMemo}from'react';import {createSatelliteConnectStore}from'@tuwaio/satellite-core';import {jsx}from'react/jsx-runtime';var C=({initializeAutoConnect:r,onError:i})=>{let o=useEffectEvent(async()=>r()),e=useEffectEvent(t=>{(i??(p=>console.error("Failed to initialize auto connect:",p)))(t);});useEffect(()=>{o().catch(t=>e(t));},[]);};function h({children:r,autoConnect:i,adapter:o,callbackAfterConnected:e,rememberWallet:t}){let n=useMemo(()=>createSatelliteConnectStore({adapter:o,callbackAfterConnected:e,rememberWallet:t}),[]);return useEffect(()=>{n.getState().updateParameters({adapter:o,callbackAfterConnected:e});},[n,o,e]),C({initializeAutoConnect:()=>n.getState().initializeAutoConnect(i??false)}),jsx(a.Provider,{value:n,children:r})}export{h as SatelliteConnectProvider,C as useInitializeAutoConnect};
@@ -58,4 +58,5 @@ declare module '@tuwaio/satellite-react' {
58
58
  }
59
59
  }
60
60
 
61
- export { SolanaConnectorsWatcher, type SolanaConnectorsWatcherProps };
61
+ export { SolanaConnectorsWatcher };
62
+ export type { SolanaConnectorsWatcherProps };
@@ -58,4 +58,5 @@ declare module '@tuwaio/satellite-react' {
58
58
  }
59
59
  }
60
60
 
61
- export { SolanaConnectorsWatcher, type SolanaConnectorsWatcherProps };
61
+ export { SolanaConnectorsWatcher };
62
+ export type { SolanaConnectorsWatcherProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuwaio/satellite-react",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",
@@ -91,17 +91,17 @@
91
91
  }
92
92
  },
93
93
  "devDependencies": {
94
- "@tuwaio/orbit-core": "^0.5.1",
95
- "@tuwaio/satellite-core": "^0.9.0",
96
- "@tuwaio/satellite-evm": "^0.9.0",
97
- "@tuwaio/satellite-solana": "^0.9.1",
94
+ "@tuwaio/orbit-core": "^0.6.0",
95
+ "@tuwaio/satellite-core": "^0.10.0",
96
+ "@tuwaio/satellite-evm": "^0.10.0",
97
+ "@tuwaio/satellite-solana": "^0.10.0",
98
98
  "@types/react": "^19.3.0",
99
99
  "@wagmi/core": "^3.6.5",
100
100
  "@wallet-standard/react": "^1.0.3",
101
- "react": "^19.3.0",
102
- "tsup": "^8.5.1",
101
+ "react": "^19.3.1",
102
+ "tsup": "^9.0.0",
103
103
  "typescript": "6.0.3",
104
- "viem": "^2.57.3",
104
+ "viem": "^2.57.7",
105
105
  "zustand": "^5.0.15"
106
106
  },
107
107
  "scripts": {