On-chain Claim Signature
Get a backend EIP-712 signature that lets you withdraw accrued rebates directly from the ReferralRebate contract to your wallet.
POST /referral/on-chain/claim-signature
Content-Type: application/json
Auth: Authorization: Bearer <JWT> from the EIP-712 login. API keys are not accepted.
Request body
{ "amount": "50.00" }
| Field | Type | Description |
|---|---|---|
amount | string | USDT, human-readable, must be > 0 |
Response
{
"amount": "50000000",
"nonce": 0,
"deadline": 1772097006,
"signature": "0x9efb5f986acf3dafdd...",
"contract_address": "0x..."
}
| Field | Description |
|---|---|
amount | On-chain units (× 10^6) — pass straight to the contract |
nonce | Current per-user nonce read from the contract (rebateNonces(address)) |
deadline | Unix seconds, 1 hour after issue |
signature | Backend EIP-712 signature over ClaimRebate(address user,uint256 amount,uint256 nonce,uint256 deadline) |
contract_address | ReferralRebate on this chain |
Contract call
const abi = ["function claimRebate(uint256 amount, uint256 deadline, bytes calldata signature) external"];
const rebate = new ethers.Contract(contract_address, abi, signer);
const tx = await rebate.claimRebate(amount, deadline, signature);
await tx.wait();
The contract verifies the signature against the backend signer, checks deadline, consumes the nonce and transfers USDT. A new signature must be requested after expiry; a used nonce invalidates any older signature.
Errors
| HTTP | code |
|---|---|
| 400 | INVALID_AMOUNT |
| 500 | SIGNATURE_ERROR, CONFIG_ERROR |