client

package
v0.0.0-...-778b29f Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownERC20Symbol  = "ERC20_UNKNOWN"
	UnknownERC721Symbol = "ERC721_UNKNOWN"
)

Variables

View Source
var ContractInfoTokenABI = ContractInfoTokenMetaData.ABI

ContractInfoTokenABI is the input ABI used to generate the binding from. Deprecated: Use ContractInfoTokenMetaData.ABI instead.

View Source
var ContractInfoTokenMetaData = &bind.MetaData{
	ABI: "[{\"type\":\"function\",\"stateMutability\":\"view\",\"outputs\":[{\"type\":\"uint8\",\"name\":\"\",\"internalType\":\"uint8\"}],\"name\":\"decimals\",\"inputs\":[]},{\"type\":\"function\",\"stateMutability\":\"view\",\"outputs\":[{\"type\":\"string\",\"name\":\"\",\"internalType\":\"string\"}],\"name\":\"symbol\",\"inputs\":[]}]",
}

ContractInfoTokenMetaData contains all meta data concerning the ContractInfoToken contract.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID           string `json:"assetId"`
	Name         string `json:"name"`
	Symbol       string `json:"symbol"`
	Denomination string `json:"denomination"`
}

type Blockchain

type Blockchain struct {
	ID       string `json:"id"`
	SubnetID string `json:"subnetID"`
	Name     string `json:"name"`
	VMID     string `json:"vmId"`
}

type Call

type Call struct {
	Type    string         `json:"type"`
	From    common.Address `json:"from"`
	To      common.Address `json:"to"`
	Value   *hexutil.Big   `json:"value"`
	GasUsed *hexutil.Big   `json:"gasUsed"`
	Revert  bool           `json:"revert"`
	Error   string         `json:"error,omitempty"`
	Calls   []*Call        `json:"calls,omitempty"`
}

type Client

type Client interface {
	IsBootstrapped(context.Context, string, ...rpc.Option) (bool, error)
	ChainID(context.Context) (*big.Int, error)
	BlockByHash(context.Context, ethcommon.Hash) (*ethtypes.Block, error)
	BlockByNumber(context.Context, *big.Int) (*ethtypes.Block, error)
	HeaderByHash(context.Context, ethcommon.Hash) (*ethtypes.Header, error)
	HeaderByNumber(context.Context, *big.Int) (*ethtypes.Header, error)
	TransactionByHash(context.Context, ethcommon.Hash) (*ethtypes.Transaction, bool, error)
	TransactionReceipt(context.Context, ethcommon.Hash) (*ethtypes.Receipt, error)
	TraceTransaction(context.Context, string) (*Call, []*FlatCall, error)
	TraceBlockByHash(context.Context, string) ([]*Call, [][]*FlatCall, error)
	SendTransaction(context.Context, *ethtypes.Transaction) error
	BalanceAt(context.Context, ethcommon.Address, *big.Int) (*big.Int, error)
	NonceAt(context.Context, ethcommon.Address, *big.Int) (uint64, error)
	SuggestGasPrice(context.Context) (*big.Int, error)
	EstimateGas(context.Context, interfaces.CallMsg) (uint64, error)
	TxPoolContent(context.Context) (*TxPoolContent, error)
	GetNetworkName(context.Context, ...rpc.Option) (string, error)
	Peers(context.Context, ...rpc.Option) ([]info.Peer, error)
	GetContractInfo(ethcommon.Address, bool) (string, uint8, error)
	CallContract(context.Context, interfaces.CallMsg, *big.Int) ([]byte, error)
}

func NewClient

func NewClient(ctx context.Context, endpoint string) (Client, error)

NewClient returns a new client for Avalanche APIs

type ContractClient

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

ContractClient is a client for the calling contract information

func NewContractClient

func NewContractClient(c ethclient.Client) *ContractClient

NewContractClient returns a new ContractInfo client

func (*ContractClient) GetContractInfo

func (c *ContractClient) GetContractInfo(addr common.Address, erc20 bool) (string, uint8, error)

GetContractInfo returns the symbol and decimals for [addr].

type ContractInfoToken

type ContractInfoToken struct {
	ContractInfoTokenCaller     // Read-only binding to the contract
	ContractInfoTokenTransactor // Write-only binding to the contract
	ContractInfoTokenFilterer   // Log filterer for contract events
}

ContractInfoToken is an auto generated Go binding around an Ethereum contract.

func NewContractInfoToken

func NewContractInfoToken(address common.Address, backend bind.ContractBackend) (*ContractInfoToken, error)

NewContractInfoToken creates a new instance of ContractInfoToken, bound to a specific deployed contract.

type ContractInfoTokenCaller

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

ContractInfoTokenCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewContractInfoTokenCaller

func NewContractInfoTokenCaller(address common.Address, caller bind.ContractCaller) (*ContractInfoTokenCaller, error)

NewContractInfoTokenCaller creates a new read-only instance of ContractInfoToken, bound to a specific deployed contract.

func (*ContractInfoTokenCaller) Decimals

func (_ContractInfoToken *ContractInfoTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error)

Decimals is a free data retrieval call binding the contract method 0x313ce567.

Solidity: function decimals() view returns(uint8)

func (*ContractInfoTokenCaller) Symbol

func (_ContractInfoToken *ContractInfoTokenCaller) Symbol(opts *bind.CallOpts) (string, error)

