satelliteEVMAdapter()
satelliteEVMAdapter(
config,chains):SatelliteAdapter<ConnectorEVM,EVMConnection>
Defined in: satellite-evm/src/adapters/evmAdapter.ts:62
Creates the EVM adapter for the Satellite Connect store (createSatelliteConnectStore from @tuwaio/satellite-core
or SatelliteConnectProvider from @tuwaio/satellite-react). It implements SatelliteAdapter with @wagmi/core:
getConnectorsreturns the connectors ofconfig. A connector matches aconnectorTypesuch as"evm:metamask"throughformatConnectorNamefrom@tuwaio/orbit-core(for example, theSafeconnector is"evm:safe").connectruns wagmi’sconnectwith the requested chain and returns an EVMConnection: the account (the zero address if wagmi reports none), the chain (1if unknown), the first default RPC URL of the chain, the connector icon and asignMessagethat signs with wagmi’ssignMessage.disconnectdisconnects the given connection, or every connector ofconfig.checkAndSwitchNetworkasks the wallet to switch chains withcheckAndSwitchChainfrom@tuwaio/orbit-evm.getBalancereads the native balance through the wagmi transports and formats it with the chain’s decimals.getExplorerUrl(url?, chainId?)joinsurlto the block explorer ofchainId(looked up inchains, then inconfig), or of the connected chain whenchainIdis omitted. It returnsundefinedwhen the chain has no explorer.getName,getAvatarandgetAddressresolve ENS names on Ethereum Mainnet with@tuwaio/orbit-evm, which caches the results in memory.checkIsContractAddressis checkIsWalletAddressContract;getSafeConnectorChainIdreturns the chain of theSafeconnector;switchConnectionruns wagmi’sswitchConnection.
Parameters
config
Config
The wagmi config of the app.
chains
readonly [Chain, Chain]
The app chains. ENS lookups use the Ethereum Mainnet entry of this list (its default RPC URL), or
viem’s mainnet when it is missing.
Returns
SatelliteAdapter<ConnectorEVM, EVMConnection>
The EVM adapter.
Throws
Satellite EVM adapter requires a wagmi config object. when config is missing.
Example
import { satelliteEVMAdapter } from '@tuwaio/satellite-evm';
import { createConfig, http, injected } from '@wagmi/core';
import { mainnet, sepolia } from 'viem/chains';
const chains = [mainnet, sepolia] as const;
const wagmiConfig = createConfig({
chains,
connectors: [injected()],
transports: { [mainnet.id]: http(), [sepolia.id]: http() },
});
export const evmAdapter = satelliteEVMAdapter(wagmiConfig, chains);Last updated on