0.0.1 • Published 2 years ago

@pontem/hw-app-aptos v0.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Aptos Hardware Wallet Example

Table of Contents

Parameters

  • transport Transport a transport for sending commands to a device
  • scrambleKey string a scramble key (optional, default "aptos")

Examples

import Aptos from "hw-app-aptos";
const aptos = new Aptos(transport);

getVersion

Get application version.

Examples
aptos.getVersion().then(r => r.version)

Returns Promise\ an object with the version field

getAddress

Get Aptos address (public key) for a BIP32 path.

Because Aptos uses Ed25519 keypairs, as per SLIP-0010 all derivation-path indexes will be promoted to hardened indexes.

Parameters
  • path string a BIP32 path
  • display boolean flag to show display (optional, default false)
Examples
aptos.getAddress("m/44'/637'/1'/0'/0'").then(r => r.address)

Returns Promise\ an object with publicKey, chainCode, address fields

signTransaction

Sign an Aptos transaction.

Parameters
  • path string a BIP32 path
  • txBuffer Buffer serialized transaction
Examples
aptos.signTransaction("m/44'/637'/1'/0'/0'", txBuffer).then(r => r.signature)

Returns Promise<{signature: Buffer}> an object with the signature field