Documentation
¶
Index ¶
- Constants
- Variables
- func MarshalBinary(v interface{}) ([]byte, error)
- func NameToString(in uint64) string
- func RegisterAction(accountName AccountName, actionName ActionName, obj interface{})
- func SigDigest(chainID, payload, contextFreeData []byte) []byte
- func StringToName(s string) (val uint64, err error)
- func UnmarshalBinary(data []byte, v interface{}) (err error)
- func UnmarshalBinaryReader(reader io.Reader, v interface{}) (err error)
- type ABI
- type ABIType
- type API
- func (api *API) EnableKeepAlives() bool
- func (api *API) FixKeepAlives() bool
- func (api *API) GetAccount(name AccountName) (out *AccountResp, err error)
- func (api *API) GetBlockByID(id string) (out *BlockResp, err error)
- func (api *API) GetBlockByNum(num uint64) (out *BlockResp, err error)
- func (api *API) GetBlockByNumOrID(query string) (out *SignedBlockMessage, err error)
- func (api *API) GetCode(account AccountName) (out *Code, err error)
- func (api *API) GetCurrencyBalance(account AccountName, symbol string, code AccountName) (out []Asset, err error)
- func (api *API) GetInfo() (out *InfoResp, err error)
- func (api *API) GetNetConnections() (out []*NetConnectionsResp, err error)
- func (api *API) GetNetStatus(host string) (out *NetStatusResp, err error)
- func (api *API) GetRequiredKeys(tx *Transaction) (out *GetRequiredKeysResp, err error)
- func (api *API) GetTableRows(params GetTableRowsRequest) (out *GetTableRowsResp, err error)
- func (api *API) GetTransaction(id string) (out *TransactionResp, err error)
- func (api *API) GetTransactions(name AccountName) (out *TransactionsResp, err error)
- func (api *API) NetConnect(host string) (out NetConnectResp, err error)
- func (api *API) NetDisconnect(host string) (out NetDisconnectResp, err error)
- func (api *API) PushSignedTransaction(tx *PackedTransaction) (out *PushTransactionFullResp, err error)
- func (api *API) SetSigner(s Signer)
- func (api *API) SignPushActions(a ...*Action) (out *PushTransactionFullResp, err error)
- func (api *API) SignPushActionsWithOpts(opts TxOptions, a ...*Action) (out *PushTransactionFullResp, err error)
- func (api *API) SignPushTransaction(tx *Transaction, opts *TxOptions) (out *PushTransactionFullResp, err error)
- func (api *API) WalletImportKey(walletName, wifPrivKey string) (err error)
- func (api *API) WalletPublicKeys() (out []ecc.PublicKey, err error)
- func (api *API) WalletSignTransaction(tx *SignedTransaction, chainID []byte, pubKeys ...ecc.PublicKey) (out *WalletSignTransactionResp, err error)
- type AccountName
- type AccountResp
- type Action
- type ActionData
- type ActionDef
- type ActionName
- type ActionTrace
- type Asset
- type Authority
- type BlockHeader
- type BlockResp
- type BlockTimestamp
- type ClausePair
- type Code
- type CompressionType
- type Currency
- type CurrencyBalanceResp
- type CurrencyName
- type Cycle
- type Cycles
- type DataAccess
- type Decoder
- type DeferredTransaction
- type Encoder
- type FieldDef
- type GetRequiredKeysResp
- type GetTableRowsRequest
- type GetTableRowsResp
- type GoAwayMessage
- type GoAwayReason
- type HandshakeMessage
- type HexBytes
- type IDListMode
- type InfoResp
- type JSONTime
- type KeyBag
- func (b *KeyBag) Add(wifKey string) error
- func (b *KeyBag) AvailableKeys() (out []ecc.PublicKey, err error)
- func (b *KeyBag) ImportFromFile(path string) error
- func (b *KeyBag) ImportPrivateKey(wifPrivKey string) (err error)
- func (b *KeyBag) Sign(tx *SignedTransaction, chainID []byte, requiredKeys ...ecc.PublicKey) (*SignedTransaction, error)
- type KeyWeight
- type M
- type MessageReflectTypes
- type MyStruct
- type Name
- type NetConnectResp
- type NetConnectionsResp
- type NetDisconnectResp
- type NetStatusResp
- type NewAccount
- type NoticeMessage
- type OptionalProducerSchedule
- type OrderedBlockIDs
- type OrderedTransactionIDs
- type P2PMessage
- type P2PMessageEnvelope
- type P2PMessageType
- type PackedTransaction
- type PackedTransactionMessage
- type Permission
- type PermissionLevel
- type PermissionLevelWeight
- type PermissionName
- type ProducerChange
- type ProducerKey
- type ProducerSchedule
- type PushTransactionFullResp
- type PushTransactionShortResp
- type RegionSummary
- type RequestMessage
- type SHA256Bytes
- type ScopeName
- type SequencedTransactionResp
- type SetABI
- type SetCode
- type ShardLock
- type ShardSummary
- type SignedBlockHeader
- type SignedBlockMessage
- type SignedBlockSummaryMessage
- type SignedTransaction
- type SignedTransactionMessage
- type Signer
- type StructDef
- type Symbol
- type SyncRequestMessage
- type TableDef
- type TableName
- type TimeMessage
- type Transaction
- type TransactionProcessed
- type TransactionReceipt
- type TransactionResp
- type TransactionStatus
- type TransactionsResp
- type Tstamp
- type TxOptions
- type Varuint32
- type WalletSignTransactionResp
- type WalletSigner
Constants ¶
const ( GoAwayNoReason = uint8(iota) GoAwaySelfConnect GoAwayDuplicate GoAwayWrongChain GoAwayWrongVersion GoAwayForked GoAwayUnlinkable GoAwayBadTransaction GoAwayValidation GoAwayAuthentication GoAwayFatalOther GoAwayBenignOther GoAwayCrazy )
const ( CompressionNone = CompressionType(iota) CompressionZlib )
const BlockTimestampFormat = "2006-01-02T15:04:05"
const JSONTimeFormat = "2006-01-02T15:04:05"
Variables ¶
var Debug bool
var EOSSymbol = Symbol{Precision: 4, Symbol: "EOS"}
EOSSymbol represents the standard EOS symbol on the chain. It's here just to speed up things.
var ErrNotFound = errors.New("resource not found")
var ErrUnknownMessageType = errors.New("unknown type")
var ErrVarIntBufferSize = errors.New("varint: invalid buffer size")
var TypeSize = struct { Byte int Int8 int UInt16 int Int16 int UInt32 int UInt64 int SHA256Bytes int PublicKey int Signature int Tstamp int BlockTimestamp int CurrencyName int Bool int }{ Byte: 1, Int8: 1, UInt16: 2, Int16: 2, UInt32: 4, UInt64: 8, SHA256Bytes: 32, PublicKey: 34, Signature: 66, Tstamp: 8, BlockTimestamp: 4, CurrencyName: 7, Bool: 1, }
Functions ¶
func MarshalBinary ¶
func NameToString ¶
func RegisterAction ¶
func RegisterAction(accountName AccountName, actionName ActionName, obj interface{})
Registers Action objects..
func StringToName ¶
func UnmarshalBinary ¶
func UnmarshalBinaryReader ¶
Types ¶
type ABI ¶
type ABI struct {
Types []ABIType `json:"types,omitempty"`
Structs []StructDef `json:"structs,omitempty"`
Actions []ActionDef `json:"actions,omitempty"`
Tables []TableDef `json:"tables,omitempty"`
Clauses []ClausePair `json:"clauses,omitempty"`
}
see: libraries/chain/contracts/abi_serializer.cpp:53... see: libraries/chain/include/eosio/chain/contracts/types.hpp:100
type API ¶
type API struct {
HttpClient *http.Client
BaseURL string
ChainID []byte
Signer Signer
Debug bool
Compress CompressionType
DefaultMaxKCPUUsage uint32 // in kilo-cpu cycles
DefaultMaxNetUsageWords uint32 // in 8-bytes words
// contains filtered or unexported fields
}
func (*API) EnableKeepAlives ¶
func (*API) FixKeepAlives ¶
FixKeepAlives tests the remote server for keepalive support (the main `nodeos` software doesn't in the version from March 22nd 2018). Some endpoints front their node with a keep-alive supporting web server. Adjust the `KeepAlive` support of the client accordingly.
func (*API) GetAccount ¶
func (api *API) GetAccount(name AccountName) (out *AccountResp, err error)
func (*API) GetBlockByNumOrID ¶
func (api *API) GetBlockByNumOrID(query string) (out *SignedBlockMessage, err error)
func (*API) GetCurrencyBalance ¶
func (api *API) GetCurrencyBalance(account AccountName, symbol string, code AccountName) (out []Asset, err error)
func (*API) GetNetConnections ¶
func (api *API) GetNetConnections() (out []*NetConnectionsResp, err error)
func (*API) GetNetStatus ¶
func (api *API) GetNetStatus(host string) (out *NetStatusResp, err error)
func (*API) GetRequiredKeys ¶
func (api *API) GetRequiredKeys(tx *Transaction) (out *GetRequiredKeysResp, err error)
func (*API) GetTableRows ¶
func (api *API) GetTableRows(params GetTableRowsRequest) (out *GetTableRowsResp, err error)
func (*API) GetTransaction ¶
func (api *API) GetTransaction(id string) (out *TransactionResp, err error)
func (*API) GetTransactions ¶
func (api *API) GetTransactions(name AccountName) (out *TransactionsResp, err error)
func (*API) NetConnect ¶
func (api *API) NetConnect(host string) (out NetConnectResp, err error)
func (*API) NetDisconnect ¶
func (api *API) NetDisconnect(host string) (out NetDisconnectResp, err error)
func (*API) PushSignedTransaction ¶
func (api *API) PushSignedTransaction(tx *PackedTransaction) (out *PushTransactionFullResp, err error)
func (*API) SignPushActions ¶
func (api *API) SignPushActions(a ...*Action) (out *PushTransactionFullResp, err error)
func (*API) SignPushActionsWithOpts ¶
func (api *API) SignPushActionsWithOpts(opts TxOptions, a ...*Action) (out *PushTransactionFullResp, err error)
func (*API) SignPushTransaction ¶
func (api *API) SignPushTransaction(tx *Transaction, opts *TxOptions) (out *PushTransactionFullResp, err error)
func (*API) WalletImportKey ¶
WalletImportKey loads a new WIF-encoded key into the wallet.
func (*API) WalletSignTransaction ¶
func (api *API) WalletSignTransaction(tx *SignedTransaction, chainID []byte, pubKeys ...ecc.PublicKey) (out *WalletSignTransactionResp, err error)
type AccountResp ¶
type AccountResp struct {
AccountName AccountName `json:"account_name"`
Permissions []Permission `json:"permissions"`
}
type Action ¶
type Action struct {
Account AccountName `json:"account"`
Name ActionName `json:"name"`
Authorization []PermissionLevel `json:"authorization,omitempty"`
ActionData
}
Action
func (*Action) MarshalJSON ¶
type ActionData ¶
type ActionData struct {
HexData HexBytes `json:"hex_data,omitempty"`
Data interface{} `json:"data,omitempty" eos:"-"`
// contains filtered or unexported fields
}
func NewActionData ¶
func NewActionData(obj interface{}) ActionData
type ActionDef ¶
type ActionDef struct {
Name ActionName `json:"name"`
Type string `json:"type"`
RicardianContract string `json:"ricardian_contract"`
}
type ActionTrace ¶
type ActionTrace struct {
Receiver AccountName `json:"receiver"`
// Action Action `json:"act"` // FIXME: how do we unpack that ? what's on the other side anyway?
Console string `json:"console"`
RegionID uint16 `json:"region_id"`
CycleIndex int `json:"cycle_index"`
DataAccess []DataAccess `json:"data_access"`
}
type Asset ¶
NOTE: there's also ExtendedAsset which is a quantity with the attached contract (AccountName)
func NewEOSAsset ¶
func NewEOSAssetFromString ¶
func (*Asset) UnmarshalJSON ¶
type Authority ¶
type Authority struct {
Threshold uint32 `json:"threshold"`
Keys []KeyWeight `json:"keys"`
Accounts []PermissionLevelWeight `json:"accounts"`
}
type BlockHeader ¶
type BlockHeader struct {
Previous SHA256Bytes `json:"previous"`
Timestamp BlockTimestamp `json:"timestamp"`
TransactionMRoot SHA256Bytes `json:"transaction_mroot"`
ActionMRoot SHA256Bytes `json:"action_mroot"`
BlockMRoot SHA256Bytes `json:"block_mroot"`
Producer AccountName `json:"producer"`
ScheduleVersion uint32 `json:"schedule_version"`
NewProducers OptionalProducerSchedule `json:"new_producers"`
}
func (*BlockHeader) BlockNumber ¶
func (b *BlockHeader) BlockNumber() uint32
type BlockResp ¶
type BlockResp struct {
Previous string `json:"previous"` // : "0000007a9dde66f1666089891e316ac4cb0c47af427ae97f93f36a4f1159a194",
Timestamp JSONTime `json:"timestamp"` // : "2017-12-04T17:12:08",
TransactionMerkleRoot string `json:"transaction_merkle_root"` // : "0000000000000000000000000000000000000000000000000000000000000000",
Producer AccountName `json:"producer"` // : "initj",
ProducerChanges []ProducerChange `json:"producer_changes"` // : [],
ProducerSignature string `json:"producer_signature"` // : "203dbf00b0968bfc47a8b749bbfdb91f8362b27c3e148a8a3c2e92f42ec55e9baa45d526412c8a2fc0dd35b484e4262e734bea49000c6f9c8dbac3d8861c1386c0",
Cycles []Cycle `json:"cycles"` // : [],
ID string `json:"id"` // : "0000007b677719bdd76d729c3ac36bed5790d5548aadc26804489e5e179f4a5b",
BlockNum uint64 `json:"block_num"` // : 123,
RefBlockPrefix uint64 `json:"ref_block_prefix"` // : 2624744919
}
type BlockTimestamp ¶
func (BlockTimestamp) MarshalJSON ¶
func (t BlockTimestamp) MarshalJSON() ([]byte, error)
func (*BlockTimestamp) UnmarshalJSON ¶
func (t *BlockTimestamp) UnmarshalJSON(data []byte) (err error)
type ClausePair ¶
ClausePair represents clauses, related to Ricardian Contracts.
type Code ¶
type Code struct {
AccountName AccountName `json:"account_name"`
CodeHash string `json:"code_hash"`
WAST string `json:"wast"` // TODO: decode into Go ast, see https://github.com/go-interpreter/wagon
ABI ABI `json:"abi"`
}
type CompressionType ¶
type CompressionType uint8
func (CompressionType) MarshalJSON ¶
func (c CompressionType) MarshalJSON() ([]byte, error)
func (CompressionType) String ¶
func (c CompressionType) String() string
func (*CompressionType) UnmarshalJSON ¶
func (c *CompressionType) UnmarshalJSON(data []byte) error
type Currency ¶
type Currency struct {
Precision uint8
Name CurrencyName
}
type CurrencyBalanceResp ¶
type CurrencyName ¶
type CurrencyName string
type Cycles ¶
type Cycles []ShardSummary
type DataAccess ¶
type DataAccess struct {
Type string `json:"type"` // "write", "read"?
Code AccountName `json:"code"`
Scope AccountName `json:"scope"`
Sequence int `json:"sequence"`
}
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder implements the EOS unpacking, similar to FC_BUFFER
func NewDecoder ¶
func (*Decoder) DecodeP2PMessage ¶
type DeferredTransaction ¶
type DeferredTransaction struct {
*Transaction
SenderID uint32 `json:"sender_id"`
Sender AccountName `json:"sender"`
DelayUntil JSONTime `json:"delay_until"`
}
type Encoder ¶
-------------------------------------------------------------- Encoder implements the EOS packing, similar to FC_BUFFER --------------------------------------------------------------
func NewEncoder ¶
type GetRequiredKeysResp ¶
type GetTableRowsRequest ¶
type GetTableRowsRequest struct {
JSON bool `json:"json"`
Scope string `json:"scope"`
Code string `json:"code"`
Table string `json:"table"`
TableKey string `json:"table_key"`
LowerBound string `json:"lower_bound"`
UpperBound string `json:"upper_bount"`
Limit uint32 `json:"limit,omitempty"` // defaults to 10 => chain_plugin.hpp:struct get_table_rows_params
}
type GetTableRowsResp ¶
type GetTableRowsResp struct {
More bool `json:"more"`
Rows json.RawMessage `json:"rows"` // defer loading, as it depends on `JSON` being true/false.
}
func (*GetTableRowsResp) BinaryToStructs ¶
func (resp *GetTableRowsResp) BinaryToStructs(v interface{}) error
func (*GetTableRowsResp) JSONToStructs ¶
func (resp *GetTableRowsResp) JSONToStructs(v interface{}) error
type GoAwayMessage ¶
type GoAwayMessage struct {
Reason GoAwayReason `json:"reason"`
NodeID SHA256Bytes `json:"node_id"`
}
func (*GoAwayMessage) GetType ¶
func (m *GoAwayMessage) GetType() P2PMessageType
type GoAwayReason ¶
type GoAwayReason uint8
type HandshakeMessage ¶
type HandshakeMessage struct {
// net_plugin/protocol.hpp handshake_message
NetworkVersion int16 `json:"network_version"`
ChainID SHA256Bytes `json:"chain_id"`
NodeID SHA256Bytes `json:"node_id"` // sha256
Key ecc.PublicKey `json:"key"` // can be empty, producer key, or peer key
Time Tstamp `json:"time"` // time?!
Token SHA256Bytes `json:"token"` // digest of time to prove we own the private `key`
Signature ecc.Signature `json:"sig"` // can be empty if no key, signature of the digest above
P2PAddress string `json:"p2p_address"`
LastIrreversibleBlockNum uint32 `json:"last_irreversible_block_num"`
LastIrreversibleBlockID SHA256Bytes `json:"last_irreversible_block_id"`
HeadNum uint32 `json:"head_num"`
HeadID SHA256Bytes `json:"head_id"`
OS string `json:"os"`
Agent string `json:"agent"`
Generation int16 `json:"generation"`
}
func (*HandshakeMessage) GetType ¶
func (m *HandshakeMessage) GetType() P2PMessageType
func (*HandshakeMessage) String ¶
func (m *HandshakeMessage) String() string
type IDListMode ¶
type IDListMode uint8
type InfoResp ¶
type InfoResp struct {
ServerVersion string `json:"server_version"` // "2cc40a4e"
HeadBlockNum uint32 `json:"head_block_num"` // 2465669,
LastIrreversibleBlockNum uint32 `json:"last_irreversible_block_num"` // 2465655
HeadBlockID string `json:"head_block_id"` // "00259f856bfa142d1d60aff77e70f0c4f3eab30789e9539d2684f9f8758f1b88",
HeadBlockTime JSONTime `json:"head_block_time"` // "2018-02-02T04:19:32"
HeadBlockProducer AccountName `json:"head_block_producer"` // "inita"
}
type KeyBag ¶
type KeyBag struct {
Keys []*ecc.PrivateKey
}
KeyBag holds private keys in memory, for signing transactions.
func (*KeyBag) ImportFromFile ¶
func (*KeyBag) ImportPrivateKey ¶
func (*KeyBag) Sign ¶
func (b *KeyBag) Sign(tx *SignedTransaction, chainID []byte, requiredKeys ...ecc.PublicKey) (*SignedTransaction, error)
type MessageReflectTypes ¶
type NetConnectResp ¶
type NetConnectResp string
type NetConnectionsResp ¶
type NetConnectionsResp struct {
Peer string `json:"peer"`
Connecting bool `json:"connecting"`
Syncing bool `json:"syncing"`
LastHandshake HandshakeMessage `json:"last_handshake"`
}
NetConnectionResp
type NetDisconnectResp ¶
type NetDisconnectResp string
type NetStatusResp ¶
type NetStatusResp struct {
}
type NewAccount ¶
type NewAccount struct {
Creator AccountName `json:"creator"`
Name AccountName `json:"name"`
Owner Authority `json:"owner"`
Active Authority `json:"active"`
Recovery Authority `json:"recovery"`
}
NewAccount represents the hard-coded `newaccount` action.
type NoticeMessage ¶
type NoticeMessage struct {
KnownTrx OrderedBlockIDs `json:"known_trx"`
KnownBlocks OrderedBlockIDs `json:"known_blocks"`
}
func (*NoticeMessage) GetType ¶
func (m *NoticeMessage) GetType() P2PMessageType
type OptionalProducerSchedule ¶
type OptionalProducerSchedule struct {
ProducerSchedule
}
func (*OptionalProducerSchedule) OptionalBinaryMarshalerPresent ¶
func (a *OptionalProducerSchedule) OptionalBinaryMarshalerPresent() bool
type OrderedBlockIDs ¶
type OrderedBlockIDs struct {
Unknown [3]byte `json:"-"` ///// wuuttzthat?
Mode IDListMode `json:"mode"`
Pending uint32 `json:"pending"`
IDs []SHA256Bytes `json:"ids"`
}
type OrderedTransactionIDs ¶
type OrderedTransactionIDs struct {
Unknown [3]byte `json:"-"` ///// WWUUuuuuuuuuuuuutzthat ?
Mode IDListMode `json:"mode"`
Pending uint32 `json:"pending"`
IDs []SHA256Bytes `json:"ids"`
}
type P2PMessage ¶
type P2PMessage interface {
GetType() P2PMessageType
}
type P2PMessageEnvelope ¶
type P2PMessageEnvelope struct {
Length uint32 `json:"length"`
Type P2PMessageType `json:"type"`
Payload []byte `json:"-"`
P2PMessage P2PMessage `json:"message" eos:"-"`
}
func ReadP2PMessageData ¶
func ReadP2PMessageData(r io.Reader) (envelope *P2PMessageEnvelope, err error)
type P2PMessageType ¶
type P2PMessageType byte
const ( HandshakeMessageType P2PMessageType = iota GoAwayMessageType TimeMessageType NoticeMessageType RequestMessageType SyncRequestMessageType SignedBlockSummaryMessageType SignedBlockMessageType SignedTransactionMessageType PackedTransactionMessageType )
func NewMessageType ¶
func NewMessageType(aType byte) (t P2PMessageType, err error)
func (P2PMessageType) Name ¶
func (t P2PMessageType) Name() (string, bool)
type PackedTransaction ¶
type PackedTransaction struct {
Signatures []ecc.Signature `json:"signatures"`
Compression CompressionType `json:"compression"` // in C++, it's an enum, not sure how it Binary-marshals..
PackedContextFreeData HexBytes `json:"packed_context_free_data"`
PackedTransaction HexBytes `json:"packed_trx"`
}
PackedTransaction represents a fully packed transaction, with signatures, and all. They circulate like that on the P2P net, and that's how they are stored.
func (*PackedTransaction) Unpack ¶
func (p *PackedTransaction) Unpack() (signedTx *SignedTransaction, err error)
type PackedTransactionMessage ¶
type PackedTransactionMessage struct {
PackedTransaction
}
func (*PackedTransactionMessage) GetType ¶
func (m *PackedTransactionMessage) GetType() P2PMessageType
type Permission ¶
type PermissionLevel ¶
type PermissionLevel struct {
Actor AccountName `json:"actor"`
Permission PermissionName `json:"permission"`
}
type PermissionLevelWeight ¶
type PermissionLevelWeight struct {
Permission PermissionLevel `json:"permission"`
Weight uint16 `json:"weight"`
}
type ProducerChange ¶
type ProducerChange struct {
}
type ProducerKey ¶
type ProducerKey struct {
AccountName AccountName `json:"account_name"`
BlockSigningKey ecc.PublicKey `json:"block_signing_key"`
}
type ProducerSchedule ¶
type ProducerSchedule struct {
Version uint32 `json:"version"`
Producers []ProducerKey `json:"producers"`
}
type PushTransactionFullResp ¶
type PushTransactionFullResp struct {
TransactionID string `json:"transaction_id"`
Processed TransactionProcessed `json:"processed"` // WARN: is an `fc::variant` in server..
}
PushTransactionFullResp unwraps the responses from a successful `push_transaction`. FIXME: REVIEW the actual output, things have moved here.
type RegionSummary ¶
type RequestMessage ¶
type RequestMessage struct {
ReqTrx OrderedBlockIDs `json:"req_trx"`
ReqBlocks OrderedBlockIDs `json:"req_blocks"`
}
func (*RequestMessage) GetType ¶
func (m *RequestMessage) GetType() P2PMessageType
type SHA256Bytes ¶
type SHA256Bytes []byte // should always be 32 bytes
func (SHA256Bytes) MarshalJSON ¶
func (t SHA256Bytes) MarshalJSON() ([]byte, error)
func (*SHA256Bytes) UnmarshalJSON ¶
func (t *SHA256Bytes) UnmarshalJSON(data []byte) (err error)
type SequencedTransactionResp ¶
type SequencedTransactionResp struct {
SeqNum int `json:"seq_num"`
TransactionResp
}
type SetABI ¶
type SetABI struct {
Account AccountName `json:"account"`
ABI ABI `json:"abi"`
}
SetABI represents the hard-coded `setabi` action.
type SetCode ¶
type SetCode struct {
Account AccountName `json:"account"`
VMType byte `json:"vmtype"`
VMVersion byte `json:"vmversion"`
Code HexBytes `json:"bytes"`
}
SetCode represents the hard-coded `setcode` action.
type ShardLock ¶
type ShardLock struct {
AccountName AccountName `json:"account_name"`
ScopeName ScopeName `json:"scope_name"`
}
type ShardSummary ¶
type ShardSummary struct {
ReadLocks []ShardLock `json:"read_locks"`
WriteLocks []ShardLock `json:"write_locks"`
Transactions []TransactionReceipt `json:"transactions"`
}
type SignedBlockHeader ¶
type SignedBlockHeader struct {
BlockHeader
ProducerSignature ecc.Signature `json:"producer_signature"`
}
type SignedBlockMessage ¶
type SignedBlockMessage struct {
SignedBlockSummaryMessage
InputTransactions []PackedTransaction `json:"input_transactions"`
}
func (*SignedBlockMessage) GetType ¶
func (m *SignedBlockMessage) GetType() P2PMessageType
func (*SignedBlockMessage) String ¶
func (m *SignedBlockMessage) String() string
type SignedBlockSummaryMessage ¶
type SignedBlockSummaryMessage struct {
SignedBlockHeader
Regions []RegionSummary `json:"regions"`
}
func (*SignedBlockSummaryMessage) GetType ¶
func (m *SignedBlockSummaryMessage) GetType() P2PMessageType
type SignedTransaction ¶
type SignedTransaction struct {
*Transaction
Signatures []ecc.Signature `json:"signatures"`
ContextFreeData []HexBytes `json:"context_free_data"`
// contains filtered or unexported fields
}
func NewSignedTransaction ¶
func NewSignedTransaction(tx *Transaction) *SignedTransaction
func (*SignedTransaction) Pack ¶
func (s *SignedTransaction) Pack(opts TxOptions) (*PackedTransaction, error)
func (*SignedTransaction) String ¶
func (s *SignedTransaction) String() string
type SignedTransactionMessage ¶
type SignedTransactionMessage struct {
Signatures []ecc.Signature `json:"signatures"`
ContextFreeData []byte `json:"context_free_data"`
}
func (*SignedTransactionMessage) GetType ¶
func (m *SignedTransactionMessage) GetType() P2PMessageType
type Signer ¶
type Signer interface {
AvailableKeys() (out []ecc.PublicKey, err error)
// Sign signs a `tx` transaction. It gets passed a
// SignedTransaction because it is possible that it holds a few
// signatures and requests this wallet only to add one or more
// signatures it requires.
Sign(tx *SignedTransaction, chainID []byte, requiredKeys ...ecc.PublicKey) (*SignedTransaction, error)
ImportPrivateKey(wifPrivKey string) error
}
type Symbol ¶
NOTE: there's also a new ExtendedSymbol (which includes the contract (as AccountName) on which it is)
type SyncRequestMessage ¶
type SyncRequestMessage struct {
StartBlock uint32 `json:"start_block"`
EndBlock uint32 `json:"end_block"`
}
func (*SyncRequestMessage) GetType ¶
func (m *SyncRequestMessage) GetType() P2PMessageType
func (*SyncRequestMessage) String ¶
func (m *SyncRequestMessage) String() string
type TableDef ¶
type TableDef struct {
Name TableName `json:"name"`
IndexType string `json:"index_type"`
KeyNames []string `json:"key_names,omitempty"`
KeyTypes []string `json:"key_types,omitempty"`
Type string `json:"type"`
}
TableDef defines a table. See libraries/chain/include/eosio/chain/contracts/types.hpp:78
type TimeMessage ¶
type TimeMessage struct {
Origin Tstamp `json:"org"`
Receive Tstamp `json:"rec"`
Transmit Tstamp `json:"xmt"`
Destination Tstamp `json:"dst"`
}
func (*TimeMessage) GetType ¶
func (m *TimeMessage) GetType() P2PMessageType
func (*TimeMessage) String ¶
func (t *TimeMessage) String() string
type Transaction ¶
type Transaction struct {
Expiration JSONTime `json:"expiration"`
Region uint16 `json:"region"`
RefBlockNum uint16 `json:"ref_block_num"`
RefBlockPrefix uint32 `json:"ref_block_prefix"`
MaxNetUsageWords Varuint32 `json:"max_net_usage_words"`
MaxKCPUUsage Varuint32 `json:"max_kcpu_usage"`
DelaySec Varuint32 `json:"delay_sec"` // number of secs to delay, making it cancellable for that duration
ContextFreeActions []*Action `json:"context_free_actions,omitempty"`
Actions []*Action `json:"actions,omitempty"`
}
func (*Transaction) ID ¶
func (tx *Transaction) ID() string
type TransactionProcessed ¶
type TransactionProcessed struct {
Status string `json:"status"`
ID SHA256Bytes `json:"id"`
ActionTraces []ActionTrace `json:"action_traces"`
DeferredTransactions []string `json:"deferred_transactions"` // that's not right... dig to find what's there..
}
type TransactionReceipt ¶
type TransactionReceipt struct {
Status TransactionStatus `json:"status"`
KCPUUsage Varuint32 `json:"kcpu_usage"`
NetUsageWords Varuint32 `json:"net_usage_words"`
ID SHA256Bytes `json:"id"`
}
type TransactionResp ¶
type TransactionResp struct {
TransactionID string `json:"transaction_id"`
Transaction struct {
Signatures []ecc.Signature `json:"signatures"`
Compression CompressionType `json:"compression"`
PackedContextFreeData HexBytes `json:"packed_context_free_data"`
ContextFreeData []HexBytes `json:"context_free_data"`
PackedTransaction HexBytes `json:"packed_transaction"`
Transaction Transaction `json:"transaction"`
} `json:"transaction"`
}
type TransactionStatus ¶
type TransactionStatus uint8
const ( TransactionStatusExecuted TransactionStatus = iota ///< succeed, no error handler executed TransactionStatusSoftFail ///< objectively failed (not executed), error handler executed TransactionStatusHardFail ///< objectively failed and error handler objectively failed thus no state change TransactionStatusDelayed ///< transaction delayed TransactionStatusUnknown = TransactionStatus(255) )
func (TransactionStatus) MarshalJSON ¶
func (s TransactionStatus) MarshalJSON() (data []byte, err error)
func (TransactionStatus) String ¶
func (s TransactionStatus) String() string
func (*TransactionStatus) UnmarshalJSON ¶
func (s *TransactionStatus) UnmarshalJSON(data []byte) error
type TransactionsResp ¶
type TransactionsResp struct {
Transactions []SequencedTransactionResp
}
type TxOptions ¶
type TxOptions struct {
MaxNetUsageWords uint32
Delay time.Duration
MaxKCPUUsage uint32 // If you want to override the CPU usage (in counts of 1024)
//ExtraKCPUUsage uint32 // If you want to *add* some CPU usage to the estimated amount (in counts of 1024)
Compress CompressionType
}
TxOptions represents options you want to pass to the transaction you're sending.
type WalletSigner ¶
type WalletSigner struct {
// contains filtered or unexported fields
}
`eosiowd` wallet-based signer
func NewWalletSigner ¶
func NewWalletSigner(api *API, walletName string) *WalletSigner
NewWalletSigner takes an `api`, because often the wallet will be a second endpoint, and not the server node with whom you're pushing transactions to.
func (*WalletSigner) AvailableKeys ¶
func (s *WalletSigner) AvailableKeys() (out []ecc.PublicKey, err error)
func (*WalletSigner) ImportPrivateKey ¶
func (s *WalletSigner) ImportPrivateKey(wifKey string) (err error)
func (*WalletSigner) Sign ¶
func (s *WalletSigner) Sign(tx *SignedTransaction, chainID []byte, requiredKeys ...ecc.PublicKey) (*SignedTransaction, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
btcsuite
|
|
|
btcd/btcec
Package btcec implements support for the elliptic curves needed for bitcoin.
|
Package btcec implements support for the elliptic curves needed for bitcoin. |
|
btcutil
Package btcutil provides bitcoin-specific convenience functions and types.
|
Package btcutil provides bitcoin-specific convenience functions and types. |
|
btcutil/base58
Package base58 provides an API for working with modified base58 and Base58Check encodings.
|
Package base58 provides an API for working with modified base58 and Base58Check encodings. |
|
cmd
|
|
|
eos-hexpubkey
command
|
|
|
eos-mega-tx
command
|
|
|
eos-p2p-client
command
|
|
|
eos-p2p-proxy
command
|
|
|
eos-p2p-ui
command
|
|
|
eos-print-tx
command
|
|
|
eos-setcode
command
|
|
|
eosapi
command
|
|
|
gowallet
command
|
|