UNPKG

@provenanceio/wallet-utils

Version:

Typescript Utilities for Provenance Blockchain Wallet

28 lines (25 loc) 739 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.msgExecuteContract = void 0; var decoder = new TextDecoder('utf-8'); /** * Formats MsgExecuteContract messages for display * @param message of type MsgExecuteContract * @returns object with MsgExecuteContract fields */ var msgExecuteContract = function msgExecuteContract(message) { return { typeName: 'MsgExecuteContractGeneric', sender: message.getSender(), msg: JSON.parse(decoder.decode(message.getMsg())), fundsList: message.getFundsList().map(function (coin) { return { denom: coin.getDenom(), amount: Number(coin.getAmount()) }; }) }; }; exports.msgExecuteContract = msgExecuteContract;