mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 13:47:12 +00:00
Expose Secp256k1Wallet
This commit is contained in:
parent
0091d9a684
commit
850dbd11db
@ -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)
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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";
|
||||
|
1
packages/launchpad/types/index.d.ts
vendored
1
packages/launchpad/types/index.d.ts
vendored
@ -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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user