transport class.
lets you specify the chunkSize for each communication.
DO not change if you don't know what you're doing.
Raw exchange protocol handling. It's exposed but it is meant for internal usage only.
Raw response buffers.
Retrieves a publicKey associated to an account
or bip32 buffer
ask ledger to show the address.
}
Simple ping utility. It won't throw if ping suceeded.
Signs a message. The message can be passed as a string or buffer. Note that if buffer contains "non-printable" characters, then the ledger will probably have some issues Displaying the message to the user.
or raw bip32 buffer
the message to sign
the "non-detached" signature. Signature goodness can be verified using sodium. See tests.
Signs a transaction. Transaction must be provided as a buffer using getBytes.
or raw bip32 buffer
buffer containing the bytes of a transaction
use true if the tx also includes a requesterPublicKey. This cannot be derived using static analysis of the content included in the bytes.
signature.
Gets Ledger App Version
see example
Communication Protocol class.
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid'; import { DposLedger, LedgerAccount } from 'dpos-ledger-ts'; const account = new LedgerAccount(); TransportNodeHid.create() .then((transport) => new DposLedger(transport)) .then((instance) => instance.getPubKey(account)); .then(({publicKey}) => console.log(`pubKey: ${publicKey}`);