SubnameMintForm mints an onchain subname under a parent name. The user picks a label, a duration, and a payment token, optionally sets records, and confirms the mint. By default it mints on ENSv2.
Onchain subname issuing on ENSv2 names is paused for now. Offchain subnames, ENSv1 listings, and everything else keep working.
Before you start
The parent must be a .eth name with a Namespace ENSv2 activation. The owner sets one up in the Namespace App. The activation sets the price, the accepted payment tokens, the whitelist, and reserved labels. The form reads all of these and fetches whitelist and reservation proofs itself.
The user pays in USDC or DAI and picks the token in the form. Network fees are always in ETH.
Props
Prop
Type
Description
parentName
string
Required. The activated parent, such as yourname.eth.
label
string
Prefills the subname label.
isTestnet
boolean
Uses Sepolia instead of Ethereum mainnet.
resolver
Address
Resolver for the new subname when the activation doesn’t set one. Defaults to Namespace’s shared resolver. Ignored with version={1}.
version
1 | 2
Defaults to 2 (ENSv2). Pass 1 for a parent on an old Namespace listing.
avatarUploadDomain
string
Hostname used in the avatar upload sign-in message.
title
string
Replaces the form title.
subtitle
string
Replaces the form subtitle.
txConfirmations
number
Confirmations to wait for, on the version={1} flow.
noBorder
boolean
Removes the card border.
onSuccess
(data: MintSuccessData) => void
Called after the mint confirms.
onSubnameMinted
(data: SubnameMintedData) => void
Also called after the mint confirms, with owner and chain details.
onConnectWallet
() => void
Called when the user needs to connect a wallet.
onCancel
() => void
Called when the user cancels.
Success data
interface MintSuccessData { fullName: string; label: string; parentName: string; txHash: string; price: string; priceCurrency?: string; // 'USDC' or 'DAI'. Unset on version={1} mints, which are paid in ETH. transactionFees: string; // ETH records: EnsRecords;}interface SubnameMintedData { label: string; parentName: string; fullSubname: string; records: EnsRecords; price: string; transactionFees: string; ownerAddress: string; txHash: string; chainId: number;}
Mint under an old Namespace listing
Parents listed in the Namespace App before ENSv2 have an ENSv1 listing. Onchain subnames don’t migrate to ENSv2, so those listings keep minting on ENSv1. Pass version={1} for them: