TRUEOPEN
English

← Docs contents

TRUEOPEN / DOCS

Developer integration: SDK, orders, outputs and tools

SDK configuration, EIP-712 signing, idempotent retries, authenticated output and unsupported operations.

Sources reviewed: · English edition · 中文

TrueOpen provides TypeScript SDK source code and a CLI for Sessions, orders, state queries and output handling. The SDK is not a drop-in replacement that works merely by changing an OpenAI-compatible API base URL. Read capabilities and version boundaries first.

Environment and versions

The inspected SDK package declares version 0.1.0, requires Node.js ≥18, and specifies ESM and CJS build outputs with TypeScript type declarations. This is a repository package version; npm publication and public production endpoints were not independently verified.

The SDK uses chain REST/RPC queries and transactions plus Nexus IngressAPI over Connect RPC. Applications must provide network configuration, signers and transport implementations. node.example in a README is a placeholder, not a service endpoint.

Signing: one wallet, EIP-712 throughout

Users sign EIP-712 typed data through TypedDataSigner. The resulting signatures use the 65-byte R||S||V encoding:

  1. Orders use TaskOrder, domain “TrueOpen Task Order” v3, with canonical task_hash as bytes32. The order signature is authorization; OpenTask has no outer signature.
  2. Builder ingress requests use SDKRequest, domain “TrueOpen SDK Request” v1: OpenTask, SubscribeOutput, AckOutput, GetTaskEvents and PrepareChallenge.
  3. Task-data requests use TaskDataRequest, domain “TrueOpen Task Data Request” v2: GetTaskDataMetadata and FetchTaskData.

A wallet can sign a session grant once, allowing an in-memory session key to sign subsequent read/delivery-progress requests. The SDK never creates consensus facts. An ingress ACK is not chain acceptance; chain queries/events are authoritative.

The inspected SDK pins wire 20702ee (v0.6.2 plus fee rule 3, not formally tagged) for a fresh Phase 1 chain. Old Sessions, output checkpoints and signatures are incompatible; see docs/phase1-migration.md.

Required configuration

Category Confirm before integration
Network Chain ID, RPC, REST, business denomination and accepted wire version
Identity Wallet/signer, user address and signature chain ID used by the EIP-712 domain
Model Exact model ID, Profile version, input schema and generation/output limits
Builder Descriptors/endpoints obtained from the prescribed source and certificate bindings
Fees Current rules, maximum fee, bid, reserves and balance; do not hard-code example amounts
State Task identity, order input, idempotency keys, retry records and output checkpoints

The EIP-712 domain's signature_chain_id must match TrueOpenClientConfig.signatureChainId in the SDK configuration. A mismatch shows up as a signature that recovers to the wrong user address.

Call sequence

Documented entry points include createSession, nextOrderSequence, openTask, resolveOutputTrustAnchors, fetchTaskOutput and streamOutput. Use complete examples from the pinned SDK version; do not hand-assemble signatures or copy obsolete protobuf definitions.

Create or read the Session, confirm the sequence, fix the input bytes and model configuration, sign and submit, retain the task ID, then query chain acceptance. A Builder ACK is insufficient.

These are source-documented methods, not an end-to-end-verified production quickstart. A real network requires additional deployment endpoints and configuration not established by this review.

Idempotency and retries

One idempotency key must identify the same input, Session and sequence. The SDK retains retry material. If the order is already recorded on-chain, it returns that record; otherwise, it can reuse the original signed order. Reusing a key with changed input fails. Default in-memory storage lasts only as long as the client object; process restarts require a persistent store.

After a timeout, check chain state before creating another paid order. Expiration, consumed sequences and changed input are distinct failures, not reasons for unlimited retries.

Output verification and tool calls

The SDK obtains the task hash, Worker identity and accepted receipt from chain state, then checks output chunks, signatures, Merkle Mountain Range (MMR) commitments and associated bindings. OUTPUT_TRUST_ANCHOR_PENDING requires a documented retry; never bypass the check. If an execution attempt becomes invalid, discard its output and handle the reset.

assistantTurn separates reasoning, content and confirmed output. Tool calls are derived from committed text aligned with an accepted receipt. Applications must not execute tool arguments from unconfirmed streaming fragments. Output confirmation does not itself mean verification rounds and financial settlement are complete.

Unsupported operations

The inspected SDK explicitly does not support MsgOpenChallengeRound. Preparing challenge material is not submitting a challenge. Validate each component and version in the integration; successful SDK compilation does not establish production readiness of the network.

Sources