3.6.1 • Published 5 months ago

@secux/protocol-device v3.6.1

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
5 months ago

lerna view on npm npm module downloads

@secux/protocol-device

SecuX Hardware Wallet device protocol API

Usage

import { SecuxDevice } from "@secux/protocol-device";

First, create instance of ITransport

Examples

  1. Get version infomation of SecuX Hardware Wallet
const data = SecuxDevice.prepareGetVersion();
const response = await device.Exchange(data);
const info = SecuxDevice.resolveVersion(response);

console.log(info.transportVersion);
console.log(info.seFwVersion);
console.log(info.mcuFwVersion);
console.log(info.bootloaderVersion);
  1. Get wallet information of SecuX Hardware Wallet
const data = SecuxDevice.prepareGetWalletInfo();
const response = await device.Exchange(data);
const info = SecuxDevice.resolveWalletInfo(response);

console.log(info.walletName);
  1. Show address on SecuX Hardware Wallet
// show Bitcoin address, and need user confirm
const data = SecuxDevice.prepareShowAddress("m/44'/0'/0'/0/0", {
    needToConfirm: true,
    chainId: 0
});
const response = await device.Exchange(data);
SecuxDevice.resolveResponse(response);

// show Ethereum address without user confirmation
const data = SecuxDevice.prepareShowAddress("m/44'/60'/0'/0/0", {
    needToConfirm: false,
    chainId: 1
});
const response = await device.Exchange(data);
SecuxDevice.resolveResponse(response);

API Reference

SecuX protocol for device management

Kind: global class

SecuxDevice.prepareGetVersion() ⇒ communicationData

Get version information command.

Returns: communicationData - data for sending to device

SecuxDevice.resolveVersion(response) ⇒ VersionInfo

Resolve version information from device.

Returns: VersionInfo - object

ParamTypeDescription
responsecommunicationDatadata from device

SecuxDevice.prepareGetWalletInfo() ⇒ communicationData

Get wallet information command.

Returns: communicationData - data for sending to device

SecuxDevice.resolveWalletInfo(response) ⇒ WalletInfo

Resolve wallet information from device.

Returns: WalletInfo - object

ParamTypeDescription
responsecommunicationDatadata from device

SecuxDevice.prepareShowAddress(path, option) ⇒ communicationData

Show address command.

Returns: communicationData - data for sending to device

ParamTypeDescription
pathstringBIP32
optionAddressOption

SecuxDevice.resolveResponse(response)

Resolve response from device.

ParamTypeDescription
responsecommunicationDatadata from device

VersionInfo

Properties

NameType
transportVersionnumber
seFwVersionstring
mcuFwVersionstring
bootloaderVersionstring

WalletInfo

Properties

NameType
walletIndexnumber
walletNamestring
walletStatusnumber

© 2018-21 SecuX Technology Inc.

authors: andersonwu@secuxtech.com

3.6.1

5 months ago

3.6.0

8 months ago

3.5.0

10 months ago

3.4.0

11 months ago

3.3.1

11 months ago

3.3.0

1 year ago

3.4.1

11 months ago

3.2.0

1 year ago

3.1.0

2 years ago

3.0.6

2 years ago

3.0.4

2 years ago

3.0.5

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

2.1.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.1.1

3 years ago

2.0.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago