diff --git a/.trix/client-lib/README.md.hbs b/.trix/client-lib/README.md.hbs new file mode 100644 index 0000000..ddbb959 --- /dev/null +++ b/.trix/client-lib/README.md.hbs @@ -0,0 +1,30 @@ +# {{tii.protocol.name}} — Go 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 `github.com/tx3-lang/go-sdk/sdk`. From your consuming module: + +```sh +go get github.com/tx3-lang/go-sdk/sdk +go mod tidy +``` + +If you also need a local dev runtime, `trix devnet` exposes a TRP endpoint at `http://localhost:8164`. + +## Use the client + +```go +import ( + "yourapp/{{tii.protocol.name}}" + "github.com/tx3-lang/go-sdk/sdk/trp" +) + +client := {{tii.protocol.name}}.NewClient( + trp.ClientOptions{Endpoint: "http://localhost:8164"}, + {{tii.protocol.name}}.ProfileLocal, +) +``` + +Each `tx` declared by the protocol becomes a typed method on `client`, returning the `Resolve → Sign → Submit → WaitForConfirmed` lifecycle. See the [Tx3 consuming guide](https://docs.txpipe.io/tx3/consuming/quick-start) for the full walkthrough.