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.
Methods
Section titled “Methods”entries()
Section titled “entries()”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.
Parameters
Section titled “Parameters”chain?
Section titled “chain?”string
address?
Section titled “address?”string
Returns
Section titled “Returns”isExposed()
Section titled “isExposed()”isExposed(
chain,address):boolean
Defined in: ledger.ts:81
Has the key behind address been exposed, as far as this ledger knows?
Parameters
Section titled “Parameters”string
address
Section titled “address”string
Returns
Section titled “Returns”boolean
record()
Section titled “record()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
load()
Section titled “load()”
staticload(storage?):Promise<ExposureLedger>
Defined in: ledger.ts:54
Read the ledger from storage, or start an in-memory one.
Parameters
Section titled “Parameters”storage?
Section titled “storage?”Returns
Section titled “Returns”Promise<ExposureLedger>