purchase_name
Purchase an ENS name — either buy a listed name from a marketplace or register an available name directly on-chain.
For AVAILABLE names: Returns a complete registration recipe with contract address, ABI, step-by-step instructions, and a pre-generated secret. Your wallet signs and submits the transactions (commit → wait 60s → register).
For LISTED names: Searches all marketplaces (OpenSea, Grails) for the best price. If there are MULTIPLE active listings, returns CHOOSE_LISTING status with all options — present these to the user and ask which one they want. When the user chooses, call this tool again with the chosen orderHash to get the buy transaction.
The tool auto-detects whether the name is available or listed. You can override with the 'action' parameter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ENS name to purchase (e.g. "coffee.eth") | |
| action | No | Action: buy_listing (purchase listed name), register (register available name), auto (detect automatically) | auto |
| duration | No | Registration duration in days. ENS protocol minimum is 28 days; maximum is 3650 (10 years); default is 365 (1 year). Sub-year is allowed. | |
| orderHash | No | Specific Seaport order hash to fulfill. Use this when the user has chosen a specific listing from multiple options. | |
| fromAddress | No | ENS v2 only: the wallet that signs and pays in USDC/DAI, when it is not walletAddress (registering to another wallet). Defaults to walletAddress. | |
| maxPriceEth | No | Maximum price willing to pay in ETH: a listing's price, or for a registration the registration fee plus any premium and the Name Whisper fee | |
| maxPriceUsd | No | ENS v2 registrations only: the most to pay in USD (v2 is priced in USDC/DAI, so maxPriceEth does not apply to it). | |
| paymentToken | No | ENS v2 registrations only: the stablecoin symbol or address explicitly chosen by the user. Otherwise omit: defaults to the first USDC-family token accepted by the active router (MOCKUSDC on Sepolia; Circle USDC is not accepted there), then DAI, then other accepted tokens. Do not choose based on wallet balances. | |
| durationYears | No | DEPRECATED — use duration (days) instead. Number of years (converted to days internally). | |
| walletAddress | Yes | Buyer wallet address (will own the name) |