Skip to content

fix(client#MethodOptions): add overrideable params#1293

Merged
Ryang-21 merged 1 commit intostellar:masterfrom
theahaco:fix/more-method-options
Dec 2, 2025
Merged

fix(client#MethodOptions): add overrideable params#1293
Ryang-21 merged 1 commit intostellar:masterfrom
theahaco:fix/more-method-options

Conversation

@chadoh
Copy link
Copy Markdown
Contributor

@chadoh chadoh commented Nov 26, 2025

This supercedes #1283, adding publicKey, signTransaction, and signAuthEntry as optional parameters on MethodOptions. This is actually the type of each method added to a Client ([1]), and needs to allow overriding these settings.

This will allow us to fix the generated TS Bindings and specify MethodOptions as the options type, rather than AssembledTransactionOptions, which causes errors since these settings (as well as contractId) are all required, but should not be required for Client methods.

This supercedes stellar#1283, adding `publicKey`, `signTransaction`, and
`signAuthEntry` as optional parameters on `MethodOptions`. This is
actually the type of each method added to a Client ([[1]]), and needs to
allow overriding these settings.

This will allow us to fix the generated TS Bindings and specify
`MethodOptions` as the `options` type, rather than
`AssembledTransactionOptions`, which causes errors since these settings
(as well as `contractId`) are all **required**, but should not be
required for Client methods.

  [1]: https://github.com/theahaco/js-stellar-sdk/blob/f1f81f7870affb444c1d2a289c1a272f01410346/src/contract/client.ts#L27
@chadoh
Copy link
Copy Markdown
Contributor Author

chadoh commented Nov 26, 2025

The build failures seem unrelated to this change?

chadoh added a commit to theahaco/stellar-cli that referenced this pull request Nov 26, 2025
This is an update to stellar#2283, which changed hard-coded `options` to
`AssembledTransactionOptions`. This was not quite correct, it should be
a `MethodOptions`.

This works together with
stellar/js-stellar-sdk#1293 to finally remove
the need for `@ts-expect-error` lines in our canonical write-method
invocation examples.
Copy link
Copy Markdown
Contributor

@Ryang-21 Ryang-21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good these should make the Client binding methods easier to override

@Ryang-21 Ryang-21 merged commit 0920562 into stellar:master Dec 2, 2025
10 of 12 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants