diff --git a/src/routes/safe/store/actions/fetchTransactions.js b/src/routes/safe/store/actions/fetchTransactions.js index 6de4d2e5..2f2a9d5d 100644 --- a/src/routes/safe/store/actions/fetchTransactions.js +++ b/src/routes/safe/store/actions/fetchTransactions.js @@ -62,33 +62,34 @@ const buildTransactionFrom = async (safeAddress: string, tx: TxServiceModel, saf } let symbol = 'ETH' - let recipient = tx.to - let value = tx.value.toString() + let decodedParams if (isToken) { const tokenContract = await getHumanFriendlyToken() const tokenInstance = await tokenContract.at(tx.to) symbol = await tokenInstance.symbol() - const decodedParams = web3.eth.abi.decodeParameters(['address', 'uint256'], tx.data.slice(10)) - /* eslint-disable */ - recipient = decodedParams[0] - value = decodedParams[1] - /* eslint-enable */ + const params = web3.eth.abi.decodeParameters(['address', 'uint256'], tx.data.slice(10)) + decodedParams = { + recipient: params[0], + value: params[1], + } } return makeTransaction({ name, symbol, nonce: tx.nonce, - value, + value: tx.value.toString(), confirmations, - recipient, + recipient: tx.to, data: tx.data ? tx.data : EMPTY_DATA, isExecuted: tx.isExecuted, submissionDate: tx.submissionDate, executionDate: tx.executionDate, executionTxHash, creationTxHash, + isToken, + decodedParams, }) } diff --git a/src/routes/safe/store/models/transaction.js b/src/routes/safe/store/models/transaction.js index 4fa7a928..3481f6da 100644 --- a/src/routes/safe/store/models/transaction.js +++ b/src/routes/safe/store/models/transaction.js @@ -20,6 +20,8 @@ export type TransactionProps = { executionTxHash?: string, cancelled?: boolean, status?: TransactionStatus, + isToken: boolean, + decodedParams?: Object, } export const makeTransaction: RecordFactory = Record({ @@ -37,6 +39,8 @@ export const makeTransaction: RecordFactory = Record({ creationTxHash: '', cancelled: false, status: 'awaiting', + isToken: false, + decodedParams: {}, }) export type Transaction = RecordOf