nearclient

package module
v0.0.0-...-14e1c4e Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 5 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

near-api-go

NEAR API GO is a client library that interacts with NEAR Protocol via RPC.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestJSON

func RequestJSON(method string, params interface{}) ([]byte, error)

Types

type Client

type Client struct {
	URL string
}

func (*Client) FunctionCall

func (c *Client) FunctionCall(account_id string, method_name string, args string) (*FunctionCallResponse, error)

func (*Client) MakeRequest

func (c *Client) MakeRequest(data []byte) ([]byte, error)

func (*Client) Status

func (c *Client) Status() ([]byte, error)

Returns general status of current validator nodes.

type FunctionCallParams

type FunctionCallParams struct {
	Request_type string `json:"request_type"`
	Finality     string `json:"finality"`
	Account_id   string `json:"account_id"`
	Method_name  string `json:"method_name"`
	Args_base64  string `json:"args_base64"`
}

type FunctionCallResponse

type FunctionCallResponse struct {
	Result      json.RawMessage `json:"result,omitempty"`
	Error       string          `json:"error,omitempty"`
	Logs        []string        `json:"logs,omitempty"`
	BlockHeight int64           `json:"block_height,omitempty"`
	BlockHash   string          `json:"block_hash,omitempty"`
}

type Request

type Request struct {
	Version string          `json:"jsonrpc,omitempty"`
	Id      string          `json:"id,omitempty"`
	Method  string          `json:"method,omitempty"`
	Params  json.RawMessage `json:"params,omitempty"`
}

type Response

type Response struct {
	Version string          `json:"jsonrpc,omitempty"`
	Result  json.RawMessage `json:"result,omitempty"`
	Id      string          `json:"id,omitempty"`
}

Jump to

Keyboard shortcuts

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