HTTP API
Use public discovery and configuration endpoints without a wallet.
The public HTTP API serves configuration and indexed discovery data. Reads do not require a wallet. Contract calls remain the right source for a final quote, listing validity, balance, allowance, or owner check.
Configuration endpoints
| Method | Path | Returns |
|---|---|---|
GET | /api/launchpad/config | Chain, launch contracts, swap infrastructure, fee tier, initial buy |
GET | /api/nft/config | Chain, NFT contracts, fees, pause state, confirmations, upload limits |
GET | /api/nft/ready | Deployment readiness and active NFT contract identity |
The launchpad configuration reports referralsEnabled and referralShareBps for the active factory and router deployment.
Referral endpoints
| Method | Path | Authentication | Use |
|---|---|---|---|
GET | /api/referrals/:code | Public | Validate a shared referral code |
POST | /api/referrals/claim | Wallet session | Claim a permanent custom code from { "code": "alice" } |
GET | /api/referrals/me | Wallet session | Read link, launch, wallet, and payout totals |
POST | /api/referrals/attribution | Wallet session | Bind the wallet to its first valid code |
GET | /api/referrals/attribution | Wallet session | Read the wallet's permanent attribution |
Create a wallet session through /api/auth/challenge and /api/auth/session, then send Authorization: Bearer <sessionToken> to authenticated endpoints.
Launchpad discovery
| Method | Path | Useful parameters |
|---|---|---|
GET | /api/launchpad/tokens | limit, offset |
GET | /api/launchpad/token | tokenAddress |
GET | /api/launchpad/trades | tokenAddress, limit |
GET | /api/launchpad/klines | tokenAddress, interval, limit |
curl 'https://spawn.finance/api/launchpad/tokens?limit=20&offset=0'
curl 'https://spawn.finance/api/launchpad/token?tokenAddress=0x...'
NFT discovery
| Method | Path | Useful parameters |
|---|---|---|
GET | /api/nft/collections | query, creatorAddress, ownerAddress, sort, limit, offset |
GET | /api/nft/collections/:contractAddress | Collection address in the route |
GET | /api/nft/items | collectionAddress, ownerAddress, listed, query, sort, limit, offset |
GET | /api/nft/items/:contractAddress/:tokenId | Collection and token ID in the route |
GET | /api/nft/listings | collectionAddress, sellerAddress, status, limit, offset |
GET | /api/nft/listings/:contractAddress/:tokenId | Current indexed listing |
GET | /api/nft/activity | collectionAddress, tokenId, accountAddress, type, limit, offset |
const url = new URL("/api/nft/items", window.location.origin);
url.searchParams.set("listed", "true");
url.searchParams.set("sort", "recent");
url.searchParams.set("limit", "24");
const response = await fetch(url);
if (!response.ok) throw new Error("NFT items did not load.");
const page = await response.json();
Submit a confirmed NFT transaction
The frontend can ask the indexer to inspect a transaction after it reaches six confirmations.
curl -X POST 'https://spawn.finance/api/nft/transactions' \
-H 'content-type: application/json' \
--data '{"txHash":"0x..."}'
The backend verifies the receipt, target contracts, event topics, block hash, and confirmation count. The response reports recognized and indexed event counts.
Pagination and freshness
List responses include total, limit, and offset. Cache discovery pages briefly, then refresh after indexed transactions or while a market is active. Do not cache direct contract validation behind the same discovery policy.