Skip to content

Latest commit

 

History

History
63 lines (51 loc) · 1.04 KB

ethereum.md

File metadata and controls

63 lines (51 loc) · 1.04 KB

API of Ethereum Wallet

Usage

const ethWallet = require('jcc_wallet').ethWallet
// import { ethWallet } from 'jcc_wallet'

isValidAddress

/**
 * check eth address is valid or not
 *
 * @param {string} address
 * @returns {boolean} return true if valid
 */

isValidSecret

/**
 * check eth secret is valid or not
 *
 * @param {string} secret
 * @returns {boolean} return true if valid
 */

getAddress

/**
 * get eth address with secret
 * @param {string} secret
 * @returns {string | null} return address if valid, otherwise return null
 */

decryptKeystore

/**
 * retrive ethereum keystore with ethereum password
 *
 * @param {string} password
 * @param {*} encryptData
 * @returns {string} return secret if success, otherwise throws `keystore is invalid` if the keystore is invalid or
 * throws `ethereum password is wrong` if the password is wrong
 */

createWallet

/**
 * create ethereum wallet
 *
 * @returns {IWalletModel}
 */