To access authenticated treasury endpoints programmatically, clients execute the two-step SIWE handshake:
- 1
Obtain Nonce
Dispatch
GET /api/auth/nonce. The response returns{ nonce: string }. - 2
Format SIWE Message
Format standard EIP-4361 string with domain, address, uri, version "1", chainId 42220, and the received nonce.
- 3
Sign and Verify
Sign with private key and dispatch
POST /api/auth/verifywith{ message, signature }. The server responds with 200 OK and sets themoi_sessioncookie.