@secux/js-sdk

3.0.10 • Public • Published

lerna view on npm npm module downloads

@secux/js-sdk

A JavaScript library for SecuX hardware wallet

Installation

npm install @secux/js-sdk

Getting Started

If you are using javascript projecct, here are packages for connecting to SecuX harware wallet:

If not, please refer to our develop portal for integrating with other programming languages. (comming soon)

Examples (using usb)

Example for connecting SecuX hardware wallet by usb:

import { SecuxWebUSB } from "@secux/transport-webusb";
require("secux-sdk");


const device = await SecuxWebUSB.Create(
    () => console.log("connected"),
    () => console.log("disconnected")
);
await device.Connect();
  • Get address by BIP32 path.

    // BTC native segwit address
    const address = await device.getAddress("m/84'/0'/0'/0/0");
    // ETH address
    const address = await device.getAddress("m/44'/60'/0'/0/0");
  • Get extended publickey by BIP32 path. (support xpub, ypub, zpub)

    const xpub = await device.getXPublickey("m/84'/0'/0'/0/0");
  • Signing.

    // for ETH EIP-1559
    const { raw_tx, signature } = await device.sign(
        "m/44'/60'/0'/0/0",
        {
            nonce: 0,
            to: "0xD080156885651fADbD6df14145051b934660a748",
            value: 1e10,
            chainId: 1,
            maxPriorityFeePerGas: 1e4,
            maxFeePerGas: 1e6,
            gasLimit: 25000
        }
    );

Modules API Reference

Please refer to related blockchain api for use.


© 2018-22 SecuX Technology Inc.

authors:
andersonwu@secuxtech.com

Package Sidebar

Install

npm i @secux/js-sdk

Weekly Downloads

0

Version

3.0.10

License

Apache-2.0

Unpacked Size

2.66 MB

Total Files

9

Last publish

Collaborators

  • rus7hex