Documentation Index
Fetch the complete documentation index at: https://unitedmarket.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Use Sign-In with Ethereum (SIWE) when calling user-specific endpoints such as authenticated order management, comments, profile updates, or private account views.
Order signing is separate from SIWE. SIWE proves the user owns a wallet session for backend auth; EIP-712 order signing proves the user authorized a specific trade.
| Network | Base URL | Chain ID |
|---|
| Testnet | https://backend-develop.themarketunited.com | 97 |
United Market is currently in sandbox/development stage. All funds, balances, markets, and trades are for testing only and do not represent real money.
1. Request a SIWE Nonce
curl "https://backend-develop.themarketunited.com/auth/nonce/0xYourWallet"
Response:
2. Create and Sign the SIWE Message
import { SiweMessage } from "siwe";
const backendUrl = "https://backend-develop.themarketunited.com";
const chainId = 97;
const siwe = new SiweMessage({
domain: new URL(backendUrl).hostname,
address: walletAddress,
statement: "Sign in to trade.",
uri: backendUrl,
version: "1",
chainId,
nonce,
});
const message = siwe.prepareMessage();
const signature = await walletClient.signMessage({
account: walletAddress,
message,
});
3. Verify the Signature
curl -X POST "https://backend-develop.themarketunited.com/auth/verify" \
-H "Content-Type: application/json" \
-d '{
"message": "SIWE_MESSAGE",
"signature": "0xSIGNATURE"
}'
Response:
{
"accessToken": "jwt...",
"refreshToken": "jwt...",
"user": {
"id": "0xYourWallet"
}
}
4. Use the Bearer Token
curl "https://backend-develop.themarketunited.com/me/orders" \
-H "Authorization: Bearer ACCESS_TOKEN"
5. Place an Order After Sign-in
Signing in does not replace order signing. Build and sign the EIP-712 order using the testnet exchange address.
const domain = {
name: "Polymarket CTF Exchange",
version: "1",
chainId: 97,
verifyingContract: "0xd5a4af09a90d67d37aaa5a6b6f877a6e1cfb9c6f",
} as const;
const signature = await walletClient.signTypedData({
account: walletAddress,
domain,
types,
primaryType: "Order",
message: order,
});
Then submit the signed order. Include the bearer token when using authenticated order routes or user-specific order management.
curl -X POST "https://backend-develop.themarketunited.com/markets/{id}/orders" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orderType": "GTC",
"order": {
"salt": "123456789",
"maker": "0xYourWallet",
"signer": "0xYourWallet",
"taker": "0x0000000000000000000000000000000000000000",
"tokenId": "TOKEN_ID",
"makerAmount": "50000000",
"takerAmount": "100000000",
"expiration": "0",
"nonce": "0",
"feeRateBps": "0",
"side": 0,
"signatureType": 0,
"signature": "0x..."
}
}'
6. Cancel an Order
curl -X POST "https://backend-develop.themarketunited.com/markets/{id}/orders/cancel" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "orderHash": "0xORDER_HASH" }'
Some authenticated routes may also support cancelling directly by order hash:
curl -X POST "https://backend-develop.themarketunited.com/orders/0xORDER_HASH/cancel" \
-H "Authorization: Bearer ACCESS_TOKEN"
7. Refresh a Session
curl -X POST "https://backend-develop.themarketunited.com/auth/refresh" \
-H "Content-Type: application/json" \
-d '{ "refreshToken": "REFRESH_TOKEN" }'