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 in localStorage by @tuwaio/orbit-core
(Satellite Connect writes it) 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.checkChainForTxcomparesdesiredChainIDwith the saved chain of the connection, ignoring asolana:prefix (devnetandsolana:devnetare the same cluster), and throws SolanaChainMismatchError 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 fortx.rpcUrlor the cluster ofdesiredChainID. 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