keeper

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DNSDenomName = "domains"
	TimeFactor   = time.Hour
)
View Source
const (
	DefaultDomainsCount = 10
)

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the NFT MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier is the module level router for state queries

func NewQueryServerImpl

func NewQueryServerImpl(keeper Keeper) types.QueryServer

NewQueryServerImpl returns an implementation of the NFT QueryServer interface for the provided Keeper.

Types

type DNSNameRecord

type DNSNameRecord struct {
	Issued                  time.Time         `json:"issued"`
	ValidTill               time.Time         `json:"valid_till"`
	TransferOffer           *DNSTransferOffer `json:"transfer_offer"`
	SubDomainsOnSale        bool              `json:"sub_domains_sale"`
	SubDomainsSalePrice     uint64            `json:"sub_domains_sale_price"`
	DomainProlongationPrice uint64            `json:"domain_prolongation_price"` // price to pay parent domain owner on prolongation
	Records                 []DNSTypeRecord   `json:"records"`
}

func ParseDomainData

func ParseDomainData(data []byte) (DNSNameRecord, error)

type DNSTransferOffer

type DNSTransferOffer struct {
	Price                uint64 `json:"price"` // in udws
	ExpectedOwnerAddress string `json:"expected_owner_address"`
}

type DNSTypeRecord

type DNSTypeRecord struct {
	RecordType   string   `json:"type"`
	RecordValues []string `json:"values"`
}

type DomainAlreadyCreated

type DomainAlreadyCreated struct {
	// contains filtered or unexported fields
}

func (DomainAlreadyCreated) Error

func (e DomainAlreadyCreated) Error() string

type DomainDoesntExist

type DomainDoesntExist struct {
	// contains filtered or unexported fields
}

func (DomainDoesntExist) Error

func (e DomainDoesntExist) Error() string

type DomainNotOwned

type DomainNotOwned struct {
	// contains filtered or unexported fields
}

func (DomainNotOwned) Error

func (e DomainNotOwned) Error() string

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, bankKeeper keeper.Keeper, ps paramtypes.Subspace) Keeper

NewKeeper creates a new instance of the NFT Keeper

func (Keeper) Authorize

func (k Keeper) Authorize(ctx sdk.Context, tokenID string, owner sdk.AccAddress) (types.BaseDomain, error)

Authorize checks if the sender is the owner of the given Domain Return the Domain if true, an error otherwise

func (Keeper) BlockedTLDs

func (k Keeper) BlockedTLDs(ctx sdk.Context) (res []string)

func (Keeper) CheckAllowedForAddress

func (k Keeper) CheckAllowedForAddress(ctx types.Context, dnsName string, creatorAddress types.AccAddress) error

func (Keeper) CheckDomainBlocked

func (k Keeper) CheckDomainBlocked(ctx types.Context, domain string) bool

func (Keeper) DomainExpirationHours

func (k Keeper) DomainExpirationHours(ctx sdk.Context) (res int64)

func (Keeper) DomainOwnerProlongationHours

func (k Keeper) DomainOwnerProlongationHours(ctx sdk.Context) (res int64)

func (Keeper) DomainPriceUDWS

func (k Keeper) DomainPriceUDWS(ctx sdk.Context) (res uint64)

func (Keeper) EditDomain

func (k Keeper) EditDomain(ctx sdk.Context, tokenID, tokenData string, owner sdk.AccAddress) error

EditDomain updates an already existing NFT

func (Keeper) GetByOwner

func (k Keeper) GetByOwner(ctx sdk.Context, address sdk.AccAddress) types.Owner

GetByOwner gets all the domains owned by an address

func (Keeper) GetCollection

func (k Keeper) GetCollection(ctx sdk.Context, denomID string) (types.Collection, error)

GetCollection returns the collection by the specified denom ID

func (Keeper) GetCollections

func (k Keeper) GetCollections(ctx sdk.Context) (cs []types.Collection)

GetCollections returns all the collections

func (Keeper) GetDenom

func (k Keeper) GetDenom(ctx sdk.Context, id string) (denom types.Denom, found bool)

GetDenom returns the denom by id

func (Keeper) GetDenoms

func (k Keeper) GetDenoms(ctx sdk.Context) (denoms []types.Denom)

GetDenoms returns all the denoms

func (Keeper) GetDomain

func (k Keeper) GetDomain(ctx sdk.Context, tokenID string) (nft exported.Domain, err error)

GetDomain gets the the specified Domain

func (Keeper) GetDomains

func (k Keeper) GetDomains(ctx sdk.Context, denom string) (nfts []exported.Domain)

GetDomains returns all Domains by the specified denom ID

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetTotalSupply

func (k Keeper) GetTotalSupply(ctx sdk.Context, denomID string) uint64

GetDenomSupply returns the number of Domains by the specified denom ID

func (Keeper) HasDenomID

func (k Keeper) HasDenomID(ctx sdk.Context, id string) bool

HasDenom returns whether the specified denom ID exists

func (Keeper) HasDomain

func (k Keeper) HasDomain(ctx sdk.Context, denomID, tokenID string) bool

HasDomain checks if the specified Domain exists

func (Keeper) IssueDenom

func (k Keeper) IssueDenom(ctx sdk.Context,
	id, name, schema, symbol string,
	creator sdk.AccAddress,
	mintRestricted, updateRestricted bool,
	description, uri, uriHash, data string,
) error

IssueDenom issues a denom according to the given params

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) ProcessDomainsExpiration

func (k Keeper) ProcessDomainsExpiration(ctx sdk.Context)

func (Keeper) RegisterDomain

func (k Keeper) RegisterDomain(ctx sdk.Context, domainName, tokenData string, owner sdk.AccAddress, recipient sdk.AccAddress) error

RegisterDomain mints an NFT and manages the NFT's existence within Collections and Owners

func (Keeper) RemoveDomain

func (k Keeper) RemoveDomain(ctx sdk.Context, tokenID string, owner sdk.AccAddress) error

RemoveDomain deletes a specified NFT

func (Keeper) SetCollection

func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection) error

SetCollection saves all Domai and returns an error if there already exists

func (Keeper) SetDenom

func (k Keeper) SetDenom(ctx sdk.Context, denom types.Denom) error

SetDenom is responsible for saving the definition of denom

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (Keeper) SubDomainPriceUDWS

func (k Keeper) SubDomainPriceUDWS(ctx sdk.Context) (res uint64)

func (Keeper) TransferDomainOwner

func (k Keeper) TransferDomainOwner(ctx sdk.Context, tokenID string, cancelTransfer bool, price uint64, trxSender sdk.AccAddress, recipientAddr string) error

TransferDomainOwner performs 2-step transfer

func (Keeper) UpdateDenom

func (k Keeper) UpdateDenom(ctx sdk.Context, denom types.Denom) error

UpdateDenom is responsible for updating the definition of denom

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL