ledger-xtz
v2.0.0
Published
Ledger Hardware Wallet Tezos Application API
Downloads
12
Readme
Ledger Hardware Wallet XTZ JavaScript bindings.
Install
npm i --save ledger-xtz
yarn add ledger-xtz
Examples
import LedgerXTZ from "ledger-xtz";
const xtz = new LedgerXTZ();
xtz.getAddress("44h/1729h/0h/0h", true, 0x00);
getAddress
get Tezos address for a given BIP 32 path.
Parameters
path
string a path in BIP 32 formatdisplay
boolean? optionally enable or not the displaycurve
number? optional, the curve to use [ed25519 = 0x00, secp256k1 = 0x01, p256 = 0x02]ed25519 is the default
Examples
// Get ed25519 address
const result = await xtz.getAddress("44h/1729h/0h/0h", true, 0x00);
const { publicKey, pkh } = result;
signOperation
Sign a Tezos operation with a given BIP 32 path
Parameters
path
string a path in BIP 32 formatrawOpHex
string a raw hex string of the bytes to signcurve
number? optional, the curve to use [ed25519 = 0x00, secp256k1 = 0x01, p256 = 0x02]ed25519 is the default
Examples
const result = await xtz.signOperation("44'/1729'/0'/0'", "0x...<some bytes>...");
const { signature, encodedSignature, blake2bHash } = result;
getAppInformation
Get the version of the Tezos app installed on the hardware device
Examples
const result = await xtz.getAppInformation();
const { version } = result;