Use BCP type in decodeCosmosPubkey

This commit is contained in:
Simon Warta 2020-02-17 12:36:55 +01:00
parent 28ee35217e
commit f8051b93dc
2 changed files with 3 additions and 10 deletions

View File

@ -5,9 +5,7 @@ import { Encoding } from "@iov/encoding";
const { fromBase64, toBase64 } = Encoding;
export function decodeCosmosPubkey(
encodedPubkey: string,
): { readonly algo: Algorithm; readonly data: PubkeyBytes } {
export function decodeCosmosPubkey(encodedPubkey: string): PubkeyBundle {
const sdkPubKey = decodeBech32Pubkey(encodedPubkey);
switch (sdkPubKey.type) {
case types.pubkeyType.secp256k1:

View File

@ -1,9 +1,4 @@
import { CosmosAddressBech32Prefix } from "@cosmwasm/sdk";
import { Address, Algorithm, PubkeyBundle, PubkeyBytes } from "@iov/bcp";
export declare function decodeCosmosPubkey(
encodedPubkey: string,
): {
readonly algo: Algorithm;
readonly data: PubkeyBytes;
};
import { Address, PubkeyBundle } from "@iov/bcp";
export declare function decodeCosmosPubkey(encodedPubkey: string): PubkeyBundle;
export declare function pubkeyToAddress(pubkey: PubkeyBundle, prefix: CosmosAddressBech32Prefix): Address;