mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Use bech32 encoder from CosmJS
This commit is contained in:
parent
7fec3a2875
commit
9d35df3d91
@ -1,4 +1,4 @@
|
||||
import { encodeSecp256k1Pubkey, makeCosmoshubPath, Secp256k1Pubkey } from "@cosmjs/amino";
|
||||
import { encodeSecp256k1Pubkey, makeCosmoshubPath, pubkeyToAddress, Secp256k1Pubkey } from "@cosmjs/amino";
|
||||
import { HdPath, Secp256k1Signature } from "@cosmjs/crypto";
|
||||
import { fromUtf8 } from "@cosmjs/encoding";
|
||||
import { assert } from "@cosmjs/utils";
|
||||
@ -115,7 +115,7 @@ export class LaunchpadLedger {
|
||||
|
||||
public async getCosmosAddress(pubkey?: Uint8Array): Promise<string> {
|
||||
const pubkeyToUse = pubkey || (await this.getPubkey());
|
||||
return CosmosApp.getBech32FromPK(this.prefix, Buffer.from(pubkeyToUse));
|
||||
return pubkeyToAddress(encodeSecp256k1Pubkey(pubkeyToUse), this.prefix);
|
||||
}
|
||||
|
||||
public async sign(message: Uint8Array, hdPath?: HdPath): Promise<Uint8Array> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user