From c82f12e40f6a5da51c474ebd83135dede479089f Mon Sep 17 00:00:00 2001 From: Santiago Date: Fri, 29 May 2026 07:49:57 -0300 Subject: [PATCH] feat: add README.md.hbs to client-lib templates Emits a README.md alongside the generated TypeScript client with install instructions for the tx3-sdk runtime and a minimal usage snippet. Picked up automatically by the trix codegen template loop. Co-Authored-By: Claude Opus 4.7 (1M context) --- .trix/client-lib/README.md.hbs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .trix/client-lib/README.md.hbs diff --git a/.trix/client-lib/README.md.hbs b/.trix/client-lib/README.md.hbs new file mode 100644 index 0000000..5edd40c --- /dev/null +++ b/.trix/client-lib/README.md.hbs @@ -0,0 +1,27 @@ +# {{tii.protocol.name}} — TypeScript client + +Generated by `trix codegen` from the `{{tii.protocol.name}}@{{tii.protocol.version}}` protocol interface. Do not edit by hand — re-run `trix codegen` to refresh. + +## Install the runtime SDK + +The generated client delegates transport, signing, and lifecycle to `tx3-sdk`. From the directory that *consumes* this client (not from inside this folder): + +```sh +npm install tx3-sdk +``` + +If you also need a local dev runtime, `trix devnet` exposes a TRP endpoint at `http://localhost:8164`. + +## Use the client + +```ts +import { Client } from "./{{tii.protocol.name}}"; +import { Party, Ed25519Signer } from "tx3-sdk"; + +const client = new Client( + { endpoint: "http://localhost:8164" }, + "local", +); +``` + +Each `tx` declared by the protocol becomes a typed method on `client`, returning the four-stage `resolve → sign → submit → wait` lifecycle. See the [Tx3 consuming guide](https://docs.txpipe.io/tx3/consuming/quick-start) for the full walkthrough.