Creates a new signing key from a mnemonic phrase. If no mnemonic is provided, one will be automatically generated.
import { MnemonicKey } from 'terra.js';
const mk = new MnemonicKey({ mnemonic: '...' });
console.log(mk.accAddress);
const mk2 = new MnemonicKey();
console.log(mk2.mnemonic);
Space-separated mnemonic phrase.
Raw private key, in bytes.
Terra account address. terra-
prefixed.
Terra validator address. terravaloper-
prefixed.
Signs a SignDoc with the method supplied by the child class.
Signs a [[StdSignMsg]] with the method supplied by the child class. only used Amino sign
sign-message of the transaction to sign
You will need to supply sign
, which produces a signature for an arbitrary bytes payload
with the ECDSA curve secp256pk1.
Signs a Tx and adds the signature to a generated StdTx that is ready to be broadcasted.
Implements a BIP39 mnemonic wallet with standard key derivation from a word list. Note that this implementation exposes the private key in memory, so it is not advised to use for applications requiring high security.