@sigilry/canton-json-api
v1.0.1
Published
Generated TypeScript types for Canton JSON API v2
Maintainers
Readme
@sigilry/canton-json-api
Generated TypeScript types and Zod schemas for Canton JSON API v2.
What this package provides
- TypeScript types generated from the pinned Canton OpenAPI spec
- Zod schemas generated from the same OpenAPI source
int64fields modeled asbigintat the contract boundary
Install
yarn add @sigilry/canton-json-apiUsage
import { zGetLedgerEndResponse } from "@sigilry/canton-json-api";
const parsed = zGetLedgerEndResponse.parse({ offset: "42" });
// parsed.offset is bigintSource of truth and reproducibility
- Pinned Canton artifact version and hash:
scripts/version-config.json - Checked-in OpenAPI snapshot:
api-specs/openapi.yaml - Generated outputs:
src/generated/types.gen.ts,src/generated/zod.gen.ts,src/generated/transformers.gen.ts
CI runs codegen:check to ensure generated files match the checked-in OpenAPI snapshot and fail on drift.
Regenerate
yarn workspace @sigilry/canton-json-api regenOr run steps individually:
yarn workspace @sigilry/canton-json-api fetch
yarn workspace @sigilry/canton-json-api codegen