Ledger Hardware Wallet Conflux JavaScript bindings.
Conflux API
transport
TransportscrambleKey
(optional, default"conflux_default_scramble_key"
)
import Cfx from "@fluent-wallet/hw-app-conflux";
const cfx = new Cfx(transport)
get Conflux address for a given BIP 32 path.
cfx.getAddress("44'/503'/0'/0/0").then(o => o.publicKey)
Returns Promise<{publicKey: string, address: string, chainCode: string?}> an object with a publicKey, address and (optionally) chainCode
You can sign a transaction and retrieve v, r, s given the raw transaction and the BIP 32 path of the account to sign
cfx.signTransaction("44'/503'/0'/0/0", "0xeb1284561f61b9831e84809410109fc8df283027b6285cc889f5aa624eac1f55843b9aca0081800182040580").then(result => ...)
Returns Promise<{s: string, v: string, r: string}>
You can sign a message and retrieve v, r, s given the message and the BIP 32 path of the account to sign.
cfx.signPersonalMessage("44'/503'/0'/0/0", Buffer.from("test").toString("hex")).then(result => {
console.log(result);
})