It's a bit late, but maybe my answer will help others struggling with this.
When you make a transaction via a smart contract function call, the input parameters are ABI.encoded into the transaction data, along with the function selector, which is the first 4bytes of the hash of the function signature.
For example, calling function set(string memory str) with str = 'hello' will result in the following transaction data:
0x4ed3885e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000
Where 4ed3885e is the function selector and the rest is the input parameter encoded.
To my knowledge there are two ways of decoding input parameters from transaction data.
I'll paste an example for decoding 4 input parameters, using both methods.
Web3 example:
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider('https...')); // your web3 provider
var transaction = '0xe7ad9ce53fd1d1559dc6ca57e67ed5c8cd612b6264ddc4f78b0736ad24a5bc29';
web3.eth.getTransaction(transaction, function(err, tx){
let tx_data = tx.input;
let input_data = '0x' + tx_data.slice(10); // get only data without function selector
let params = web3.eth.abi.decodeParameters(['bytes32', 'string', 'string', 'string'], input_data);
console.log(params);
});
Abi-decoder example:
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider('https...')); // your web3 provider
var abiDecoder = require('abi-decoder');
var ABI = ... ; // abi of your contract
var transaction = '0xe7ad9ce53fd1d1559dc6ca57e67ed5c8cd612b6264ddc4f78b0736ad24a5bc29';
web3.eth.getTransaction(transaction, function(err, tx){
abiDecoder.addABI(ABI);
let tx_data = tx.input;
let decoded_data = abiDecoder.decodeMethod(tx_data);
let params = decoded_data.params;
let param_values = [];
for(i in params){ // loop to print parameters without unnecessary info
param_values.push(params[i].name + " : " + params[i].value);
}
console.log(param_values);
});