No name for properties in struct return data after calling contract #1656
Replies: 7 comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
-
Though, you did mention that the function returns a struct. In which, it should decode as an object. Got an ABI that I can look at? |
Beta Was this translation helpful? Give feedback.
This comment has been minimized.
This comment has been minimized.
-
Looks like you may be running into this nuance with ABI compilation: https://x.com/_jxom/status/1645391096204369920 Maybe we could add a |
Beta Was this translation helpful? Give feedback.
-
Sure, here is the ABI for the slot0:
|
Beta Was this translation helpful? Give feedback.
-
Is there an existing issue for this?
Package Version
1.19.0
Current Behavior
When calling a contract function which will return something more complex than a single value (basically a struct), the returned data won't be formatted correctly with the name of the returned properties.
When calling "slot0" on an Uniswap V3 pool:
I get the following array prototype:
The result is the same when i use readContract directly from the client, or even after decoding the raw data from a client.call, using "decodeFunctionResult".
Expected Behavior
The expected behavior would have been to actually be able to call props in the return data by their name, just like ethersjs does:
Steps To Reproduce
Calling any contract's function which will return a struct.
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
No response
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions