stargate: Use signer types from amino

This commit is contained in:
willclarktech 2021-03-24 13:55:28 +01:00
parent 48e4223ca0
commit e73fe04274
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
2 changed files with 5 additions and 5 deletions

View File

@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { decodeBech32Pubkey, encodeBech32Pubkey } from "@cosmjs/amino";
import { AminoMsg, decodeBech32Pubkey, encodeBech32Pubkey } from "@cosmjs/amino";
import { fromBase64, toBase64 } from "@cosmjs/encoding";
import {
Msg,
MsgBeginRedelegate as LaunchpadMsgBeginRedelegate,
MsgCreateValidator as LaunchpadMsgCreateValidator,
MsgDelegate as LaunchpadMsgDelegate,
@ -416,7 +415,7 @@ export class AminoTypes {
this.register = { ...filteredDefaultTypes, ...additions };
}
public toAmino({ typeUrl, value }: EncodeObject): Msg {
public toAmino({ typeUrl, value }: EncodeObject): AminoMsg {
const converter = this.register[typeUrl];
if (!converter) {
throw new Error(
@ -431,7 +430,7 @@ export class AminoTypes {
};
}
public fromAmino({ type, value }: Msg): EncodeObject {
public fromAmino({ type, value }: AminoMsg): EncodeObject {
const result = Object.entries(this.register).find(([_typeUrl, { aminoType }]) => aminoType === type);
if (!result) {
throw new Error(

View File

@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { AminoSignResponse, StdSignDoc } from "@cosmjs/amino";
import { Bip39, EnglishMnemonic, Random, Secp256k1, Slip10, Slip10Curve } from "@cosmjs/crypto";
import { Bech32 } from "@cosmjs/encoding";
import { AminoSignResponse, Secp256k1HdWallet, StdSignDoc } from "@cosmjs/launchpad";
import { Secp256k1HdWallet } from "@cosmjs/launchpad";
import {
coins,
DirectSecp256k1HdWallet,