ons

package
v0.18.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDomain = errors.New("invalid domain name")
)

Functions

func EnableONS

func EnableONS(r action.Router) error

Types

type DeleteSub added in v0.14.0

type DeleteSub struct {
	Name  ons.Name       `json:"name"`
	Owner action.Address `json:"owner"`
}
DeleteSub

This transaction deletes the specific sub domain if sub domain name is passed. It deletes all the subdomains if a parent domain name is passed.

func (DeleteSub) Marshal added in v0.14.0

func (d DeleteSub) Marshal() ([]byte, error)

func (DeleteSub) Signers added in v0.14.0

func (d DeleteSub) Signers() []action.Address

func (DeleteSub) Tags added in v0.14.0

func (d DeleteSub) Tags() kv.Pairs

func (DeleteSub) Type added in v0.14.0

func (d DeleteSub) Type() action.Type

func (*DeleteSub) Unmarshal added in v0.14.0

func (d *DeleteSub) Unmarshal(data []byte) error

type DomainCreate

type DomainCreate struct {
	Owner       action.Address `json:"owner"`
	Beneficiary action.Address `json:"account"`
	Name        ons.Name       `json:"name"`
	Uri         string         `json:"uri"`
	BuyingPrice action.Amount  `json:"buyingPrice"`
}
	DomainCreate

This transaction is used to create a domain or sub-domain. This transaction is supposed to be sent by creator of an

original domain or the owner of the parent of the sub-domain. The Beneficiary Address can be a valid Oneledger Address, which will receive funds in any currency sent to this domain. The domain name has to be of the type domain.ol or sub.domain.ol, always terminating in the .ol top level domain. The URI can be a valid RFC-3986 compliant string of characters, which is expected to be used as a meta resource location.

The BuyingPrice which must be in OLT, for domain is the sum of the creation price and the domain per block fees.

func (DomainCreate) Marshal

func (dc DomainCreate) Marshal() ([]byte, error)

func (DomainCreate) OnsName

func (dc DomainCreate) OnsName() string

func (DomainCreate) Signers

func (dc DomainCreate) Signers() []action.Address

func (DomainCreate) Tags

func (dc DomainCreate) Tags() kv.Pairs

func (DomainCreate) Type

func (dc DomainCreate) Type() action.Type

func (*DomainCreate) Unmarshal

func (dc *DomainCreate) Unmarshal(data []byte) error

type DomainPurchase

type DomainPurchase struct {
	Name     ons.Name       `json:"name"`
	Buyer    action.Address `json:"buyer"`
	Account  action.Address `json:"account"`
	Offering action.Amount  `json:"offering"`
}
DomainPurchase

This transaction lets any buyer purchase a domain which is on sale or has expired.

For on sale domains the Offering should be more than the sale price and for expired domains the offering should be more than the base domain price.

The expiry height is reset based on the extra OLT offered.

func (DomainPurchase) Marshal

func (dp DomainPurchase) Marshal() ([]byte, error)

func (DomainPurchase) OnsName

func (dp DomainPurchase) OnsName() string

func (DomainPurchase) Signers

func (dp DomainPurchase) Signers() []action.Address

func (DomainPurchase) Tags

func (dp DomainPurchase) Tags() kv.Pairs

func (DomainPurchase) Type

func (dp DomainPurchase) Type() action.Type

func (*DomainPurchase) Unmarshal

func (dp *DomainPurchase) Unmarshal(data []byte) error

type DomainSale

type DomainSale struct {
	Name         ons.Name       `json:"name"`
	OwnerAddress action.Address `json:"ownerAddress"`
	Price        action.Amount  `json:"price"`
	CancelSale   bool           `json:"cancelSale"`
}

func (DomainSale) Marshal

func (s DomainSale) Marshal() ([]byte, error)

func (DomainSale) OnsName

func (s DomainSale) OnsName() string

func (DomainSale) Signers

