NFTs

NFTs

PirateCrew NFTs are mpl-core assets — Metaplex's single-account NFT model, not the older Token Metadata + SPL Token + master-edition stack. Each NFT is one account: the asset itself stores the owner, the name, the URI, and any plugins (royalties, attributes, freeze rules). No associated token account, no master edition, no edition marker. Half the accounts, ~half the rent.

mpl-core program: CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d.
Pirates program: BpEjeUewpz8v3QTenXTwkknBBsXaRH37DW7x2jKmVrAg.

NFTs are typically minted into a Pirates collection — itself an mpl-core collection account that lives at a known address. The collection groups assets, anchors shared royalty/auth plugins, and is referenced explicitly on every mint and burn.

Lifecycle

NFT lifecycle — mint, hold, burn (atomically claims GOLD points)

Both endpoints are user-signed only. mode=signed is rejected — the asset payer (mint) and the asset owner (burn) are the only valid signing authorities, and the Privy platform wallet is neither.

Important — burning is not just destruction. The same transaction that closes the asset also transfers the NFT's accumulated GOLD-point balance to the user's GOLD associated token account. Don't surface "burn" as a destructive action in your UI; surface it as claim and burn.

Endpoints

MethodPathModeScopeNotes
POST/v2/nftsunsigned onlyn/a (signed rejected)Creates an mpl-core asset under a Pirates collection
DELETE/v2/nfts/{asset}unsigned onlyn/a (signed rejected)Burns the asset and transfers GOLD points to the owner

Asset state (owner, plugins, GOLD-points config) lives entirely on-chain. To read the current state of an asset, derive the relevant PDA via POST /v2/pdas/user_nft_config and fetch the raw account with GET /v2/accounts/{address}. There is no direct GET /v2/nfts/{asset} route — querying chain state is cheaper than maintaining a parallel DB index.

GOLD mint: GoLDDqDRHcGZBiGPeXAYi5ougndqBNQSNXdNeT3re6gr.

Mint

curl -X POST https://api.piratecrew.fun/v2/nfts \
  -H "Authorization: Bearer $PIRATE_API_KEY" \
  -H "Idempotency-Key: 1c2d3e4f-..." \
  -H "Content-Type: application/json" \
  -d '{
    "payer": "USER_WALLET_PUBKEY",
    "platform_id": "pirate-crew",
    "collection": "COLLECTION_PUBKEY",
    "name": "Captain Redbeard #042",
    "uri": "https://example.com/metadata/042.json",
    "mode": "unsigned"
  }'

Response:

{
  "data": {
    "mode": "unsigned",
    "transaction": "AQABAo...",
    "asset": "ASSET_PUBKEY"
  },
  "meta": { "request_id": "req_…" }
}
  • name — 1 to 64 characters; stored on the asset account itself (no separate metadata account).
  • uri — an http/https URL pointing to standard JSON metadata. Host on Storacha, Helius, S3, or any HTTPS host.
  • collection — the mpl-core collection address the asset is minted into.

Sign with the user wallet and submit via POST /v2/transactions. The new asset address is returned alongside the transaction so you can show it in your UI before the transaction lands.

Burn

curl -X DELETE https://api.piratecrew.fun/v2/nfts/ASSET_PUBKEY \
  -H "Authorization: Bearer $PIRATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "owner": "USER_WALLET_PUBKEY",
    "platform_id": "pirate-crew",
    "collection": "COLLECTION_PUBKEY",
    "mode": "unsigned"
  }'

Same wrapped { mode, transaction } response shape. Once confirmed:

  • The mpl-core asset account is closed.
  • The asset's accrued GOLD-point balance has been transferred to the owner's GOLD ATA (created in the same tx if it didn't exist).
  • Rent from the closed asset returns to the owner.

If you need to know how many GOLD points an asset is sitting on before burning, derive the asset's reward-config PDA via POST /v2/pdas/user_nft_config and read it with GET /v2/accounts/{address} — the value is on-chain and deterministic.

Why mpl-core?

Compared to the legacy Token Metadata stack, mpl-core gives PirateCrew:

  • One account per NFT. No mint account, no associated token account, no master edition. Lower rent, fewer accounts to thread through every instruction.
  • Native plugin system. Royalties, freeze delegate, attributes, transfer rules — all live on the same asset account and execute on-chain without extra programs.
  • Collection-level state. Royalties and freeze rules can be declared once on the collection and inherited by every asset, instead of duplicated per mint.

The trade-off is that any wallet UI that hasn't shipped mpl-core support yet won't display these NFTs natively. All major wallets (Phantom, Solflare, Backpack) added mpl-core display in 2024.

Reference