Library for Ledger Hardware Wallets.
- createTransportRecorder
- createTransportReplayer
- RecordStoreInvalidSynthax
- RecordStoreQueueEmpty
- RecordStoreWrongAPDU
- RecordStoreRemainingAPDU
- RecordStoreOptions
- RecordStore
decorate a real transport and proxy it to record the APDUs.
DecoratedTransport
Class<Transport<any>> : an actual transport class. Like @ledgerhq/hw-transport-webusbrecordStore
RecordStore : a record store to record the apdu in.
Returns Class<Transport<any>>
create a transport replayer with a record store.
recordStore
RecordStore
Returns Class<Transport<any>>
thrown by the RecordStore.fromString parser.
message
string
thrown by the replayer if the queue is empty
thrown by replayer if it meets an unexpected apdu
thrown by ensureQueueEmpty
expected
string
- autoSkipUnknownApdu: smart mechanism that would skip an apdu un-recognize to the next one that does this is meant to be used when you have refactored/dropped some APDUs it will produces warnings for you to fix the APDUs queue
- warning: allows to override the warning function (defaults to console.warn)
a RecordStore is a stateful object that represents a queue of APDUs. It is both used by replayer and recorder transports and is the basic for writing Ledger tests with a mock device.
queue
Queue??opts
$Shape<RecordStoreOptions>?
check if there is no more APDUs to replay
Record an APDU (used by createTransportRecorder)
Replay an APDU (used by createTransportReplayer)
apdu
Buffer
Returns Buffer
Check all APDUs was replayed. Throw if it's not the case.
Print out the series of apdus
Returns string
Create a RecordStore by parsing a string (a series of => HEX\n<= HEX)
str
stringopts
$Shape<RecordStoreOptions>series
string of APDUs
Returns RecordStore