let abi = { "name" : "balanceOf", "stateMutability" : "view", "outputs" : [ ], "inputs" : [ { "name" : "expiry", "type" : "uint256" }, { "name" : "tickets", "type" : "uint256[]" }, { "name" : "v", "type" : "uint8" }, { "name" : "r", "type" : "bytes32" }, { "name" : "s", "type" : "bytes32" }, { "name" : "recipient", "type" : "address" } ], "constant" : false, "payable" : true, "type" : "function" } let parameters = [ 0x000000000000000000000000000000000000000000000000000000005c53968b, ["0x000032303139303133313132343435392d313230300000000000313200000000"], 0x000000000000000000000000000000000000000000000000000000000000001b, "0xca0bb06bdedbaacda05efdeaf5f5a5f17d15bf679aeb838f928f016e4a572ce7", "0x2785e0591c3ecf8d1739f46bdbb5b96e1f11450b8c278dd93119997b051f786e", "0x6fed4f99bcbec84125110918fd214099c1cbb57f"] let x = web3.eth.abi.encodeFunctionCall(abi, parameters); console.log(`x: ${x}`) //Output: // //0x8d2b0768 //000000000000000000000000000000000000000000000000000000005c53968b //00000000000000000000000000000000000000000000000000000000000000c0 //000000000000000000000000000000000000000000000000000000000000001b //ca0bb06bdedbaacda05efdeaf5f5a5f17d15bf679aeb838f928f016e4a572ce7 //2785e0591c3ecf8d1739f46bdbb5b96e1f11450b8c278dd93119997b051f786e //0000000000000000000000006fed4f99bcbec84125110918fd214099c1cbb57f //0000000000000000000000000000000000000000000000000000000000000001 //000032303139303133313132343435392d313230300000000000313200000000