Huge News!Announcing our $40M Series B led by Abstract Ventures.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.1
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by200%
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

  1. 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);

*/
  1. 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

FAQs

Package last updated on 11 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc