cURL
curl --request POST \ --url https://demo-api.mobula.io/api/2/pm/auth/build \ --header 'Content-Type: application/json' \ --data ' { "address": "<string>", "nonce": 0 } '
{ "data": { "domain": { "name": "<string>", "version": "<string>", "chainId": 123 }, "types": {}, "primaryType": "<string>", "message": { "address": "<string>", "timestamp": "<string>", "nonce": "<string>", "message": "<string>" } }, "hostname": "<string>", "took": 123 }
Build EIP-712 typed data for authenticating with the Polymarket CLOB API. Sign the returned data and submit to Auth Derive to obtain API credentials.
0
Show ClobAuthTypedData
Show Domain
"ClobAuthDomain"
"1"
ClobAuth
"ClobAuth"
Show Message
"This message attests that I control the given wallet"
curl -X POST "https://api.mobula.io/api/2/pm/auth/build" \ -H "Content-Type: application/json" \ -d '{ "address": "0xYourWalletAddress", "nonce": 0 }'
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 }
Auth typed data
Show child attributes