@secux/app-bnb
SecuX Hardware Wallet BNB API
Usage
import { SecuxBNB } from "@secux/app-bnb";
First, create instance of ITransport
Examples
- Get address of bip44 path
const address = await SecuxBNB.getAddress(device, "m/44'/714'/0'/0/0");
- Sign transaction
const { raw_tx, signature } = await SecuxBNB.signTransaction(
device,
path,
{
to: "bnb1rcxjc3a6va0ldwzerx2t58g3sz6ss6x7cglwyc",
amount: 1e18
},
{
chainId: "Binance-Chain-Tigris",
accountNumber: 0,
sequence: 0,
memo: ""
}
);
API doc
SecuxBNB
BNB package for SecuX device
Kind: global class
SecuxBNB.getAddress(trans, path) ⇒ string
Get BNB address derived by given BIP32 path
Kind: static method of SecuxBNB
Returns: string
- address
Param | Type | Description |
---|
trans | ITransport | |
path | string | BIP32 |
SecuxBNB.signTransaction(trans, path, content, [option]) ⇒ object
Create transaction and Sign
Kind: static method of SecuxBNB
Returns: object
- signed
string
- signed.raw_tx
Buffer
- signed.signature
Param | Type | Description |
---|
trans | ITransport | |
path | string | BIP32 |
content | txDetail | transaction content |
[option] | txOption | |