MockSolanaAdapter
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / MockSolanaAdapter
Class: MockSolanaAdapter
Section titled “Class: MockSolanaAdapter”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:13161
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-DXh2IGkz.d.ts:13175
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-DXh2IGkz.d.ts:13162
Chain this adapter connects to
Overrides
Section titled “Overrides”
readonlyname:"mock-solana"="mock-solana"
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:13163
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-DXh2IGkz.d.ts:12528
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-DXh2IGkz.d.ts:12529
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-DXh2IGkz.d.ts:12530
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-DXh2IGkz.d.ts:12535
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-DXh2IGkz.d.ts:12541
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-DXh2IGkz.d.ts:12571
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-DXh2IGkz.d.ts:13179
Get the current Solana cluster
Returns
Section titled “Returns”connect()
Section titled “connect()”connect():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:13183
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-DXh2IGkz.d.ts:13187
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-DXh2IGkz.d.ts:13191
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-DXh2IGkz.d.ts:13195
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-DXh2IGkz.d.ts:13199
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-DXh2IGkz.d.ts:13203
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-DXh2IGkz.d.ts:13207
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-DXh2IGkz.d.ts:13211
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-DXh2IGkz.d.ts:13215
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-DXh2IGkz.d.ts:13219
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-DXh2IGkz.d.ts:13223
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-DXh2IGkz.d.ts:13227
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-DXh2IGkz.d.ts:13231
Clear transaction history
Returns
Section titled “Returns”void
simulateAccountChange()
Section titled “simulateAccountChange()”simulateAccountChange(
newAddress):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:13235
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-DXh2IGkz.d.ts:13239
Simulate a disconnect event
Returns
Section titled “Returns”void