zymkey-js
This repository is a Node.js wrapper of Zymbit's C++ API, intended to facilitate interactions between Node.js applications and Zymbit's hardware wallet.
Note: This is not an official Zymbit API, so it has not been robustly tested, and does not have a thorough documentation.
Table of Contents
Installation
Run the following command:
yarn add zymkey-js
or
npm i zymkey-js
Usage
const zkJS = require('zymkey-js/build/Release/zkAppUtilsJS.node')
const zymkey = new zkJS.zkObj()
zymkey.getTime()
Supported Functions
Here is the list of currently supported functions:
- getTime - Retrieve the current time from the secure RTC (Real-Time Clock) module.
- exportPubKey - Export the public key of a previously generated key pair.
- storeForeignPubKey - Store a foreign public key on the device.
- genKeyPair - Generate an asymmetric key pair (ECC or RSA) in the specified slot.
- genEphemeralKeyPair - Generate an ephemeral asymmetric key pair (ECC or RSA) in a specified slot.
- removeKey - Remove a key or key pair from the specified slot.
- invalidateEphemeralKey - Invalidate an ephemeral key pair, making it unusable.
- genECDSASigFromDigest - Generate an ECDSA signature for a given message digest using the specified private key.
- verifyECDSASigFromDigest - Verify an ECDSA signature for a given message digest using the specified public key.
- genWalletMasterSeedWithBIP39 - Generate a hierarchical deterministic wallet master seed using the BIP39 mnemonic scheme.
- genWalletMasterSeedWithSLIP39 - Generate a hierarchical deterministic wallet master seed using the SLIP39 mnemonic scheme.
- setGenSLIP39GroupInfo - Set the group information for generating SLIP39 mnemonics.
- addGenSLIP39Member - Add a member to a group for generating SLIP39 mnemonics.
- cancelSLIP39Session - Cancel an ongoing SLIP39 generation or restoration session.
- genOverSightWallet - Generate an oversight wallet for monitoring and controlling wallet functions.
- genWalletChildKey - Derive a child key from the wallet master seed using a specified derivation path.
- restoreWalletMasterSeedFromBIP39 - Restore a hierarchical deterministic wallet master seed from a BIP39 mnemonic.
- restoreWalletMasterSeedFromSLIP39 - Restore a hierarchical deterministic wallet master seed from a SLIP39 mnemonic.
- addRestoreSLIP39Mnemonic - Add a mnemonic to the restoration session for SLIP39-based wallets.
- getWalletNodeAddrFromKeySlot - Retrieve the wallet node address associated with a specific key slot.
- getWalletKeySlotFromNodeAddr - Retrieve the key slot associated with a specific wallet node address.
- getAllocSlotsList - Get a list of allocated key slots, showing their types and attributes.
Resources
In order to understand how to call these functions and the return values of each function, refer to Zymbit's C++ Documentation.