> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flux.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Message

> Request a challenge message that you'll sign with your wallet to authenticate. The challenge includes an HMAC that expires after 1 minute, so you should sign and submit it promptly.



## OpenAPI

````yaml openapi.json post /v1/auth/get-message
openapi: 3.0.0
info:
  title: Swaps API
  description: The Swaps API documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://swap-api.flux.fun
    description: Production
  - url: http://localhost:3000
    description: Development
security: []
tags: []
paths:
  /v1/auth/get-message:
    post:
      tags:
        - Authentication
      summary: Get Message
      description: >-
        Request a challenge message that you'll sign with your wallet to
        authenticate. The challenge includes an HMAC that expires after 1
        minute, so you should sign and submit it promptly.
      operationId: AuthController_walletChallenge
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetMessageRequestDto'
      responses:
        '200':
          description: Challenge message generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMessageResponseDto'
        '400':
          description: Invalid wallet address or parameters
      security:
        - api-key: []
components:
  schemas:
    GetMessageRequestDto:
      type: object
      properties:
        walletAddress:
          type: string
          description: Your EVM wallet address. Must be a valid Ethereum address format.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
        isSmartContractWallet:
          type: boolean
          description: Whether the wallet is a smart contract wallet (EIP-1271) or an EOA
          example: false
        chainId:
          type: number
          description: >-
            The chain ID where the signature will be verified. Required if
            isSmartContractWallet is true. Defaults to 8453 (Base) for EOAs.
          example: 8453
      required:
        - walletAddress
        - isSmartContractWallet
    GetMessageResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        challenge:
          description: The challenge object containing the message to sign
          allOf:
            - $ref: '#/components/schemas/ChallengeDto'
      required:
        - success
        - challenge
    ChallengeDto:
      type: object
      properties:
        message:
          type: string
          example: |-
            Sign into prediction market swaps by MoonPay.
                   
                  WARNING: do not sign this message on any other site.
                
                  Challenge: a1b2c3d4e5f6...
          description: The message you need to sign with your wallet
        extraData:
          type: string
          example: >-
            {"walletAddress":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","expiresOn":"2024-01-15T10:01:00.000Z","hmac":"a1b2c3d4e5f6..."}
          description: >-
            JSON string containing challenge metadata (walletAddress, expiresOn,
            hmac)
      required:
        - message
        - extraData
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key

````