allow tuple inputs as parameters
The current version of web3 allows for tuple input parameters, but this eth-connect lib does not. Can we update eth-connect to mirror web3?
Hi there, could you provide an example contract and the EIP so we can implement the spec?
Thanks!
Sure thing.
Here's a web3 example interacting with a contract on mainnet passing in tuples as parameters.
`var newLeaseDetail = { rentAmount: this.state.web3.utils.toWei("" + this.state.amount, 'ether'), leaseLength: this.state.length, rentToken: this.state.token, dateSigned: 0, isOpen: true, isLeased: false, autoPay: false, monthsPaid: 0, gracePeriod: this.state.grace, autoRegenerate: this.state.auto, deposit: this.state.web3.utils.toWei("" +this.state.deposit, 'ether'), }
dclContract.methods.createLease(newLease, newLeaseDetail, isUpdate).send({from: this.state.account})`
Here's a stack overflow with the same question and simple example https://stackoverflow.com/questions/52620848/how-to-encode-tuple-as-input-parameter-to-function-using-web3j
`contract Test { struct Foo { uint a; string b; address c; }
function bar (Foo memory foo) public {
c = foo.c;
}
} contract.methods.bar([123, "123", "0xABC...."]).send({ from: '0x...' })`