satelliteSolanaAdapter()
satelliteSolanaAdapter(
params):SatelliteAdapter<UiWallet,SolanaConnection>
Defined in: satellite-solana/src/adapters/solanaAdapter.ts:60
Creates the Solana adapter for the Satellite Connect store (createSatelliteConnectStore from
@tuwaio/satellite-core or SatelliteConnectProvider from @tuwaio/satellite-react). It implements
SatelliteAdapter with the Wallet Standard and @solana/kit:
getConnectorsreturns the wallets ofgetAvailableSolanaConnectorsfrom@tuwaio/orbit-solana(registered Wallet Standard wallets with the Solana features Satellite needs). A wallet matches aconnectorTypesuch as"solana:phantom"throughformatConnectorNamefrom@tuwaio/orbit-core.connectasks the wallet to connect (standard:connect) and returns a SolanaConnection: the first account, the cluster moniker of the requested chain ("solana:devnet"and"devnet"both become"devnet"), the RPC URL of that cluster fromrpcUrls, the wallet icon, the Wallet Standard handles and asignMessagecreated with createSolanaMessageSigner. WhenrpcUrlshas no URL for the cluster,getRpcUrlForClusterfrom@tuwaio/orbit-solanareturns the public endpoint of that cluster (the mainnet-beta one forlocalnet, and for every cluster with@tuwaio/orbit-solana0.3.1 and earlier).disconnectdisconnects the wallet of the given connection, or every wallet that has accounts.checkAndSwitchNetworkmakes no wallet request (Solana wallets have no network switch): it sets the connection’schainIdandrpcURLto the new cluster.getBalancereads the balance withgetBalanceover RPC and returns it in SOL.getExplorerUrl(url?, chainId?)builds a Solana Explorer link (explorer.solana.com).getNameandgetAvatarresolve SNS names and avatars with@tuwaio/orbit-solana(Bonfida APIs, cached in memory);getNamereturns the address when there is no name. There is nogetAddressand no contract check.switchConnectionrunsstandard:connectof the wallet again.
Parameters
params
SolanaRPCUrls
Adapter options: rpcUrls, the RPC URL for each cluster moniker (mainnet, devnet, testnet,
localnet). The URLs are kept in memory and exposed as rpcURL of the connection; they are not saved to
localStorage.
Returns
SatelliteAdapter<UiWallet, SolanaConnection>
The Solana adapter.
Example
import { satelliteSolanaAdapter } from '@tuwaio/satellite-solana';
export const solanaAdapter = satelliteSolanaAdapter({
rpcUrls: {
mainnet: 'https://api.mainnet-beta.solana.com',
devnet: 'https://api.devnet.solana.com',
},
});Last updated on