MockSolanaAdapter
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / MockSolanaAdapter
Class: MockSolanaAdapter
Section titled “Class: MockSolanaAdapter”Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9563
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-BYZbDjal.d.ts:9577
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-BYZbDjal.d.ts:9564
Chain this adapter connects to
Overrides
Section titled “Overrides”
readonlyname:"mock-solana"="mock-solana"
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9565
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-BYZbDjal.d.ts:8930
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-BYZbDjal.d.ts:8931
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-BYZbDjal.d.ts:8932
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-BYZbDjal.d.ts:8937
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-BYZbDjal.d.ts:8943
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-BYZbDjal.d.ts:8973
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-BYZbDjal.d.ts:9581
Get the current Solana cluster
Returns
Section titled “Returns”connect()
Section titled “connect()”connect():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9585
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-BYZbDjal.d.ts:9589
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-BYZbDjal.d.ts:9593
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-BYZbDjal.d.ts:9597
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-BYZbDjal.d.ts:9601
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-BYZbDjal.d.ts:9605
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-BYZbDjal.d.ts:9609
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-BYZbDjal.d.ts:9613
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-BYZbDjal.d.ts:9617
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-BYZbDjal.d.ts:9621
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-BYZbDjal.d.ts:9625
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-BYZbDjal.d.ts:9629
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-BYZbDjal.d.ts:9633
Clear transaction history
Returns
Section titled “Returns”void
simulateAccountChange()
Section titled “simulateAccountChange()”simulateAccountChange(
newAddress):void
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:9637
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-BYZbDjal.d.ts:9641
Simulate a disconnect event
Returns
Section titled “Returns”void