domains

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MetaName        = "name"
	MetaUri         = "uri"
	MetaDescription = "description"
)
View Source
const (
	TokenCtrlNonDivisible    = 1
	TokenCtrlNonTransferable = 2
	TokenCtrlBurnable        = 3
	TokenCtrlNonCollateral   = 4
)

Variables

View Source
var DictErrInvalidType = errors.Verify("the value obtained is not of the expected type")
View Source
var DictErrInvalidValue = errors.Verify("dict value must be a string or a Dict")
View Source
var DictErrKeyNotFound = errors.Verify("no such key in this dict")

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Link      Link         `json:"link" bson:"link"`
	Authority keys.Address `json:"authority" bson:"authority"`
	Network   NetworkAddr  `json:"network" bson:"network"`
	Address   AssetAddr    `json:"address" bson:"address"`
	Symbol    string       `json:"symbol" bson:"symbol"`
	Ctrl      Ctrl         `json:"ctrl" bson:"ctrl"`
	Tag       Tag          `json:"tag" bson:"tag"`
	Meta      Meta         `json:"meta" bson:"meta"`
}

type AssetAccount

type AssetAccount struct {
	Asset    AssetAddr `json:"asset" bson:"asset"`
	Quantity uint64    `json:"quantity" bson:"quantity"`
}

type AssetAddr

type AssetAddr = keys.Address

type AssetSymbol

type AssetSymbol string

func (AssetSymbol) Validate

func (s AssetSymbol) Validate() *errors.Error

type Ctrl

type Ctrl []byte

Ctrl LEN * 8

func MustNewCtrl

func MustNewCtrl(length ...int) Ctrl

func NewCtrl

func NewCtrl(length ...int) (Ctrl, *errors.Error)

func (Ctrl) Check

func (ctrl Ctrl) Check(pos int) (bool, *errors.Error)

func (Ctrl) Iter

func (ctrl Ctrl) Iter(callback func(pos int, value bool))

func (Ctrl) MustSet

func (ctrl Ctrl) MustSet(pos int, value bool) Ctrl

func (Ctrl) Set

func (ctrl Ctrl) Set(pos int, value bool) *errors.Error

type Dict

type Dict map[string]interface{}

func MustNewDict

func MustNewDict(values ...map[string]interface{}) Dict

func NewDict

func NewDict(values ...map[string]interface{}) (Dict, *errors.Error)

func (Dict) Exists

func (dict Dict) Exists(key string) bool

func (Dict) GetBool

func (dict Dict) GetBool(key string) (bool, *errors.Error)

func (Dict) GetDict

func (dict Dict) GetDict(key string) (Dict, *errors.Error)

func (Dict) GetFloat32

func (dict Dict) GetFloat32(key string) (float32, *errors.Error)

func (Dict) GetFloat64

func (dict Dict) GetFloat64(key string) (float64, *errors.Error)

func (Dict) GetInt16

func (dict Dict) GetInt16(key string) (int16, *errors.Error)

func (Dict) GetInt32

func (dict Dict) GetInt32(key string) (int32, *errors.Error)

func (Dict) GetInt64

func (dict Dict) GetInt64(key string) (int64, *errors.Error)

func (Dict) GetString

func (dict Dict) GetString(key string) (string, *errors.Error)

func (Dict) MustExists

func (dict Dict) MustExists(key ...string) *errors.Error

func (Dict) MustSet

func (dict Dict) MustSet(key string, value interface{}) Dict

func (*Dict) Scan

func (dict *Dict) Scan(value interface{}) error

func (Dict) Set

func (dict Dict) Set(key string, value interface{}) *errors.Error

func (Dict) Value

func (dict Dict) Value() (driver.Value, error)

type EncryptedPassword

type EncryptedPassword string

func NewEncryptedPassword

func NewEncryptedPassword(pwd Password) EncryptedPassword

func (EncryptedPassword) Match

func (ep EncryptedPassword) Match(pwd Password) bool

type Identity

type Identity struct {
	Address   IdentityAddr   `bson:"address" json:"address"`
	NineoraID keys.NineoraID `bson:"nineora_id" json:"nineora_id"`
	Link      Link           `bson:"link" json:"link"`
	Ctrl      Ctrl           `bson:"ctrl,omitempty" json:"ctrl,omitempty"`
	Tag       Tag            `bson:"tag,omitempty" json:"tag,omitempty"`
	Meta      Meta           `bson:"meta,omitempty" json:"meta,omitempty"`
}

type IdentityAddr

type IdentityAddr = keys.Address
type Link string
func NewLink(seed string) Link

func (Link) Equals

func (link Link) Equals(str string) bool

func (Link) IsValid

func (link Link) IsValid() bool

func (Link) String

func (link Link) String() string

type Memo

type Memo = Dict

func NewMemo

func NewMemo() Memo

type Meta

type Meta = Dict

func MustNewMeta

