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:
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:
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:
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