POST /api/v1/mint

Endpoint responsible for generation of subname minting parameters

As stated above, this endpoint can be used to generate the minting parameters required for minting subnames on our smart contract.

To generate minting parameters, you would need to make a POST request with JSON parameters in a request body.

Example request:

{
    "subnameLabel: "my-subname-label",
    "parentLabel": "listed-name-label",
    "subnameOwner": "0xb219f3C5BfC83707BcC3E151B6f0C9b84eD21Ed2",
    "resolver": "0x8FADE66B79cC9f707aB26799354482EB93a5B7dD",
    "network:": "sepolia"
}

Parameters:

  • subnameLabel

  • parentLabel: Label of listed ENS name ( without .eth)

  • subnameOwner: specifies which address will be the owner of the minted subname

  • resolver: resolver address which will be used by minted subname, if not specified, the latest ENS PublicResolver will be used

  • network: "sepolia" or "mainnet"

If the minter is allowed to mint a subname with the parameters about, the backend API will return a response with valid minting parameters.

Example response:

{ 
    "parameters": 
    {
        "fuses":327680,
        "mintFee":"500000000000000",
        "mintPrice":"100000000000000",
        "parentNode":"0x86b8df7717d51a57dd8b2aeda99c3e8d925c733d9eaeb90681d392eb1f483147",
        "resolver":"0x8FADE66B79cC9f707aB26799354482EB93a5B7dD",
        "subnameLabel":"my-subname-label",
        "subnameOwner":"0xAF01A75196273a7eEd5C74445Ab53f3A0a775F99",
        "ttl":0
    },
        "signature": "0xacbbc277f60073cc4540b28c0c21992c46bbc5wfgsbc4twergsd46929cd43245ssg92541373543212b30ebf67d186c94e5be20f5fbc92fd3fc57af2d563971c"      
}

The parameters from the response can be used to mint a subname by calling the "mint" function on our smart contract which is responsible for minting subnames Namespace Minter.

If the minter is not allowed to mint a subname, the API will return a BadRequest(400) exception with one of these reasons (specified in the message parameter of the response).

Example validation error response:

{
    status: 400,
    message: "SUBNAME_TAKEN"
    timestamp: 2384923234
}

The reason for failed minting validation can be one of these reasons:

  • SUBNAME_TAKEN - Subname is already registered by another address

  • MINTER_NOT_TOKEN_OWNER - Some ENS names can require the minter to be the owner of an ERC20/712/1155 token in order to mint subnames.

  • MINTER_NOT_WHITELISTED - For ENS names that use the whitelist feature, the minter will have to be whitelisted in order to mint the subname.

  • LISTING_EXPIRED - The ENS name owner can set a minting deadline. If the deadline expires, minting will not be possible.

  • SUBNAME_RESERVED - The ENS name owner can reserve some labels for himself, these subnames cannot be minted.

  • VERIFIED_MINTER_ADDRESS_REQUIRED - For minting subnames under ENS names that use Whitelisting or TokenGatedAccess, the minter will have to sign a message and verify that he's an owner of whitelisted/token address. In order to mint a subname under these kinds of listings, you will have to use POST /api/v1/mint/verifiedendpoint.

Last updated