@kazeblockchain/krypton-js
Version:
Javascript libraries for kaze wallet using https://github.com/kazechainio/kazewallet/blob/master/js/wallet.js as the original source.
44 lines (35 loc) • 1.44 kB
TypeScript
import { ScryptParams } from './core';
export interface AccountLike {
address: string
label: string
isDefault: boolean
lock: boolean
key: string
contract: object | null
extra: object
}
/**
* This allows for simple utilisation and manipulating of keys without need the long access methods.
* Key formats are derived from each other lazily and stored for future access.
* If the previous key (one level higher) is not found, it will attempt to generate it or throw an Error if insufficient information was provided (eg. trying to generate private key when only address was given.)
* KEP2 <=> WIF <=> Private => Public => ScriptHash <=> Address
*/
export class Account {
constructor(str?: string|object)
encrypted: string
WIF: string
privateKey: string
publicKey: string
scriptHash: string
address: string
/** Create a multi-sig account from a list of public keys */
static createMultiSig(signingThreshold: number, publicKeys: string[]): Account
/** Retrieves the Public Key in encoded / unencoded form. */
getPublicKey(encoded: boolean): string
/** Encrypts the current privateKey and return the Account object. */
encrypt(keyphrase: string, scryptParams?: ScryptParams): Account
/** Decrypts the encrypted key and return the Account object. */
decrypt(keyphrase: string, scryptParams?: ScryptParams): Account
/** Export Account as a AccountLike object. */
export(): AccountLike
}