@ledgerhq/hw-app-icon
v1.1.2
Published
Ledger Hardware Wallet ICON Application API
Downloads
340
Readme
@ledgerhq/hw-app-icon
Ledger Hardware Wallet Icon JavaScript bindings.
API
Table of Contents
Icx
ICON API
Parameters
transport
Transport
Examples
import Icx from "@ledgerhq/hw-app-icx";
const icx = new Icx(transport)
getAddress
Returns public key and ICON address for a given BIP 32 path.
Parameters
path
string a path in BIP 32 formatboolDisplay
(optional, defaultfalse
)boolChaincode
(optional, defaulttrue
)
Examples
icx.getAddress("44'/4801368'/0'", true, true).then(o => o.address)
Returns Promise<{publicKey: string, address: string, chainCode: string?}> an object with a publickey(hexa string), address(string) and (optionally) chaincode(hexa string)
signTransaction
Signs a transaction and returns signed message given the raw transaction and the BIP 32 path of the account to sign
Parameters
path
string a path in BIP 32 formatrawTxAscii
string raw transaction data to sign in ASCII string format
Examples
icx.signTransaction("44'/4801368'/0'",
"icx_sendTransaction.fee.0x2386f26fc10000." +
"from.hxc9ecad30b05a0650a337452fce031e0c60eacc3a.nonce.0x3." +
"to.hx4c5101add2caa6a920420cf951f7dd7c7df6ca24.value.0xde0b6b3a7640000")
.then(result => ...)
Returns Promise<{signedRawTxBase64: string, hashHex: string}> an object with a base64 encoded signature and hash in hexa string
getAppConfiguration
Returns the application configurations such as versions.
Returns Promise<{majorVersion: number, minorVersion: number, patchVersion: number}> major/minor/patch versions of Icon application