Documentation ¶
Index ¶
- Constants
- func SendRawPost(data []byte, url string) (*http.Response, error)
- func SendRequest(request Request, url string) (*http.Response, error)
- func SendRequestWithRetry(request Request, url string, timeoutInSecs int, retries int) (response *http.Response, err error)
- type AccountContext
- type AccountValue
- type AddressDecoder
- type Client
- type ClientOptions
- type Error
- type Request
- type Response
- type ResponseGetAccountInfo
Constants ¶
View Source
const DefaultClientRPCURL = "http://localhost:8899"
Variables ¶
This section is empty.
Functions ¶
func SendRawPost ¶
SendRawPost sends a raw bytes as a POST request to the URL specified
func SendRequest ¶
SendRequest sends the JSON-2.0 request to the target url and returns the response and any error.
Types ¶
type AccountContext ¶
type AccountContext struct {
Slot int `json:"slot"`
}
type AccountValue ¶
type AddressDecoder ¶
type AddressDecoder struct{}
func NewAddressDecoder ¶
func NewAddressDecoder() AddressDecoder
func (AddressDecoder) DecodeAddress ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ClientOptions) *Client
type ClientOptions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() ClientOptions
type Error ¶
type Error struct { Code int `json:"code"` Message string `json:"message"` Data *json.RawMessage `json:"data"` }
Error defines a JSON-RPC 2.0 error object. See https://www.jsonrpc.org/specification for more information.
type Request ¶
type Request struct { Version string `json:"jsonrpc"` ID interface{} `json:"id"` Method string `json:"method"` Params json.RawMessage `json:"params,omitempty"` }
Request defines a JSON-RPC 2.0 request object. See https://www.jsonrpc.org/specification for more information. A Request should not be explicitly created, but instead unmarshaled from JSON.
type Response ¶
type Response struct { Version string `json:"jsonrpc"` ID interface{} `json:"id"` Result *json.RawMessage `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
Response defines a JSON-RPC 2.0 response object. See https://www.jsonrpc.org/specification for more information. A Response is usually marshaled into bytes and returned in response to a Request.
type ResponseGetAccountInfo ¶
type ResponseGetAccountInfo struct { Context AccountContext `json:"context"` Value AccountValue `json:"value"` }
Click to show internal directories.
Click to hide internal directories.