链上领取返佣 (On-Chain Claim)
本文档介绍如何通过智能合约领取推荐返佣。
合约信息
| 合约 | 地址 |
|---|---|
| ReferralRebate | 0xaF486e11c824389E4Ab3ced7608ac3Bd43c176B8 |
| USDT | 0x572E474C3Cf364D085760784F938A1Aa397a8B9b |
Chain ID: 421614 (Arbitrum Sepolia)
领取流程
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ 查询余额 │────▶│ 获取签名 │────▶│ 调用合约 │────▶│ 领取成功 │
│ dashboard │ │claim-sig │ │claimRebate│ │ │
└──────────┘ └──────────┘ └──────────┘ └──────────┘
合约 ABI
[
{
"name": "claimRebate",
"type": "function",
"inputs": [
{"name": "amount", "type": "uint256"},
{"name": "deadline", "type": "uint256"},
{"name": "signature", "type": "bytes"}
],
"outputs": [],
"stateMutability": "nonpayable"
}
]
完整领取流程
Step 1: 获取领取签名
const API_BASE = 'https://api.axblade.io/api/v1';
async function getClaimSignature(jwtToken: string, amountUsdt: string) {
const response = await fetch(`${API_BASE}/referral/on-chain/claim-signature`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${jwtToken}`
},
body: JSON.stringify({ amount: amountUsdt })
});
return response.json();
}