Bind Referral Code
Bind the current account (as a trader) to a referrer's code. Calling it again with a different code rebinds: the old referrer's count drops by one, the new one's rises, and only future fills accrue to the new referrer.
POST /referral/bind
Content-Type: application/json
Auth: Authorization: Bearer <JWT> from the EIP-712 login. API keys are not accepted.
Request body
{ "code": "4DDDC2D4", "signature": "0x...", "timestamp": 1772010600 }
EIP-712 message
{
"primaryType": "BindReferralCode",
"types": {
"BindReferralCode": [
{ "name": "wallet", "type": "address" },
{ "name": "code", "type": "string" },
{ "name": "timestamp", "type": "uint256" }
]
},
"message": { "wallet": "0x<your_address>", "code": "4DDDC2D4", "timestamp": 1772010600 }
}
The signature is verified: the recovered signer must equal the JWT's wallet address, and timestamp (seconds) must be within ±5 minutes.
Response
{ "success": true, "referrer_address": "0x29f721b203a9fc9c5dde35a739d8b8e0e4605489", "referrer_code": "4DDDC2D4" }
Errors
| HTTP | code |
|---|---|
| 400 | TIMESTAMP_EXPIRED, SELF_REFERRAL, SAME_REFERRER, INVALID_SIGNATURE_FORMAT |
| 401 | SIGNATURE_INVALID |
| 404 | CODE_NOT_FOUND |
| 500 | BIND_FAILED, TX_FAILED |