ontrpc

package
v0.0.0-...-22ffadd Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBalanceResponse

type GetBalanceResponse struct {
	JSONRPCResponse
	Result struct {
		Ont string `json:"ont"`
		Ong string `json:"ong"`
	} `json:"result"`
}

type GetBlockCountResponse

type GetBlockCountResponse struct {
	JSONRPCResponse
	Result int `json:"result"`
}

type GetBlockResponse

type GetBlockResponse struct {
	JSONRPCResponse
	Result string `json:"result"`
}

type GetRawTransactionResponse

type GetRawTransactionResponse struct {
	JSONRPCResponse
	Result string `json:"result"`
}

type GetSmartCodeEventResponse

type GetSmartCodeEventResponse struct {
	JSONRPCResponse
	Result struct {
		TxHash      string `json:"TxHash"`
		State       int    `json:"State"`
		GasConsumed int    `json:"GasConsumed"`
		Notify      []struct {
			ContractAddress string        `json:"ContractAddress"`
			States          []interface{} `json:"States"`
		} `json:"Notify"`
	} `json:"result"`
}

type GetStorageResponse

type GetStorageResponse struct {
	JSONRPCResponse
	Result string `json:"result"`
}

type GetUnboundONGResponse

type GetUnboundONGResponse struct {
	JSONRPCResponse
	Result string `json:"result"`
}

type InvokeFunctionStackArg

type InvokeFunctionStackArg struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type JSONRPCRequest

type JSONRPCRequest struct {
	Jsonrpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
	ID      int           `json:"id"`
}

func NewRequest

func NewRequest(method string, params []interface{}) JSONRPCRequest

type JSONRPCResponse

type JSONRPCResponse struct {
	Desc   string `json:"desc"`
	Error  int    `json:"error"`
	ID     int    `json:"id"`
	Jsonpc string `json:"jsonpc"`
}

type RPCClient

type RPCClient struct {
	Endpoint url.URL
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(endpoint string) *RPCClient

func (*RPCClient) GetBalance

func (n *RPCClient) GetBalance(ontAddress string) (GetBalanceResponse, error)

func (*RPCClient) GetBlockCount

func (n *RPCClient) GetBlockCount() (GetBlockCountResponse, error)

func (*RPCClient) GetBlockWithHash

func (n *RPCClient) GetBlockWithHash(blockHash string) (GetBlockResponse, error)

func (*RPCClient) GetBlockWithHeight

func (n *RPCClient) GetBlockWithHeight(blockHeight int) (GetBlockResponse, error)

func (*RPCClient) GetRawTransaction

func (n *RPCClient) GetRawTransaction(txID string) (GetRawTransactionResponse, error)

func (*RPCClient) GetSmartCodeEvent

func (n *RPCClient) GetSmartCodeEvent(txHash string) (GetSmartCodeEventResponse, error)

func (*RPCClient) GetStorage

func (n *RPCClient) GetStorage(scriptHash string, key string) (GetStorageResponse, error)

func (*RPCClient) GetUnboundONG

func (n *RPCClient) GetUnboundONG(ontAddress string) (GetUnboundONGResponse, error)

func (*RPCClient) SendPreExecRawTransaction

func (n *RPCClient) SendPreExecRawTransaction(rawTransactionHex string) (SendPreExecRawTransactionResponse, error)

func (*RPCClient) SendRawTransaction

func (n *RPCClient) SendRawTransaction(rawTransactionHex string) (SendRawTransactionResponse, error)

type RPCInterface

type RPCInterface interface {
	GetBlockCount() (GetBlockCountResponse, error)
	GetBalance(ontAddress string) (GetBalanceResponse, error)
	GetSmartCodeEvent(txHash string) (GetSmartCodeEventResponse, error)
	SendRawTransaction(rawTransactionHex string) (SendRawTransactionResponse, error)
	SendPreExecRawTransaction(rawTransactionHex string) (SendPreExecRawTransactionResponse, error)
	GetUnboundONG(ontAddress string) (GetUnboundONGResponse, error)
	GetStorage(scriptHash string, key string) (GetStorageResponse, error)
	GetRawTransaction(txID string) (GetRawTransactionResponse, error)
	GetBlockWithHash(blockHash string) (GetBlockResponse, error)
	GetBlockWithHeight(blockHeight int) (GetBlockResponse, error)
	// contains filtered or unexported methods
}

type SendPreExecRawTransactionResponse

type SendPreExecRawTransactionResponse struct {
	JSONRPCResponse
	//this is when we send 1
	Result struct {
		State  int    `json:"State"`
		Gas    int    `json:"Gas"`
		Result string `json:"Result"`
	} `json:"result"`
}

type SendRawTransactionResponse

type SendRawTransactionResponse struct {
	JSONRPCResponse
	//this is when we send 0
	Result string `json:"result"`
}

Jump to

Keyboard shortcuts

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