@tuwaio/satellite-react 1.0.0-fix-packages-alpha.4.ce09a66 → 1.0.0-fix-packages-alpha.6.a5851f3
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/solana/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunk4MZHI7NY_cjs=require('../chunk-4MZHI7NY.cjs'),orbitCore=require('@tuwaio/orbit-core'),react=require('@wallet-standard/react'),react$1=require('react');function
|
|
1
|
+
'use strict';var chunk4MZHI7NY_cjs=require('../chunk-4MZHI7NY.cjs'),orbitCore=require('@tuwaio/orbit-core'),react=require('@wallet-standard/react'),react$1=require('react');function h(){let c=react.useWallets(),o=chunk4MZHI7NY_cjs.b(n=>n.activeConnection),r=chunk4MZHI7NY_cjs.b(n=>n.updateActiveConnection),a=chunk4MZHI7NY_cjs.b(n=>n.connectionError),i=chunk4MZHI7NY_cjs.b(n=>n.disconnect);return react$1.useEffect(()=>{if(o&&orbitCore.getAdapterFromConnectorType(o.connectorType)===orbitCore.OrbitAdapter.SOLANA){let n=c.filter(e=>orbitCore.getConnectorTypeFromName(orbitCore.OrbitAdapter.SOLANA,orbitCore.formatConnectorName(e.name))===o.connectorType)[0];if(!a){let e={address:n?.accounts[0]?.address,isConnected:n?.accounts.length>0,connectedAccount:n?.accounts[0],connectedWallet:n};(e.address!==o.address||e.isConnected!==o.isConnected)&&r(e);}n?.accounts.length===0&&o.connectorType&&i(o.connectorType);}},[o?.connectorType,c,a,r,i]),null}exports.SolanaConnectorsWatcher=h;//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/solana/SolanaConnectorsWatcher.tsx"],"names":["SolanaConnectorsWatcher","wallets","useWallets","activeConnectionFromStore","useSatelliteConnectStore","store","updateActiveConnection","connectionError","disconnect","useEffect","getAdapterFromConnectorType","OrbitAdapter","activeConnection","w","getConnectorTypeFromName","formatConnectorName"],"mappings":"6KAsBO,SAASA,CAAAA,EAA0B,CACxC,IAAMC,
|
|
1
|
+
{"version":3,"sources":["../../src/solana/SolanaConnectorsWatcher.tsx"],"names":["SolanaConnectorsWatcher","wallets","useWallets","activeConnectionFromStore","useSatelliteConnectStore","store","updateActiveConnection","connectionError","disconnect","useEffect","getAdapterFromConnectorType","OrbitAdapter","activeConnection","w","getConnectorTypeFromName","formatConnectorName","newState"],"mappings":"6KAsBO,SAASA,CAAAA,EAA0B,CACxC,IAAMC,EAAUC,gBAAAA,EAAW,CAErBC,CAAAA,CAA4BC,mBAAAA,CAA0BC,CAAAA,EAAUA,CAAAA,CAAM,gBAAgB,CAAA,CACtFC,EAAyBF,mBAAAA,CAA0BC,CAAAA,EAAUA,CAAAA,CAAM,sBAAsB,CAAA,CACzFE,CAAAA,CAAkBH,mBAAAA,CAA0BC,CAAAA,EAAUA,EAAM,eAAe,CAAA,CAC3EG,CAAAA,CAAaJ,mBAAAA,CAA0BC,CAAAA,EAAUA,CAAAA,CAAM,UAAU,CAAA,CAGvE,OAAAI,iBAAAA,CAAU,IAAM,CACd,GACEN,CAAAA,EACAO,qCAAAA,CAA4BP,CAAAA,CAA0B,aAAa,IAAMQ,sBAAAA,CAAa,MAAA,CACtF,CACA,IAAMC,CAAAA,CAAmBX,CAAAA,CAAQ,MAAA,CAC9BY,CAAAA,EACCC,mCAAyBH,sBAAAA,CAAa,MAAA,CAAQI,6BAAAA,CAAoBF,CAAAA,CAAE,IAAI,CAAC,CAAA,GACzEV,CAAAA,CAA0B,aAC9B,CAAA,CAAE,CAAC,CAAA,CAEH,GAAI,CAACI,CAAAA,CAAiB,CACpB,IAAMS,CAAAA,CAAW,CAEf,OAAA,CAASJ,CAAAA,EAAkB,QAAA,CAAS,CAAC,CAAA,EAAG,OAAA,CAExC,YAAaA,CAAAA,EAAkB,QAAA,CAAS,MAAA,CAAS,CAAA,CAEjD,gBAAA,CAAkBA,CAAAA,EAAkB,QAAA,CAAS,CAAC,EAC9C,eAAA,CAAiBA,CACnB,CAAA,CAAA,CAMEI,CAAAA,CAAS,OAAA,GAAYb,CAAAA,CAA0B,OAAA,EAC/Ca,CAAAA,CAAS,cAAgBb,CAAAA,CAA0B,WAAA,GAInDG,CAAAA,CAAuBU,CAAQ,EAEnC,CACIJ,CAAAA,EAAkB,QAAA,CAAS,SAAW,CAAA,EAAKT,CAAAA,CAA0B,aAAA,EAEvEK,CAAAA,CAAWL,CAAAA,CAA0B,aAAa,EAEtD,CAEF,EAAG,CAACA,CAAAA,EAA2B,aAAA,CAAeF,CAAAA,CAASM,CAAAA,CAAiBD,CAAAA,CAAwBE,CAAU,CAAC,EAGpG,IACT","file":"index.cjs","sourcesContent":["import {\n formatConnectorName,\n getAdapterFromConnectorType,\n getConnectorTypeFromName,\n OrbitAdapter,\n} from '@tuwaio/orbit-core';\nimport { useWallets } from '@wallet-standard/react';\nimport { useEffect } from 'react';\n\nimport { useSatelliteConnectStore } from '../index';\n\n/**\n * React component that monitors Solana connector connections and updates the Satellite store\n *\n * @remarks\n * This component watches for changes in connected Solana connectors using the Wallet Standard.\n * Currently handles the first active connector only, with multi-connector support planned for future.\n * It's a headless component that manages state synchronization between Wallet Standard and Satellite store.\n *\n * @returns null - This is a headless component\n *\n */\nexport function SolanaConnectorsWatcher() {\n const wallets = useWallets();\n\n const activeConnectionFromStore = useSatelliteConnectStore((store) => store.activeConnection);\n const updateActiveConnection = useSatelliteConnectStore((store) => store.updateActiveConnection);\n const connectionError = useSatelliteConnectStore((store) => store.connectionError);\n const disconnect = useSatelliteConnectStore((store) => store.disconnect);\n\n // Watch for changes in connected connectors\n useEffect(() => {\n if (\n activeConnectionFromStore &&\n getAdapterFromConnectorType(activeConnectionFromStore.connectorType) === OrbitAdapter.SOLANA\n ) {\n const activeConnection = wallets.filter(\n (w) =>\n getConnectorTypeFromName(OrbitAdapter.SOLANA, formatConnectorName(w.name)) ===\n activeConnectionFromStore.connectorType,\n )[0];\n\n if (!connectionError) {\n const newState = {\n // Use the first account's address\n address: activeConnection?.accounts[0]?.address,\n // Set connection status\n isConnected: activeConnection?.accounts.length > 0,\n // Store Wallet Standard specific information\n connectedAccount: activeConnection?.accounts[0],\n connectedWallet: activeConnection,\n };\n\n // Check if anything actually changed to prevent infinite loops\n // We only check address and isConnected because connectedAccount/connectedWallet\n // might be new references on every render, causing infinite loops if checked.\n const hasChanged =\n newState.address !== activeConnectionFromStore.address ||\n newState.isConnected !== activeConnectionFromStore.isConnected;\n\n if (hasChanged) {\n // Update the Satellite store with the active connector information\n updateActiveConnection(newState);\n }\n }\n if (activeConnection?.accounts.length === 0 && activeConnectionFromStore.connectorType) {\n // If the connector is disconnected from the wallet provider, disconnect from Satellite store as well\n disconnect(activeConnectionFromStore.connectorType);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeConnectionFromStore?.connectorType, wallets, connectionError, updateActiveConnection, disconnect]); // Re-run effect when wallets array changes\n\n // This is a headless component, so return null\n return null;\n}\n"]}
|
package/dist/solana/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b}from'../chunk-KZKVF5GG.js';import {getAdapterFromConnectorType,OrbitAdapter,getConnectorTypeFromName,formatConnectorName}from'@tuwaio/orbit-core';import {useWallets}from'@wallet-standard/react';import {useEffect}from'react';function
|
|
1
|
+
import {b}from'../chunk-KZKVF5GG.js';import {getAdapterFromConnectorType,OrbitAdapter,getConnectorTypeFromName,formatConnectorName}from'@tuwaio/orbit-core';import {useWallets}from'@wallet-standard/react';import {useEffect}from'react';function h(){let c=useWallets(),o=b(n=>n.activeConnection),r=b(n=>n.updateActiveConnection),a=b(n=>n.connectionError),i=b(n=>n.disconnect);return useEffect(()=>{if(o&&getAdapterFromConnectorType(o.connectorType)===OrbitAdapter.SOLANA){let n=c.filter(e=>getConnectorTypeFromName(OrbitAdapter.SOLANA,formatConnectorName(e.name))===o.connectorType)[0];if(!a){let e={address:n?.accounts[0]?.address,isConnected:n?.accounts.length>0,connectedAccount:n?.accounts[0],connectedWallet:n};(e.address!==o.address||e.isConnected!==o.isConnected)&&r(e);}n?.accounts.length===0&&o.connectorType&&i(o.connectorType);}},[o?.connectorType,c,a,r,i]),null}export{h as SolanaConnectorsWatcher};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/solana/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/solana/SolanaConnectorsWatcher.tsx"],"names":["SolanaConnectorsWatcher","wallets","useWallets","activeConnectionFromStore","useSatelliteConnectStore","store","updateActiveConnection","connectionError","disconnect","useEffect","getAdapterFromConnectorType","OrbitAdapter","activeConnection","w","getConnectorTypeFromName","formatConnectorName"],"mappings":"0OAsBO,SAASA,CAAAA,EAA0B,CACxC,IAAMC,
|
|
1
|
+
{"version":3,"sources":["../../src/solana/SolanaConnectorsWatcher.tsx"],"names":["SolanaConnectorsWatcher","wallets","useWallets","activeConnectionFromStore","useSatelliteConnectStore","store","updateActiveConnection","connectionError","disconnect","useEffect","getAdapterFromConnectorType","OrbitAdapter","activeConnection","w","getConnectorTypeFromName","formatConnectorName","newState"],"mappings":"0OAsBO,SAASA,CAAAA,EAA0B,CACxC,IAAMC,EAAUC,UAAAA,EAAW,CAErBC,CAAAA,CAA4BC,CAAAA,CAA0BC,CAAAA,EAAUA,CAAAA,CAAM,gBAAgB,CAAA,CACtFC,EAAyBF,CAAAA,CAA0BC,CAAAA,EAAUA,CAAAA,CAAM,sBAAsB,CAAA,CACzFE,CAAAA,CAAkBH,CAAAA,CAA0BC,CAAAA,EAAUA,EAAM,eAAe,CAAA,CAC3EG,CAAAA,CAAaJ,CAAAA,CAA0BC,CAAAA,EAAUA,CAAAA,CAAM,UAAU,CAAA,CAGvE,OAAAI,SAAAA,CAAU,IAAM,CACd,GACEN,CAAAA,EACAO,2BAAAA,CAA4BP,CAAAA,CAA0B,aAAa,IAAMQ,YAAAA,CAAa,MAAA,CACtF,CACA,IAAMC,CAAAA,CAAmBX,CAAAA,CAAQ,MAAA,CAC9BY,CAAAA,EACCC,yBAAyBH,YAAAA,CAAa,MAAA,CAAQI,mBAAAA,CAAoBF,CAAAA,CAAE,IAAI,CAAC,CAAA,GACzEV,CAAAA,CAA0B,aAC9B,CAAA,CAAE,CAAC,CAAA,CAEH,GAAI,CAACI,CAAAA,CAAiB,CACpB,IAAMS,CAAAA,CAAW,CAEf,OAAA,CAASJ,CAAAA,EAAkB,QAAA,CAAS,CAAC,CAAA,EAAG,OAAA,CAExC,YAAaA,CAAAA,EAAkB,QAAA,CAAS,MAAA,CAAS,CAAA,CAEjD,gBAAA,CAAkBA,CAAAA,EAAkB,QAAA,CAAS,CAAC,EAC9C,eAAA,CAAiBA,CACnB,CAAA,CAAA,CAMEI,CAAAA,CAAS,OAAA,GAAYb,CAAAA,CAA0B,OAAA,EAC/Ca,CAAAA,CAAS,cAAgBb,CAAAA,CAA0B,WAAA,GAInDG,CAAAA,CAAuBU,CAAQ,EAEnC,CACIJ,CAAAA,EAAkB,QAAA,CAAS,SAAW,CAAA,EAAKT,CAAAA,CAA0B,aAAA,EAEvEK,CAAAA,CAAWL,CAAAA,CAA0B,aAAa,EAEtD,CAEF,EAAG,CAACA,CAAAA,EAA2B,aAAA,CAAeF,CAAAA,CAASM,CAAAA,CAAiBD,CAAAA,CAAwBE,CAAU,CAAC,EAGpG,IACT","file":"index.js","sourcesContent":["import {\n formatConnectorName,\n getAdapterFromConnectorType,\n getConnectorTypeFromName,\n OrbitAdapter,\n} from '@tuwaio/orbit-core';\nimport { useWallets } from '@wallet-standard/react';\nimport { useEffect } from 'react';\n\nimport { useSatelliteConnectStore } from '../index';\n\n/**\n * React component that monitors Solana connector connections and updates the Satellite store\n *\n * @remarks\n * This component watches for changes in connected Solana connectors using the Wallet Standard.\n * Currently handles the first active connector only, with multi-connector support planned for future.\n * It's a headless component that manages state synchronization between Wallet Standard and Satellite store.\n *\n * @returns null - This is a headless component\n *\n */\nexport function SolanaConnectorsWatcher() {\n const wallets = useWallets();\n\n const activeConnectionFromStore = useSatelliteConnectStore((store) => store.activeConnection);\n const updateActiveConnection = useSatelliteConnectStore((store) => store.updateActiveConnection);\n const connectionError = useSatelliteConnectStore((store) => store.connectionError);\n const disconnect = useSatelliteConnectStore((store) => store.disconnect);\n\n // Watch for changes in connected connectors\n useEffect(() => {\n if (\n activeConnectionFromStore &&\n getAdapterFromConnectorType(activeConnectionFromStore.connectorType) === OrbitAdapter.SOLANA\n ) {\n const activeConnection = wallets.filter(\n (w) =>\n getConnectorTypeFromName(OrbitAdapter.SOLANA, formatConnectorName(w.name)) ===\n activeConnectionFromStore.connectorType,\n )[0];\n\n if (!connectionError) {\n const newState = {\n // Use the first account's address\n address: activeConnection?.accounts[0]?.address,\n // Set connection status\n isConnected: activeConnection?.accounts.length > 0,\n // Store Wallet Standard specific information\n connectedAccount: activeConnection?.accounts[0],\n connectedWallet: activeConnection,\n };\n\n // Check if anything actually changed to prevent infinite loops\n // We only check address and isConnected because connectedAccount/connectedWallet\n // might be new references on every render, causing infinite loops if checked.\n const hasChanged =\n newState.address !== activeConnectionFromStore.address ||\n newState.isConnected !== activeConnectionFromStore.isConnected;\n\n if (hasChanged) {\n // Update the Satellite store with the active connector information\n updateActiveConnection(newState);\n }\n }\n if (activeConnection?.accounts.length === 0 && activeConnectionFromStore.connectorType) {\n // If the connector is disconnected from the wallet provider, disconnect from Satellite store as well\n disconnect(activeConnectionFromStore.connectorType);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeConnectionFromStore?.connectorType, wallets, connectionError, updateActiveConnection, disconnect]); // Re-run effect when wallets array changes\n\n // This is a headless component, so return null\n return null;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/satellite-react",
|
|
3
|
-
"version": "1.0.0-fix-packages-alpha.
|
|
3
|
+
"version": "1.0.0-fix-packages-alpha.6.a5851f3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -131,9 +131,9 @@
|
|
|
131
131
|
"viem": "^2.40.3",
|
|
132
132
|
"typescript": "^5.9.3",
|
|
133
133
|
"zustand": "^5.0.8",
|
|
134
|
-
"@tuwaio/satellite-core": "^1.0.0-fix-packages-alpha.
|
|
135
|
-
"@tuwaio/satellite-evm": "^1.0.0-fix-packages-alpha.
|
|
136
|
-
"@tuwaio/satellite-solana": "^1.0.0-fix-packages-alpha.
|
|
134
|
+
"@tuwaio/satellite-core": "^1.0.0-fix-packages-alpha.6.a5851f3",
|
|
135
|
+
"@tuwaio/satellite-evm": "^1.0.0-fix-packages-alpha.6.a5851f3",
|
|
136
|
+
"@tuwaio/satellite-solana": "^1.0.0-fix-packages-alpha.6.a5851f3"
|
|
137
137
|
},
|
|
138
138
|
"scripts": {
|
|
139
139
|
"start": "tsup src/index.ts --watch",
|