@tuwaio/satellite-react 0.4.1 → 0.4.2

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.
@@ -0,0 +1 @@
1
+ 'use strict';var chunk6DPJBCEF_cjs=require('./chunk-6DPJBCEF.cjs'),react=require('react'),satelliteCore=require('@tuwaio/satellite-core'),jsxRuntime=require('react/jsx-runtime');var c=({initializeAutoConnect:t,onError:n})=>{react.useEffect(()=>{(async()=>{try{await t();}catch(o){(n??(l=>console.error("Failed to initialize auto connect:",l)))(o);}})();},[]);};function y({children:t,autoConnect:n,...e}){let o=react.useMemo(()=>satelliteCore.createSatelliteConnectStore({...e}),[]);return react.useEffect(()=>{o.getState().updateParameters(e);},[e,o]),c({initializeAutoConnect:()=>o.getState().initializeAutoConnect(n??!1)}),jsxRuntime.jsx(chunk6DPJBCEF_cjs.a.Provider,{value:o,children:t})}exports.a=c;exports.b=y;
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-H5TQSDNK.js';import {useEffect,useMemo}from'react';import {createSatelliteConnectStore}from'@tuwaio/satellite-core';import {jsx}from'react/jsx-runtime';var l=({initializeAutoConnect:t,onError:n})=>{useEffect(()=>{(async()=>{try{await t();}catch(o){(n??(a=>console.error("Failed to initialize auto connect:",a)))(o);}})();},[]);};function E({children:t,autoConnect:n,...e}){let o=useMemo(()=>createSatelliteConnectStore({...e}),[]);return useEffect(()=>{o.getState().updateParameters(e);},[e,o]),l({initializeAutoConnect:()=>o.getState().initializeAutoConnect(n??!1)}),jsx(a.Provider,{value:o,children:t})}export{l as a,E as b};
@@ -1 +1 @@
1
- 'use strict';require('../chunk-PF2SJS7F.cjs');var chunk6DPJBCEF_cjs=require('../chunk-6DPJBCEF.cjs'),react=require('react'),jsxRuntime=require('react/jsx-runtime');function M(t){let[r,w]=react.useState(null);return react.useEffect(()=>{(async()=>{try{let n=!1,i=null;try{let[c]=await Promise.all([import('@tuwaio/satellite-evm'),import('@wagmi/core'),import('viem')]);i=c.createEVMConnectionsWatcher,n=!0;}catch{n=!1;}if(n){let c=()=>{let a=chunk6DPJBCEF_cjs.b(e=>e.activeConnection),l=chunk6DPJBCEF_cjs.b(e=>e.disconnect),s=chunk6DPJBCEF_cjs.b(e=>e.connectionError),C=chunk6DPJBCEF_cjs.b(e=>e.updateActiveConnection);return react.useEffect(()=>i({wagmiConfig:t.wagmiConfig,siwx:t.siwx,siwe:t.siwe},{activeConnection:a,disconnect:l,connectionError:s,updateActiveConnection:C}),[a?.connectorType,t.siwx,t.siwe,s,t.wagmiConfig,l,C]),null};w(()=>c);}}catch(n){console.warn("Failed to load EVM watcher:",n);}})();},[]),r?jsxRuntime.jsx(r,{...t}):null}exports.EVMConnectorsWatcher=M;
1
+ 'use strict';require('../chunk-ALI6B44Y.cjs');var chunk6DPJBCEF_cjs=require('../chunk-6DPJBCEF.cjs'),react=require('react'),jsxRuntime=require('react/jsx-runtime');function M(t){let[r,w]=react.useState(null);return react.useEffect(()=>{(async()=>{try{let n=!1,i=null;try{let[c]=await Promise.all([import('@tuwaio/satellite-evm'),import('@wagmi/core'),import('viem')]);i=c.createEVMConnectionsWatcher,n=!0;}catch{n=!1;}if(n){let c=()=>{let a=chunk6DPJBCEF_cjs.b(e=>e.activeConnection),l=chunk6DPJBCEF_cjs.b(e=>e.disconnect),s=chunk6DPJBCEF_cjs.b(e=>e.connectionError),C=chunk6DPJBCEF_cjs.b(e=>e.updateActiveConnection);return react.useEffect(()=>i({wagmiConfig:t.wagmiConfig,siwx:t.siwx,siwe:t.siwe},{activeConnection:a,disconnect:l,connectionError:s,updateActiveConnection:C}),[a?.connectorType,t.siwx,t.siwe,s,t.wagmiConfig,l,C]),null};w(()=>c);}}catch(n){console.warn("Failed to load EVM watcher:",n);}})();},[]),r?jsxRuntime.jsx(r,{...t}):null}exports.EVMConnectorsWatcher=M;
package/dist/evm/index.js CHANGED
@@ -1 +1 @@
1
- import'../chunk-3ZDGAX5W.js';import {b}from'../chunk-H5TQSDNK.js';import {useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';function V(t){let[r,w]=useState(null);return useEffect(()=>{(async()=>{try{let n=!1,i=null;try{let[c]=await Promise.all([import('@tuwaio/satellite-evm'),import('@wagmi/core'),import('viem')]);i=c.createEVMConnectionsWatcher,n=!0;}catch{n=!1;}if(n){let c=()=>{let a=b(e=>e.activeConnection),l=b(e=>e.disconnect),s=b(e=>e.connectionError),C=b(e=>e.updateActiveConnection);return useEffect(()=>i({wagmiConfig:t.wagmiConfig,siwx:t.siwx,siwe:t.siwe},{activeConnection:a,disconnect:l,connectionError:s,updateActiveConnection:C}),[a?.connectorType,t.siwx,t.siwe,s,t.wagmiConfig,l,C]),null};w(()=>c);}}catch(n){console.warn("Failed to load EVM watcher:",n);}})();},[]),r?jsx(r,{...t}):null}export{V as EVMConnectorsWatcher};
1
+ import'../chunk-O4B7H2P6.js';import {b}from'../chunk-H5TQSDNK.js';import {useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';function V(t){let[r,w]=useState(null);return useEffect(()=>{(async()=>{try{let n=!1,i=null;try{let[c]=await Promise.all([import('@tuwaio/satellite-evm'),import('@wagmi/core'),import('viem')]);i=c.createEVMConnectionsWatcher,n=!0;}catch{n=!1;}if(n){let c=()=>{let a=b(e=>e.activeConnection),l=b(e=>e.disconnect),s=b(e=>e.connectionError),C=b(e=>e.updateActiveConnection);return useEffect(()=>i({wagmiConfig:t.wagmiConfig,siwx:t.siwx,siwe:t.siwe},{activeConnection:a,disconnect:l,connectionError:s,updateActiveConnection:C}),[a?.connectorType,t.siwx,t.siwe,s,t.wagmiConfig,l,C]),null};w(()=>c);}}catch(n){console.warn("Failed to load EVM watcher:",n);}})();},[]),r?jsx(r,{...t}):null}export{V as EVMConnectorsWatcher};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkPF2SJS7F_cjs=require('./chunk-PF2SJS7F.cjs'),chunk6DPJBCEF_cjs=require('./chunk-6DPJBCEF.cjs');Object.defineProperty(exports,"SatelliteConnectProvider",{enumerable:true,get:function(){return chunkPF2SJS7F_cjs.b}});Object.defineProperty(exports,"useInitializeAutoConnect",{enumerable:true,get:function(){return chunkPF2SJS7F_cjs.a}});Object.defineProperty(exports,"SatelliteStoreContext",{enumerable:true,get:function(){return chunk6DPJBCEF_cjs.a}});Object.defineProperty(exports,"useSatelliteConnectStore",{enumerable:true,get:function(){return chunk6DPJBCEF_cjs.b}});
1
+ 'use strict';var chunkALI6B44Y_cjs=require('./chunk-ALI6B44Y.cjs'),chunk6DPJBCEF_cjs=require('./chunk-6DPJBCEF.cjs');Object.defineProperty(exports,"SatelliteConnectProvider",{enumerable:true,get:function(){return chunkALI6B44Y_cjs.b}});Object.defineProperty(exports,"useInitializeAutoConnect",{enumerable:true,get:function(){return chunkALI6B44Y_cjs.a}});Object.defineProperty(exports,"SatelliteStoreContext",{enumerable:true,get:function(){return chunk6DPJBCEF_cjs.a}});Object.defineProperty(exports,"useSatelliteConnectStore",{enumerable:true,get:function(){return chunk6DPJBCEF_cjs.b}});
package/dist/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as react from 'react';
2
- import * as _tuwaio_satellite_core from '@tuwaio/satellite-core';
3
- import { BaseConnector, ISatelliteConnectStore, SatelliteConnectStoreInitialParameters } from '@tuwaio/satellite-core';
2
+ import { ISatelliteConnectStore, SatelliteConnectStoreInitialParameters } from '@tuwaio/satellite-core';
4
3
  import { StoreApi } from 'zustand';
5
4
 
6
5
  /**
@@ -18,23 +17,22 @@ interface AllConnections {
18
17
  */
19
18
  interface AllConnectors {
20
19
  }
21
-
22
20
  /**
23
21
  * Union type for all supported connection types.
24
22
  * It's created from the values of the AllConnections interface.
25
23
  * e.g., { evm: EVMConnection, solana: SolanaConnection } -> EVMConnection | SolanaConnection
26
24
  */
27
- type Connection = [keyof AllConnections] extends [never] ? BaseConnector : AllConnections[keyof AllConnections];
25
+ type Connection = AllConnections[keyof AllConnections];
28
26
  /**
29
27
  * Union type for all supported connector types.
30
28
  */
31
- type Connector = [keyof AllConnectors] extends [never] ? any : AllConnectors[keyof AllConnectors];
29
+ type Connector = AllConnectors[keyof AllConnectors];
32
30
 
33
31
  /**
34
32
  * React Context for providing Satellite Connect store throughout the application
35
33
  * @internal
36
34
  */
37
- declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<any, _tuwaio_satellite_core.BaseConnector>> | null>;
35
+ declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<never, never>> | null>;
38
36
  /**
39
37
  * Custom hook for accessing the Satellite Connect store state
40
38
  *
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as react from 'react';
2
- import * as _tuwaio_satellite_core from '@tuwaio/satellite-core';
3
- import { BaseConnector, ISatelliteConnectStore, SatelliteConnectStoreInitialParameters } from '@tuwaio/satellite-core';
2
+ import { ISatelliteConnectStore, SatelliteConnectStoreInitialParameters } from '@tuwaio/satellite-core';
4
3
  import { StoreApi } from 'zustand';
5
4
 
6
5
  /**
@@ -18,23 +17,22 @@ interface AllConnections {
18
17
  */
19
18
  interface AllConnectors {
20
19
  }
21
-
22
20
  /**
23
21
  * Union type for all supported connection types.
24
22
  * It's created from the values of the AllConnections interface.
25
23
  * e.g., { evm: EVMConnection, solana: SolanaConnection } -> EVMConnection | SolanaConnection
26
24
  */
27
- type Connection = [keyof AllConnections] extends [never] ? BaseConnector : AllConnections[keyof AllConnections];
25
+ type Connection = AllConnections[keyof AllConnections];
28
26
  /**
29
27
  * Union type for all supported connector types.
30
28
  */
31
- type Connector = [keyof AllConnectors] extends [never] ? any : AllConnectors[keyof AllConnectors];
29
+ type Connector = AllConnectors[keyof AllConnectors];
32
30
 
33
31
  /**
34
32
  * React Context for providing Satellite Connect store throughout the application
35
33
  * @internal
36
34
  */
37
- declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<any, _tuwaio_satellite_core.BaseConnector>> | null>;
35
+ declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<never, never>> | null>;
38
36
  /**
39
37
  * Custom hook for accessing the Satellite Connect store state
40
38
  *
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{b as SatelliteConnectProvider,a as useInitializeAutoConnect}from'./chunk-3ZDGAX5W.js';export{a as SatelliteStoreContext,b as useSatelliteConnectStore}from'./chunk-H5TQSDNK.js';
1
+ export{b as SatelliteConnectProvider,a as useInitializeAutoConnect}from'./chunk-O4B7H2P6.js';export{a as SatelliteStoreContext,b as useSatelliteConnectStore}from'./chunk-H5TQSDNK.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuwaio/satellite-react",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",
@@ -156,8 +156,8 @@
156
156
  "typescript": "^6.0.3",
157
157
  "zustand": "^5.0.14",
158
158
  "@tuwaio/satellite-core": "^0.4.1",
159
- "@tuwaio/satellite-solana": "^0.4.1",
160
- "@tuwaio/satellite-evm": "^0.4.1"
159
+ "@tuwaio/satellite-evm": "^0.4.2",
160
+ "@tuwaio/satellite-solana": "^0.4.2"
161
161
  },
162
162
  "scripts": {
163
163
  "start": "tsup src/index.ts --watch",
@@ -1 +0,0 @@
1
- import {a}from'./chunk-H5TQSDNK.js';import {useEffect,useMemo}from'react';import {createSatelliteConnectStore}from'@tuwaio/satellite-core';import {jsx}from'react/jsx-runtime';var l=({initializeAutoConnect:t,onError:n})=>{useEffect(()=>{(async()=>{try{await t();}catch(e){(n??(a=>console.error("Failed to initialize auto connect:",a)))(e);}})();},[]);};function E({children:t,autoConnect:n,...o}){let e=useMemo(()=>createSatelliteConnectStore({...o}),[]);return useEffect(()=>{e.getState().updateParameters(o);},[o,e]),l({initializeAutoConnect:()=>e.getState().initializeAutoConnect(n??!1)}),jsx(a.Provider,{value:e,children:t})}export{l as a,E as b};
@@ -1 +0,0 @@
1
- 'use strict';var chunk6DPJBCEF_cjs=require('./chunk-6DPJBCEF.cjs'),react=require('react'),satelliteCore=require('@tuwaio/satellite-core'),jsxRuntime=require('react/jsx-runtime');var c=({initializeAutoConnect:t,onError:n})=>{react.useEffect(()=>{(async()=>{try{await t();}catch(e){(n??(l=>console.error("Failed to initialize auto connect:",l)))(e);}})();},[]);};function y({children:t,autoConnect:n,...o}){let e=react.useMemo(()=>satelliteCore.createSatelliteConnectStore({...o}),[]);return react.useEffect(()=>{e.getState().updateParameters(o);},[o,e]),c({initializeAutoConnect:()=>e.getState().initializeAutoConnect(n??!1)}),jsxRuntime.jsx(chunk6DPJBCEF_cjs.a.Provider,{value:e,children:t})}exports.a=c;exports.b=y;