apis

package module
v0.0.0-...-51cf05b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

README

chain5j-apis

简介

chain5j-apis chain5j链对外接口。

功能

证书

chain5j-apis 的源码允许用户在遵循 Apache 2.0 开源证书 规则的前提下使用。

版权

Copyright@2021 chain5j

chain5j

Documentation

Overview

Package apis

@author: xwc1125

Package apis

@author: xwc1125

Package apis

@author: xwc1125

Package apis

@author: xwc1125

Package apis

@author: xwc1125

Package apis

@author: xwc1125

Package apis

@author: xwc1125

Package apis

@author: xwc1125

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApis

func NewApis(rootCtx context.Context, opts ...option) (protocol.APIs, error)

NewApis 创建一个新的Api,提供给rpc调用

func RPCMarshalBlock

func RPCMarshalBlock(b *models.Block) (map[string]interface{}, error)

func WithBlockDB

func WithBlockDB(blockDB protocol.DatabaseReader) option

func WithBlockReader

func WithBlockReader(f protocol.APIs, blockReader protocol.BlockReader)

func WithStateDB

func WithStateDB(stateDB protocol.DatabaseReader) option

func WithTxPools

func WithTxPools(f protocol.APIs, txPools protocol.TxPools)

Types

type API

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

func (*API) GetTransaction

func (a *API) GetTransaction(ctx context.Context, hash types.Hash) models.Transaction

func (*API) GetTransactionLogs

func (a *API) GetTransactionLogs(ctx context.Context, hash types.Hash) ([]*statetype.Log, error)

func (*API) GetTransactionReceipt

func (a *API) GetTransactionReceipt(ctx context.Context, hash types.Hash) (models.Transaction, error)

func (*API) SendRawTransaction

func (a *API) SendRawTransaction(ctx context.Context, txType types.TxType, rawTx hexutil.Bytes) (types.Hash, error)

type AddressStatus

type AddressStatus struct {
	Pending NonceHashList `json:"pending"`
	Count   uint64        `json:"count"`
}

AddressStatus 地址状态

type NonceHashInfo

type NonceHashInfo struct {
	Nonce *big.Int `json:"nonce"`
	Hash  string   `json:"hash"`
}

NonceHashInfo TODO

type NonceHashList

type NonceHashList []NonceHashInfo

NonceHashList TODO

func (NonceHashList) Len

func (a NonceHashList) Len() int

Len TODO

func (NonceHashList) Less

func (a NonceHashList) Less(i, j int) bool

Less TODO

func (NonceHashList) Swap

func (a NonceHashList) Swap(i, j int)

Swap TODO

type RPCTransaction

type RPCTransaction struct {
	BlockHash          types.Hash     `json:"blockHash"`
	BlockNumber        hexutil.Uint64 `json:"blockNumber"`
	TransactionIndex   hexutil.Uint   `json:"transactionIndex"`
	Type               types.TxType   `json:"type"`
	models.Transaction `json:"transaction"`
}

RPCTransaction rpc响应的交易

Jump to

Keyboard shortcuts

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