Ledger Hardware Wallet XTZ JavaScript bindings.
Tezos API
-
transport
Transport<any> -
scrambleKey
string (optional, default"XTZ"
)
import LedgerXTZ from "hw-app-xtz";
const xtz = new LedgerXTZ(transport);
get Tezos address for a given BIP 32 path.
-
path
string a path in BIP 32 format -
display
boolean? optionally enable or not the display -
curve
number? optional, the curve to use [ed25519 = 0x00, secp256k1 = 0x01, p256 = 0x02]ed25519 is the default
const result = await xtz.getAddress("44'/1729'/0'/0'");
const { publicKey, address } = result;
Returns Promise<{publicKey: string, address: string}> an object with a publicKey and address
sign a Tezos operation with a given BIP 32 path
-
path
string a path in BIP 32 format -
rawBytesHex
string a raw hex string of the bytes to sign -
curve
number? optional, the curve to use [ed25519 = 0x00, secp256k1 = 0x01, p256 = 0x02]ed25519 is the default
const signature = await xtz.signTransaction("44'/1729'/0'/0'", "some bytes");
Returns Promise<string> a signature as hex string
get the version of the Tezos app installed on the hardware device
const result = await xtz.getAppConfiguration();
{
"version": "2.0.1"
}