Documentation ¶
Index ¶
- func NewHttpError(r *http.Response) error
- type Block
- type ClientV3
- func (c *ClientV3) Call(param *v3.CallParam) (interface{}, error)
- func (c *ClientV3) Cleanup()
- func (c *ClientV3) EstimateStep(param *v3.TransactionParamForEstimate) (*common.HexInt, error)
- func (c *ClientV3) GetBalance(param *v3.AddressParam) (*jsonrpc.HexInt, error)
- func (c *ClientV3) GetBlockByHash(param *v3.BlockHashParam) (*Block, error)
- func (c *ClientV3) GetBlockByHeight(param *v3.BlockHeightParam) (*Block, error)
- func (c *ClientV3) GetBlockHeaderByHeight(param *v3.BlockHeightParam) ([]byte, error)
- func (c *ClientV3) GetDataByHash(param *v3.DataHashParam) ([]byte, error)
- func (c *ClientV3) GetLastBlock() (*Block, error)
- func (c *ClientV3) GetProofForEvents(param *v3.ProofEventsParam) ([][][]byte, error)
- func (c *ClientV3) GetProofForResult(param *v3.ProofResultParam) ([][]byte, error)
- func (c *ClientV3) GetScoreApi(param *v3.ScoreAddressParam) ([]interface{}, error)
- func (c *ClientV3) GetTotalSupply() (*jsonrpc.HexInt, error)
- func (c *ClientV3) GetTransactionByHash(param *v3.TransactionHashParam) (*Transaction, error)
- func (c *ClientV3) GetTransactionResult(param *v3.TransactionHashParam) (*TransactionResult, error)
- func (c *ClientV3) GetVotesByHeight(param *v3.BlockHeightParam) ([]byte, error)
- func (c *ClientV3) Monitor(reqUrl string, reqPtr, respPtr interface{}, cb func(v interface{}), ...) error
- func (c *ClientV3) MonitorBlock(param *server.BlockRequest, cb func(v *server.BlockNotification), ...) error
- func (c *ClientV3) MonitorEvent(param *server.EventRequest, cb func(v *server.EventNotification), ...) error
- func (c *ClientV3) SendRawTransaction(w module.Wallet, param map[string]interface{}) (*jsonrpc.HexBytes, error)
- func (c *ClientV3) SendTransaction(w module.Wallet, param *v3.TransactionParam) (*jsonrpc.HexBytes, error)
- func (c *ClientV3) WaitTransactionResult(param *v3.TransactionHashParam) (*TransactionResult, error)
- type EventLog
- type FailureReason
- type HttpError
- type JsonRpcClient
- type NormalTransaction
- type Response
- type Transaction
- type TransactionResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHttpError ¶
Types ¶
type Block ¶
type Block struct { BlockHash jsonrpc.HexBytes `json:"block_hash" validate:"required,t_hash"` Version jsonrpc.HexInt `json:"version" validate:"required,t_int"` Height int64 `json:"height" validate:"required,t_int"` Timestamp int64 `json:"time_stamp" validate:"required,t_int"` Proposer jsonrpc.HexBytes `json:"peer_id" validate:"optional,t_addr_eoa"` PrevID jsonrpc.HexBytes `json:"prev_block_hash" validate:"required,t_hash"` NormalTransactionsHash jsonrpc.HexBytes `json:"merkle_tree_root_hash" validate:"required,t_hash"` Signature jsonrpc.HexBytes `json:"signature" validate:"optional,t_hash"` NormalTransactions []json.RawMessage `json:"confirmed_transaction_list" ` }
refer block/blockv2.go blockv2.ToJSON
type ClientV3 ¶
type ClientV3 struct { *JsonRpcClient DebugEndPoint string // contains filtered or unexported fields }
jsonrpc client using echo commands reference server/v3/api_v3.go params reference server/v3/schema_v3.go response schema Block, ConfirmedTransaction, TransactionResult{EventLog, Failure}, ScoreApi,
func NewClientV3 ¶
func (*ClientV3) EstimateStep ¶
func (*ClientV3) GetBalance ¶
func (*ClientV3) GetBlockByHash ¶
func (c *ClientV3) GetBlockByHash(param *v3.BlockHashParam) (*Block, error)
func (*ClientV3) GetBlockByHeight ¶
func (c *ClientV3) GetBlockByHeight(param *v3.BlockHeightParam) (*Block, error)
func (*ClientV3) GetBlockHeaderByHeight ¶
func (c *ClientV3) GetBlockHeaderByHeight(param *v3.BlockHeightParam) ([]byte, error)
func (*ClientV3) GetDataByHash ¶
func (c *ClientV3) GetDataByHash(param *v3.DataHashParam) ([]byte, error)
using blockHeader.NextValidatorsHash
func (*ClientV3) GetLastBlock ¶
func (*ClientV3) GetProofForEvents ¶
func (c *ClientV3) GetProofForEvents(param *v3.ProofEventsParam) ([][][]byte, error)
func (*ClientV3) GetProofForResult ¶
func (c *ClientV3) GetProofForResult(param *v3.ProofResultParam) ([][]byte, error)
refer common/trie/ompt/mtp.go mpt.GetProof(index)
func (*ClientV3) GetScoreApi ¶
func (c *ClientV3) GetScoreApi(param *v3.ScoreAddressParam) ([]interface{}, error)
refer servicce/scoreapi/info.go Info.ToJSON
func (*ClientV3) GetTransactionByHash ¶
func (c *ClientV3) GetTransactionByHash(param *v3.TransactionHashParam) (*Transaction, error)
func (*ClientV3) GetTransactionResult ¶
func (c *ClientV3) GetTransactionResult(param *v3.TransactionHashParam) (*TransactionResult, error)
func (*ClientV3) GetVotesByHeight ¶
func (c *ClientV3) GetVotesByHeight(param *v3.BlockHeightParam) ([]byte, error)
func (*ClientV3) MonitorBlock ¶
func (c *ClientV3) MonitorBlock(param *server.BlockRequest, cb func(v *server.BlockNotification), cancelCh <-chan bool) error
func (*ClientV3) MonitorEvent ¶
func (c *ClientV3) MonitorEvent(param *server.EventRequest, cb func(v *server.EventNotification), cancelCh <-chan bool) error
func (*ClientV3) SendRawTransaction ¶ added in v0.9.6
func (*ClientV3) SendTransaction ¶
func (*ClientV3) WaitTransactionResult ¶
func (c *ClientV3) WaitTransactionResult(param *v3.TransactionHashParam) (*TransactionResult, error)
type EventLog ¶
type EventLog struct { Addr jsonrpc.Address `json:"scoreAddress"` Indexed []*string `json:"indexed"` Data []*string `json:"data"` }
refer service/txresult/receipt.go:29 eventLogJSON
type FailureReason ¶
type FailureReason struct { CodeValue jsonrpc.HexInt `json:"code"` MessageValue string `json:"message"` }
refer service/txresult/receipt.go:193 failureReason
type JsonRpcClient ¶
type JsonRpcClient struct { Endpoint string CustomHeader map[string]string Pre func(req *http.Request) error // contains filtered or unexported fields }
func NewJsonRpcClient ¶
func NewJsonRpcClient(hc *http.Client, endpoint string) *JsonRpcClient
func (*JsonRpcClient) Do ¶
func (c *JsonRpcClient) Do(method string, reqPtr, respPtr interface{}) (jrResp *Response, err error)
type NormalTransaction ¶
type NormalTransaction struct { TxHash jsonrpc.HexBytes `json:"txHash"` Version jsonrpc.HexInt `json:"version"` From jsonrpc.Address `json:"from"` To jsonrpc.Address `json:"to"` Value jsonrpc.HexInt `json:"value,omitempty" ` StepLimit jsonrpc.HexInt `json:"stepLimit"` TimeStamp jsonrpc.HexInt `json:"timestamp"` NID jsonrpc.HexInt `json:"nid,omitempty"` Nonce jsonrpc.HexInt `json:"nonce,omitempty"` Signature jsonrpc.HexBytes `json:"signature"` DataType string `json:"dataType,omitempty"` Data json.RawMessage `json:"data,omitempty"` }
refer service/transaction/transaction_v3.go:24 transactionV3Data, transactionV3.ToJSON
type Response ¶
type Response struct { Version string `json:"jsonrpc"` Result json.RawMessage `json:"result"` Error *jsonrpc.Error `json:"error,omitempty"` ID interface{} `json:"id"` }
type Transaction ¶
type Transaction struct { NormalTransaction BlockHash jsonrpc.HexBytes `json:"blockHash" validate:"required,t_hash"` BlockHeight jsonrpc.HexInt `json:"blockHeight" validate:"required,t_int"` TxIndex jsonrpc.HexInt `json:"txIndex" validate:"required,t_int"` }
refer server/v3/api_v3.go:307 getTransactionByHash
type TransactionResult ¶
type TransactionResult struct { To jsonrpc.Address `json:"to"` CumulativeStepUsed jsonrpc.HexInt `json:"cumulativeStepUsed"` StepUsed jsonrpc.HexInt `json:"stepUsed"` StepPrice jsonrpc.HexInt `json:"stepPrice"` EventLogs []EventLog `json:"eventLogs"` LogsBloom jsonrpc.HexBytes `json:"logsBloom"` Status jsonrpc.HexInt `json:"status"` Failure *FailureReason `json:"failure,omitempty"` SCOREAddress jsonrpc.Address `json:"scoreAddress,omitempty"` BlockHash jsonrpc.HexBytes `json:"blockHash" validate:"required,t_hash"` BlockHeight jsonrpc.HexInt `json:"blockHeight" validate:"required,t_int"` TxIndex jsonrpc.HexInt `json:"txIndex" validate:"required,t_int"` TxHash jsonrpc.HexBytes `json:"txHash" validate:"required,t_int"` StepDetails interface{} `json:"stepUsedDetails,omitempty"` }
refer service/txresult/receipt.go:220 receiptJSON, receipt.ToJSON refer server/v3/api_v3.go:260 getTransactionResult