Skip to content

Delete Record

Permanently deletes a record from the blockchain. This operation cannot be undone.

Parameters

ParameterTypeDescription
authoritySignerThe record owner or class authority (for permissioned classes)
recordPublicKey | PdaThe record account to be deleted
class?PublicKey | PdaOptional class account of the record

Returns

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

Example

import { deleteRecord } from "srs-lib";
 
const transaction = deleteRecord(context, {
    authority: authority,
    record: recordPublicKey,
    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)
  • This operation is permanent and cannot be undone
  • All record data will be permanently removed from the blockchain
  • For permissioned classes, providing the class account is recommended to ensure proper authority verification
  • The record's associated token (if any) must be burned before deleting the record

Related