Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateRandomSecret() ([32]byte, error)
- func NameHash(name string) (hash [32]byte, err error)
- func New() app.Component
- func NormalizeAnyName(name string, useEnsip15 bool) (string, error)
- func PeriodMonthsToTimestamp(registerPeriodMonths uint32) big.Int
- func PrepareCallData_SetContentHashSpaceID(fullName string, contentHash string, spaceID string) ([][]byte, error)
- func RemoveTLD(str string) string
- type CommitParams
- type ContractsService
- type MakeCommitmentParams
- type RegisterParams
- type RenewParams
Constants ¶
View Source
const CName = "any-ns.contracts"
View Source
const MAX_NAME_LENGTH = 100
Variables ¶
View Source
var ( ErrNonceTooLow = errors.New("nonce too low") ErrNonceTooHigh = errors.New("nonce too high") )
Functions ¶
func GenerateRandomSecret ¶
func NormalizeAnyName ¶ added in v0.3.0
func PeriodMonthsToTimestamp ¶ added in v0.1.9
Types ¶
type CommitParams ¶ added in v0.2.3
type CommitParams struct { Opts *bind.TransactOpts Commitment [32]byte Controller *ac.AnytypeRegistrarControllerPrivate }
type ContractsService ¶
type ContractsService interface { CreateEthConnection() (*ethclient.Client, error) // generic method to call any contract CallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) // AA methods: IsContractDeployed(ctx context.Context, address common.Address) (bool, error) // will return .owner of the contract GetScwOwner(ctx context.Context, address common.Address) (common.Address, error) // ENS methods GetOwnerForNamehash(ctx context.Context, namehash [32]byte) (common.Address, error) GetAdditionalNameInfo(ctx context.Context, currentOwner common.Address, fullName string) (ownerEthAddress string, ownerAnyAddress string, spaceId string, expiration *big.Int, err error) Commit(ctx context.Context, params *CommitParams) (*types.Transaction, error) Register(ctx context.Context, params *RegisterParams) (*types.Transaction, error) Renew(ctx context.Context, params *RenewParams) (*types.Transaction, error) // Aux methods MakeCommitment(params *MakeCommitmentParams) ([32]byte, error) GetNameByAddress(address common.Address) (string, error) GetBalanceOf(ctx context.Context, tokenAddress common.Address, address common.Address) (*big.Int, error) ConnectToRegistryContract() (*ac.ENSRegistry, error) ConnectToNamewrapperContract() (*ac.AnytypeNameWrapper, error) ConnectToResolver() (*ac.AnytypeResolver, error) ConnectToRegistrar() (*ac.AnytypeRegistrarImplementation, error) ConnectToPrivateController() (*ac.AnytypeRegistrarControllerPrivate, error) GenerateAuthOptsForAdmin() (*bind.TransactOpts, error) CalculateTxParams(conn *ethclient.Client, address common.Address) (*big.Int, uint64, error) // Check if tx is even started to mine WaitForTxToStartMining(ctx context.Context, txHash common.Hash) error WaitMined(ctx context.Context, tx *types.Transaction) (wasMined bool, err error) TxByHash(ctx context.Context, txHash common.Hash) (*types.Transaction, error) app.Component }
TODO: refactor, split into several interfaces Low-level calls to contracts
type MakeCommitmentParams ¶ added in v0.2.3
type RegisterParams ¶ added in v0.2.3
type RenewParams ¶ added in v0.2.3
type RenewParams struct { TxOpts *bind.TransactOpts FullName string DurationSec uint64 Controller *ac.AnytypeRegistrarControllerPrivate }
Click to show internal directories.
Click to hide internal directories.