manager

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSessionID

func NewSessionID() string

func NewSessionIDBytes

func NewSessionIDBytes() []byte

func WriteSessionID

func WriteSessionID(dst []byte) ([]byte, error)

Types

type KlayManager

type KlayManager interface {
	Balance(ctx context.Context, account common.Address) (*klayfw.Peb, error)
	BalanceAt(ctx context.Context, account common.Address, blockNum uint64) (*klayfw.Peb, error)
	PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
	PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
	EstimateGas(ctx context.Context, msg klaytn.CallMsg) (uint64, error)
	SuggestGasPrice(ctx context.Context) (*big.Int, error)
	TransactionByHash(ctx context.Context, txHex string) (*TxInfo, error)
	TransactionReceiptByHash(ctx context.Context, txHex string) (*TxReceipt, error)
	SendTransaction(ctx context.Context, tx *types.Transaction) error

	ChainID() uint64
	GasLimit() uint64

	Nodes() []string
	Close() error
}

func NewManager

func NewManager(nodes []string, gasLimit uint64) KlayManager

type TxInfo

type TxInfo struct {
	Hash        common.Hash     `json:"hash"`
	BlockNumber *hexutil.Big    `json:"blockNumber"`
	Nonce       hexutil.Uint64  `json:"nonce"`
	From        common.Address  `json:"from"`
	To          *common.Address `json:"to"`
	Value       *hexutil.Big    `json:"value"`
}

type TxReceipt

type TxReceipt struct {
	Status            hexutil.Uint64  `json:"status"`
	CumulativeGasUsed hexutil.Uint64  `json:"cumulativeGasUsed"`
	Logs              []*types.Log    `json:"logs"`
	Hash              common.Hash     `json:"transactionHash"`
	ContractAddress   *common.Address `json:"contractAddress"`
	GasUsed           hexutil.Uint64  `json:"gasUsed"`
}

Jump to

Keyboard shortcuts

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