Exit to App
Developers

Authentication

Programmatic EIP-4361 SIWE handshake: nonce generation, signature validation, and session cookies.

To access authenticated treasury endpoints programmatically, clients execute the two-step SIWE handshake:

  1. 1

    Obtain Nonce

    Dispatch GET /api/auth/nonce. The response returns { nonce: string }.

  2. 2

    Format SIWE Message

    Format standard EIP-4361 string with domain, address, uri, version "1", chainId 42220, and the received nonce.

  3. 3

    Sign and Verify

    Sign with private key and dispatch POST /api/auth/verify with { message, signature }. The server responds with 200 OK and sets the moi_session cookie.