you CAN pass `publicKey` to Contract Client methods
Describe the bug
If I pass publicKey to a specific method call on a contract client, it tells me that's not supported:
But it actually is passed through!
What version are you on? 12.3.0
To Reproduce Steps to reproduce the behavior:
- Instantiate a contract client, omitting
publicKey - For a write method, set
publicKeyto your sender's address. You may need to add a// @ts-ignoreor// @ts-expect-errorbefore the line! - See that the
publicKeyyou set on the method call is set as the invoker on the call.
Expected behavior We need to update the types to let people know they can do this! It's super handy, allowing you to have static contract clients in the project (as set up in our frontend templates), but still override transaction senders for change methods (which are actually fairly rare in apps, in my experience)
Additional context We will need to update the types generated in the TS bindings to match, once this is done.
Hello @chadoh i will love to take this up when OD hack begins tomorrow
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
software engineering background and smart contract developer.
How I plan on tackling this issue
I would try updating the typescript bindings to accurately document and support the passing of publickey in contract client methods.
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
i am a blockchain developer and i will like to contribute to this ecosystem.
How I plan on tackling this issue
To approach this issue, i will firstly verify the bug by the following:
- Reproduce the Bug
- Update Type Definitions
- Test Changes
- Submit Changes
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
@chadoh I am a Frontend and a Blockchain Dev
How I plan on tackling this issue
This is the steps i will take to solve the existing bug:
- I will reproduce the bug to confirm the issue.
- Move to Identify the source of type mismatch, then update these types to include publicKey as a valid parameter.
- I will modify the type definitions so that publicKey is recognized as a valid parameter in contract method calls. I’ll ensure the generator can properly handle this behavior.
- Finally, after updating the types, I’ll test both the static type-checking and the runtime behavior to ensure everything works as expected without having to manually suppress TypeScript errors.
@chadoh I'm creating a PR soon, thank you
Fixed in #1293