client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertTx

func ConvertTx(tx Transaction) *types.Transaction

Types

type API

type API interface {
	BlockNumber() (uint64, error)
	SendRawTransaction(tx *types.Transaction) error
	GetTxListByHeight(height uint64) (RpcTxs, error)
}

type Client

type Client struct {
	Rpc *rpc.Client
	// contains filtered or unexported fields
}

func New

func New(url string) (*Client, error)

func (Client) BlockNumber

func (c Client) BlockNumber() (uint64, error)

func (Client) Close

func (c Client) Close()

func (Client) GetTxListByHeight

func (c Client) GetTxListByHeight(height uint64) (RpcTxs, error)

func (Client) SendRawTransaction

func (c Client) SendRawTransaction(tx *types.Transaction) error

type RpcTxs

type RpcTxs []Transaction

type Transaction

type Transaction struct {
	BlockHash        *common.Hash    `json:"blockHash"`
	BlockNumber      *hexutil.Big    `json:"blockNumber"`
	From             common.Address  `json:"from"`
	Gas              hexutil.Uint64  `json:"gas"`
	GasPrice         *hexutil.Big    `json:"gasPrice"`
	Hash             common.Hash     `json:"hash"`
	Input            hexutil.Bytes   `json:"input"`
	Nonce            hexutil.Uint64  `json:"nonce"`
	To               *common.Address `json:"to"`
	TransactionIndex *hexutil.Uint64 `json:"transactionIndex"`
	Value            *hexutil.Big    `json:"value"`
	V                *hexutil.Big    `json:"v"`
	R                *hexutil.Big    `json:"r"`
	S                *hexutil.Big    `json:"s"`
}

func (*Transaction) PrintJson

func (t *Transaction) PrintJson() ([]byte, error)

Jump to

Keyboard shortcuts

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