Skip to main content

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

string
required
The Solana token mint address to claim from
string
required
Base58 encoded public key of the user’s wallet
string
required
Amount of tokens to claim (as string to handle large numbers)

Response

boolean
Indicates if the operation was successful
string
Base58 encoded unsigned transaction that needs to be signed by the user
string
Unique identifier for this transaction (needed for confirmation)
string
The amount of tokens that will be claimed
array
Array of recipients who will receive tokens from this claim, each containing:
  • wallet (string): The recipient’s wallet address
  • amount (string): The amount allocated to this recipient
  • label (string, optional): Description of the recipient (e.g., “Developer”)
string
The amount allocated to protocol fees (10% of total claim)
number
Number of decimal places for the token
string
Instructions for the next step in the process

Success Response

Error Responses

The user is trying to claim more than they’re eligible for.
The user has no tokens available to claim at this time.
The protocol has lost mint authority or the token wasn’t launched through this API.
Or:

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

The transactionKey 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: mintDecimals field 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:
  1. Deserialize the transaction using @solana/web3.js
  2. Sign the transaction with your wallet
  3. 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/confirm within the time window