Skip to content

MockSolanaAdapter

SIP Protocol API Reference v0.7.2


SIP Protocol API Reference / MockSolanaAdapter

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9626

Mock Solana wallet adapter for testing

Provides full Solana wallet functionality with mock data. No browser environment or actual wallet required.

const wallet = new MockSolanaAdapter({
address: 'TestWalletAddress123',
balance: 5_000_000_000n, // 5 SOL
})
await wallet.connect()
const balance = await wallet.getBalance() // 5_000_000_000n
// Simulate failures
const failingWallet = new MockSolanaAdapter({
shouldFailSign: true,
})

new MockSolanaAdapter(config?): MockSolanaAdapter

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9640

MockSolanaAdapterConfig

MockSolanaAdapter

BaseWalletAdapter.constructor

readonly chain: "solana"

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9627

Chain this adapter connects to

BaseWalletAdapter.chain


readonly name: "mock-solana" = "mock-solana"

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9628

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

BaseWalletAdapter.name

get address(): string

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:8993

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-CzWPI6Le.d.ts:8994

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-CzWPI6Le.d.ts:8995

Current connection state

WalletConnectionState

Current connection state

BaseWalletAdapter.connectionState

on<T>(event, handler): void

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9000

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-CzWPI6Le.d.ts:9006

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-CzWPI6Le.d.ts:9036

Check if wallet is connected

boolean

BaseWalletAdapter.isConnected


getCluster(): SolanaCluster

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9644

Get the current Solana cluster

SolanaCluster


connect(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9648

Connect to the mock wallet

Promise<void>

BaseWalletAdapter.connect


disconnect(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9652

Disconnect from the mock wallet

Promise<void>

BaseWalletAdapter.disconnect


signMessage(message): Promise<Signature>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9656

Sign a message

Uint8Array

Promise<Signature>

BaseWalletAdapter.signMessage


signTransaction(tx): Promise<SignedTransaction>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9660

Sign a transaction

UnsignedTransaction

Promise<SignedTransaction>

BaseWalletAdapter.signTransaction


signAndSendTransaction(tx): Promise<TransactionReceipt>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9664

Sign and send a transaction

UnsignedTransaction

Promise<TransactionReceipt>

BaseWalletAdapter.signAndSendTransaction


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

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9668

Sign multiple transactions

T extends SolanaTransaction | SolanaVersionedTransaction

T[]

Promise<T[]>


getBalance(): Promise<bigint>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9672

Get SOL balance

Promise<bigint>

BaseWalletAdapter.getBalance


getTokenBalance(asset): Promise<bigint>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9676

Get token balance

Asset

Promise<bigint>

BaseWalletAdapter.getTokenBalance


setMockBalance(balance): void

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9680

Set mock balance

bigint

void


setMockTokenBalance(mintAddress, balance): void

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9684

Set mock token balance

string

bigint

void


getSignedTransactions(): (SolanaTransaction | SolanaVersionedTransaction)[]

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9688

Get all signed transactions (for verification)

(SolanaTransaction | SolanaVersionedTransaction)[]


getSentTransactions(): string[]

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9692

Get all sent transaction signatures (for verification)

string[]


clearTransactionHistory(): void

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9696

Clear transaction history

void


simulateAccountChange(newAddress): void

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9700

Simulate an account change event

string

void


simulateDisconnect(): void

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9704

Simulate a disconnect event

void