Authentication Endpoint

Authenticate users via their Solana wallet signature

POST /api/auth/wallet

Authenticate a user with their wallet signature. The server verifies the signature and creates or updates the user in the database.

Request Body

application/json
{
  "wallet": "9B5X5wUohEaoKHTVzpqsTmWKHS1DL1K5CTbqJ6C7W9jG",
  "signature": "3Z4X2qWoL8pNmB9X...",
  "message": "Sign in to Axira AI\n\nWallet: 9B5X5wUohEaoKHTVzpqsTmWKHS1DL1K5CTbqJ6C7W9jG\nTimestamp: 1704931200000"
}

Request Parameters

wallet

The Solana wallet address (base58 encoded)

signature

The Ed25519 signature of the message (base58 encoded)

message

The original message that was signed

Response

200 OK
{
  "success": true,
  "data": {
    "userId": "user-abc123",
    "wallet": "9B5X5wUohEaoKHTVzpqsTmWKHS1DL1K5CTbqJ6C7W9jG",
    "createdAt": "2024-01-10T12:00:00Z"
  }
}

Error Response

400 Bad Request
{
  "success": false,
  "error": "Invalid signature"
}