SolanaWalletAdapter
SIP Protocol API Reference v0.7.2
SIP Protocol API Reference / SolanaWalletAdapter
Class: SolanaWalletAdapter
Section titled “Class: SolanaWalletAdapter”Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9498
Solana wallet adapter
Provides SIP-compatible wallet interface for Solana. Works with Phantom, Solflare, Backpack, and other Solana wallets.
Examples
Section titled “Examples”const wallet = new SolanaWalletAdapter({ wallet: 'phantom' })await wallet.connect()
const balance = await wallet.getBalance()console.log(`Balance: ${balance} lamports`)
// Sign a messageconst sig = await wallet.signMessage(new TextEncoder().encode('Hello'))const wallet = new SolanaWalletAdapter({ wallet: 'phantom', cluster: 'devnet', rpcEndpoint: 'https://my-rpc.example.com',})Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SolanaWalletAdapter(
config?):SolanaWalletAdapter
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9509
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”SolanaWalletAdapter
Overrides
Section titled “Overrides”Properties
Section titled “Properties”
readonlychain:"solana"
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9499
Chain this adapter connects to
Overrides
Section titled “Overrides”
readonlyname:string
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9500
Wallet name/identifier (e.g., ‘phantom’, ‘metamask’)
Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”address
Section titled “address”Get Signature
Section titled “Get Signature”get address():
string
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:8993
Current address (empty string if not connected)
Returns
Section titled “Returns”string
Current address (empty string if not connected)
Inherited from
Section titled “Inherited from”publicKey
Section titled “publicKey”Get Signature
Section titled “Get Signature”get publicKey():
""|`0x${string}`
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:8994
Public key (hex encoded, empty string if not connected)
Returns
Section titled “Returns”"" | `0x${string}`
Public key (hex encoded, empty string if not connected)
Inherited from
Section titled “Inherited from”connectionState
Section titled “connectionState”Get Signature
Section titled “Get Signature”get connectionState():
WalletConnectionState
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:8995
Current connection state
Returns
Section titled “Returns”Current connection state
Inherited from
Section titled “Inherited from”BaseWalletAdapter.connectionState
Methods
Section titled “Methods”on<
T>(event,handler):void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9000
Subscribe to wallet events
Type Parameters
Section titled “Type Parameters”T extends WalletEventType
Parameters
Section titled “Parameters”T
handler
Section titled “handler”WalletEventHandler<Extract<WalletConnectEvent, { type: T; }> | Extract<WalletDisconnectEvent, { type: T; }> | Extract<WalletAccountChangedEvent, { type: T; }> | Extract<WalletChainChangedEvent, { type: T; }> | Extract<WalletErrorEvent, { type: T; }>>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”off<
T>(event,handler):void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9006
Unsubscribe from wallet events
Type Parameters
Section titled “Type Parameters”T extends WalletEventType
Parameters
Section titled “Parameters”T
handler
Section titled “handler”WalletEventHandler<Extract<WalletConnectEvent, { type: T; }> | Extract<WalletDisconnectEvent, { type: T; }> | Extract<WalletAccountChangedEvent, { type: T; }> | Extract<WalletChainChangedEvent, { type: T; }> | Extract<WalletErrorEvent, { type: T; }>>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”isConnected()
Section titled “isConnected()”isConnected():
boolean
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9036
Check if wallet is connected
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”getCluster()
Section titled “getCluster()”getCluster():
SolanaCluster
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9513
Get the current Solana cluster
Returns
Section titled “Returns”getRpcEndpoint()
Section titled “getRpcEndpoint()”getRpcEndpoint():
string
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9517
Get the RPC endpoint
Returns
Section titled “Returns”string
setRpcEndpoint()
Section titled “setRpcEndpoint()”setRpcEndpoint(
endpoint):void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9521
Set the RPC endpoint
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Returns
Section titled “Returns”void
connect()
Section titled “connect()”connect():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9529
Connect to the wallet
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”disconnect()
Section titled “disconnect()”disconnect():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9533
Disconnect from the wallet
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”signMessage()
Section titled “signMessage()”signMessage(
message):Promise<Signature>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9537
Sign a message
Parameters
Section titled “Parameters”message
Section titled “message”Uint8Array
Returns
Section titled “Returns”Promise<Signature>
Overrides
Section titled “Overrides”signTransaction()
Section titled “signTransaction()”signTransaction(
tx):Promise<SignedTransaction>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9543
Sign a transaction
The transaction data should be a SolanaTransaction or SolanaVersionedTransaction
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SignedTransaction>
Overrides
Section titled “Overrides”BaseWalletAdapter.signTransaction
signAndSendTransaction()
Section titled “signAndSendTransaction()”signAndSendTransaction(
tx):Promise<TransactionReceipt>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9547
Sign and send a transaction
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TransactionReceipt>
Overrides
Section titled “Overrides”BaseWalletAdapter.signAndSendTransaction
signAllTransactions()
Section titled “signAllTransactions()”signAllTransactions<
T>(transactions):Promise<T[]>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9553
Sign multiple transactions at once
Solana-specific method for batch signing
Type Parameters
Section titled “Type Parameters”T extends SolanaTransaction | SolanaVersionedTransaction
Parameters
Section titled “Parameters”transactions
Section titled “transactions”T[]
Returns
Section titled “Returns”Promise<T[]>
getBalance()
Section titled “getBalance()”getBalance():
Promise<bigint>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9557
Get native SOL balance
Returns
Section titled “Returns”Promise<bigint>
Overrides
Section titled “Overrides”getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
asset):Promise<bigint>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9561
Get SPL token balance
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<bigint>