Skip to main content

Presales

Presales are read-only in the public API. You can list every presale, read one presale’s public state, and read the participation record for the wallet your API key is pinned to. There are no presale write operations in v2 — deposits, claims, and refunds happen in the Blank app. For the product rules behind caps, allocations, and settlement, see Pre-Raise.

Operations

Base URL is https://api.blank.build/api/v2. See Scopes for how to grant presales:read, and Conventions for the pagination, caching, rate-limit, and retry contract.

Client setup

API keys are server-side only. Never ship one to a browser.
Every SDK call resolves to { data, metadata, response }. data is the parsed payload, metadata carries the request ID and rate-limit state, and response is the raw Response.

List presales

listPresales is newest-first and cursor paginated. Pass cursor and limit (1–100, default 50).
The raw response is a standard cursor collection:
Anonymous reads work over plain HTTP with no credentials:
Both list and detail responses carry an ETag. Send it back as If-None-Match to get a 304 instead of a body.

Presale fields

All lamport fields are unsigned integer strings. 1 SOL = 1,000,000,000 lamports. Parse them with BigInt, never Number — a large raise overflows IEEE-754 precision and silently rounds.
getPresale returns public state only. Custody internals are deliberately excluded from the API surface.

Your participation

getPresaleParticipation requires an API key with the presales:read scope and is never cached (private, no-store).
This route returns participation only for the wallet pinned to your API key. A v2 API key is bound to one Blank account, and that account has one verified wallet. There is no parameter for reading someone else’s participation, and no key can do it.
tokenAllocationRaw is a raw on-chain amount in the token’s base units — it is not scaled by decimals. Keep it as a BigInt and apply the mint’s decimals yourself when displaying it. A useful polling shape: watch status move from active to claimable or refundable, then to claimed or refunded once the corresponding signature appears.

Errors

Errors use the shared problem-details body documented in Error Model. If a call behaves unexpectedly, Troubleshooting covers the common causes.