Skip to content

WalletAdapter

SIP Protocol API Reference v0.7.0


SIP Protocol API Reference / 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.).

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)
}
}

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: 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

signMessage(message): Promise<string>

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

Sign a message with the wallet’s private key

string

UTF-8 string to sign

Promise<string>

Signature as hex string or base58 (chain-dependent)

const signature = await wallet.signMessage('Hello SIP!')

signTransaction(tx): Promise<unknown>

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

Sign a transaction without broadcasting

unknown

Chain-specific transaction object

Promise<unknown>

Signed transaction ready for broadcast

const signedTx = await wallet.signTransaction(tx)

optional sendTransaction(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.

unknown

Chain-specific transaction object

Promise<string>

Transaction hash after broadcast

if (wallet.sendTransaction) {
const txHash = await wallet.sendTransaction(tx)
}