@tuwaio/satellite-react 0.4.2 → 0.4.4
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-EYVLQZ24.js +1 -0
- package/dist/chunk-G2YC6JBO.cjs +1 -0
- package/dist/{chunk-O4B7H2P6.js → chunk-UDS7MUYZ.js} +1 -1
- package/dist/{chunk-ALI6B44Y.cjs → chunk-YTP4ADBV.cjs} +1 -1
- 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 +2 -5
- package/dist/index.d.ts +2 -5
- package/dist/index.js +1 -1
- package/dist/solana/index.cjs +1 -1
- package/dist/solana/index.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-6DPJBCEF.cjs +0 -1
- package/dist/chunk-H5TQSDNK.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {createContext,useContext}from'react';import {useStore}from'zustand';var e=Symbol.for("tuwaio.satellite.context"),o=globalThis,a=o[e]||(o[e]=createContext(null)),m=n=>{let t=useContext(a);if(!t)throw new Error("useSatelliteConnectStore must be used within a SatelliteConnectProvider");return useStore(t,n)};export{a,m as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var react=require('react'),zustand=require('zustand');var e=Symbol.for("tuwaio.satellite.context"),o=globalThis,a=o[e]||(o[e]=react.createContext(null)),u=n=>{let t=react.useContext(a);if(!t)throw new Error("useSatelliteConnectStore must be used within a SatelliteConnectProvider");return zustand.useStore(t,n)};exports.a=a;exports.b=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-EYVLQZ24.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';var
|
|
1
|
+
'use strict';var chunkG2YC6JBO_cjs=require('./chunk-G2YC6JBO.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(chunkG2YC6JBO_cjs.a.Provider,{value:o,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-YTP4ADBV.cjs');var chunkG2YC6JBO_cjs=require('../chunk-G2YC6JBO.cjs'),react=require('react'),jsxRuntime=require('react/jsx-runtime');function M(t){let[r,f]=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=chunkG2YC6JBO_cjs.b(e=>e.activeConnection),l=chunkG2YC6JBO_cjs.b(e=>e.disconnect),s=chunkG2YC6JBO_cjs.b(e=>e.connectionError),C=chunkG2YC6JBO_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};f(()=>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-UDS7MUYZ.js';import {b}from'../chunk-EYVLQZ24.js';import {useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';function V(t){let[r,f]=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};f(()=>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 chunkYTP4ADBV_cjs=require('./chunk-YTP4ADBV.cjs'),chunkG2YC6JBO_cjs=require('./chunk-G2YC6JBO.cjs');Object.defineProperty(exports,"SatelliteConnectProvider",{enumerable:true,get:function(){return chunkYTP4ADBV_cjs.b}});Object.defineProperty(exports,"useInitializeAutoConnect",{enumerable:true,get:function(){return chunkYTP4ADBV_cjs.a}});Object.defineProperty(exports,"SatelliteStoreContext",{enumerable:true,get:function(){return chunkG2YC6JBO_cjs.a}});Object.defineProperty(exports,"useSatelliteConnectStore",{enumerable:true,get:function(){return chunkG2YC6JBO_cjs.b}});
|
package/dist/index.d.cts
CHANGED
|
@@ -28,11 +28,8 @@ type Connection = AllConnections[keyof AllConnections];
|
|
|
28
28
|
*/
|
|
29
29
|
type Connector = AllConnectors[keyof AllConnectors];
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<never, never>> | null>;
|
|
31
|
+
type SatelliteContextType = StoreApi<ISatelliteConnectStore<Connector, Connection>> | null;
|
|
32
|
+
declare const SatelliteStoreContext: react.Context<SatelliteContextType>;
|
|
36
33
|
/**
|
|
37
34
|
* Custom hook for accessing the Satellite Connect store state
|
|
38
35
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -28,11 +28,8 @@ type Connection = AllConnections[keyof AllConnections];
|
|
|
28
28
|
*/
|
|
29
29
|
type Connector = AllConnectors[keyof AllConnectors];
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
declare const SatelliteStoreContext: react.Context<StoreApi<ISatelliteConnectStore<never, never>> | null>;
|
|
31
|
+
type SatelliteContextType = StoreApi<ISatelliteConnectStore<Connector, Connection>> | null;
|
|
32
|
+
declare const SatelliteStoreContext: react.Context<SatelliteContextType>;
|
|
36
33
|
/**
|
|
37
34
|
* Custom hook for accessing the Satellite Connect store state
|
|
38
35
|
*
|
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-UDS7MUYZ.js';export{a as SatelliteStoreContext,b as useSatelliteConnectStore}from'./chunk-EYVLQZ24.js';
|
package/dist/solana/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkG2YC6JBO_cjs=require('../chunk-G2YC6JBO.cjs'),react=require('react'),jsxRuntime=require('react/jsx-runtime');function x(o={}){let[c,m]=react.useState(null);return react.useEffect(()=>{(async()=>{try{let e=!1,l=null,i=null;try{let[r,a]=await Promise.all([import('@tuwaio/satellite-solana'),import('@wallet-standard/react')]);l=r.createSolanaConnectionsWatcher,i=a.useWallets,e=!0;}catch{e=!1;}if(e){let r=()=>{let a=i(),s=chunkG2YC6JBO_cjs.b(t=>t.activeConnection),p=chunkG2YC6JBO_cjs.b(t=>t.updateActiveConnection),u=chunkG2YC6JBO_cjs.b(t=>t.connectionError),S=chunkG2YC6JBO_cjs.b(t=>t.disconnect);return react.useEffect(()=>l({wallets:a,siwx:o.siwx},{activeConnection:s,disconnect:S,connectionError:u,updateActiveConnection:p}),[s?.connectorType,a,o.siwx,u,p,S]),null};m(()=>r);}}catch(e){console.warn("Failed to load Solana watcher:",e);}})();},[o.siwx]),c?jsxRuntime.jsx(c,{...o}):null}exports.SolanaConnectorsWatcher=x;
|
package/dist/solana/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'../chunk-
|
|
1
|
+
import {b}from'../chunk-EYVLQZ24.js';import {useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';function y(o={}){let[c,m]=useState(null);return useEffect(()=>{(async()=>{try{let e=!1,l=null,i=null;try{let[r,a]=await Promise.all([import('@tuwaio/satellite-solana'),import('@wallet-standard/react')]);l=r.createSolanaConnectionsWatcher,i=a.useWallets,e=!0;}catch{e=!1;}if(e){let r=()=>{let a=i(),s=b(t=>t.activeConnection),p=b(t=>t.updateActiveConnection),u=b(t=>t.connectionError),S=b(t=>t.disconnect);return useEffect(()=>l({wallets:a,siwx:o.siwx},{activeConnection:s,disconnect:S,connectionError:u,updateActiveConnection:p}),[s?.connectorType,a,o.siwx,u,p,S]),null};m(()=>r);}}catch(e){console.warn("Failed to load Solana watcher:",e);}})();},[o.siwx]),c?jsx(c,{...o}):null}export{y as SolanaConnectorsWatcher};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/satellite-react",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -137,9 +137,9 @@
|
|
|
137
137
|
"@tuwaio/orbit-evm": "^0.2.22",
|
|
138
138
|
"@tuwaio/orbit-solana": "^0.2.13",
|
|
139
139
|
"@tuwaio/siwx-core": "^0.1.0",
|
|
140
|
-
"@tuwaio/siwx-react": "^0.1.
|
|
141
|
-
"@tuwaio/siwx-evm": "^0.1.
|
|
142
|
-
"@tuwaio/siwx-solana": "^0.1.
|
|
140
|
+
"@tuwaio/siwx-react": "^0.1.1",
|
|
141
|
+
"@tuwaio/siwx-evm": "^0.1.1",
|
|
142
|
+
"@tuwaio/siwx-solana": "^0.1.1",
|
|
143
143
|
"@wagmi/core": "^3.6.4",
|
|
144
144
|
"@wallet-standard/react": "^1.0.3",
|
|
145
145
|
"@wallet-standard/app": "^1.1.1",
|
|
@@ -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.1",
|
|
159
158
|
"@tuwaio/satellite-evm": "^0.4.2",
|
|
160
|
-
"@tuwaio/satellite-
|
|
159
|
+
"@tuwaio/satellite-core": "^0.4.1",
|
|
160
|
+
"@tuwaio/satellite-solana": "^0.4.3"
|
|
161
161
|
},
|
|
162
162
|
"scripts": {
|
|
163
163
|
"start": "tsup src/index.ts --watch",
|
package/dist/chunk-6DPJBCEF.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var react=require('react'),zustand=require('zustand');var i=react.createContext(null),s=e=>{let t=react.useContext(i);if(!t)throw new Error("useSatelliteConnectStore must be used within a SatelliteConnectProvider");return zustand.useStore(t,e)};exports.a=i;exports.b=s;
|
package/dist/chunk-H5TQSDNK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {createContext,useContext}from'react';import {useStore}from'zustand';var i=createContext(null),a=e=>{let t=useContext(i);if(!t)throw new Error("useSatelliteConnectStore must be used within a SatelliteConnectProvider");return useStore(t,e)};export{i as a,a as b};
|