Documentation ¶
Index ¶
- Constants
- type Action
- type ActionArguments
- type Args
- type Asset
- type AuthorizerWeight
- type DomainDef
- type Encoding
- type EvtLink
- type FullAction
- type Fungible
- type FungibleDef
- type GroupDef
- type Leaf
- type Meta
- type Node
- type PermissionDef
- type Root
- type SignedTRXJson
- type SimpleAction
- type SuspendDef
- type Symbol
- type TRXJson
- type TokenDef
Constants ¶
const ( StdPadding rune = '=' // Standard padding character NoPadding rune = -1 // No padding )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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.
type AuthorizerWeight ¶
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
type EvtLink ¶
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 ¶
type FullAction ¶
type Fungible ¶
type Fungible struct {
// contains filtered or unexported fields
}
func NewFungbile ¶
func (*Fungible) StringWithSymbol ¶
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 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"` }
type SignedTRXJson ¶
type SimpleAction ¶
type SuspendDef ¶
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.
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"` }