Alpha — This endpoint is part of the Prediction Markets API, currently in early access. May change without notice.
Request Body
The wallet address to authenticate.
Optional nonce for the authentication message. Use 0 for first-time auth or increment for key rotation.
Response
EIP-712 typed data to sign.
EIP-712 domain.
Domain version (e.g., "1").
Chain ID (137 for Polygon).
EIP-712 type definitions for ClobAuth.
Message to sign.
Epoch timestamp in seconds.
Attestation message: "This message attests that I control the given wallet".
Request processing time in milliseconds.
Usage Example
curl -X POST "https://api.mobula.io/api/2/pm/auth/build" \
-H "Content-Type: application/json" \
-d '{ "address": "0xYourWalletAddress", "nonce": 0 }'
Integration Example
import { signTypedData } from 'viem/accounts';
// 1. Build auth typed data
const res = await fetch('https://api.mobula.io/api/2/pm/auth/build', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ address: walletAddress, nonce: 0 })
});
const { data: typedData } = await res.json();
// 2. Sign it with your wallet
const signature = await signTypedData({
...typedData,
privateKey: '0x...'
});
// 3. Derive credentials using the signature
const deriveRes = await fetch('https://api.mobula.io/api/2/pm/auth/derive', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
address: walletAddress,
signature,
timestamp: typedData.message.timestamp,
nonce: 0
})
});
const { data: credentials } = await deriveRes.json();
// credentials = { apiKey, apiSecret, apiPassphrase }