Claim Season Tokens
Generates an EIP-712 signature payload. The user presents this signature to the on-chain contract to claim their season token reward.
The endpoint is idempotent — repeated calls with the same (user, distribution, nonce) return the same signature.
POST /points/claim/:distribution_id
Authorization: Bearer <token>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
distribution_id | UUID | Distribution record ID (the id field from GET /points/distribution/:season_id) |
Request Body
None.
Response
{
"user": "0xabcd...1234",
"distribution_id": "f1e2d3c4-...",
"amount": "805.00",
"nonce": 1,
"deadline": 1741132800,
"signature": "0x4a5b6c...f0a1b2",
"domain": {
"name": "AXBlade Points Distribution",
"version": "1",
"chain_id": 1,
"verifying_contract": "0xContractAddress..."
}
}
The response is a flat structure (no nested
eip712_payload).amountis human-readable (not wei) — the contract converts to 18-decimal precision on-chain.deadlineis a Unix timestamp in seconds.
Response Fields
| Field | Type | Description |
|---|---|---|
user | string | User's wallet address |
distribution_id | string | Distribution record UUID |
amount | Decimal | Token amount to claim (human-readable) |
nonce | int | EIP-712 nonce |
deadline | int | Claim deadline (Unix seconds) |
signature | string | Backend-signed EIP-712 signature |
domain.name | string | EIP-712 domain name |
domain.version | string | EIP-712 domain version |
domain.chain_id | int | Chain ID |
domain.verifying_contract | string | On-chain verifying contract address |
EIP-712 Struct
ClaimPointsRewards(
address user,
uint256 distributionId,
uint256 amount,
uint256 nonce,
uint256 deadline
)
distributionId— big-endian uint256 representation of the distribution UUIDamount— converted to 18-decimal wei for on-chain verification- Signature expires at
claim_deadline(claim_statusbecomesexpiredafter that) - After on-chain confirmation:
claim_status → claimed,claimed_atandclaim_tx_hashare filled in
Error Codes
| Code | Description |
|---|---|
FORBIDDEN | Distribution record does not belong to the current user |
NOT_FOUND | Distribution record not found |
ALREADY_CLAIMED | Already claimed |
EXPIRED | Past the claim deadline |
SIGNER_UNAVAILABLE | Backend signing key not configured |
SIGN_FAILED | Signing failed |
Code Examples
Python
import requests
BASE_URL = "https://api.primit.io/api/v1"
JWT_TOKEN = "your_jwt_token"
DISTRIBUTION_ID = "f1e2d3c4-..."
resp = requests.post(
f"{BASE_URL}/points/claim/{DISTRIBUTION_ID}",
headers={"Authorization": f"Bearer {JWT_TOKEN}"},
)
data = resp.json()
print(f"Amount: {data['amount']} tokens")
print(f"Signature: {data['signature']}")
print(f"Deadline: {data['deadline']} (unix)")
# Pass data to on-chain contract to complete the claim