ABI coding: representing bytes as Uint8Array #927
Unanswered
timbrinded
asked this question in
Idea / Feature Request
Replies: 1 comment
-
|
Going to convert this one to a discussion as it’s not really a bug. viem represents If there is larger demand for this, maybe we can find an API to make it a bit easier. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there an existing issue for this?
Package Version
1.4.1
Current Behavior
The
encodeFunctionData()fn can't seem to turn uint arrays into bytes when using as an args parameter.Workaround is to use
fromBytes()to first convert to a hex string, but this is non-ideal.Expected Behavior
encodeFunctionData()should be able to handle native bytes inputSteps To Reproduce
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
https://stackblitz.com/edit/viem-getting-started-dmhpsz?file=main.ts
Anything else?
Run the above with
pnpm exampleBeta Was this translation helpful? Give feedback.
All reactions