IWalletAdapter
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / IWalletAdapter
Interface: IWalletAdapter
Section titled “Interface: IWalletAdapter”Defined in: @sip-protocol/types/dist/index.d.ts:2955
Core wallet adapter interface
Chain-agnostic interface that all wallet implementations must support. Provides basic wallet operations: connection, signing, and balance queries.
Example
Section titled “Example”class SolanaWalletAdapter implements WalletAdapter { readonly chain = 'solana'
async connect(): Promise<void> { // Connect to Phantom, Solflare, etc. }
async signMessage(message: Uint8Array): Promise<Signature> { // Sign using connected wallet }}Extended by
Section titled “Extended by”Properties
Section titled “Properties”
readonlychain:ChainId
Defined in: @sip-protocol/types/dist/index.d.ts:2957
Chain this adapter connects to
readonlyname:string
Defined in: @sip-protocol/types/dist/index.d.ts:2959
Wallet name/identifier (e.g., ‘phantom’, ‘metamask’)
address
Section titled “address”
readonlyaddress:string
Defined in: @sip-protocol/types/dist/index.d.ts:2961
Current address (empty string if not connected)
publicKey
Section titled “publicKey”
readonlypublicKey:""|`0x${string}`
Defined in: @sip-protocol/types/dist/index.d.ts:2963
Public key (hex encoded, empty string if not connected)
connectionState
Section titled “connectionState”
readonlyconnectionState:WalletConnectionState
Defined in: @sip-protocol/types/dist/index.d.ts:2967
Current connection state
Methods
Section titled “Methods”connect()
Section titled “connect()”connect():
Promise<void>
Defined in: @sip-protocol/types/dist/index.d.ts:2973
Connect to the wallet
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”If connection fails
disconnect()
Section titled “disconnect()”disconnect():
Promise<void>
Defined in: @sip-protocol/types/dist/index.d.ts:2977
Disconnect from the wallet
Returns
Section titled “Returns”Promise<void>
isConnected()
Section titled “isConnected()”isConnected():
boolean
Defined in: @sip-protocol/types/dist/index.d.ts:2981
Check if wallet is connected
Returns
Section titled “Returns”boolean
signMessage()
Section titled “signMessage()”signMessage(
message):Promise<Signature>
Defined in: @sip-protocol/types/dist/index.d.ts:2989
Sign an arbitrary message
Parameters
Section titled “Parameters”message
Section titled “message”Uint8Array
The message bytes to sign
Returns
Section titled “Returns”Promise<Signature>
The signature
Throws
Section titled “Throws”If signing fails or wallet not connected
signTransaction()
Section titled “signTransaction()”signTransaction(
tx):Promise<SignedTransaction>
Defined in: @sip-protocol/types/dist/index.d.ts:2997
Sign a transaction
Parameters
Section titled “Parameters”The unsigned transaction
Returns
Section titled “Returns”Promise<SignedTransaction>
The signed transaction
Throws
Section titled “Throws”If signing fails or wallet not connected
signAndSendTransaction()
Section titled “signAndSendTransaction()”signAndSendTransaction(
tx):Promise<TransactionReceipt>
Defined in: @sip-protocol/types/dist/index.d.ts:3005
Sign and broadcast a transaction
Parameters
Section titled “Parameters”The unsigned transaction
Returns
Section titled “Returns”Promise<TransactionReceipt>
The transaction receipt
Throws
Section titled “Throws”If signing or broadcast fails
getBalance()
Section titled “getBalance()”getBalance():
Promise<bigint>
Defined in: @sip-protocol/types/dist/index.d.ts:3012
Get native token balance
Returns
Section titled “Returns”Promise<bigint>
Balance in smallest unit (lamports, wei, etc.)
Throws
Section titled “Throws”If query fails
getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
asset):Promise<bigint>
Defined in: @sip-protocol/types/dist/index.d.ts:3020
Get token balance for a specific asset
Parameters
Section titled “Parameters”The asset to query balance for
Returns
Section titled “Returns”Promise<bigint>
Balance in smallest unit
Throws
Section titled “Throws”If query fails or asset not supported
on<
T>(event,handler):void
Defined in: @sip-protocol/types/dist/index.d.ts:3027
Subscribe to wallet events
Type Parameters
Section titled “Type Parameters”T extends WalletEventType
Parameters
Section titled “Parameters”T
Event type to subscribe to
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; }>>
Event handler function
Returns
Section titled “Returns”void
off<
T>(event,handler):void
Defined in: @sip-protocol/types/dist/index.d.ts:3036
Unsubscribe from wallet events
Type Parameters
Section titled “Type Parameters”T extends WalletEventType
Parameters
Section titled “Parameters”T
Event type to unsubscribe from
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; }>>
Event handler to remove
Returns
Section titled “Returns”void