UNPKG

@provenanceio/wallet-utils

Version:

Typescript Utilities for Provenance Blockchain Wallet

20 lines (19 loc) 579 B
var decoder = new TextDecoder('utf-8'); /** * Formats MsgExecuteContract messages for display * @param message of type MsgExecuteContract * @returns object with MsgExecuteContract fields */ export 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()) }; }) }; };