Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterCodec(cdc *codec.Codec)
- type Account
- type Domain
- type MsgAddAccountCertificates
- type MsgDeleteAccount
- type MsgDeleteAccountCertificate
- type MsgDeleteDomain
- type MsgFlushDomain
- type MsgRegisterAccount
- type MsgRegisterDomain
- type MsgRenewAccount
- type MsgRenewDomain
- type MsgReplaceAccountTargets
- type MsgSetAccountMetadata
- type MsgTransferAccount
- type MsgTransferDomain
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "domain" // DomainStore key defines the store key used to store domains information DomainStoreKey = "domain" // AccountStoreKey defines the store key used to store account information AccountStoreKey = "account" // IndexStoreKey defines the store key used to store indexing information IndexStoreKey = ModuleName + "index" // RouterKey defines the path used to interact with the domain module RouterKey = ModuleName // QuerierRoute defines the query path used to interact with the domain module QuerierRoute = ModuleName // DefaultParamSpace defines the key for the default param space DefaultParamSpace = ModuleName )
Module names
Variables ¶
var ErrAccountDoesNotExist = sdkerrors.Register(ModuleName, 6, "account does not exist")
ErrAccountDoesNotExist is returned when an action is performed on a domain that does not contain the specified account
var ErrAccountExists = sdkerrors.Register(ModuleName, 12, "account already exists")
ErrAccountExists is returned when a create action is done on an account that already exists
var ErrAccountExpired = sdkerrors.Register(ModuleName, 7, "account has expired")
ErrAccountExpired is returned when actions are performed on expired accounts
var ErrCertificateDoesNotExist = sdkerrors.Register(ModuleName, 15, "certificate does not exist")
ErrCertificateDoesNotExist is returned when an action is performed on a domain that already exists
var ErrCertificateExists = sdkerrors.Register(ModuleName, 14, "certificate already exists")
ErrCertificateExists is returned when a creation action is done on a certificate that already exists
var ErrDomainAlreadyExists = sdkerrors.Register(ModuleName, 2, "domain already exists")
ErrDomainAlreadyExists is returned when a create action is done on a domain that already exists
var ErrDomainDoesNotExist = sdkerrors.Register(ModuleName, 5, "domain does not exist")
ErrDomainDoesNotExist is returned when an action is performed on a domain that does not exist
var ErrDomainExpired = sdkerrors.Register(ModuleName, 11, "domain has expired")
ErrDomainExpired is returned when actions are performed on expired domains
var ErrInvalidAccountName = sdkerrors.Register(ModuleName, 9, "invalid account name")
ErrInvalidAccountName is returned when the account name does not match the required standards
var ErrInvalidBlockchainTarget = sdkerrors.Register(ModuleName, 10, "blockchain target provided is not valid")
ErrInvalidBlockchainTarget is returned when provided blockchain target is not valid
var ErrInvalidDomainName = sdkerrors.Register(ModuleName, 1, "domain name provided is invalid")
ErrInvalidDomainName is returned when the domain name does not match the required standards
var ErrInvalidOwner = sdkerrors.Register(ModuleName, 8, "invalid owner")
ErrInvalidOwner is returned when the owner address provided is not valid (empty, malformed, etc)
var ErrInvalidRequest = sdkerrors.Register(ModuleName, 13, "malformed request")
ErrInvalidRequest is a general error that covers the uncommon cases of invalid request
ErrUnauthorized is returned when authentication process for an action fails
var ModuleCdc = codec.New()
ModuleCdc instantiates a new codec for the domain module
Functions ¶
func RegisterCodec ¶
RegisterCodec registers the sdk.Msg for the module
Types ¶
type Account ¶
type Account struct { // Domain references the domain this account belongs to Domain string // Name is the name of the account Name string // Owner is the address that owns the account Owner sdk.AccAddress // ValidUntil defines a unix timestamp of the expiration of the account ValidUntil int64 // Targets is the list of blockchain addresses this account belongs to Targets []iovns.BlockchainAddress // Certificates contains the list of certificates to identify the account owner Certificates [][]byte // Broker can be empty // it identifies an entity that facilitated the transaction of the account Broker sdk.AccAddress // MetadataURI contains a link to extra information regarding the account MetadataURI string }
Account defines an account that belongs to a domain
type Domain ¶
type Domain struct { // Name is the name of the domain Name string // Admin is the owner of the domain Admin sdk.AccAddress // ValidUntil is a unix timestamp that defines for how long the domain is valid ValidUntil int64 // HasSuperuser checks if the domain is owned by a super user or not HasSuperuser bool // AccountRenew defines the duration of each created or renewed account // under the domain AccountRenew time.Duration // Broker TODO needs comment Broker sdk.AccAddress }
Domain defines a domain
type MsgAddAccountCertificates ¶
type MsgAddAccountCertificates struct { // Domain is the domain of the account Domain string // Name is the name of the account Name string // Owner is the owner of the account Owner sdk.AccAddress // NewCertificate is the new certificate to add NewCertificate []byte }
MsgAddAccountCertificates is the message used when a user wants to add new certificates to his account
func (*MsgAddAccountCertificates) GetSignBytes ¶
func (m *MsgAddAccountCertificates) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgAddAccountCertificates) GetSigners ¶
func (m *MsgAddAccountCertificates) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgAddAccountCertificates) Route ¶
func (m *MsgAddAccountCertificates) Route() string
Route implements sdk.Msg
func (*MsgAddAccountCertificates) Type ¶
func (m *MsgAddAccountCertificates) Type() string
Type implements sdk.Msg
func (*MsgAddAccountCertificates) ValidateBasic ¶
func (m *MsgAddAccountCertificates) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgDeleteAccount ¶
type MsgDeleteAccount struct { // Domain is the name of the domain of the account Domain string // Name is the name of the account Name string // Owner is the owner of the account Owner sdk.AccAddress }
MsgDeleteAccount is the request model used to delete an account
func (*MsgDeleteAccount) GetSignBytes ¶
func (m *MsgDeleteAccount) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgDeleteAccount) GetSigners ¶
func (m *MsgDeleteAccount) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgDeleteAccount) ValidateBasic ¶
func (m *MsgDeleteAccount) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgDeleteAccountCertificate ¶
type MsgDeleteAccountCertificate struct { // Domain is the name of the domain of the account Domain string // Name is the name of the account Name string // DeleteCertificate is the certificate to delete DeleteCertificate []byte // Owner is the owner of the account Owner sdk.AccAddress }
MsgDeleteAccountCertificate is the request model used to remove certificates from an account
func (*MsgDeleteAccountCertificate) GetSignBytes ¶
func (m *MsgDeleteAccountCertificate) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgDeleteAccountCertificate) GetSigners ¶
func (m *MsgDeleteAccountCertificate) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgDeleteAccountCertificate) Route ¶
func (m *MsgDeleteAccountCertificate) Route() string
Route implements sdk.Msg
func (*MsgDeleteAccountCertificate) Type ¶
func (m *MsgDeleteAccountCertificate) Type() string
Type implements sdk.Msg
func (*MsgDeleteAccountCertificate) ValidateBasic ¶
func (m *MsgDeleteAccountCertificate) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgDeleteDomain ¶
type MsgDeleteDomain struct { Domain string Owner sdk.AccAddress }
MsgDeleteDomain is the request model to delete a domain
func (*MsgDeleteDomain) GetSignBytes ¶
func (m *MsgDeleteDomain) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgDeleteDomain) GetSigners ¶
func (m *MsgDeleteDomain) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgDeleteDomain) ValidateBasic ¶
func (m *MsgDeleteDomain) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgFlushDomain ¶
type MsgFlushDomain struct { // Domain is the domain name to flush Domain string // Owner is the owner of the domain Owner sdk.AccAddress }
MsgFlushDomain is used to flush a domain
func (*MsgFlushDomain) GetSignBytes ¶
func (m *MsgFlushDomain) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgFlushDomain) GetSigners ¶
func (m *MsgFlushDomain) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgFlushDomain) ValidateBasic ¶
func (m *MsgFlushDomain) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgRegisterAccount ¶
type MsgRegisterAccount struct { // Domain is the domain of the account Domain string // Name is the name of the account Name string // Owner is the owner of the account Owner sdk.AccAddress // Targets are the blockchain addresses of the account Targets []iovns.BlockchainAddress // Broker is the account that facilitated the transaction Broker sdk.AccAddress }
MsgRegisterAccount is the request model used to register new accounts
func (*MsgRegisterAccount) GetSignBytes ¶
func (m *MsgRegisterAccount) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgRegisterAccount) GetSigners ¶
func (m *MsgRegisterAccount) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgRegisterAccount) Route ¶
func (m *MsgRegisterAccount) Route() string
Route implements sdk.Msg
func (*MsgRegisterAccount) Type ¶
func (m *MsgRegisterAccount) Type() string
Type implements sdk.Msg
func (*MsgRegisterAccount) ValidateBasic ¶
func (m *MsgRegisterAccount) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgRegisterDomain ¶
type MsgRegisterDomain struct { // Name is the name of the domain we want to register Name string `json:"domain" arg:"--domain" helper:"name of the domain"` // Admin is the address of the newly registered domain Admin sdk.AccAddress `json:"admin"` // HasSuperuser defines if the domain registered has an owner or not HasSuperuser bool `json:"has_superuser"` // Broker TODO document Broker sdk.AccAddress `json:"broker" arg:"--broker" helper:"the broker"` // AccountRenew defines the expiration time in seconds of each newly registered account. AccountRenew int64 `json:"account_renew" arg:"--account-renew" helper:"account's renewal time in seconds"` }
MsgRegisterDomain is the request used to register new domains
func (*MsgRegisterDomain) GetSignBytes ¶
func (m *MsgRegisterDomain) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgRegisterDomain) GetSigners ¶
func (m *MsgRegisterDomain) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgRegisterDomain) Route ¶
func (m *MsgRegisterDomain) Route() string
Route implements sdk.Msg
func (*MsgRegisterDomain) ValidateBasic ¶
func (m *MsgRegisterDomain) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgRenewAccount ¶
type MsgRenewAccount struct { // Domain is the domain of the account Domain string // Name is the name of the account Name string }
MsgRenewAccount is the request model used to renew accounts
func (*MsgRenewAccount) GetSignBytes ¶
func (m *MsgRenewAccount) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgRenewAccount) GetSigners ¶
func (m *MsgRenewAccount) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgRenewAccount) ValidateBasic ¶
func (m *MsgRenewAccount) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgRenewDomain ¶
type MsgRenewDomain struct { // Domain is the domain name to renew Domain string }
MsgRenewDomain is the request model used to renew a domain
func (*MsgRenewDomain) GetSignBytes ¶
func (m *MsgRenewDomain) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgRenewDomain) GetSigners ¶
func (m *MsgRenewDomain) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgRenewDomain) ValidateBasic ¶
func (m *MsgRenewDomain) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgReplaceAccountTargets ¶
type MsgReplaceAccountTargets struct { // Domain is the domain name of the account Domain string // Name is the name of the account Name string // NewTargets are the new blockchain addresses NewTargets []iovns.BlockchainAddress // Owner is the owner of the account Owner sdk.AccAddress }
MsgReplaceAccountTargets is the request model used to renew blockchain addresses associated with an account
func (*MsgReplaceAccountTargets) GetSignBytes ¶
func (m *MsgReplaceAccountTargets) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgReplaceAccountTargets) GetSigners ¶
func (m *MsgReplaceAccountTargets) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgReplaceAccountTargets) Route ¶
func (m *MsgReplaceAccountTargets) Route() string
Route implements sdk.Msg
func (*MsgReplaceAccountTargets) Type ¶
func (m *MsgReplaceAccountTargets) Type() string
Type implements sdk.Msg
func (*MsgReplaceAccountTargets) ValidateBasic ¶
func (m *MsgReplaceAccountTargets) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgSetAccountMetadata ¶ added in v0.2.1
type MsgSetAccountMetadata struct { // Domain is the domain name of the account Domain string // Name is the name of the account Name string // NewMetadataURI is the metadata URI of the account // we want to update or insert NewMetadataURI string // Owner is the owner of the account Owner sdk.AccAddress }
MsgSetAccountMetadata is the function used to set accounts metadata
func (*MsgSetAccountMetadata) GetSignBytes ¶ added in v0.2.1
func (m *MsgSetAccountMetadata) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgSetAccountMetadata) GetSigners ¶ added in v0.2.1
func (m *MsgSetAccountMetadata) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgSetAccountMetadata) Route ¶ added in v0.2.1
func (m *MsgSetAccountMetadata) Route() string
Route implements sdk.Msg
func (*MsgSetAccountMetadata) Type ¶ added in v0.2.1
func (m *MsgSetAccountMetadata) Type() string
Type implements sdk.Msg
func (*MsgSetAccountMetadata) ValidateBasic ¶ added in v0.2.1
func (m *MsgSetAccountMetadata) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgTransferAccount ¶
type MsgTransferAccount struct { // Domain is the domain name of the account Domain string // Account is the account name Name string // Owner is the actual owner of the account Owner sdk.AccAddress // NewOwner is the new owner of the account NewOwner sdk.AccAddress }
MsgTransferAccount is the request model used to transfer accounts
func (*MsgTransferAccount) GetSignBytes ¶
func (m *MsgTransferAccount) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgTransferAccount) GetSigners ¶
func (m *MsgTransferAccount) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgTransferAccount) Route ¶
func (m *MsgTransferAccount) Route() string
Route implements sdk.Msg
func (*MsgTransferAccount) Type ¶
func (m *MsgTransferAccount) Type() string
Type implements sdk.Msg
func (*MsgTransferAccount) ValidateBasic ¶
func (m *MsgTransferAccount) ValidateBasic() error
ValidateBasic implements sdk.Msg
type MsgTransferDomain ¶
type MsgTransferDomain struct { Domain string Owner sdk.AccAddress NewAdmin sdk.AccAddress }
MsgTransferDomain is the request model used to transfer a domain
func (*MsgTransferDomain) GetSignBytes ¶
func (m *MsgTransferDomain) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (*MsgTransferDomain) GetSigners ¶
func (m *MsgTransferDomain) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (*MsgTransferDomain) Route ¶
func (m *MsgTransferDomain) Route() string
Route implements sdk.Msg
func (*MsgTransferDomain) ValidateBasic ¶
func (m *MsgTransferDomain) ValidateBasic() error
ValidateBasic implements sdk.Msg
Source Files
¶
- codec.go
- errors.go
- msg_add_account_certs.go
- msg_del_account_certs.go
- msg_delete_account.go
- msg_delete_domain.go
- msg_flush_domain.go
- msg_register_account.go
- msg_register_domain.go
- msg_renew_account.go
- msg_renew_domain.go
- msg_replace_account_targets.go
- msg_set_metadata_account.go
- msg_transfer_account.go
- msg_transfer_domain.go
- naming.go
- types.go