nearclient

package module
v0.0.0-...-d2b4a0c Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 4 Imported by: 0

README

nearclient

PkgGoDev Go Report Card GoDoc

nearclient is golang client library to interact with NEAR Protocol via RPC API, inspired by ethclient.

Warning: not production ready

Supported methods

  • status
  • send transaction (async)
  • send transaction (wait until done)
  • query
  • block (doesn't support finality)
  • chunk
  • transaction status
  • validators
  • gasprice

Install

go get -u github.com/akme/nearclient

Docs

For docs go to pkg.go.dev or godoc

Contribute

Pull Requests are welcome!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client defines typed wrappers for the Ethereum RPC API.

func Dial

func Dial(rawurl string) (*Client, error)

Dial connects a client to the given URL.

func DialContext

func DialContext(ctx context.Context, rawurl string) (*Client, error)

DialContext with context

func NewClient

func NewClient(c *rpc.Client) *Client

NewClient creates a client that uses the given RPC client.

func (*Client) Block

func (nc *Client) Block(ctx context.Context, params interface{}) (*types.Block, error)

Block get block information

func (*Client) Chunk

func (nc *Client) Chunk(ctx context.Context, params interface{}) (*types.ChunkResponse, error)

Chunk gets chunk info

func (*Client) Close

func (nc *Client) Close()

Close client

func (*Client) GasPrice

func (nc *Client) GasPrice(ctx context.Context, params interface{}) (*types.GasPrice, error)

GasPrice get the price of Gas

func (*Client) Status

func (nc *Client) Status(ctx context.Context) (*types.Status, error)

Status gets status of the network

func (*Client) TransactionStatus

func (nc *Client) TransactionStatus(ctx context.Context, txHash, AccountID string) (*types.TransactionStatus, error)

TransactionStatus gets status of transaction

func (*Client) Validators

func (nc *Client) Validators(ctx context.Context, params interface{}) (*types.ValidatorsResponse, error)

Validators gets list of validators

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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