pulsarSolanaAdapter()
pulsarSolanaAdapter<
T>(config):TxAdapter<T>
Defined in: adapters/solanaAdapter.ts:68
Creates the Solana adapter for createPulsarStore from @tuwaio/pulsar-core. Pass it alone or in the adapter array.
The adapter reads the connected wallet from the last connection saved by @tuwaio/orbit-core (Satellite Connect
writes it, in localStorage, or in sessionStorage for a wallet the user did not ask to remember) and finds the
matching Wallet Standard wallet with getConnectedSolanaConnector from @tuwaio/orbit-solana. It implements TxAdapter from @tuwaio/pulsar-core:
getConnectorInforeturns the saved address and the connector type, e.g.solana:phantom. It throws when no installed wallet holds the saved address.checkChainForTxcompares the cluster ofdesiredChainIDwith the saved chain of the connection (devnet,solana:devnetand the genesis-hash chain IDsolana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1are the same cluster), and throws SolanaChainMismatchError with both cluster monikers when they differ. It does not switch the wallet.checkTransactionsTrackerkeeps the returned signature astxKeyand usesTransactionTracker.Solanaunless another tracker is requested.checkAndInitializeTrackerInStoreis checkAndInitializeTrackerInStore.getExplorerUrlandgetExplorerTxUrlbuild Solana Explorer links withgetSolanaExplorerLinkfrom@tuwaio/orbit-solana.retryTxActioncloses the modal and runsexecuteTxActionagain withtx.actionFunction({ client, ...tx.payload }), whereclientis a cached RPC client for the URL of the cluster ofdesiredChainIDinrpcUrls, or its public endpoint. It throws when no wallet is connected orexecuteTxActionis missing.
There is no cancelTxAction or speedUpTxAction for Solana.
Type Parameters
T
T extends Transaction
The application transaction type.
Parameters
config
The RPC URLs by cluster.
Returns
TxAdapter<T>
The Solana adapter.
Example
import { createPulsarStore } from '@tuwaio/pulsar-core';
import { pulsarSolanaAdapter } from '@tuwaio/pulsar-solana';
const pulsarStore = createPulsarStore({
name: 'transactions-tracking-storage',
adapter: pulsarSolanaAdapter({ rpcUrls: { devnet: 'https://api.devnet.solana.com' } }),
});Last updated on