Overview
Creates an unsigned mint transaction for claiming available tokens. The API validates eligibility, creates the user’s associated token account if needed, and returns a transaction ready for user signing.Request Parameters
The Solana token mint address to claim from
Base58 encoded public key of the user’s wallet
Amount of tokens to claim (as string to handle large numbers)
Response
Indicates if the operation was successful
Base58 encoded unsigned transaction that needs to be signed by the user
Unique identifier for this transaction (needed for confirmation)
The associated token account address where tokens will be minted
The amount of tokens that will be claimed
Number of decimal places for the token
Instructions for the next step in the process
Success Response
Error Responses
400 - Missing Parameters
400 - Missing Parameters
400 - Amount Exceeds Available
400 - Amount Exceeds Available
400 - No Tokens Available
400 - No Tokens Available
400 - No Mint Authority
400 - No Mint Authority
404 - Token Not Found
404 - Token Not Found
500 - Configuration Error
500 - Configuration Error
500 - Transaction Creation Failed
500 - Transaction Creation Failed
Process Flow
This endpoint performs several validations and setup steps:1
Validate Environment
Checks that required environment variables (RPC_URL, PROTOCOL_PRIVATE_KEY) are configured
2
Validate Parameters
Ensures all required parameters are provided and valid
3
Check Token Existence
Verifies the token was launched through this API
4
Validate Eligibility
Re-calculates claim eligibility to ensure the request is valid
5
Verify Mint Authority
Confirms the protocol still has mint authority for the token
6
Get/Create Token Account
Gets or creates the user’s associated token account for this token
7
Create Mint Instruction
Builds the mint instruction with the correct decimal amount
8
Build Transaction
Creates a complete transaction with recent blockhash and user as fee payer
9
Store Transaction Data
Temporarily stores transaction details for confirmation step
10
Return Unsigned Transaction
Returns the Base58 encoded transaction for user signing
Transaction Key
ThetransactionKey is essential for the confirmation step:
- Format:
{tokenAddress}_{userWallet}_{timestamp} - Expiration: Automatically cleaned up after 10 minutes
- Required: Must be provided to
/claims/confirm
Associated Token Account
The API automatically handles associated token account (ATA) creation:- If exists: Uses the existing ATA
- If missing: Creates a new ATA (protocol pays rent)
- Address: Deterministic based on wallet + token mint
Decimal Handling
Token amounts are handled with proper decimal precision:- Input: Raw token amount (e.g., 1000000 for 1M tokens)
- Processing: Multiplied by 10^decimals for blockchain
- Most tokens: Use 9 decimal places
- Returned:
mintDecimalsfield shows the actual decimal count
Rate Limiting
This endpoint is subject to rate limiting:- 8 requests per IP per 2-minute window
- Returns HTTP 429 when limit exceeded
Security Validations
Real-time Validations:
- Eligibility is re-calculated at request time
- Mint authority is verified before transaction creation
- Token existence is confirmed
- User cannot claim more than eligible amount
Next Steps
After receiving the unsigned transaction:- Deserialize the transaction using
@solana/web3.js - Sign the transaction with your wallet
- Submit the signed transaction to
/claims/confirm
Transaction Storage
Transaction data is stored temporarily:- Storage Duration: 10 minutes maximum
- Cleanup: Automatic cleanup of expired transactions
- Expiration: You must call
/claims/confirmwithin the time window
