Expose Secp256k1Wallet

This commit is contained in:
Simon Warta 2020-10-27 14:32:27 +01:00
parent 0091d9a684
commit 850dbd11db
4 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,8 @@
- @cosmjs/cosmwasm: `logs` is no longer exported. Use `logs` from
@cosmjs/launchpad instead.
- @cosmjs/launchpad: Add `Secp256k1Wallet` to manage a single raw secp256k1
keypair.
## 0.23.1 (2020-10-27)

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();

View File

@ -117,3 +117,4 @@ export { isStdTx, isWrappedStdTx, makeStdTx, CosmosSdkTx, StdTx, WrappedStdTx, W
export { pubkeyType, PubKey, StdFee, StdSignature } from "./types";
export { makeCosmoshubPath, executeKdf, KdfConfiguration } from "./wallet";
export { extractKdfConfiguration, Secp256k1HdWallet } from "./secp256k1hdwallet";
export { Secp256k1Wallet } from "./secp256k1wallet";

View File

@ -115,3 +115,4 @@ export { isStdTx, isWrappedStdTx, makeStdTx, CosmosSdkTx, StdTx, WrappedStdTx, W
export { pubkeyType, PubKey, StdFee, StdSignature } from "./types";
export { makeCosmoshubPath, executeKdf, KdfConfiguration } from "./wallet";
export { extractKdfConfiguration, Secp256k1HdWallet } from "./secp256k1hdwallet";
export { Secp256k1Wallet } from "./secp256k1wallet";