@provenanceio/wallet-utils
Version:
Typescript Utilities for Provenance Blockchain Wallet
25 lines (24 loc) • 1.38 kB
TypeScript
import { MsgSend } from '../../../proto/cosmos/bank/v1beta1/tx_pb';
import { MsgSubmitProposal } from '../../../proto/cosmos/gov/v1/tx_pb';
import { MsgSubmitProposal as MsgSubmitGroupProposal } from '../../../proto/cosmos/group/v1/tx_pb';
import { CoinAsObject, MsgSendDisplay, MsgSubmitProposalDisplay, MsgSubmitGroupProposalDisplay, ReadableMessageNames } from '../../../types';
export declare type MsgExecuteContractDisplay = {
sender: string;
msg: any;
fundsList: CoinAsObject[];
};
export declare type GenericDisplay = {
[key: string]: any;
};
export declare type FallbackGenericMessageName = 'MsgGeneric' | 'MsgExecuteContractGeneric';
/**
* Unpacks an anyMsgBase64 string to a formatted JSON object. The
* display object templates are mapped to {@link SupportedMessageTypeNames}.
* The display object returned contains a typeName field representing
* the given SupportedMessageTypeNames type (i.e. cosmos.bank.v1beta1.MsgSend -> MsgSend).
* @param anyMsgBase64 base64 string of supported message type
* @returns a display formatted result of the provided message
*/
export declare const unpackDisplayObjectFromWalletMessage: (anyMsgBase64: string) => (MsgSend.AsObject | MsgSubmitProposal.AsObject | MsgSubmitGroupProposal.AsObject | MsgExecuteContractDisplay | GenericDisplay) & {
typeName: ReadableMessageNames | FallbackGenericMessageName;
};