跳到主要内容

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

HTTPcode
400TIMESTAMP_EXPIRED, SELF_REFERRAL, SAME_REFERRER, INVALID_SIGNATURE_FORMAT
401SIGNATURE_INVALID
404CODE_NOT_FOUND
500BIND_FAILED, TX_FAILED