func (s DomainSale) Signers() []action.Address

func (DomainSale) Tags

func (s DomainSale) Tags() kv.Pairs

func (DomainSale) Type

func (DomainSale) Type() action.Type

func (*DomainSale) Unmarshal

func (s *DomainSale) Unmarshal(data []byte) error

type DomainSend

type DomainSend struct {
	From   action.Address `json:"from"`
	Name   ons.Name       `json:"name"`
	Amount action.Amount  `json:"amount"`
}

DomainSend is a struct which encapsulates information required in a send to domain transaction. This is struct is serialized according to network strategy before sending over network.

func (DomainSend) Marshal

func (s DomainSend) Marshal() ([]byte, error)

func (DomainSend) OnsName

func (s DomainSend) OnsName() string

func (DomainSend) Signers

func (s DomainSend) Signers() []action.Address

Signers gives the list of addresses of the signers (useful for verification_

func (DomainSend) Tags

func (s DomainSend) Tags() kv.Pairs

func (DomainSend) Type

func (s DomainSend) Type() action.Type

Type method gives the transaction type of the

func (*DomainSend) Unmarshal

func (s *DomainSend) Unmarshal(data []byte) error

type DomainUpdate

type DomainUpdate struct {
	Owner       action.Address `json:"owner"`
	Beneficiary action.Address `json:"beneficiary"`
	Name        ons.Name       `json:"name"`
	Active      bool           `json:"active"`
	Uri         string         `json:"uri"`
}

func (DomainUpdate) Marshal

func (du DomainUpdate) Marshal() ([]byte, error)

func (DomainUpdate) OnsName

func (du DomainUpdate) OnsName() string

func (DomainUpdate) Signers

func (du DomainUpdate) Signers() []action.Address

func (DomainUpdate) Tags

func (du DomainUpdate) Tags() kv.Pairs

func (DomainUpdate) Type

func (du DomainUpdate) Type() action.Type

func (*DomainUpdate) Unmarshal

func (du *DomainUpdate) Unmarshal(data []byte) error

type Ons

type Ons interface {
	action.Msg
	OnsName() string
}

type RenewDomain added in v0.14.0

type RenewDomain struct {
	//Owner of sub Domain
	Owner action.Address `json:"owner"`

	//Name of New Sub domain
	Name ons.Name `json:"name"`

	//Amount Added to extend duration of subscription
	BuyingPrice action.Amount `json:"buyingPrice"`
}
RenewDomain

This transaction is used to renew

func (RenewDomain) Marshal added in v0.14.0

func (r RenewDomain) Marshal() ([]byte, error)

func (RenewDomain) OnsName added in v0.14.0

func (r RenewDomain) OnsName() string

func (RenewDomain) Signers added in v0.14.0

func (r RenewDomain) Signers() []action.Address

func (RenewDomain) Tags added in v0.14.0

func (r RenewDomain) Tags() kv.Pairs

func (RenewDomain) Type added in v0.14.0

func (r RenewDomain) Type() action.Type

func (*RenewDomain) Unmarshal added in v0.14.0

func (r *RenewDomain) Unmarshal(data []byte) error

type RenewDomainTx added in v0.14.0

type RenewDomainTx struct {
}

func (RenewDomainTx) ProcessCheck added in v0.14.0

func (r RenewDomainTx) ProcessCheck(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (RenewDomainTx) ProcessDeliver added in v0.14.0

func (r RenewDomainTx) ProcessDeliver(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (RenewDomainTx) ProcessFee added in v0.14.0

func (r RenewDomainTx) ProcessFee(ctx *action.Context, signedTx action.SignedTx, start action.Gas, size action.Gas, gasUsed action.Gas) (bool, action.Response)

func (RenewDomainTx) Validate added in v0.14.0

func (r RenewDomainTx) Validate(ctx *action.Context, signedTx action.SignedTx) (bool, error)

Jump to

Keyboard shortcuts

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