eth

package
v0.0.0-...-5ed304f Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAddress

func ValidateAddress(address string) bool

Types

type Block

type Block struct {
	Number   string `json:"number"`
	Hash     string `json:"hash"`
	GasLimit string `json:"gasLimit"`
	GasUsed  string `json:"gasUsed"`
	BaseFee  string `json:"baseFeePerGas"`
}

type ERC20

type ERC20 struct {
	Chain    string
	Address  string
	Decimals int
	Units    *types.Number
}

type Node

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

func New

func New(
	mainnet bool,
	url, rawPriv string,
	erc20 *ERC20,
	logger *log.Logger,
) (*Node, error)

func (Node) Address

func (node Node) Address() string

func (Node) BroadcastTx

func (node Node) BroadcastTx(tx string) (string, error)

func (Node) Chain

func (node Node) Chain() string

func (Node) CreateTx

func (node Node) CreateTx(inputs []*types.TxInput, outputs []*types.TxOutput) (string, string, error)

func (Node) GetAccountingType

func (node Node) GetAccountingType() types.AccountingType

func (Node) GetAddressExplorerURL

func (node Node) GetAddressExplorerURL(address string) string

func (Node) GetAddressPrefix

func (node Node) GetAddressPrefix() string

func (Node) GetBalance

func (node Node) GetBalance() (*big.Int, error)

func (Node) GetTx

func (node Node) GetTx(txid string) (*types.TxResponse, error)

func (Node) GetTxExplorerURL

func (node Node) GetTxExplorerURL(txid string) string

func (Node) GetUnits

func (node Node) GetUnits() *types.Number

func (Node) Mocked

func (node Node) Mocked() bool

func (Node) Name

func (node Node) Name() string

func (Node) ShouldMergeUTXOs

func (node Node) ShouldMergeUTXOs() bool

func (Node) ValidateAddress

func (node Node) ValidateAddress(address string) bool

type Transaction

type Transaction struct {
	Hash                 string `json:"hash"`
	BlockHash            string `json:"blockHash"`
	BlockNumber          string `json:"blockNumber"`
	From                 string `json:"from"`
	To                   string `json:"to"`
	Value                string `json:"value"`
	Gas                  string `json:"gas"`
	GasPrice             string `json:"gasPrice"`
	MaxFeePerGas         string `json:"maxFeePerGas"`
	MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas"`
	Input                string `json:"input"`
	Nonce                string `json:"nonce"`
	Index                string `json:"transactionIndex"`
	Type                 string `json:"type"`
	V                    string `json:"v"`
	R                    string `json:"r"`
	S                    string `json:"s"`
}

type TransactionReceipt

type TransactionReceipt struct {
	TxHash            string `json:"transactionHash"`
	GasUsed           string `json:"gasUsed"`
	EffectiveGasPrice string `json:"effectiveGasPrice"`
	BlockHash         string `json:"blockHash"`
	BlockNumber       string `json:"blockNumber"`
	Status            string `json:"status"`
}

Jump to

Keyboard shortcuts

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