Expose Secp256k1Wallet

This commit is contained in:
Simon Warta
2020-10-27 14:37:37 +01:00
parent 0091d9a684
commit 850dbd11db
4 changed files with 9 additions and 0 deletions
+5
View File
@@ -117,6 +117,7 @@ export async function main(originalArgs: readonly string[]): Promise<void> {
"PubKey",
"pubkeyToAddress",
"Secp256k1HdWallet",
"Secp256k1Wallet",
"SigningCosmosClient",
"StdFee",
"StdSignDoc",
@@ -162,6 +163,10 @@ export async function main(originalArgs: readonly string[]): Promise<void> {
assert(Decimal.fromAtomics("12870000", 6).toString() === "12.87");
const oneKeyWallet = await Secp256k1Wallet.fromKey(fromHex("b8c462d2bb0c1a92edf44f735021f16c270f28ee2c3d1cb49943a5e70a3c763e"));
const accounts = await oneKeyWallet.getAccounts();
assert(accounts[0].address == "cosmos1kxt5x5q2l57ma2d434pqpafxdm0mgeg9c8cvtx");
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic, makeCosmoshubPath(0));
const [{ address }] = await wallet.getAccounts();