Skip to content

Make contract.Client factories generic for typed runtime clients#1504

Merged
quietbits merged 2 commits into
issue-1469from
issue-1439
Jul 2, 2026
Merged

Make contract.Client factories generic for typed runtime clients#1504
quietbits merged 2 commits into
issue-1469from
issue-1439

Conversation

@quietbits

Copy link
Copy Markdown
Contributor

Makes the three runtime contract.Client factories generic so consumers get typed contract methods without code generation:

  • from<T = unknown>(options): Promise<Client & T>
  • fromWasm<T = unknown>(wasm, options): Promise<Client & T>
  • fromWasmHash<T = unknown>(wasmHash, options, format?): Promise<Client & T>
interface MyContract {
  increment: (opts?: MethodOptions) => Promise<AssembledTransaction<number>>;
}
const client = await contract.Client.from<MyContract>(options);
const tx = await client.increment(); // typed

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Jul 1, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

)

* Add rpc.Server.getContractMethods for contract method discovery

* Document queryContract and getContractMethods in the invoke-a-contract guide

* Type the contract.Client examples in the invoke and auth guides
@quietbits quietbits merged commit d6945d0 into issue-1469 Jul 2, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Jul 2, 2026
@quietbits quietbits deleted the issue-1439 branch July 2, 2026 20:14
quietbits added a commit that referenced this pull request Jul 2, 2026
…1502)

* Add rpc.Server.queryContract for one-line read-only contract calls

* Sanitize method name

* Check only contract methods before invoking

* e2e test happy path

* Make contract.Client factories generic for typed runtime clients (#1504)

* Make contract.Client factories generic for typed runtime clients

* Add `rpc.Server.getContractMethods` for contract method discovery (#1505)

* Add rpc.Server.getContractMethods for contract method discovery

* Document queryContract and getContractMethods in the invoke-a-contract guide

* Type the contract.Client examples in the invoke and auth guides
quietbits added a commit that referenced this pull request Jul 6, 2026
…om` (#1501)

* Handle SAC in contract.Client.from

* Docs updated

* Fix tests

* Optimize

* Fix and update docs

* Update error response

* Rollup: enable inlineDynamicImports

* Update error message + outdated comment

* Add rpc.Server.queryContract for one-line read-only contract calls (#1502)

* Add rpc.Server.queryContract for one-line read-only contract calls

* Sanitize method name

* Check only contract methods before invoking

* e2e test happy path

* Make contract.Client factories generic for typed runtime clients (#1504)

* Make contract.Client factories generic for typed runtime clients

* Add `rpc.Server.getContractMethods` for contract method discovery (#1505)

* Add rpc.Server.getContractMethods for contract method discovery

* Document queryContract and getContractMethods in the invoke-a-contract guide

* Type the contract.Client examples in the invoke and auth guides

* Updated changelog

* Return { result, isReadCall } from queryContract (#1511)
@oceans404 oceans404 added this to the v17.0.0 milestone Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

3 participants