klaytn

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: LGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixOfHex = "0x"
)

Variables

View Source
var ErrNoResult = errors.New("no result in JSON-RPC response")

Functions

func AssembleProof

func AssembleProof(cli *Client, header Header, log *types.Log, fId msg.ChainId, receipts []*types.Receipt, method string, proofType int64) ([]byte, error)

func GetReceiptsByTxsHash added in v1.2.0

func GetReceiptsByTxsHash(cli *Client, receipts []*types.Receipt)

func GetTxsHashByBlockNumber

func GetTxsHashByBlockNumber(conn *Client, number *big.Int) ([]common.Hash, error)

Types

type Client

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

func DialHttp

func DialHttp(endpoint string, isHttp bool) (*Client, error)

func (*Client) BlockByNumber

func (c *Client) BlockByNumber(ctx context.Context, number *big.Int) (*RpcHeader, error)

func (*Client) CallContext

func (c *Client) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error

func (*Client) TransactionReceiptRpcOutput added in v1.2.0

func (c *Client) TransactionReceiptRpcOutput(ctx context.Context, txHash common.Hash) (map[string]interface{}, error)

type DeriveShaOriginal

type DeriveShaOriginal uint8
const (
	DeriveShaOrigin DeriveShaOriginal = iota
	DeriveShaSimple
	DeriveShaConcat
)

type GovernanceVote added in v1.2.0

type GovernanceVote struct {
	Validator common.Address `json:"validator"`
	Key       string         `json:"key"`
	Value     interface{}    `json:"value"`
}
type Header struct {
	ParentHash       []byte         `json:"parentHash"`
	Reward           common.Address `json:"reward"`
	StateRoot        []byte         `json:"stateRoot"`
	TransactionsRoot []byte         `json:"transactionsRoot"`
	ReceiptsRoot     []byte         `json:"receiptsRoot"`
	LogsBloom        []byte         `json:"logsBloom"`
	BlockScore       *big.Int       `json:"blockScore"`
	Number           *big.Int       `json:"number"`
	GasUsed          *big.Int       `json:"gasUsed"`
	Timestamp        *big.Int       `json:"timestamp"`
	TimestampFoS     *big.Int       `json:"timestampFoS"`
	ExtraData        []byte         `json:"extraData"`
	GovernanceData   []byte         `json:"governanceData"`
	VoteData         []byte         `json:"voteData"`
	BaseFee          *big.Int       `json:"baseFee"`
}

func ConvertContractHeader

func ConvertContractHeader(ethHeader *types.Header, rh *RpcHeader) Header

type ReceiptProof

type ReceiptProof struct {
	Proof     []byte
	DeriveSha DeriveShaOriginal
}

type ReceiptProofOriginal

type ReceiptProofOriginal struct {
	Header    Header
	Proof     [][]byte
	TxReceipt []byte
	KeyIndex  []byte
}

type ReceiptRLP

type ReceiptRLP struct {
	Status  uint
	GasUsed uint64
	Bloom   types.Bloom
	Logs    []*types.Log
}

type ReceiptRlps

type ReceiptRlps []*ReceiptRLP

ReceiptRlps implements DerivableList for receipts.

func (ReceiptRlps) EncodeIndex

func (rs ReceiptRlps) EncodeIndex(i int, w *bytes.Buffer)

EncodeIndex encodes the i'th receipt to w.

func (ReceiptRlps) Len

func (rs ReceiptRlps) Len() int

Len returns the number of receipts in this list.

type RpcHeader

type RpcHeader struct {
	BaseFeePerGas    string         `json:"baseFeePerGas"`
	BlockScore       string         `json:"blockscore"`
	ExtraData        string         `json:"extraData"`
	GasUsed          string         `json:"gasUsed"`
	GovernanceData   string         `json:"governanceData"`
	Hash             common.Hash    `json:"hash"`
	LogsBloom        string         `json:"logsBloom"`
	Number           string         `json:"number"`
	ParentHash       common.Hash    `json:"parentHash"`
	ReceiptsRoot     common.Hash    `json:"receiptsRoot"`
	Reward           common.Address `json:"reward"`
	Size             string         `json:"size"`
	StateRoot        common.Hash    `json:"stateRoot"`
	Timestamp        string         `json:"timestamp"`
	TimestampFoS     string         `json:"timestampFoS"`
	TotalBlockScore  string         `json:"totalBlockScore"`
	TransactionsRoot common.Hash    `json:"transactionsRoot"`
	Transactions     []Transactions `json:"transactions"`
	VoteData         string         `json:"voteData"`
}

type Transactions

type Transactions struct {
	AccessList           []interface{} `json:"accessList,omitempty"`
	BlockHash            string        `json:"blockHash"`
	BlockNumber          string        `json:"blockNumber"`
	ChainID              string        `json:"chainId,omitempty"`
	From                 string        `json:"from"`
	Gas                  string        `json:"gas"`
	GasPrice             string        `json:"gasPrice"`
	Hash                 string        `json:"hash"`
	Input                string        `json:"input"`
	MaxFeePerGas         string        `json:"maxFeePerGas,omitempty"`
	MaxPriorityFeePerGas string        `json:"maxPriorityFeePerGas,omitempty"`
	Nonce                string        `json:"nonce"`
	R                    string        `json:"r"`
	S                    string        `json:"s"`
	To                   string        `json:"to"`
	TransactionIndex     string        `json:"transactionIndex"`
	Type                 string        `json:"type"`
	V                    string        `json:"v"`
	Value                string        `json:"value"`
}

type TxLog

type TxLog struct {
	Addr   common.Address
	Topics [][]byte
	Data   []byte
}

type TxReceipt added in v1.2.0

type TxReceipt struct {
	PostStateOrStatus []byte
	CumulativeGasUsed *big.Int
	Bloom             []byte
	Logs              []mapprotocol.TxLog
}

func GetTxReceipt

func GetTxReceipt(receipt *types.Receipt) (*TxReceipt, error)

Jump to

Keyboard shortcuts

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