Skip to main content

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" }
FieldTypeDescription
amountstringUSDT, human-readable, must be > 0

Response

{
"amount": "50000000",
"nonce": 0,
"deadline": 1772097006,
"signature": "0x9efb5f986acf3dafdd...",
"contract_address": "0x..."
}
FieldDescription
amountOn-chain units (× 10^6) — pass straight to the contract
nonceCurrent per-user nonce read from the contract (rebateNonces(address))
deadlineUnix seconds, 1 hour after issue
signatureBackend EIP-712 signature over ClaimRebate(address user,uint256 amount,uint256 nonce,uint256 deadline)
contract_addressReferralRebate 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

HTTPcode
400INVALID_AMOUNT
500SIGNATURE_ERROR, CONFIG_ERROR