Delete Domains
Domain deletion permanently removes the domain from your ownership and returns it to the global namespace. Once deleted, the domain becomes available for anyone to register, meaning you lose all control and access to it.
import {
getDomainKeySync,
NAME_PROGRAM_ID,
deleteInstruction,
} from "@bonfida/spl-name-service";
const domain = "bonfida.sol"; // With or without .sol
// Owner public key
const owner = new PublicKey("...")
const { pubkey: domainKey } = getDomainKeySync(domain);
const ix = deleteInstruction(
NAME_PROGRAM_ID,
domainKey,
owner,
owner
);
// sign and send instruction...
Last updated