func MustNewMeta(values ...map[string]interface{}) Meta

func NewMeta

func NewMeta(values ...map[string]interface{}) (Meta, *errors.Error)

type MetaID

type MetaID string

type MetaRef

type MetaRef string

type Network

type Network struct {
	Authority keys.Address `json:"authority" bson:"authority"`
	Symbol    string       `json:"symbol" bson:"symbol"`
	Ctrl      Ctrl         `json:"ctrl" bson:"ctrl"`
	Tag       Tag          `json:"tag" bson:"tag"`
	Meta      Meta         `json:"meta" bson:"meta"`
}

type NetworkAddr

type NetworkAddr = keys.Address

type NetworkSymbol

type NetworkSymbol string

func (NetworkSymbol) Validate

func (s NetworkSymbol) Validate() *errors.Error

type NodeAddr

type NodeAddr = keys.Address

type Participant

type Participant struct {
	Network keys.Address `json:"network" bson:"network"`
	Node    keys.Address `json:"node" bson:"node"`
	Ctrl    Ctrl         `json:"ctrl" bson:"ctrl"`
	Tag     Tag          `json:"tag" bson:"tag"`
	Meta    Meta         `json:"meta" bson:"meta"`
}

type ParticipantAddr

type ParticipantAddr = keys.Address

type Password

type Password string

func NewPassword

func NewPassword(str string) Password

func (Password) EncryptedPassword

func (p Password) EncryptedPassword() EncryptedPassword

func (Password) IsValid

func (p Password) IsValid() bool

func (Password) String

func (p Password) String() string

type Signature

type Signature string

func (Signature) Validate

func (s Signature) Validate() *errors.Error

type Stake

type Stake struct {
	Link      Link         `json:"link" bson:"link"`
	Authority keys.Address `json:"authority" bson:"authority"`
	Network   NetworkAddr  `json:"network" bson:"network"`
	Symbol    StakeSymbol  `json:"symbol" bson:"symbol"`
	Total     uint64       `json:"total" bson:"total"`
	Ctrl      Ctrl         `json:"ctrl" bson:"ctrl"`
	Tag       Tag          `json:"tag" bson:"tag"`
	Meta      Meta         `json:"meta" bson:"meta"`
}

type StakeAccount

type StakeAccount struct {
	Mint    StakeAddr `json:"mint" bson:"mint"`
	Balance uint64    `json:"balance" bson:"balance"`
}

type StakeAddr

type StakeAddr = keys.Address

type StakeSymbol

type StakeSymbol string

func (StakeSymbol) Validate

func (s StakeSymbol) Validate() *errors.Error

type Tag

type Tag []string

func NewTag

func NewTag(values ...string) Tag

func (*Tag) Append

func (tag *Tag) Append(t string) *Tag

func (*Tag) Exists

func (tag *Tag) Exists(t string) bool

func (*Tag) Remove

func (tag *Tag) Remove(t string)

type Token

type Token struct {
	Link      Link         `json:"link" bson:"link"`
	Authority keys.Address `json:"authority" bson:"authority"`
	Network   NetworkAddr  `json:"network" bson:"network"`
	Mint      TokenAddr    `json:"address" bson:"address"`
	Symbol    string       `json:"symbol" bson:"symbol"`
	Decimals  uint8        `json:"decimals" bson:"decimals"`
	Ctrl      Ctrl         `json:"ctrl" bson:"ctrl"`
	Tag       Tag          `json:"tag" bson:"tag"`
	Meta      Meta         `json:"meta" bson:"meta"`
}

type TokenAccount

type TokenAccount struct {
	Address  TokenAccountAddr `json:"address" bson:"address"`
	Mint     TokenAddr        `json:"mint" bson:"mint"`
	Symbol   TokenSymbol      `json:"symbol" bson:"symbol"`
	Supply   uint64           `json:"supply" bson:"supply"`
	Balance  uint64           `json:"balance" bson:"balance"`
	Decimals uint8            `json:"decimals" bson:"decimals"`
}

func (*TokenAccount) UiAmount

func (t *TokenAccount) UiAmount() string

type TokenAccountAddr

type TokenAccountAddr = keys.Address

type TokenAddr

type TokenAddr = keys.Address

type TokenSymbol

type TokenSymbol string

func (TokenSymbol) Validate

func (s TokenSymbol) Validate() *errors.Error

type Tx

type Tx string

type ValuableNode

type ValuableNode struct {
	Network   NetworkAddr  `json:"network" bson:"network"`
	Superior  keys.Address `json:"superior" bson:"superior"`
	Authority keys.Address `json:"authority" bson:"authority"`
	Symbol    string       `json:"symbol" bson:"symbol"`
	Ctrl      Ctrl         `json:"ctrl" bson:"ctrl"`
	Tag       Tag          `json:"tag" bson:"tag"`
	Meta      Meta         `json:"meta" bson:"meta"`
}

Jump to

Keyboard shortcuts

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