Skip to content

GET /keys/challenge

The message to sign to create an API key.

GET https://marketmayhem.co/api/v1/keys/challenge
NameInRequiredMeaning
addressqueryyesThe wallet
FieldTypeRequiredMeaning
noncestringyes
expiresintegeryesUnix milliseconds; 5 minutes after it was issued
messagestringyesSign this exact text with the wallet (personal_sign / EIP-191)
nextstringyes

Captured from BSC testnet, exactly as the API sent it (long calldata shortened).

{
"nonce": "dc6e92c43c1d3f116a24932fc7d5f3ca6b76be2a56768626",
"expires": 1790413078980,
"message": "Market Mayhem: create an API key\n\nWallet: 0x2bf842241129be12f3a0e4f21e25d2fd43d9e6da\nNonce: dc6e92c43c1d3f116a24932fc7d5f3ca6b76be2a56768626\n\nTrades built with this key pay this wallet as referrer unless the request names another.\nThis signature costs nothing and moves no money.",
"next": "Sign `message`, then POST /api/v1/keys { nonce, signature, label }."
}

Every error is { "error": { "code", "message", "fix"? } }. This endpoint can answer:

  • INVALID_ADDRESS: A field that must be a 0x address is not one.
  • KEYS_OFF: API keys are switched off on this server.