Documentation-only repo (no application code): OpenAPI spec (YAML) + Mintlify docs (MDX). Grid is an API for global payments across fiat, stablecoins, and Bitcoin.
- Edit OpenAPI in
openapi/— never edit the rootopenapi.yamldirectly (it's generated by bundling) - Bump
info.versiononly when a breaking change ships — at which point it should match a newservers.urlpath - Run
make buildafter any OpenAPI changes to rebundle - Run
make lintbefore committing - Mintlify CLI must be version 4.2.284 — newer versions (e.g., 4.2.312) have a bug where API reference pages render blank. Install with
npm install -g mintlify@4.2.284 --force - Requires Node.js v20 or v22 — Mintlify does not support Node 25+. If needed:
export PATH="/opt/homebrew/opt/node@22/bin:$PATH" - Use snippets from
mintlify/snippets/instead of duplicating content across use cases - Follow writing standards in
mintlify/CLAUDE.mdfor all documentation content - MDX files require frontmatter with
titleanddescription - React hooks (
useState,useEffect, etc.) work in MDX. If the acorn parser throws, it's usually a JS expression issue (e.g., template literals in JSX curlies), not the hook itself.
make install # Install dependencies
make build # Bundle OpenAPI spec (openapi/ → openapi.yaml + mintlify/openapi.yaml)
make lint # Lint OpenAPI + markdown + run mint openapi-check
make lint-openapi # Lint OpenAPI only
make lint-markdown # Lint markdown only
make mint # Serve docs locally (cd mintlify && mint dev)openapi/ # Source OpenAPI YAML (edit here)
openapi.yaml # Root spec with $ref references
paths/ # Endpoint definitions by domain
components/schemas/ # Reusable schema definitions
webhooks/ # Webhook event definitions
openapi.yaml # Generated bundle (don't edit)
mintlify/ # Mintlify documentation (MDX)
docs.json # Navigation and theme config
snippets/ # Shared MDX snippets (use these to avoid duplication)
styles/base.css # CSS overrides
.redocly.yaml # Redocly bundler/linter config
Bundled and linted with Redocly (@redocly/cli), configured in .redocly.yaml. Lint rules enforce operation descriptions, operation IDs, and security definitions.
For the USDB embedded wallet → USD bank offramp flow, see scripts/README.md. It walks through onboarding, on-ramp, and off-ramp with copy-pasteable curl, and points at the only operations that can't be done with curl alone:
- HPKE bundle decrypt (the
encryptedSessionSigningKeyreturned byPOST /auth/credentials/{id}/verify) - Turnkey API stamp construction (the
Grid-Wallet-Signatureheader onPOST /quotes/{id}/execute)
Both are wrapped by scripts/embedded-wallet-sign.js (uses @turnkey/crypto + @turnkey/api-key-stamper). One-time setup: cd scripts && npm install.
Important gotcha: the USDB embedded wallet's Turnkey sub-org and Spark network wallet aren't fully bootstrapped when a customer is created. Verify the auto-created EMAIL_OTP auth credential on the USDB account before the first quote, otherwise on-ramp quotes fail with to_network INTERNAL_FUNDED_FIAT does not support USDB. This is documented in scripts/README.md step 1.4.
Read scripts/README.md whenever the task involves Turnkey signing, offramp, or Grid-Wallet-Signature.
- Tailwind utility classes (e.g.,
mb-3.5) are hard to override even with!important— use negative margins on sibling elements as a workaround - Test selectors with
border: 2px solid red !importantto confirm they match before debugging property conflicts - Mobile nav is in
#mobile-nav; modals/portals are in#headlessui-portal-root
- Restart dev server:
pkill -f "mint.*dev" && cd mintlify && mint dev - Verify CLI version is 4.2.284
- Run
cd mintlify && mint openapi-check openapi.yaml