πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Sign inDemoInstall
Socket

@secux/app-bnb

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@secux/app-bnb

SecuX Hardware Wallet BNB API

3.0.3
latest
npm
Version published
Weekly downloads
2
100%
Maintainers
2
Weekly downloads
Β 
Created
Source

lerna view on npm npm module downloads

@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 path = "m/44'/714'/0'/0/0";
const address = await device.getAddress(path);

/*

// transfer data to hardware wallet by custom transport layer
const data = SecuxBNB.prepareAddress(path);
const response = await device.Exchange(data);
const address = SecuxBNB.resolveAddress(response);

*/
  • Sign transaction
const { raw_tx, signature } = await deivce.sign(
"m/44'/714'/0'/0/0",
{
to: "bnb17jr3n9xaxm92fp5dznuazql2c2x6ypw2gvuvmy",
amount: 1e18
}
);

/*

// transfer data to hardware wallet by custom transport layer
const data = SecuxBNB.prepareSign(
"m/44'/714'/0'/0/0",
{
from: "bnb1rcxjc3a6va0ldwzerx2t58g3sz6ss6x7cglwyc",
to: "bnb17jr3n9xaxm92fp5dznuazql2c2x6ypw2gvuvmy",
amount: 1e18
}
);

*/

API Reference

BNB package for SecuX device

Kind: global class


SecuxBNB.prepareAddress β‡’ communicationData

Prepare data for address generation.

Returns: communicationData - data for sending to device

ParamTypeDescription
pathstringm/44'/714'/...

SecuxBNB.addressConvert(publickey) β‡’ string

Convert secp256k1 publickey to BNB address.

Returns: string - BNB address

ParamTypeDescription
publickeystring | Buffersecp256k1 publickey

SecuxBNB.resolveAddress(response) β‡’ string

Generate address from response data.

Returns: string - BNB address

ParamTypeDescription
responsecommunicationDatadata from device

SecuxBNB.preparePublickey(path) β‡’ communicationData

Prepare data for secp256k1 publickey.

Returns: communicationData - data for sending to device

ParamTypeDescription
pathstringm/44'/714'/...

SecuxBNB.resolvePublickey(response) β‡’ string

Resolve secp256k1 publickey from response data.

Returns: string - secp256k1 publickey (hex string)

ParamTypeDescription
responsecommunicationDatadata from device

SecuxBNB.prepareXPublickey(path) β‡’ communicationData

Prepare data for xpub.

Returns: communicationData - data for sending to device

ParamTypeDescription
pathstringm/44'/714'/...

SecuxBNB.resolveXPublickey(response, path) β‡’ string

Resolve xpub from response data.

Returns: string - xpub

ParamTypeDescription
responsecommunicationDatadata from device
pathstringm/44'/714'/...

SecuxBNB.prepareSign(path, content) β‡’ prepared

Prepare data for signing.

Returns: prepared - return object

ParamTypeDescription
pathstringm/44'/714'/...
contenttxDetailtransaction object

SecuxBNB.resolveSignature(response) β‡’ string

Resolve signature from response data

Returns: string - signature (hex string)

ParamTypeDescription
responsecommunicationDatadata from device

SecuxBNB.resolveTransaction(response, serialized) β‡’ string

Resolve raw transaction for broadcasting

Returns: string - signed raw transaction

ParamTypeDescription
responsecommunicationDatadata from device
serializedcommunicationData


txDetail

Properties

NameTypeDescription
publickeystring | Buffersender's publickey
tostringreceiving address
amountnumberBNB has 8 decimals
[chainId]stringuse specific BNB network
[accountNumber]numberfor replay protection
[sequence]numberfor replay protection
[memo]string

prepared

Properties

NameTypeDescription
commandDatacommunicationDatadata for sending to device
serializedcommunicationData

Β© 2018-21 SecuX Technology Inc.

authors:
andersonwu@secuxtech.com

Keywords

secux

FAQs

Package last updated on 13 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts