Quickstart
Request a partner key scoped to your collections and application origins, then install the SDK:
npm i @solanadeads/gravemintThe package includes TypeScript types and supports ESM and CommonJS.
Read a drop
import { GraveMintClient } from '@solanadeads/gravemint';
const gm = new GraveMintClient({ apiKey: 'gm_pub_…' });
const drop = await gm.v1.collection('deads');
// drop.collection — name, image, chain and socials
// drop.stats — totalSupply, mintedCount, availableCount, percentMinted
// drop.phases.active — array of active phases
// drop.serverTime — server timestamp for countdownsThe collection read accepts a short ID, UUID or on-chain address. Prefer the short ID for public URLs and preserve address case.
Render the price correctly
Read the phase's priceDisplay and handle each kind:
const phase = drop.phases.active[0];
const p = phase?.priceDisplay;
const label = p?.kind === 'amount'
? (p.isFree ? 'Free' : `${p.amount} ${p.currency}`)
: p?.kind === 'range'
? `${p.min}–${p.max} ${p.currency}`
: p?.kind === 'hidden'
? 'Price revealed when you qualify'
: 'See on GraveMint';This example selects the first active phase. If a collection has several, let the collector choose the appropriate phase. Display hidden and unknown without assigning them a zero price.
Mint
Use a base64 signer to connect your wallet library. mint() coordinates preparation, signing and server submission:
import { MintOutcomeUnknownError, type TransactionSigner } from '@solanadeads/gravemint';
async function mintOne(signer: TransactionSigner, walletAddress: string) {
if (!drop.capabilities.supportedBySurface || !phase) {
throw new Error('Open the hosted mint page for this collection.');
}
try {
const result = await gm.mint.mint({
collectionId: drop.collection.id,
phaseId: phase.id,
walletAddress,
quantity: 1,
signer,
});
return result;
} catch (error) {
if (error instanceof MintOutcomeUnknownError) {
// Save error.sessionIds and check the wallet before allowing another mint.
// The submitted transaction may still complete.
}
throw error;
}
}The wallet signs the prepared bytes; GraveMint validates and broadcasts them. Pass signed transactions to the SDK rather than broadcasting them with your wallet library. See wallets and signing for the manual flow, batch results and session handling.
Supported features
Check the collection's capabilities before enabling the mint flow. For collections that require features outside the core surface, offer the hosted mint page:
if (!drop.capabilities.supportedBySurface) {
return drop.capabilities.mintUrl
? <a href={drop.capabilities.mintUrl}>Mint on GraveMint</a>
: <p>This collection is not available through this integration.</p>;
}Next
- The read model: phases, prices, eligibility and wallet limits.
- Wallets and signing: signer adapters, submission and batch outcomes.
- React mint panel: a component example to adapt to your application.
- Keys and origins: browser and server configuration.
- Errors and troubleshooting: response codes and recovery steps.
- SDK reference, v1 API and MCP server.
