Skip to content

MockLedgerAdapter

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / MockLedgerAdapter

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:14976

Mock Ledger adapter for testing

new MockLedgerAdapter(config): MockLedgerAdapter

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:14984

MockHardwareConfig

MockLedgerAdapter

BaseWalletAdapter.constructor

readonly chain: ChainId

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:14977

Chain this adapter connects to

BaseWalletAdapter.chain


readonly name: string

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:14978

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

BaseWalletAdapter.name

get address(): string

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:12528

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-DXh2IGkz.d.ts:12529

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-DXh2IGkz.d.ts:12530

Current connection state

WalletConnectionState

Current connection state

BaseWalletAdapter.connectionState


get deviceInfo(): HardwareDeviceInfo | null

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:14988

Get device information

HardwareDeviceInfo | null


get derivationPath(): string

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:14992

Get current derivation path

string


get account(): HardwareAccount | null

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:14996

Get current account

HardwareAccount | null

on<T>(event, handler): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:12535

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-DXh2IGkz.d.ts:12541

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-DXh2IGkz.d.ts:12571

Check if wallet is connected

boolean

BaseWalletAdapter.isConnected


connect(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15000

Connect to mock Ledger device

Promise<void>

BaseWalletAdapter.connect


disconnect(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15004

Disconnect from mock device

Promise<void>

BaseWalletAdapter.disconnect


signMessage(message): Promise<Signature>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15008

Sign a message

Uint8Array

Promise<Signature>

BaseWalletAdapter.signMessage


signTransaction(tx): Promise<SignedTransaction>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15012

Sign a transaction

UnsignedTransaction

Promise<SignedTransaction>

BaseWalletAdapter.signTransaction


signAndSendTransaction(tx): Promise<TransactionReceipt>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15016

Sign and send transaction

UnsignedTransaction

Promise<TransactionReceipt>

BaseWalletAdapter.signAndSendTransaction


getBalance(): Promise<bigint>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15020

Get balance (not supported by hardware wallets)

Promise<bigint>

BaseWalletAdapter.getBalance


getTokenBalance(_asset): Promise<bigint>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15024

Get token balance (not supported by hardware wallets)

Asset

Promise<bigint>

BaseWalletAdapter.getTokenBalance


getAccounts(startIndex?, count?): Promise<HardwareAccount[]>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15028

Get multiple accounts

number

number

Promise<HardwareAccount[]>


switchAccount(accountIndex): Promise<HardwareAccount>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15032

Switch account

number

Promise<HardwareAccount>


setShouldReject(shouldReject): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15036

Set whether device should reject signing

boolean

void


setSigningDelay(delay): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15040

Set signing delay

number

void


simulateLock(): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15044

Simulate device lock

void


simulateUnlock(): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15048

Simulate device unlock

void