diff --git a/CHANGELOG.md b/CHANGELOG.md index 2364ff81f2..6be723bc19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 2633a8e9a9..c0cb5a12cc 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -117,6 +117,7 @@ export async function main(originalArgs: readonly string[]): Promise { "PubKey", "pubkeyToAddress", "Secp256k1HdWallet", + "Secp256k1Wallet", "SigningCosmosClient", "StdFee", "StdSignDoc", @@ -162,6 +163,10 @@ export async function main(originalArgs: readonly string[]): Promise { 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(); diff --git a/packages/launchpad/src/index.ts b/packages/launchpad/src/index.ts index 324b0fd2aa..fb3cd0a8f2 100644 --- a/packages/launchpad/src/index.ts +++ b/packages/launchpad/src/index.ts @@ -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"; diff --git a/packages/launchpad/types/index.d.ts b/packages/launchpad/types/index.d.ts index fe5b08ea6d..6580a9a28a 100644 --- a/packages/launchpad/types/index.d.ts +++ b/packages/launchpad/types/index.d.ts @@ -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";