Symbol is a free data retrieval call binding the contract method 0x95d89b41.

Solidity: function symbol() view returns(string)

type ContractInfoTokenCallerRaw

type ContractInfoTokenCallerRaw struct {
	Contract *ContractInfoTokenCaller // Generic read-only contract binding to access the raw methods on
}

ContractInfoTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*ContractInfoTokenCallerRaw) Call

func (_ContractInfoToken *ContractInfoTokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type ContractInfoTokenCallerSession

type ContractInfoTokenCallerSession struct {
	Contract *ContractInfoTokenCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts            // Call options to use throughout this session
}

ContractInfoTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*ContractInfoTokenCallerSession) Decimals

func (_ContractInfoToken *ContractInfoTokenCallerSession) Decimals() (uint8, error)

Decimals is a free data retrieval call binding the contract method 0x313ce567.

Solidity: function decimals() view returns(uint8)

func (*ContractInfoTokenCallerSession) Symbol

func (_ContractInfoToken *ContractInfoTokenCallerSession) Symbol() (string, error)

Symbol is a free data retrieval call binding the contract method 0x95d89b41.

Solidity: function symbol() view returns(string)

type ContractInfoTokenFilterer

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

ContractInfoTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewContractInfoTokenFilterer

func NewContractInfoTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractInfoTokenFilterer, error)

NewContractInfoTokenFilterer creates a new log filterer instance of ContractInfoToken, bound to a specific deployed contract.

type ContractInfoTokenRaw

type ContractInfoTokenRaw struct {
	Contract *ContractInfoToken // Generic contract binding to access the raw methods on
}

ContractInfoTokenRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*ContractInfoTokenRaw) Call

func (_ContractInfoToken *ContractInfoTokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*ContractInfoTokenRaw) Transact

func (_ContractInfoToken *ContractInfoTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ContractInfoTokenRaw) Transfer

func (_ContractInfoToken *ContractInfoTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ContractInfoTokenSession

type ContractInfoTokenSession struct {
	Contract     *ContractInfoToken // Generic contract binding to set the session for
	CallOpts     bind.CallOpts      // Call options to use throughout this session
	TransactOpts bind.TransactOpts  // Transaction auth options to use throughout this session
}

ContractInfoTokenSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*ContractInfoTokenSession) Decimals

func (_ContractInfoToken *ContractInfoTokenSession) Decimals() (uint8, error)

Decimals is a free data retrieval call binding the contract method 0x313ce567.

Solidity: function decimals() view returns(uint8)

func (*ContractInfoTokenSession) Symbol

func (_ContractInfoToken *ContractInfoTokenSession) Symbol() (string, error)

Symbol is a free data retrieval call binding the contract method 0x95d89b41.

Solidity: function symbol() view returns(string)

type ContractInfoTokenTransactor

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

ContractInfoTokenTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewContractInfoTokenTransactor

func NewContractInfoTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*ContractInfoTokenTransactor, error)

NewContractInfoTokenTransactor creates a new write-only instance of ContractInfoToken, bound to a specific deployed contract.

type ContractInfoTokenTransactorRaw

type ContractInfoTokenTransactorRaw struct {
	Contract *ContractInfoTokenTransactor // Generic write-only contract binding to access the raw methods on
}

ContractInfoTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*ContractInfoTokenTransactorRaw) Transact

func (_ContractInfoToken *ContractInfoTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ContractInfoTokenTransactorRaw) Transfer

func (_ContractInfoToken *ContractInfoTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ContractInfoTokenTransactorSession

type ContractInfoTokenTransactorSession struct {
	Contract     *ContractInfoTokenTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts            // Transaction auth options to use throughout this session
}

ContractInfoTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

type EthClient

type EthClient struct {
	ethclient.Client
	// contains filtered or unexported fields
}

EthClient provides access to Coreth API

func NewEthClient

func NewEthClient(ctx context.Context, endpoint string) (*EthClient, error)

NewEthClient returns a new EVM client

func (*EthClient) TraceBlockByHash

func (c *EthClient) TraceBlockByHash(ctx context.Context, hash string) ([]*Call, [][]*FlatCall, error)

TraceBlockByHash returns the transaction traces of all transactions in the block

func (*EthClient) TraceTransaction

func (c *EthClient) TraceTransaction(ctx context.Context, hash string) (*Call, []*FlatCall, error)

TraceTransaction returns a transaction trace

func (*EthClient) TxPoolContent

func (c *EthClient) TxPoolContent(ctx context.Context) (*TxPoolContent, error)

TxPoolContent returns the tx pool content

type FlatCall

type FlatCall struct {
	Type    string         `json:"type"`
	From    common.Address `json:"from"`
	To      common.Address `json:"to"`
	Value   *big.Int       `json:"value"`
	GasUsed *big.Int       `json:"gasUsed"`
	Revert  bool           `json:"revert"`
	Error   string         `json:"error,omitempty"`
}

type TxAccountMap

type TxAccountMap map[string]TxNonceMap

type TxNonceMap

type TxNonceMap map[string]string

type TxPoolContent

type TxPoolContent struct {
	Pending TxAccountMap `json:"pending"`
	Queued  TxAccountMap `json:"queued"`
}

type TxPoolStatus

type TxPoolStatus struct {
	PendingCount int `json:"pending"`
	QueuedCount  int `json:"queued"`
}

Jump to

Keyboard shortcuts

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