Skip to main content

Design tokens, the component library and the typed SDK

CoRelayer
Cooperative Relayer Infrastructure for Autonomous Transactions

Three workspace packages are built: the design tokens, the component library that consumes them, and the typed API client that everything else talks to the API through.

@corelayer/tokens​

Design tokens authored in the DTCG format and compiled two ways: a Tailwind v4 @theme block and a typed TypeScript module. Dark and light are both first-class, and a contrast gate runs in the build — a token pair that fails its contrast requirement fails the build rather than shipping.

This documentation site uses the same file. src/css/tokens.css here is a verbatim copy of @corelayer/tokens/themes.css, written on every build, and every Infima variable points at one of its tokens. One edit re-skins all three sites.

@corelayer/ui​

The component library: a theme provider that applies the stored theme before first paint, so there is no flash of the wrong one; self-hosted Geist and Geist Mono; and the component inventory the front-end specification calls for. Charts, icons and illustrations are separate entry points so a page pays only for what it imports.

The fonts on this site come from that package, rewritten to versioned paths under /fonts so that the preload and the @font-face rule name the same URL and nobody downloads a font twice.

@corelayer/sdk​

The typed client. Four parts:

  1. Generated types. Every request and response shape comes from openapi.yaml. A check mode fails if the checked-in types have drifted from the document.
  2. A transport with direct-host failover: when the edge does not answer in time, the identical bytes are resubmitted to a regional host.
  3. Typed errors matching the RFC 9457 catalogue, including the open-enum rule — an unknown code keeps its status and retryable instead of being guessed at.
  4. relayOnce, which assigns a relayer and submits exactly one signed transaction. It wraps the caller's signer so that a second invocation throws.

Nothing in the package contacts a chain. Every call goes to the CoRelayer API, which is why the test suite needs no network: point baseUrl at a fixture server and the whole client is exercised.

SDK documentation · TypeScript guide

Not published​

None of the three is on a public registry yet. They are workspace packages in this repository.