Skip to content

you CAN pass publicKey to Contract Client methods #1055

@chadoh

Description

@chadoh

Describe the bug

If I pass publicKey to a specific method call on a contract client, it tells me that's not supported:

image

But it actually is passed through!

What version are you on?
12.3.0

To Reproduce
Steps to reproduce the behavior:

  1. Instantiate a contract client, omitting publicKey
  2. For a write method, set publicKey to your sender's address. You may need to add a // @ts-ignore or // @ts-expect-error before the line!
  3. See that the publicKey you 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions