MockSolanaAdapter
SIP Protocol API Reference v0.7.2
SIP Protocol API Reference / MockSolanaAdapter
Class: MockSolanaAdapter
Section titled “Class: 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.
Example
Section titled “Example”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 failuresconst failingWallet = new MockSolanaAdapter({ shouldFailSign: true,})Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MockSolanaAdapter(
config?):MockSolanaAdapter
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9640
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”MockSolanaAdapter
Overrides
Section titled “Overrides”Properties
Section titled “Properties”
readonlychain:"solana"
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9627
Chain this adapter connects to
Overrides
Section titled “Overrides”
readonlyname:"mock-solana"="mock-solana"
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9628
Wallet name/identifier (e.g., ‘phantom’, ‘metamask’)
Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”address
Section titled “address”Get Signature
Section titled “Get Signature”get address():
string
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:8993
Current address (empty string if not connected)
Returns
Section titled “Returns”string
Current address (empty string if not connected)
Inherited from
Section titled “Inherited from”publicKey
Section titled “publicKey”Get Signature
Section titled “Get Signature”get publicKey():
""|`0x${string}`
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:8994
Public key (hex encoded, empty string if not connected)
Returns
Section titled “Returns”"" | `0x${string}`
Public key (hex encoded, empty string if not connected)
Inherited from
Section titled “Inherited from”connectionState
Section titled “connectionState”Get Signature
Section titled “Get Signature”get connectionState():
WalletConnectionState
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:8995
Current connection state
Returns
Section titled “Returns”Current connection state
Inherited from
Section titled “Inherited from”BaseWalletAdapter.connectionState
Methods
Section titled “Methods”on<
T>(event,handler):void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9000
Subscribe to wallet events
Type Parameters
Section titled “Type Parameters”T extends WalletEventType
Parameters
Section titled “Parameters”T
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; }>>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”off<
T>(event,handler):void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9006
Unsubscribe from wallet events
Type Parameters
Section titled “Type Parameters”T extends WalletEventType
Parameters
Section titled “Parameters”T
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; }>>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”isConnected()
Section titled “isConnected()”isConnected():
boolean
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9036
Check if wallet is connected
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”getCluster()
Section titled “getCluster()”getCluster():
SolanaCluster
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9644
Get the current Solana cluster
Returns
Section titled “Returns”connect()
Section titled “connect()”connect():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9648
Connect to the mock wallet
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”disconnect()
Section titled “disconnect()”disconnect():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9652
Disconnect from the mock wallet
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”signMessage()
Section titled “signMessage()”signMessage(
message):Promise<Signature>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9656
Sign a message
Parameters
Section titled “Parameters”message
Section titled “message”Uint8Array
Returns
Section titled “Returns”Promise<Signature>
Overrides
Section titled “Overrides”signTransaction()
Section titled “signTransaction()”signTransaction(
tx):Promise<SignedTransaction>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9660
Sign a transaction
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SignedTransaction>
Overrides
Section titled “Overrides”BaseWalletAdapter.signTransaction
signAndSendTransaction()
Section titled “signAndSendTransaction()”signAndSendTransaction(
tx):Promise<TransactionReceipt>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9664
Sign and send a transaction
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TransactionReceipt>
Overrides
Section titled “Overrides”BaseWalletAdapter.signAndSendTransaction
signAllTransactions()
Section titled “signAllTransactions()”signAllTransactions<
T>(transactions):Promise<T[]>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9668
Sign multiple transactions
Type Parameters
Section titled “Type Parameters”T extends SolanaTransaction | SolanaVersionedTransaction
Parameters
Section titled “Parameters”transactions
Section titled “transactions”T[]
Returns
Section titled “Returns”Promise<T[]>
getBalance()
Section titled “getBalance()”getBalance():
Promise<bigint>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9672
Get SOL balance
Returns
Section titled “Returns”Promise<bigint>
Overrides
Section titled “Overrides”getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
asset):Promise<bigint>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9676
Get token balance
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<bigint>
Overrides
Section titled “Overrides”BaseWalletAdapter.getTokenBalance
setMockBalance()
Section titled “setMockBalance()”setMockBalance(
balance):void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9680
Set mock balance
Parameters
Section titled “Parameters”balance
Section titled “balance”bigint
Returns
Section titled “Returns”void
setMockTokenBalance()
Section titled “setMockTokenBalance()”setMockTokenBalance(
mintAddress,balance):void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9684
Set mock token balance
Parameters
Section titled “Parameters”mintAddress
Section titled “mintAddress”string
balance
Section titled “balance”bigint
Returns
Section titled “Returns”void
getSignedTransactions()
Section titled “getSignedTransactions()”getSignedTransactions(): (
SolanaTransaction|SolanaVersionedTransaction)[]
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9688
Get all signed transactions (for verification)
Returns
Section titled “Returns”(SolanaTransaction | SolanaVersionedTransaction)[]
getSentTransactions()
Section titled “getSentTransactions()”getSentTransactions():
string[]
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9692
Get all sent transaction signatures (for verification)
Returns
Section titled “Returns”string[]
clearTransactionHistory()
Section titled “clearTransactionHistory()”clearTransactionHistory():
void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9696
Clear transaction history
Returns
Section titled “Returns”void
simulateAccountChange()
Section titled “simulateAccountChange()”simulateAccountChange(
newAddress):void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9700
Simulate an account change event
Parameters
Section titled “Parameters”newAddress
Section titled “newAddress”string
Returns
Section titled “Returns”void
simulateDisconnect()
Section titled “simulateDisconnect()”simulateDisconnect():
void
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:9704
Simulate a disconnect event
Returns
Section titled “Returns”void