Skip to content
docs

ExposureLedger

Defined in: ledger.ts:38

What this device knows about exposed keys. The chain shows transactions; only the wallet knows about off-chain signatures, so an address with nonce 0 can still be exposed. Every signature that goes through bunkerPolicies is written here BEFORE the wallet signs: a crash between signing and broadcast leaves the key marked exposed, never the other way round.

entries(chain?, address?): ExposureEntry[]

Defined in: ledger.ts:86

The events of one key, oldest first (one per reason); all events when no account is given.

string

string

ExposureEntry[]


isExposed(chain, address): boolean

Defined in: ledger.ts:81

Has the key behind address been exposed, as far as this ledger knows?

string

string

boolean


record(entry): Promise<void>

Defined in: ledger.ts:65

Record an event and persist it. Resolves only once it is stored; rejects when the storage does, with the event still known in memory.

One entry is kept per key and reason, the earliest: exposure is permanent, and a busy account would otherwise grow the ledger with every transaction it sends.

ExposureEntry

Promise<void>


static load(storage?): Promise<ExposureLedger>

Defined in: ledger.ts:54

Read the ledger from storage, or start an in-memory one.

LedgerStorage

Promise<ExposureLedger>