@ledgerhq/hw-transport-mocker
Ledger Hardware Wallet mocker utilities used for tests
Last updated 5 days ago by gre .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ledgerhq/hw-transport-mocker 
SYNC missed versions from official npm registry.

@ledgerhq/hw-transport-mocker

Library for Ledger Hardware Wallets.

Github, Ledger Devs Slack

API

Table of Contents

createTransportRecorder

decorate a real transport and proxy it to record the APDUs.

Parameters

  • DecoratedTransport Class<Transport<any>> : an actual transport class. Like @ledgerhq/hw-transport-webusb
  • recordStore RecordStore : a record store to record the apdu in.

Returns Class<Transport<any>>

createTransportReplayer

create a transport replayer with a record store.

Parameters

Returns Class<Transport<any>>

RecordStoreInvalidSynthax

thrown by the RecordStore.fromString parser.

Parameters

RecordStoreQueueEmpty

thrown by the replayer if the queue is empty

RecordStoreWrongAPDU

thrown by replayer if it meets an unexpected apdu

Parameters

RecordStoreRemainingAPDU

thrown by ensureQueueEmpty

Parameters

RecordStoreOptions

  • 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)

Type: {autoSkipUnknownApdu: boolean, warning: function (string): void}

Properties

RecordStore

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.

Parameters

isEmpty

check if there is no more APDUs to replay

recordExchange

Record an APDU (used by createTransportRecorder)

Parameters

replayExchange

Replay an APDU (used by createTransportReplayer)

Parameters

Returns Buffer

ensureQueueEmpty

Check all APDUs was replayed. Throw if it's not the case.

toString

Print out the series of apdus

Returns string

fromString

Create a RecordStore by parsing a string (a series of => HEX\n<= HEX)

Parameters

Returns RecordStore

Current Tags

  • 5.1.1-alpha.2                                ...           canary (8 months ago)
  • 5.22.0                                ...           latest (5 days ago)

141 Versions

  • 5.22.0                                ...           5 days ago
  • 5.21.0                                ...           16 days ago
  • 5.19.1                                ...           a month ago
  • 5.19.0                                ...           a month ago
  • 5.17.0                                ...           2 months ago
  • 5.15.0                                ...           3 months ago
  • 5.13.1                                ...           4 months ago
  • 5.13.0                                ...           4 months ago
  • 5.12.0                                ...           5 months ago
  • 5.11.0                                ...           5 months ago
  • 5.9.0                                ...           6 months ago
  • 5.8.0                                ...           6 months ago
  • 5.7.0                                ...           7 months ago
  • 5.6.0                                ...           7 months ago
  • 5.5.0                                ...           7 months ago
  • 5.3.0                                ...           7 months ago
  • 5.2.0                                ...           8 months ago
  • 5.1.1-alpha.2                                ...           8 months ago
  • 5.0.0                                ...           8 months ago
  • 5.0.0-rc.4                                ...           8 months ago
  • 5.0.0-babel7.4                                ...           8 months ago
  • 4.78.0                                ...           9 months ago
  • 5.0.0-babel7.3                                ...           9 months ago
  • 5.0.0-babel7.1                                ...           9 months ago
  • 4.77.0                                ...           9 months ago
  • 5.0.0-alpha.7                                ...           9 months ago
  • 4.74.3-alpha.6                                ...           9 months ago
  • 5.0.0-alpha.5                                ...           9 months ago
  • 5.0.0-alpha.4                                ...           9 months ago
  • 5.0.0-alpha.3                                ...           9 months ago
  • 4.74.2                                ...           9 months ago
  • 4.74.1                                ...           9 months ago
  • 4.74.0                                ...           9 months ago
  • 4.73.7                                ...           9 months ago
  • 4.73.5                                ...           9 months ago
  • 4.73.4                                ...           10 months ago
  • 4.73.3                                ...           10 months ago
  • 4.73.2                                ...           10 months ago
  • 4.73.1                                ...           10 months ago
  • 4.72.2                                ...           10 months ago
  • 4.72.1                                ...           10 months ago
  • 4.72.0                                ...           10 months ago
  • 4.71.0                                ...           10 months ago
  • 4.70.3                                ...           10 months ago
  • 4.70.2                                ...           10 months ago
  • 4.70.0                                ...           a year ago
  • 4.68.4                                ...           a year ago
  • 4.68.2                                ...           a year ago
  • 4.68.0                                ...           a year ago
  • 4.66.0                                ...           a year ago
  • 4.64.1                                ...           a year ago
  • 4.64.0                                ...           a year ago
  • 4.63.2                                ...           a year ago
  • 4.63.1                                ...           a year ago
  • 4.62.0                                ...           a year ago
  • 4.61.0                                ...           a year ago
  • 4.60.3                                ...           a year ago
  • 4.60.2                                ...           a year ago
  • 4.60.0                                ...           a year ago
  • 4.59.1-alpha.2                                ...           a year ago
  • 4.58.0                                ...           a year ago
  • 4.57.0                                ...           a year ago
  • 4.14.0-alpha.6c128343                                ...           a year ago
  • 4.56.0                                ...           a year ago
  • 4.55.1-alpha.2                                ...           a year ago
  • 4.55.0                                ...           a year ago
  • 4.54.0                                ...           a year ago
  • 4.53.0                                ...           a year ago
  • 4.52.2                                ...           a year ago
  • 4.52.1                                ...           a year ago
  • 4.52.0                                ...           a year ago
  • 4.51.2                                ...           a year ago
  • 4.51.0                                ...           a year ago
  • 4.50.0                                ...           a year ago
  • 4.48.0                                ...           a year ago
  • 4.47.0                                ...           a year ago
  • 4.46.0                                ...           a year ago
  • 4.45.0                                ...           a year ago
  • 4.44.2                                ...           a year ago
  • 4.44.0                                ...           a year ago
  • 4.43.1-alpha.0                                ...           a year ago
  • 4.43.0                                ...           a year ago
  • 4.41.1                                ...           a year ago
  • 4.39.0                                ...           2 years ago
  • 4.38.6                                ...           2 years ago
  • 4.38.0                                ...           2 years ago
  • 4.36.2                                ...           2 years ago
  • 4.37.0                                ...           2 years ago
  • 4.35.1-beta.28                                ...           2 years ago
  • 4.37.0-beta.2b8718d2                                ...           2 years ago
  • 4.35.0                                ...           2 years ago
  • 4.32.0                                ...           2 years ago
  • 4.28.0-beta.927e2da4                                ...           2 years ago
  • 4.26.0-beta.33b393bd                                ...           2 years ago
  • 4.26.0-beta.0a38903c                                ...           2 years ago
  • 4.26.0-beta.ecce9a72                                ...           2 years ago
  • 4.26.0-beta.61c8ac0d                                ...           2 years ago
  • 4.26.0-beta.65ce4393                                ...           2 years ago
  • 4.26.0-beta.9614a692                                ...           2 years ago
  • 4.26.0-beta.ad904ce3                                ...           2 years ago
  • 4.26.0-beta.ebeb3540                                ...           2 years ago
  • 4.24.0                                ...           2 years ago
  • 4.24.0-beta.aeaefa0e                                ...           2 years ago
  • 4.22.0-beta.a1987cb3                                ...           2 years ago
  • 4.22.0-beta.96c1e355                                ...           2 years ago
  • 4.22.0-beta.ae6f5c51                                ...           2 years ago
  • 4.21.0                                ...           2 years ago
  • 4.21.0-beta.9cf3bfae                                ...           2 years ago
  • 4.21.0-beta.12bfb9a2                                ...           2 years ago
  • 4.19.0                                ...           2 years ago
  • 4.15.0                                ...           2 years ago
  • 4.13.0                                ...           2 years ago
  • 4.12.0-beta.b14e7f27                                ...           2 years ago
  • 4.12.0-beta.87012289                                ...           2 years ago
  • 4.12.0-beta.a4c9b217                                ...           2 years ago
  • 4.12.0-beta.7be0b960                                ...           2 years ago
  • 4.12.0-beta.e285238a                                ...           2 years ago
  • 4.12.0-beta.a9ddcef0                                ...           2 years ago
  • 4.12.0                                ...           2 years ago
  • 4.12.0-beta.fd04ab6f                                ...           2 years ago
  • 4.7.3                                ...           2 years ago
  • 4.8.0-rc1.1b178f67                                ...           2 years ago
  • 4.8.0-beta.1b178f67                                ...           2 years ago
  • 4.8.0-beta.b178a6cf                                ...           2 years ago
  • 4.8.0-beta.37537633                                ...           2 years ago
  • 4.7.0                                ...           2 years ago
  • 4.6.0                                ...           2 years ago
  • 4.6.0-beta.4dd99136                                ...           2 years ago
  • 4.6.0-beta.5109e524                                ...           2 years ago
  • 4.3.0                                ...           2 years ago
  • 4.3.0-beta.f8165b69                                ...           2 years ago
  • 4.3.0-beta.bff98635                                ...           2 years ago
  • 4.3.0-beta.4bae85a3                                ...           2 years ago
  • 4.3.0-beta.42bb5526                                ...           2 years ago
  • 4.3.0-beta.c3ce76cd                                ...           2 years ago
  • 4.3.0-beta.954e9e07                                ...           2 years ago
  • 4.3.0-beta.589ba3c6                                ...           2 years ago
  • 4.3.0-beta.79913151                                ...           2 years ago
  • 4.3.0-beta.d226ed3b                                ...           2 years ago
  • 4.2.0                                ...           2 years ago
  • 4.0.0                                ...           3 years ago

Copyright 2014 - 2016 © taobao.org |