func (n *Name) ExtendRegistration(opts *bind.TransactOpts) (*types.Transaction, error) {
	isRegistered, err := n.IsRegistered()
	if err != nil {
		return nil, err
	}
	if !isRegistered {
		return nil, errors.New("name is not registered")
	}
	rentCost, err := n.RentCost()
	if err != nil {
		return nil, err
	}
	if opts.Value == nil || opts.Value.Cmp(rentCost) < 0 {
		return nil, errors.New("not enough funds to extend the registration")
	}
	return n.controller.Renew(opts, n.Name)
}
ExtendRegistration sends a transaction that extends the registration of the name.
package ens
import (
	"crypto/rand"
	"errors"
	"fmt"
	"math/big"
	"time"
	"github.com/ethereum/go-ethereum/accounts/abi/bind"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/types"
)
type Name struct {
	backend bind.ContractBackend
	Name string
	Domain string
	Label string
	registry   *Registry
	registrar  *BaseRegistrar
	controller *ETHController
}
func NewName(backend bind.ContractBackend, name string) (*Name, error) {
	name, err := NormaliseDomain(name)
	if err != nil {
		return nil, err
	}
	domain := Domain(name)
	label, err := DomainPart(name, 1)
	if err != nil {
		return nil, err
	}
	registry, err := NewRegistry(backend)
	if err != nil {
		return nil, err
	}
	registrar, err := NewBaseRegistrar(backend, domain)
	if err != nil {
		return nil, err
	}
	controller, err := NewETHController(backend, domain)
	if err != nil {
		return nil, err
	}
	isValid, err := controller.IsValid(name)
	if err != nil {
		return nil, err
	}
	if !isValid {
		return nil, errors.New("name is not valid according to the rules of the registrar (too short, invalid characters, etc.)")
	}
	return &Name{
		backend:    backend,
		Name:       name,
		Domain:     domain,
		Label:      label,
		registry:   registry,
		registrar:  registrar,
		controller: controller,
	}, nil
}
func (n *Name) IsRegistered() (bool, error) {
	registrant, err := n.Registrant()
	if err != nil {
		return false, err
	}
	return registrant != UnknownAddress, nil
}