3.0.10 • Published 11 months ago

@secux/js-sdk v3.0.10

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
11 months ago

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

3.0.10

11 months ago

3.0.9

1 year ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago