evttypes

package
v0.0.0-...-eb4c3ac Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StdPadding rune = '=' // Standard padding character
	NoPadding  rune = -1  // No padding
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name   string `json:"name"`
	Domain string `json:"domain"`
	Key    string `json:"key"`
}

type ActionArguments

type ActionArguments struct {
	Action string      `json:"action"`
	Args   interface{} `json:"args"`
}

type Args

type Args struct {
	Name        string         `json:"name,omitempty"`
	Creator     string         `json:"creator,omitempty"`
	Issue       *PermissionDef `json:"issue,omitempty"`
	Transfer    *PermissionDef `json:"transfer,omitempty"`
	Manage      *PermissionDef `json:"manage,omitempty"`
	TotalSupply int64          `json:"total_supply,omitempty"`
	From        string         `json:"from,omitempty"`
	To          string         `json:"to,omitempty"`
	Number      string         `json:"number,omitempty"`
}

type Asset

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

asset type is composed of two parts: the number part representing price or volume, and the symbol part describing the type name of asset. The number part is a number containing a . which introduces its precision. The precision is determined by the digits after the .. That is, 0.300 has the precision of 3, while 0.3 only has the precision of 1. The precision of an asset should be less than 18. The symbol part introduces the symbol id, which is an integer number representing one unqiue fungible symbol. Only the assets of the same type can be added up. The EVT asset is an asset type with the precision of 5 and 1 as symbol id. Therefore, 12.00000 S#1 is a valid EVT asset, but 12.000 S#1, 12 S#1 or 12.0000 S#1 are invalid EVT asset due to the wrong precision.

func NewAsset

func NewAsset(value string, fungibleId string) *Asset

func (*Asset) String

func (it *Asset) String() string

type AuthorizerWeight

type AuthorizerWeight struct {
	Ref    string `json:"ref"`
	Weight int    `json:"weight"`
}

func GroupOwnedAuthorizer

func GroupOwnedAuthorizer() *AuthorizerWeight

func SingleAddressAuthorizer

func SingleAddressAuthorizer(address string) *AuthorizerWeight

type DomainDef

type DomainDef struct {
	Name       string         `json:"name"`
	Creator    string         `json:"creator"`
	CreateTime string         `json:"create_time"` // Format 2018-03-02T12:00:00
	Issue      *PermissionDef `json:"issue"`
	Transfer   *PermissionDef `json:"transfer"`
	Manage     *PermissionDef `json:"manage"`
	Metas      []Meta         `json:"metas"`
}

type Encoding

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

func NewEncoding

func NewEncoding() *Encoding

func (Encoding) Decode

func (e Encoding) Decode(message string) []byte
type EvtLink struct {
	Flag     int `json:"flag"`
	Segments []struct {
		TypeKey int         `json:"typeKey"`
		Value   interface{} `json:"value"`
	} `json:"segments"`
	PublicKeys []string `json:"publicKeys"`
	Signatures []string `json:"signatures"`
}
func ParseEvtLink(evtLink string) (*EvtLink, error)

type FullAction

type FullAction struct {
	Action
	Data    Args   `json:"data"`
	HexData string `json:"hex_data"`
}

type Fungible

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

func NewFungbile

func NewFungbile(symbol *Symbol) *Fungible

func (*Fungible) String

func (it *Fungible) String() string

func (*Fungible) StringWithSymbol

func (it *Fungible) StringWithSymbol() string

type FungibleDef

type FungibleDef struct {
	Name        string         `json:"name"`
	Sym         string         `json:"sym"`
	Creator     string         `json:"creator"`
	CreateTime  string         `json:"create_time"` // Format 2018-03-02T12:00:00
	Issue       *PermissionDef `json:"issue"`
	Manage      *PermissionDef `json:"manage"`
	TotalSupply string         `json:"total_supply"`
	Metas       []Meta         `json:"metas"`
}

type GroupDef

type GroupDef struct {
	Name string `json:"name"`
	Key  string `json:"key"`
	Root Root   `json:"root"`
}

func NewGrouDef

func NewGrouDef(name string, key string, threshold int) *GroupDef

type Leaf

type Leaf struct {
	Key    string `json:"key"`
	Weight int    `json:"weight"`
}

type Meta

type Meta struct {
	Key     string `json:"key"`
	Value   string `json:"value"`
	Creator string `json:"creator"`
}

type Node

type Node struct {
	Threshold int           `json:"threshold"`
	Weight    int           `json:"weight"`
	Nodes     []interface{} `json:"nodes"`
}

func NewNode

func NewNode(threshold int, weight int) *Node

func (*Node) AddLeaf

func (node *Node) AddLeaf(leaf *Leaf) *Node

func (*Node) AddNode

func (node *Node) AddNode(newNode *Node) *Node

type PermissionDef

type PermissionDef struct {
	Name        string             `json:"name"`
	Threshold   int                `json:"threshold"`
	Authorizers []AuthorizerWeight `json:"authorizers"`
}

func PermissionDefIssue

func PermissionDefIssue(threshold int) *PermissionDef

func PermissionDefManage

func PermissionDefManage(threshold int) *PermissionDef

func PermissionDefTranfer

func PermissionDefTranfer(threshold int) *PermissionDef

func (*PermissionDef) AddAuthorizer

func (pd *PermissionDef) AddAuthorizer(weight *AuthorizerWeight)

type Root

type Root struct {
	Threshold int           `json:"threshold"`
	Nodes     []interface{} `json:"nodes"`
}

func (*Root) AddLeaf

func (root *Root) AddLeaf(leaf *Leaf) *Root

func (*Root) AddNode

func (root *Root) AddNode(newNode *Node) *Root

type SignedTRXJson

type SignedTRXJson struct {
	Signatures  []string `json:"signatures"`
	Compression string   `json:"compression"`
	Transaction *TRXJson `json:"transaction"`
}

type SimpleAction

type SimpleAction struct {
	Action
	Data string `json:"data"`
}

type SuspendDef

type SuspendDef struct {
	Name       string `json:"name"`
	Proposer   string `json:"proposer"`
	Status     string `json:"status"`
	Trx        string `json:"trx"`
	SignedKeys string `json:"signed_keys"`
	Signatures string `json:"signatures"`
}

type Symbol

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

symbol type is the symbol part in asset type. It represents a token and contains precision and unique id. Precision is a number and should be less than 18 and symbol id is a unique integer number. For example, 12.00000 S#1 is a valid EVT asset, and it has the precision of 5 and '1' as symbol id. Its symbol expression is 5,S#1. Then 7,S#123 represents a asset symbol with precision of 7 and '123' as symbol id.

func NewSymbol

func NewSymbol(precision int, id string) *Symbol

func (*Symbol) String

func (it *Symbol) String() string

type TRXJson

type TRXJson struct {
	Id                    string         `json:"-"`
	Expiration            string         `json:"expiration"`
	RefBlockNum           int            `json:"ref_block_num"`
	RefBlockPrefix        int            `json:"ref_block_prefix"`
	MaxCharge             int            `json:"max_charge"`
	Payer                 string         `json:"payer"`
	Actions               []SimpleAction `json:"actions"`
	TransactionExtensions []interface{}  `json:"transaction_extensions"`
}

type TokenDef

type TokenDef struct {
	Domain string `json:"domain"`
	Name   string `json:"name"`
	Owner  string `json:"owner"`
}

Jump to

Keyboard shortcuts

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