Skip to main content
POST
/
v1
/
auth
/
get-message
Get Message
curl --request POST \
  --url https://swap-api.flux.fun/v1/auth/get-message \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "isSmartContractWallet": false,
  "chainId": 8453
}
'
{
  "success": true,
  "challenge": {
    "message": "Sign into prediction market swaps by MoonPay.\n       \n      WARNING: do not sign this message on any other site.\n    \n      Challenge: a1b2c3d4e5f6...",
    "extraData": "{\"walletAddress\":\"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\"expiresOn\":\"2024-01-15T10:01:00.000Z\",\"hmac\":\"a1b2c3d4e5f6...\"}"
  }
}

Authorizations

x-api-key
string
header
required

Body

application/json
walletAddress
string
required

Your EVM wallet address. Must be a valid Ethereum address format.

Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"

isSmartContractWallet
boolean
required

Whether the wallet is a smart contract wallet (EIP-1271) or an EOA

Example:

false

chainId
number

The chain ID where the signature will be verified. Required if isSmartContractWallet is true. Defaults to 8453 (Base) for EOAs.

Example:

8453

Response

Challenge message generated

success
boolean
required
Example:

true

challenge
object
required

The challenge object containing the message to sign