Skip to content

SolanaWalletAdapter

SIP Protocol API Reference v0.7.0


SIP Protocol API Reference / SolanaWalletAdapter

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9435

Solana wallet adapter

Provides SIP-compatible wallet interface for Solana. Works with Phantom, Solflare, Backpack, and other Solana wallets.

const wallet = new SolanaWalletAdapter({ wallet: 'phantom' })
await wallet.connect()
const balance = await wallet.getBalance()
console.log(`Balance: ${balance} lamports`)
// Sign a message
const sig = await wallet.signMessage(new TextEncoder().encode('Hello'))
const wallet = new SolanaWalletAdapter({
wallet: 'phantom',
cluster: 'devnet',
rpcEndpoint: 'https://my-rpc.example.com',
})

new SolanaWalletAdapter(config?): SolanaWalletAdapter

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9446

SolanaAdapterConfig

SolanaWalletAdapter

BaseWalletAdapter.constructor

readonly chain: "solana"

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9436

Chain this adapter connects to

BaseWalletAdapter.chain


readonly name: string

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9437

Wallet name/identifier (e.g., ‘phantom’, ‘metamask’)

BaseWalletAdapter.name

get address(): string

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:8930

Current address (empty string if not connected)

string

Current address (empty string if not connected)

BaseWalletAdapter.address


get publicKey(): "" | `0x${string}`

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:8931

Public key (hex encoded, empty string if not connected)

"" | `0x${string}`

Public key (hex encoded, empty string if not connected)

BaseWalletAdapter.publicKey


get connectionState(): WalletConnectionState

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:8932

Current connection state

WalletConnectionState

Current connection state

BaseWalletAdapter.connectionState

on<T>(event, handler): void

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:8937

Subscribe to wallet events

T extends WalletEventType

T

WalletEventHandler<Extract<WalletConnectEvent, { type: T; }> | Extract<WalletDisconnectEvent, { type: T; }> | Extract<WalletAccountChangedEvent, { type: T; }> | Extract<WalletChainChangedEvent, { type: T; }> | Extract<WalletErrorEvent, { type: T; }>>

void

BaseWalletAdapter.on


off<T>(event, handler): void

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:8943

Unsubscribe from wallet events

T extends WalletEventType

T

WalletEventHandler<Extract<WalletConnectEvent, { type: T; }> | Extract<WalletDisconnectEvent, { type: T; }> | Extract<WalletAccountChangedEvent, { type: T; }> | Extract<WalletChainChangedEvent, { type: T; }> | Extract<WalletErrorEvent, { type: T; }>>

void

BaseWalletAdapter.off


isConnected(): boolean

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:8973

Check if wallet is connected

boolean

BaseWalletAdapter.isConnected


getCluster(): SolanaCluster

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9450

Get the current Solana cluster

SolanaCluster


getRpcEndpoint(): string

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9454

Get the RPC endpoint

string


setRpcEndpoint(endpoint): void

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9458

Set the RPC endpoint

string

void


connect(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9466

Connect to the wallet

Promise<void>

BaseWalletAdapter.connect


disconnect(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9470

Disconnect from the wallet

Promise<void>

BaseWalletAdapter.disconnect


signMessage(message): Promise<Signature>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9474

Sign a message

Uint8Array

Promise<Signature>

BaseWalletAdapter.signMessage


signTransaction(tx): Promise<SignedTransaction>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9480

Sign a transaction

The transaction data should be a SolanaTransaction or SolanaVersionedTransaction

UnsignedTransaction

Promise<SignedTransaction>

BaseWalletAdapter.signTransaction


signAndSendTransaction(tx): Promise<TransactionReceipt>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9484

Sign and send a transaction

UnsignedTransaction

Promise<TransactionReceipt>

BaseWalletAdapter.signAndSendTransaction


signAllTransactions<T>(transactions): Promise<T[]>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9490

Sign multiple transactions at once

Solana-specific method for batch signing

T extends SolanaTransaction | SolanaVersionedTransaction

T[]

Promise<T[]>


getBalance(): Promise<bigint>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9494

Get native SOL balance

Promise<bigint>

BaseWalletAdapter.getBalance


getTokenBalance(asset): Promise<bigint>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9498

Get SPL token balance

Asset

Promise<bigint>

BaseWalletAdapter.getTokenBalance