GetMintDetails

GetMintDetails function

GetMintDetails function returns data with details about minting a single/specific subname under a listed ENS name.

Usage

index.ts
const listedName = await NamespaceClient.getListedName("example.eth", sepolia.id);
const minterAddress = "0x3E1e131E7e613D260F809E6BBE6Cbf7765EDC77f";
const subnameLabel = "hello";

const mintDetails = await NamespaceClient
        .getMintDetails(listedName, subnameLabel, minterAddress);

Return Type

The Data returned from this function answers the questions:

  • What is the total price of minting a given subname

  • Is minter address allowed to mint a subname

  • Is minter address required to perform verification in order to mint a subname

export interface MintDetails {
  canMint: boolean;
  estimatedPrice: number;
  estimatedFee: number;
  validationErrors: MintDeniedReason[];
  requiresVerifiedMinter: boolean;
  isStandardFee: boolean;
}
  1. canMint - specifies whether a minter address has permission to mint a subname, will be false in case the listing uses whitelist functionality and the minter address is not whitelisted

  2. estimatedPrice - The price for minting a subname, set by listing owner

  3. estimatedFee - The minting fee for minting a subname

  4. validationErrors - If the subname cannot be minted, the validation errors will specify the reason. There could be different reasons, such as: 1. Listing has expired. 2. Minter is not whiteslited, 3. Minter doesn't have a required token in case listing uses token gated access etc.

  5. requiresVerifiedMinter - Specifies whether a minter needs to provide an authentication token when minting a subname. This will be the case when listing uses Whitelist function, the minter address is whitelisted and therefore it needs to prove address ownership.

Last updated