MockSolanaAdapter
SIP Protocol API Reference v0.15.1
SIP Protocol API Reference / MockSolanaAdapter
Class: MockSolanaAdapter
Section titled “Class: MockSolanaAdapter”Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:13234
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-GLbkPPho.d.ts:13248
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-GLbkPPho.d.ts:13235
Chain this adapter connects to
Overrides
Section titled “Overrides”
readonlyname:"mock-solana"="mock-solana"
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:13236
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-GLbkPPho.d.ts:12601
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-GLbkPPho.d.ts:12602
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-GLbkPPho.d.ts:12603
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-GLbkPPho.d.ts:12608
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-GLbkPPho.d.ts:12614
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-GLbkPPho.d.ts:12644
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-GLbkPPho.d.ts:13252
Get the current Solana cluster
Returns
Section titled “Returns”connect()
Section titled “connect()”connect():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:13256
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-GLbkPPho.d.ts:13260
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-GLbkPPho.d.ts:13264
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-GLbkPPho.d.ts:13268
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-GLbkPPho.d.ts:13272
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-GLbkPPho.d.ts:13276
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-GLbkPPho.d.ts:13280
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-GLbkPPho.d.ts:13284
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-GLbkPPho.d.ts:13288
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-GLbkPPho.d.ts:13292
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-GLbkPPho.d.ts:13296
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-GLbkPPho.d.ts:13300
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-GLbkPPho.d.ts:13304
Clear transaction history
Returns
Section titled “Returns”void
simulateAccountChange()
Section titled “simulateAccountChange()”simulateAccountChange(
newAddress):void
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:13308
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-GLbkPPho.d.ts:13312
Simulate a disconnect event
Returns
Section titled “Returns”void