Skip to content

Mint Tokenized Record

Mints a token for an existing record, creating a tokenized record that can be transferred.

Parameters

ParameterTypeDescription
ownerPublicKey | PdaThe owner of the record
authoritySignerThe record owner or class authority (for permissioned classes)
recordPublicKey | PdaThe record account to be tokenized
mintPublicKey | PdaThe mint account for the tokenized record
tokenAccountPublicKey | PdaThe token account that will hold the tokenized record
associatedTokenProgram?PublicKey | PdaOptional Associated Token Program account
token2022?PublicKey | PdaOptional Token2022 Program account
systemProgram?PublicKey | PdaOptional System Program account
class?PublicKey | PdaOptional class account of the record

Returns

Returns a TransactionBuilder that can be used to build and send the transaction.

Example

import { mintTokenizedRecord } from "srs-lib";
 
const transaction = mintTokenizedRecord(context, {
    owner: ownerPublicKey,
    authority: authority,
    record: recordPublicKey,
    mint: mintPublicKey,
    tokenAccount: tokenAccountPublicKey,
    associatedTokenProgram: associatedTokenProgramPublicKey,
    token2022: token2022ProgramPublicKey,
    systemProgram: systemProgramPublicKey,
    class: classPublicKey // Optional, but recommended for permissioned classes
});
 
// Send the transaction
await transaction.sendAndConfirm();

Important Notes

  • The authority must be either the record owner or the class authority (for permissioned classes)
  • The record must not already be tokenized
  • The mint account must be initialized and configured for tokenization
  • The token account will be created if it doesn't exist
  • Only one token will be minted per record
  • The token can be transferred to other accounts after minting
  • For permissioned classes, providing the class account is recommended to ensure proper authority verification
  • The record's data can still be updated after tokenization

Related