GetMintTransactionParameters is a function which generates all the required parameters needed to send a successful transaction and mint a subname on a given chain.

Usage

index.ts
import {
  MintTransactionRequest,
  MintTransactionResponse,
} from "@namespacesdk/mint-manager";

const request: MintTransactionRequest = {
  parentName: "namespace.eth",
  label: "superman",
  owner: "0x1D84ad46F1ec91b4Bb3208F645aD2fA7aBEc19f8", // optional
  minterAddress: "0x1D84ad46F1ec91b4Bb3208F645aD2fA7aBEc19f8",
  expiryInYears: 1, // optional
  records: {
    texts: {
      name: "Superman",
      avatar: "https://my-avatar-uri",
      description: "I am superman",
    },
    addresses: {
      60: "0x1D84ad46F1ec91b4Bb3208F645aD2fA7aBEc19f8",
    },
  },
};

const response: MintTransactionResponse =
  await mintClient.getMintTransactionParameters(request);

MintTransactionRequest

ParameterDescriptionRequired
parentNameName of listed ENS nameYes
labelThe full subname will be ${label}.${parentName}Yes
ownerThe owner of minted subname NFTNo, defaults to minter address
minterAddressAddress of a wallet which is going to perform mint transactionYes
expiryInYearsFor subnames which are expirable, this is where the expiry in years is set.No, defaults to 1 year
recordsText and Address records to be set in the same transactionNo

MintTransactionResponse

The response object contains all the needed information that can be used to send a transaction and mint a subname.
export interface MintTransactionResponse {
  contractAddress: Address;
  args: any[];
  account: string;
  abi: any;
  functionName: string;
  value: bigint;
}