Module: trezor

Provides classes for interacting with Trezor hardware wallets.

The base class provided is TrezorInteraction which wraps calls to TrezorConnect. New interactions should subclass TrezorInteraction.

Many Trezor calls require knowing the bitcoin network. This library uses the API defined by unchained-bitcoin to label bitcoin networks, and this is the value expected in several off the constructors for classes in this module.

The value of the network is mapped internally to this.trezorCoin. This value is useful to subclasses implementing the params() method as many TrezorConnect methods require the coin parameter.

The following API classes are implemented:

  • TrezorGetMetadata
  • TrezorExportPublicKey
  • TrezorExportExtendedPublicKey
  • TrezorSignMultisigTransaction
  • TrezorConfirmMultisigAddress
Source:

Classes

TrezorConfirmMultisigAddress
TrezorExportExtendedPublicKey
TrezorExportHDNode
TrezorExportPublicKey
TrezorGetMetadata
TrezorInteraction
TrezorSignMultisigTransaction

Members

(static, constant) TREZOR :string

Constant defining Trezor interactions.

Type:
  • string
Default Value:
  • trezor
Source:

(static, constant) TREZOR_BOTH_BUTTONS :string

Constant representing the action of pushing both buttons on a Trezor device.

Type:
  • string
Default Value:
  • 'trezor_both_buttons'
Source:

(static, constant) TREZOR_LEFT_BUTTON :string

Constant representing the action of pushing the left button on a Trezor device.

Type:
  • string
Default Value:
  • 'trezor_left_button'
Source:

(static, constant) TREZOR_PUSH_AND_HOLD_BUTTON :string

Constant representing the action of pushing and holding the Confirm button on a Trezor model T device.

Type:
  • string
Default Value:
  • 'trezor_push_and_hold_button'
Source:

(static, constant) TREZOR_RIGHT_BUTTON :string

Constant representing the action of pushing the right button on a Trezor device.

Type:
  • string
Default Value:
  • 'trezor_right_button'
Source:

Methods

(static) trezorCoin(network) → {string}

Returns the Trezor API version of the given network.

Parameters:
Name Type Description
network string

bitcoin network

Source:
Returns:

Trezor API spelling for this network

Type
string