Connect the wallet and network
Use the Solana Kit setup with your connected wallet’s transaction signer. Check the selected cluster and program availability before enabling a mint button. The signer pays fees and account rent, and must match the Rawchunks song’s creator. The references give actual instruction layouts and Kit examples. They do not require a separate Rawchunks SDK.Mint an original
Prepare the final song and metadata CID as in the mint guide. SetmetadataUri to ipfs:// followed by the CID. Follow the Factory instruction example with your song’s terms:
Read Factory’s
nextSongId and derive the song PDA immediately before building. Simulate, sign and confirm the instruction. Store its signature before sending, then read the resulting song account. Confirm its ID, creator, URI and original flags.
Another mint can use the next ID first. After a confirmed seed conflict, reload and rebuild. Do not resubmit a transaction with uncertain confirmation.
Record the confirmed result
Here,chainSongId is the verified Factory song ID and signature is the confirmed transaction signature from the send step. Use the creator’s request client:
Buy a license
This step is unavailable on the current published devnet configuration. On a deployment where it is enabled:- Read the original song and check its creator, URI, network and remixable-original flags.
- Check the buyer’s license PDA. Existing rights do not require another purchase.
- Read the settlement mint and treasury from Royalties config. Derive the buyer, creator and treasury token accounts for that mint; create missing associated token accounts.
- Build Remix instruction 4 with its exact 9-byte data and 15 accounts, then simulate, sign and confirm.
- Read the resulting license record and check its song ID and buyer before opening an editable draft.
Mint the variation
With confirmed rights, create the REST draft and edit it as in licenses and variations. Pin its final metadata. Build Remix instruction 1 with the confirmed original ID, zero allocation and license price, your stored stream rate and the final URI. Read the current Factory next ID and original remix count before deriving its new song and record PDAs. Use the exact account order in that reference. Simulate, sign and confirm. Read the new song and verify the remixer, URI,isRemix = true and original parent ID. Record its confirmed ID, signature, CID and network through the draft’s song PATCH using the same fields as the original step.
Use your Rawchunks session for paid music API calls. Chain minting and license purchases use wallet transactions on the selected deployment.