class: The class of the record, chosen from a predefined list of possibilities.
data: The data associated with the record, which can be a string or a buffer, depending on the record class.
Available Record Classes
The following classes are available for domain records:
Bio
Discord
Twitter
Uri
Wallet
Avatar
Minting a Domain Record
Minting a domain record involves creating a new record associated with a domain. You need to provide the class and data fields for the new record. Here's how you can use the mint function to achieve this:
const { transactionHash,fetchResult } =awaitdomain.getRecordRepository(metaNamesSdk).create({ class:RecordClassEnum.Wallet, data:'data'});console.log(`Transaction hash: ${transactionHash}`);constresult=await fetchResult;console.log(`Domain record mint submitted: ${result}`);
Replace 'RecordClassEnum.Wallet' with the desired record class and 'data' with the appropriate data for the record.
Updating a Domain Record
To update an existing domain record, you can use the update function. Here's how you can use the update function: