@tuwaio/satellite-react 0.4.0 → 0.4.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.
- package/dist/chunk-3ZDGAX5W.js +1 -0
- package/dist/chunk-PF2SJS7F.cjs +1 -0
- package/dist/evm/index.cjs +1 -1
- package/dist/evm/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-ALI6B44Y.cjs +0 -1
- package/dist/chunk-O4B7H2P6.js +0 -1
|
@@ -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(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};
|
|
@@ -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(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;
|
package/dist/evm/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('../chunk-
|
|
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;
|
package/dist/evm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'../chunk-
|
|
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};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
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}});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import
|
|
2
|
+
import * as _tuwaio_satellite_core from '@tuwaio/satellite-core';
|
|
3
|
+
import { BaseConnector, ISatelliteConnectStore, SatelliteConnectStoreInitialParameters } from '@tuwaio/satellite-core';
|
|
3
4
|
import { StoreApi } from 'zustand';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -17,22 +18,23 @@ interface AllConnections {
|
|
|
17
18
|
*/
|
|
18
19
|
interface AllConnectors {
|
|
19
20
|
}
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* Union type for all supported connection types.
|
|
22
24
|
* It's created from the values of the AllConnections interface.
|
|
23
25
|
* e.g., { evm: EVMConnection, solana: SolanaConnection } -> EVMConnection | SolanaConnection
|
|
24
26
|
*/
|
|
25
|
-
type Connection = AllConnections[keyof AllConnections];
|
|
27
|
+
type Connection = [keyof AllConnections] extends [never] ? BaseConnector : AllConnections[keyof AllConnections];
|
|
26
28
|
/**
|
|
27
29
|
* Union type for all supported connector types.
|
|
28
30
|
*/
|
|
29
|
-
type Connector = AllConnectors[keyof AllConnectors];
|
|
31
|
+
type Connector = [keyof AllConnectors] extends [never] ? any : AllConnectors[keyof AllConnectors];
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
34
|
* React Context for providing Satellite Connect store throughout the application
|
|
33
35
|
* @internal
|
|
34
36
|
*/
|
|
35
|
-
declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<
|
|
37
|
+
declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<any, _tuwaio_satellite_core.BaseConnector>> | null>;
|
|
36
38
|
/**
|
|
37
39
|
* Custom hook for accessing the Satellite Connect store state
|
|
38
40
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import
|
|
2
|
+
import * as _tuwaio_satellite_core from '@tuwaio/satellite-core';
|
|
3
|
+
import { BaseConnector, ISatelliteConnectStore, SatelliteConnectStoreInitialParameters } from '@tuwaio/satellite-core';
|
|
3
4
|
import { StoreApi } from 'zustand';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -17,22 +18,23 @@ interface AllConnections {
|
|
|
17
18
|
*/
|
|
18
19
|
interface AllConnectors {
|
|
19
20
|
}
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* Union type for all supported connection types.
|
|
22
24
|
* It's created from the values of the AllConnections interface.
|
|
23
25
|
* e.g., { evm: EVMConnection, solana: SolanaConnection } -> EVMConnection | SolanaConnection
|
|
24
26
|
*/
|
|
25
|
-
type Connection = AllConnections[keyof AllConnections];
|
|
27
|
+
type Connection = [keyof AllConnections] extends [never] ? BaseConnector : AllConnections[keyof AllConnections];
|
|
26
28
|
/**
|
|
27
29
|
* Union type for all supported connector types.
|
|
28
30
|
*/
|
|
29
|
-
type Connector = AllConnectors[keyof AllConnectors];
|
|
31
|
+
type Connector = [keyof AllConnectors] extends [never] ? any : AllConnectors[keyof AllConnectors];
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
34
|
* React Context for providing Satellite Connect store throughout the application
|
|
33
35
|
* @internal
|
|
34
36
|
*/
|
|
35
|
-
declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<
|
|
37
|
+
declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<any, _tuwaio_satellite_core.BaseConnector>> | null>;
|
|
36
38
|
/**
|
|
37
39
|
* Custom hook for accessing the Satellite Connect store state
|
|
38
40
|
*
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as SatelliteConnectProvider,a as useInitializeAutoConnect}from'./chunk-
|
|
1
|
+
export{b as SatelliteConnectProvider,a as useInitializeAutoConnect}from'./chunk-3ZDGAX5W.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.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -155,9 +155,9 @@
|
|
|
155
155
|
"viem": "^2.55.11",
|
|
156
156
|
"typescript": "^6.0.3",
|
|
157
157
|
"zustand": "^5.0.14",
|
|
158
|
-
"@tuwaio/satellite-core": "^0.4.
|
|
159
|
-
"@tuwaio/satellite-
|
|
160
|
-
"@tuwaio/satellite-
|
|
158
|
+
"@tuwaio/satellite-core": "^0.4.1",
|
|
159
|
+
"@tuwaio/satellite-solana": "^0.4.1",
|
|
160
|
+
"@tuwaio/satellite-evm": "^0.4.1"
|
|
161
161
|
},
|
|
162
162
|
"scripts": {
|
|
163
163
|
"start": "tsup src/index.ts --watch",
|
package/dist/chunk-ALI6B44Y.cjs
DELETED
|
@@ -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(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;
|
package/dist/chunk-O4B7H2P6.js
DELETED
|
@@ -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(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};
|