This repository is the canonical, versioned source of truth for OIF protocol standards and specifications.
It includes:
- API standards for Quote, Intent submission, and Asset discovery
- Machine-readable OpenAPI schemas
- Language-friendly TypeScript interfaces for client/server implementation
specs/openapi.yaml: OpenAPI 3.0 specification covering Quote, Intent, and Asset discovery endpointsschemas/typescript/types.ts: TypeScript interfaces for all OIF protocol typesschemas/typescript/schemas.generated.ts: Auto-generated Zod schemas from TypeScript typesdocs/references.md: Curated external references to related off-chain APIs and intent protocols
This repository defines the following endpoints:
- Quote: quote generation for requested outputs based on available inputs
- Intent: submit a previously quoted, signed order for execution
- Asset Discovery: discover supported assets and chains
GET /api/tokens: returns all supported assets across all configured blockchain networksGET /api/tokens/{chain_id}: returns supported assets for a specific blockchain network
Authoritative schema: specs/openapi.yaml
TypeScript-friendly interfaces are provided in schemas/typescript/types.ts
To express user preference for gasless execution and who submits the origin transaction, use originSubmission:
{
"originSubmission": {
"mode": "user", // or "protocol"
"schemes": ["erc-4337", "permit2", "erc20-permit", "eip-3009"]
}
}- mode: who is expected to submit the origin transaction.
- schemes: acceptable signing/authorization schemes for interoperability.
Notes:
- This is orthogonal to
lock(asset state) and focuses on submission responsibility and signing surface.
To discover which assets and chains are supported by a provider, use the asset discovery endpoints:
GET /api/tokens: Returns all supported networks and their assetsGET /api/tokens/{chain_id}: Returns assets for a specific chain
The response includes asset metadata (address in EIP-7930 format, symbol, and decimals) for each supported network. This enables clients to build asset and chain selection UIs and validate that a provider can theoretically fulfill a given intent before requesting quotes.
The OpenAPI specification is auto-generated from TypeScript types using a TypeScript → Zod → OpenAPI pipeline. To regenerate:
npm install
npm run generate:openapiThe TypeScript types in schemas/typescript/types.ts are the source of truth. The generation process:
ts-to-zodconverts TypeScript types to Zod schemas with validation@asteasolutions/zod-to-openapiconverts Zod schemas to OpenAPI specification- JSDoc annotations (@description, @pattern, @example) are preserved throughout the pipeline
Use any of the following online viewers. After this repo is public, you can point them directly to the raw openapi.yaml URL; until then, copy-paste the YAML content into the viewer.
- Swagger Editor: open
https://editor.swagger.io/and paste the contents ofspecs/openapi.yaml.
No local server is required.
The specs follow semantic versioning at the file level. Backwards-compatible changes (additive fields) will increment the minor version via Git tags/releases. Breaking changes will increment the major version. See Git history and release notes for details.
- Propose changes via pull request with rationale and, where applicable, example payloads.
- Modify TypeScript schemas in
schemas/typescript/types.tsand runnpm run generate:openapito update the OpenAPI spec. - Favor explicit types and self-explanatory naming. Avoid ambiguous or protocol-specific jargon without a definition.
This repository is licensed under the terms of the LICENSE file at the root of the repository.