← Cookbook

⚠️ partial

Recipe 18 — Wallet connection: SIWE / Permit2 flow

Status: ⚠️ partial What ships Day-0: Permit2 helpers via @cryptoai/aa What's deferred: SIWE (Sign-In With Ethereum) auth flow → M6+

The CryptoAI Gateway's account-abstraction layer is in packages/aa/ (separate package from this SDK). It exposes the canonical helpers to construct Permit2 signatures + session keys, which the M1-S3 payment FSM verifies on the server.

Permit2 today (via @cryptoai/aa)

import { buildPermit2Single } from '@cryptoai/aa/permit2';
// see packages/aa/src/permit2.ts for the canonical signature

The CryptoAI Gateway SDK proper (cryptoai-gateway / @cryptoai/gateway) does NOT bundle wallet-signing primitives. Use the AA package for that, and this SDK for the API calls that consume the resulting signatures.

SIWE deferred (M6+)

The SIWE auth flow (EIP-4361 message signing → JWT exchange) replaces the dev JWT helper at the boundary into M6 Public Beta. Recipe will be filled in then.

Source: cookbook/recipes/18-siwe-permit2/README.md