Documentation ¶
Index ¶
- func CalcPackedSize(i interface{}) (int, error)
- func DecodeHash256(hash string) ([]byte, error)
- func GetBlockNumFromHex(refBlock string) (uint32, error)
- func GetRefBlockNum(refBlock []byte) uint32
- func GetRefBlockPrefix(refBlock []byte) uint32
- func IsNameValid(addr string) bool
- func N2S(value uint64) string
- func PackArray(a []Serializer) []byte
- func PackUint64(n uint64) []byte
- func PackVarInt32(v int32) []byte
- func PackVarUint32(val uint32) []byte
- func PackedVarInt32Length(v int32) int
- func PackedVarUint32Length(val uint32) int
- func S2N(s string) uint64
- func UnpackVarInt32(buf []byte) (int32, int)
- func UnpackVarUint32(val []byte) (v uint32, n int)
- type Action
- type BlockTimestampType
- type Bytes
- type Bytes32
- type ChainApi
- func (api *ChainApi) GetAccount(name string) (JsonObject, error)
- func (api *ChainApi) GetActions(account string, pos int, offset int) (JsonObject, error)
- func (api *ChainApi) GetBlock(number uint32) (JsonObject, error)
- func (api *ChainApi) GetInfo() (*ChainInfo, error)
- func (api *ChainApi) GetRpc() *Rpc
- func (api *ChainApi) GetTableRows(json bool, code string, scope string, table string, lowerbound string, ...) (JsonObject, error)
- func (api *ChainApi) PushAction(action *Action) (JsonObject, error)
- func (api *ChainApi) PushActions(actions []*Action) (JsonObject, error)
- func (t *ChainApi) PushTransaction(tx *Transaction, signatures []string, comporess bool) (JsonObject, error)
- type ChainInfo
- type Decoder
- func (dec *Decoder) IsEnd() bool
- func (dec *Decoder) Pos() int
- func (dec *Decoder) Read(b []byte) error
- func (dec *Decoder) ReadBool() (bool, error)
- func (dec *Decoder) ReadFloat32() (float32, error)
- func (dec *Decoder) ReadFloat64() (float64, error)
- func (dec *Decoder) ReadInt16() (int16, error)
- func (dec *Decoder) ReadInt32() (int32, error)
- func (dec *Decoder) ReadInt64() (int64, error)
- func (dec *Decoder) ReadInt8() (int8, error)
- func (dec *Decoder) ReadUint16() (uint16, error)
- func (dec *Decoder) ReadUint32() (uint32, error)
- func (dec *Decoder) ReadUint64() (uint64, error)
- func (dec *Decoder) ReadUint8() (uint8, error)
- func (dec *Decoder) Unpack(i interface{}) (n int, err error)
- func (dec *Decoder) UnpackAction() (*Action, error)
- func (dec *Decoder) UnpackBool() (bool, error)
- func (dec *Decoder) UnpackBytes() ([]byte, error)
- func (dec *Decoder) UnpackFloat32() (float32, error)
- func (dec *Decoder) UnpackFloat64() (float64, error)
- func (dec *Decoder) UnpackI(unpacker Unpacker) error
- func (dec *Decoder) UnpackInt16() (int16, error)
- func (dec *Decoder) UnpackInt32() (int32, error)
- func (dec *Decoder) UnpackInt64() (int64, error)
- func (dec *Decoder) UnpackInt8() (int8, error)
- func (dec *Decoder) UnpackLength() (int, error)
- func (dec *Decoder) UnpackName() (Name, error)
- func (dec *Decoder) UnpackString() (string, error)
- func (dec *Decoder) UnpackUint16() (uint16, error)
- func (dec *Decoder) UnpackUint32() (uint32, error)
- func (dec *Decoder) UnpackUint64() (uint64, error)
- func (dec *Decoder) UnpackUint8() (uint8, error)
- func (dec *Decoder) UnpackVarInt32() (int32, error)
- func (dec *Decoder) UnpackVarUint32() (VarUint32, error)
- type Encoder
- func (enc *Encoder) Bytes() []byte
- func (enc *Encoder) GetBytes() []byte
- func (enc *Encoder) Pack(i interface{}) error
- func (enc *Encoder) PackBool(b bool)
- func (enc *Encoder) PackBytes(v []byte)
- func (enc *Encoder) PackFloat32(f float32)
- func (enc *Encoder) PackFloat64(f float64)
- func (enc *Encoder) PackInt16(d int16)
- func (enc *Encoder) PackInt32(d int32)
- func (enc *Encoder) PackInt64(d int64)
- func (enc *Encoder) PackInt8(d int8)
- func (enc *Encoder) PackLength(n int)
- func (enc *Encoder) PackName(name Name)
- func (enc *Encoder) PackString(s string)
- func (enc *Encoder) PackUint16(d uint16)
- func (enc *Encoder) PackUint32(d uint32)
- func (enc *Encoder) PackUint64(d uint64)
- func (enc *Encoder) PackUint8(d uint8)
- func (enc *Encoder) PackVarInt32(n int32)
- func (enc *Encoder) PackVarUint32(n uint32)
- func (enc *Encoder) Reset()
- func (enc *Encoder) Write(b []byte)
- func (enc *Encoder) WriteByte(b byte)
- func (enc *Encoder) WriteBytes(v []byte)
- func (enc *Encoder) WriteInt(d int)
- func (enc *Encoder) WriteInt16(d int16)
- func (enc *Encoder) WriteInt32(d int32)
- func (enc *Encoder) WriteInt64(d int64)
- func (enc *Encoder) WriteUint16(d uint16)
- func (enc *Encoder) WriteUint32(d uint32)
- func (enc *Encoder) WriteUint64(d uint64)
- func (enc *Encoder) WriteUint8(d uint8)
- type Float128
- type GetAccountArgs
- type GetActionsArgs
- type GetRequiredKeysArgs
- type GetRequiredKeysResult
- type GetTableRowsArgs
- type Int128
- type JsonObject
- func (b JsonObject) Get(keys ...interface{}) (interface{}, error)
- func (b JsonObject) GetArray(keys ...interface{}) ([]interface{}, error)
- func (b JsonObject) GetInt64(keys ...interface{}) (int64, error)
- func (b JsonObject) GetJsonObject(keys ...interface{}) (JsonObject, error)
- func (b JsonObject) GetString(keys ...interface{}) (string, error)
- func (b JsonObject) GetTime(keys ...interface{}) (*time.Time, error)
- func (b JsonObject) GetUint64(keys ...interface{}) (uint64, error)
- func (b JsonObject) ToString() string
- type Name
- type PackedSize
- type PackedTransaction
- type Packer
- type PermissionLevel
- type Rpc
- func (r *Rpc) Call(api string, endpoint string, params interface{}) ([]byte, error)
- func (r *Rpc) GetAccount(args *GetAccountArgs) (JsonObject, error)
- func (t *Rpc) GetActions(args *GetActionsArgs) (JsonObject, error)
- func (r *Rpc) GetInfo() (*ChainInfo, error)
- func (r *Rpc) GetRequiredKeys(args *GetRequiredKeysArgs) (*GetRequiredKeysResult, error)
- func (t *Rpc) GetTableRows(args *GetTableRowsArgs) (JsonObject, error)
- func (t *Rpc) PushTransaction(tx *Transaction, signatures []string, compress bool) (JsonObject, error)
- type RpcError
- type Serializer
- type TimePoint
- type TimePointSec
- type Transaction
- func (t *Transaction) AddAction(a *Action)
- func (t *Transaction) Id(chainId *Bytes32) *Bytes32
- func (t *Transaction) Marshal() string
- func (t *Transaction) Pack() []byte
- func (t *Transaction) SetReferenceBlock(refBlock string) error
- func (t *Transaction) Sign(privKey *secp256k1.PrivateKey, chainId *Bytes32) (*secp256k1.Signature, error)
- func (t *Transaction) SignWithPublicKey(pubKey string, chainId *Bytes32) (*secp256k1.Signature, error)
- func (t *Transaction) Unpack(data []byte) (int, error)
- type TransactionExtension
- type Uint128
- type Uint256
- type Unpacker
- type VarInt32
- type VarUint32
- type Wallet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcPackedSize ¶
func DecodeHash256 ¶
func GetBlockNumFromHex ¶
func GetRefBlockNum ¶
func GetRefBlockPrefix ¶
func IsNameValid ¶
func PackArray ¶
func PackArray(a []Serializer) []byte
func PackUint64 ¶
func PackVarInt32 ¶
func PackVarUint32 ¶
func PackedVarInt32Length ¶
func PackedVarUint32Length ¶
func UnpackVarInt32 ¶
func UnpackVarUint32 ¶
Types ¶
type Action ¶
type Action struct { Account Name `json:"account"` Name Name `json:"name"` Authorization []*PermissionLevel `json:"authorization"` Data Bytes `json:"data"` }
func NewAction ¶
func NewAction(perm *PermissionLevel, account Name, name Name, args ...interface{}) *Action
func (*Action) AddPermission ¶
type BlockTimestampType ¶
type BlockTimestampType struct {
Slot uint32
}
func (*BlockTimestampType) Pack ¶
func (t *BlockTimestampType) Pack() []byte
func (*BlockTimestampType) Size ¶
func (t *BlockTimestampType) Size() int
type ChainApi ¶
type ChainApi struct {
// contains filtered or unexported fields
}
func NewChainApi ¶
func (*ChainApi) GetAccount ¶
func (api *ChainApi) GetAccount(name string) (JsonObject, error)
func (*ChainApi) GetActions ¶
func (*ChainApi) GetTableRows ¶
func (*ChainApi) PushAction ¶
func (api *ChainApi) PushAction(action *Action) (JsonObject, error)
func (*ChainApi) PushActions ¶
func (api *ChainApi) PushActions(actions []*Action) (JsonObject, error)
func (*ChainApi) PushTransaction ¶
func (t *ChainApi) PushTransaction(tx *Transaction, signatures []string, comporess bool) (JsonObject, error)
type ChainInfo ¶
type ChainInfo struct { ServerVersion string `json:"server_version"` ChainID string `json:"chain_id"` HeadBlockNum uint32 `json:"head_block_num"` LastIrreversibleBlockNum uint32 `json:"last_irreversible_block_num"` LastIrreversibleBlockID string `json:"last_irreversible_block_id"` HeadBlockID string `json:"head_block_id"` HeadBlockTime string `json:"head_block_time"` HeadBlockProducer string `json:"head_block_producer"` VirtualBlockCPULimit int64 `json:"virtual_block_cpu_limit"` VirtualBlockNetLimit int64 `json:"virtual_block_net_limit"` BlockCPULimit int64 `json:"block_cpu_limit"` BlockNetLimit int64 `json:"block_net_limit"` ServerVersionString string `json:"server_version_string"` ForkDBHeadBlockNum int64 `json:"fork_db_head_block_num"` ForkDBHeadBlockID string `json:"fork_db_head_block_id"` ServerFullVersionString string `json:"server_full_version_string"` LastIrreversibleBlockTime string `json:"last_irreversible_block_time"` }
func NewChainInfo ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func (*Decoder) ReadFloat32 ¶
func (*Decoder) ReadFloat64 ¶
func (*Decoder) ReadUint16 ¶
func (*Decoder) ReadUint32 ¶
func (*Decoder) ReadUint64 ¶
func (*Decoder) UnpackAction ¶
func (*Decoder) UnpackBool ¶
func (*Decoder) UnpackBytes ¶
func (*Decoder) UnpackFloat32 ¶
func (*Decoder) UnpackFloat64 ¶
func (*Decoder) UnpackInt16 ¶
func (*Decoder) UnpackInt32 ¶
func (*Decoder) UnpackInt64 ¶
func (*Decoder) UnpackInt8 ¶
func (*Decoder) UnpackLength ¶
func (*Decoder) UnpackName ¶
func (*Decoder) UnpackString ¶
func (*Decoder) UnpackUint16 ¶
func (*Decoder) UnpackUint32 ¶
func (*Decoder) UnpackUint64 ¶
func (*Decoder) UnpackUint8 ¶
func (*Decoder) UnpackVarInt32 ¶
func (*Decoder) UnpackVarUint32 ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func (*Encoder) Pack ¶
Pack supported types: Packer, interface string, bytes byte, uint16, int32, uint32, int64, uint64, float64 Name
func (*Encoder) PackFloat32 ¶
func (*Encoder) PackFloat64 ¶
func (*Encoder) PackLength ¶
func (*Encoder) PackString ¶
func (*Encoder) PackUint16 ¶
func (*Encoder) PackUint32 ¶
func (*Encoder) PackUint64 ¶
func (*Encoder) PackVarInt32 ¶
func (*Encoder) PackVarUint32 ¶
func (*Encoder) WriteBytes ¶
func (*Encoder) WriteInt16 ¶
func (*Encoder) WriteInt32 ¶
func (*Encoder) WriteInt64 ¶
func (*Encoder) WriteUint16 ¶
func (*Encoder) WriteUint32 ¶
func (*Encoder) WriteUint64 ¶
func (*Encoder) WriteUint8 ¶
type GetAccountArgs ¶
type GetAccountArgs struct {
AccountName string `json:"account_name"`
}
type GetActionsArgs ¶
type GetRequiredKeysArgs ¶
type GetRequiredKeysArgs struct { Transaction *Transaction `json:"transaction"` AvailableKeys []string `json:"available_keys"` }
type GetRequiredKeysResult ¶
type GetRequiredKeysResult struct {
RequiredKeys []string `json:"required_keys"`
}
required_keys
type GetTableRowsArgs ¶
type GetTableRowsArgs struct { Json bool `json:"json"` Code string `json:"code"` Scope string `json:"scope"` Table string `json:"table"` LowerBound string `json:"lower_bound"` UpperBound string `json:"upper_bound"` Limit int `json:"limit"` KeyType string `json:"key_type"` IndexPosition int `json:"index_position"` Reverse bool `json:"reverse"` ShowPayer bool `json:"show_payer"` }
type JsonObject ¶
type JsonObject map[string]interface{}
func NewJsonObjectFromBytes ¶
func NewJsonObjectFromBytes(data []byte) (JsonObject, error)
func NewJsonObjectFromInterface ¶
func NewJsonObjectFromInterface(obj interface{}) (JsonObject, bool)
func (JsonObject) Get ¶
func (b JsonObject) Get(keys ...interface{}) (interface{}, error)
return string, []JsonObject, or map[string]interface{}
func (JsonObject) GetArray ¶
func (b JsonObject) GetArray(keys ...interface{}) ([]interface{}, error)
func (JsonObject) GetInt64 ¶
func (b JsonObject) GetInt64(keys ...interface{}) (int64, error)
func (JsonObject) GetJsonObject ¶
func (b JsonObject) GetJsonObject(keys ...interface{}) (JsonObject, error)
func (JsonObject) GetString ¶
func (b JsonObject) GetString(keys ...interface{}) (string, error)
func (JsonObject) GetUint64 ¶
func (b JsonObject) GetUint64(keys ...interface{}) (uint64, error)
func (JsonObject) ToString ¶
func (b JsonObject) ToString() string
type PackedSize ¶
type PackedSize interface {
Size() int
}
type PackedTransaction ¶
type PackedTransaction struct { Signatures []string `json:"signatures"` Compression string `json:"compression"` PackedContext Bytes `json:"packed_context_free_data"` PackedTx Bytes `json:"packed_trx"` }
func NewPackedTransaction ¶
func NewPackedTransaction(tx *Transaction, signatures []string, compress bool) *PackedTransaction
func (*PackedTransaction) AddSignatures ¶
func (t *PackedTransaction) AddSignatures(signatures []string)
type PermissionLevel ¶
func (*PermissionLevel) Pack ¶
func (t *PermissionLevel) Pack() []byte
func (*PermissionLevel) Size ¶
func (t *PermissionLevel) Size() int
type Rpc ¶
type Rpc struct {
// contains filtered or unexported fields
}
func (*Rpc) GetAccount ¶
func (r *Rpc) GetAccount(args *GetAccountArgs) (JsonObject, error)
func (*Rpc) GetActions ¶
func (t *Rpc) GetActions(args *GetActionsArgs) (JsonObject, error)
func (*Rpc) GetRequiredKeys ¶
func (r *Rpc) GetRequiredKeys(args *GetRequiredKeysArgs) (*GetRequiredKeysResult, error)
func (*Rpc) GetTableRows ¶
func (t *Rpc) GetTableRows(args *GetTableRowsArgs) (JsonObject, error)
func (*Rpc) PushTransaction ¶
func (t *Rpc) PushTransaction(tx *Transaction, signatures []string, compress bool) (JsonObject, error)
type RpcError ¶
type RpcError struct {
// contains filtered or unexported fields
}
func NewRpcError ¶
type TimePointSec ¶
type TimePointSec struct {
UTCSeconds uint32
}
func (TimePointSec) MarshalJSON ¶
func (t TimePointSec) MarshalJSON() ([]byte, error)
func (*TimePointSec) Pack ¶
func (t *TimePointSec) Pack() []byte
func (*TimePointSec) Size ¶
func (t *TimePointSec) Size() int
func (*TimePointSec) UnmarshalJSON ¶
func (a *TimePointSec) UnmarshalJSON(b []byte) error
type Transaction ¶
type Transaction struct { // time_point_sec expiration; // uint16_t ref_block_num; // uint32_t ref_block_prefix; // unsigned_int max_net_usage_words = 0UL; /// number of 8 byte words this transaction can serialize into after compressions // uint8_t max_cpu_usage_ms = 0UL; /// number of CPU usage units to bill transaction for // unsigned_int delay_sec = 0UL; /// number of seconds to delay transaction, default: 0 Expiration TimePointSec `json:"expiration"` RefBlockNum uint16 `json:"ref_block_num"` RefBlockPrefix uint32 `json:"ref_block_prefix"` //[VLQ or Base-128 encoding](https://en.wikipedia.org/wiki/Variable-length_quantity) //unsigned_int vaint (eosio.cdt/libraries/eosiolib/core/eosio/varint.hpp) MaxNetUsageWords VarUint32 `json:"max_net_usage_words"` MaxCpuUsageMs uint8 `json:"max_cpu_usage_ms"` DelaySec VarUint32 `json:"delay_sec"` ContextFreeActions []*Action `json:"context_free_actions"` Actions []*Action `json:"actions"` Extention []*TransactionExtension `json:"transaction_extensions"` }
func NewTransaction ¶
func NewTransaction(expiration uint32) *Transaction
func (*Transaction) AddAction ¶
func (t *Transaction) AddAction(a *Action)
func (*Transaction) Id ¶
func (t *Transaction) Id(chainId *Bytes32) *Bytes32
func (*Transaction) Marshal ¶
func (t *Transaction) Marshal() string
func (*Transaction) Pack ¶
func (t *Transaction) Pack() []byte
func (*Transaction) SetReferenceBlock ¶
func (t *Transaction) SetReferenceBlock(refBlock string) error
func (*Transaction) Sign ¶
func (t *Transaction) Sign(privKey *secp256k1.PrivateKey, chainId *Bytes32) (*secp256k1.Signature, error)
func (*Transaction) SignWithPublicKey ¶
type TransactionExtension ¶
func (*TransactionExtension) Pack ¶
func (t *TransactionExtension) Pack() []byte
func (*TransactionExtension) Size ¶
func (a *TransactionExtension) Size() int
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func (*Wallet) GetPrivateKey ¶
func (w *Wallet) GetPrivateKey(pubKey string) (*secp256k1.PrivateKey, error)
Click to show internal directories.
Click to hide internal directories.