npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ledgerhq/hw-app-trx

v6.29.4

Published

Ledger Hardware Wallet Tron Application API

Downloads

59,003

Readme

GitHub, Ledger Devs Discord, Developer Portal

@ledgerhq/hw-app-trx

Ledger Hardware Wallet TRX JavaScript bindings.


Are you adding Ledger support to your software wallet?

You may be using this package to communicate with the TRX Nano App.

For a smooth and quick integration:

  • See the developers’ documentation on the Developer Portal and
  • Go on Discord to chat with developer support and the developer community.

API

Table of Contents

Trx

Tron API

Parameters

  • transport Transport
  • scrambleKey (optional, default "TRX")

Examples

import Trx from "@ledgerhq/hw-app-trx";
const trx = new Trx(transport)

getAddress

get Tron address for a given BIP 32 path.

Parameters
Examples
const address = await tron.getAddress("44'/195'/0'/0/0").then(o => o.address)

Returns Promise<{publicKey: string, address: string}> an object with a publicKey and address

signTransaction

sign a Tron transaction with a given BIP 32 path and Token Names

Parameters
  • path string a path in BIP 32 format
  • rawTxHex string a raw transaction hex string
  • tokenSignatures Array<string> Tokens Signatures array
Examples
const signature = await tron.signTransaction("44'/195'/0'/0/0", "0a02f5942208704dda506d59dceb40f0f4978f802e5a69080112650a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412340a1541978dbd103cfe59c35e753d09dd44ae1ae64621c7121541e2ae49db6a70b9b4757d2137a43b69b24a445780188ef8b5ba0470cbb5948f802e", [], 105);

Returns Promise<string> a signature as hex string

signTransactionHash

sign a Tron transaction hash with a given BIP 32 path

Parameters
  • path string a path in BIP 32 format
  • rawTxHashHex string
  • rawTxHex a raw transaction hex string
Examples
const signature = await tron.signTransactionHash("44'/195'/0'/0/0", "25b18a55f86afb10e7aca38d0073d04c80397c6636069193953fdefaea0b8369");

Returns Promise<string> a signature as hex string

getAppConfiguration

get the version of the Tron app installed on the hardware device

Examples
const result = await tron.getAppConfiguration();
{
  "version": "0.1.5",
  "versionN": "105".
  "allowData": false,
  "allowContract": false,
  "truncateAddress": false,
  "signByHash": false
}

Returns Promise<{allowContract: boolean, truncateAddress: boolean, allowData: boolean, signByHash: boolean, version: string, versionN: number}> an object with a version

signPersonalMessage

sign a Tron Message with a given BIP 32 path

Parameters
  • path string a path in BIP 32 format
  • messageHex string
  • message hex string to sign
Examples
const signature = await tron.signPersonalMessage("44'/195'/0'/0/0", "43727970746f436861696e2d54726f6e5352204c6564676572205472616e73616374696f6e73205465737473");

Returns Promise<string> a signature as hex string

signTIP712HashedMessage

Sign a typed data. The host computes the domain separator and hashStruct(message)

Parameters
Examples
const signature = await tronApp.signTIP712HashedMessage("44'/195'/0'/0/0",Buffer.from( "0101010101010101010101010101010101010101010101010101010101010101").toString("hex"), Buffer.from("0202020202020202020202020202020202020202020202020202020202020202").toString("hex"));

getECDHPairKey

get Tron address for a given BIP 32 path.

Parameters
  • path string a path in BIP 32 format
  • publicKey string address public key to generate pair key
Examples
const signature = await tron.getECDHPairKey("44'/195'/0'/0/0", "04ff21f8e64d3a3c0198edfbb7afdc79be959432e92e2f8a1984bb436a414b8edcec0345aad0c1bf7da04fd036dd7f9f617e30669224283d950fab9dd84831dc83");

Returns Promise<string> shared key hex string,