Skip to main content
Minting is a wallet transaction, not a Rawchunks REST endpoint. Finish the audio, pin the final song metadata to IPFS, call the Factory contract or Solana program, verify the mint, then record its chain identity through the song API.

Prepare the final song

Load /api/songs/{id} with the creator’s account header. Check that it has final audio, selling terms and artwork. The signer must be the song’s creator. For an original, source must be empty. Use your own pinning account on your server. For example, this Pinata request pins the final song JSON and returns its CID:
Keep this provider credential on your server. Return the CID to the wallet flow. Pinning JSON does not execute a mint or make the audio URL itself an IPFS file.

Connect the chain client

Use publicClient, walletClient, account and evmContracts from Contracts stack. Choose a network from deployed contracts. Payment-network support alone does not establish a Factory deployment.

Mint and verify

Decode mintedId from this receipt using the Factory event example. Read that song and verify its creator, URI and original-song flags before the catalog update below. Prices in the REST song are decimal amounts. parseUnits converts them to six-decimal atomic units; validate that user-entered prices have at most six decimal places. licenseAmount is the allocation. Read the selected network’s settlement token before showing its currency in your UI. If confirmation is interrupted, recover the saved hash and receipt. Do not issue another mint because the browser stopped waiting. Wallet rejection, chain failure and catalog-update failure need different recovery actions.

Record and publish

Use the request client with the creator account. Set public: false if the mint should stay out of the public catalog. A PATCH only records the result; your integration must verify the chain receipt first. For Solana, use the Solana integration and record its confirmed song ID and transaction signature. For a variation, use the licensed remix flow.