Creating a Subname
Label: The label of the subname follows the ENS naming convention. It follows UTS-51 encoding and can include emojis. See ENSIP-15 for more details.
createSubname
to add a subname under an existing ENS name.You can include text records, address records, and metadata.
Include the
owner
field when creating a subname. This allows you to later fetch all subnames owned by a specific address using the SDK or API.Parameters
label
: Subname label (e.g.,"subname"
forsubname.example.eth
)parentName
: Parent ENS nametexts
: Array of key-value text records. (optional)addresses
: Array of address records. (optional)metadata
: Array of key-value metadata. It can be used to filter out the subnames later. (optional)contenthash
: Content hash (optional)owner
: Owner address (optional)ttl
: Time-to-live. (optional)
Updating a Subname
UseupdateSubname
to modify text records, address records, content hash, or metadata for an existing subname.
Parameters
texts
: Array of text records to update (optional)addresses
: Array of address records to update (optional)metadata
: Array of key-value metadata to update. It can be used to filter out the subnames later. (optional)contenthash
: New content hash (optional)ttl
: Time-to-live (optional)