y-pakorn / flutter_web3

Web3 Ethereum, Etherjs and Wallet Connect wrapper for Flutter Web.
Other
136 stars 46 forks source link

Way to return tuple / struct type? #25

Closed patniemeyer closed 2 years ago

patniemeyer commented 3 years ago

I'm not seeing a way to use a tuple / struct value as a return type, e.g.:

function read(address foo) external view returns (uint256, uint256)

As a workaround I'm just interpreting the dynammics as strings but I was wondering if I missed something. Thanks.

y-pakorn commented 2 years ago

As mentioned in README, all tuple is consider List type. And because of dart:js limitation, List instances coming from JavaScript will always be List<dynamic>.

So your return type are List<dynamic> which first and second element is BigNumber type.