import { AminoMsg } from "@cosmjs/amino"; import { EncodeObject, Registry } from "@cosmjs/proto-signing"; import { AminoConverter as CosmJSAminoConverter, AminoTypes as CosmJSAminoTypes } from "@cosmjs/stargate"; import { Any } from "@desmoslabs/desmjs-types/google/protobuf/any"; /** * Interface that represents an object capable of convert * an {@link EncodeObject} from and to {@link AminoMsg}. * NOTE: This is an extension of the {@link CosmJSAminoConverter} from * cosmjs to allow the conversion of objects that have a field with * type {@link Any} like the MsgExec of the x/authz module. */ export interface AminoConverter extends CosmJSAminoConverter { /** * Converts an object to its amino representation. * @param value - The object to convert to {@link AminoMsg}. * @param aminoTypes - An object to convert an {@link Any} encoded object * from and to {@link AminoMsg}. * NOTE: This is optional to make the interface backward compatible with * {@link CosmJSAminoConverter}. */ readonly toAmino: (value: any, aminoTypes?: AminoTypes) => any; /** * Converts an amino encoded object to its protobuf representation. * @param value - The object to convert. * @param aminoTypes - An object to convert an {@link Any} encoded object * from and to {@link AminoMsg}. * NOTE: This is optional to make the interface backward compatible with * {@link CosmJSAminoConverter}. */ readonly fromAmino: (value: any, aminoTypes?: AminoTypes) => any; } export type AminoConverters = Record; /** * Extensions of the {@link CosmJSAminoTypes} that supports * the amino serialization of messages that have {@link Any} encoed * messages as child like the MsgExec of the x/authz module. */ export declare class AminoTypes extends CosmJSAminoTypes { private readonly converters; private readonly registry; constructor(converters: AminoConverters, registry: Registry); toAmino({ typeUrl, value }: EncodeObject): AminoMsg; fromAmino({ type, value }: AminoMsg): EncodeObject; /** * Function to convert a {@link Any} encoded object to its * amino representation. * @param anyEncodedObject - The object to convert to amino. */ fromAny(anyEncodedObject: Any): AminoMsg; /** * Function to convert a {@link AminoMsg} to its {@link Any} * representation. * @param aminoEncodedObject - The object to convert to {@link Any}. */ toAny(aminoEncodedObject: AminoMsg): Any; }