WalletAdapter
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / WalletAdapter
Interface: WalletAdapter
Section titled “Interface: WalletAdapter”Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:2049
Wallet adapter interface for blockchain interactions
Provides a unified interface for signing messages and transactions across different blockchain wallets (Ethereum, Solana, etc.).
Example
Section titled “Example”class MyWalletAdapter implements WalletAdapter { chain = 'ethereum' as const address = '0x...'
async signMessage(message: string): Promise<string> { return await wallet.signMessage(message) }
async signTransaction(tx: unknown): Promise<unknown> { return await wallet.signTransaction(tx) }}Properties
Section titled “Properties”chain:
ChainId
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:2055
Blockchain network this wallet is connected to
Must match one of the supported ChainId values.
address
Section titled “address”address:
string
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:2064
Wallet address on the connected chain
Format depends on the chain:
- Ethereum:
0x...(checksummed) - Solana: Base58-encoded public key
- NEAR: Account ID or implicit address
Methods
Section titled “Methods”signMessage()
Section titled “signMessage()”signMessage(
message):Promise<string>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:2076
Sign a message with the wallet’s private key
Parameters
Section titled “Parameters”message
Section titled “message”string
UTF-8 string to sign
Returns
Section titled “Returns”Promise<string>
Signature as hex string or base58 (chain-dependent)
Example
Section titled “Example”const signature = await wallet.signMessage('Hello SIP!')signTransaction()
Section titled “signTransaction()”signTransaction(
tx):Promise<unknown>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:2088
Sign a transaction without broadcasting
Parameters
Section titled “Parameters”unknown
Chain-specific transaction object
Returns
Section titled “Returns”Promise<unknown>
Signed transaction ready for broadcast
Example
Section titled “Example”const signedTx = await wallet.signTransaction(tx)sendTransaction()?
Section titled “sendTransaction()?”
optionalsendTransaction(tx):Promise<string>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:2105
Sign and broadcast a transaction (optional)
If implemented, allows the wallet to handle both signing and sending. If not implemented, caller must broadcast the signed transaction separately.
Parameters
Section titled “Parameters”unknown
Chain-specific transaction object
Returns
Section titled “Returns”Promise<string>
Transaction hash after broadcast
Example
Section titled “Example”if (wallet.sendTransaction) { const txHash = await wallet.sendTransaction(tx)}