client

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UnknownERC20Symbol   = "ERC20_UNKNOWN"
	UnknownERC20Decimals = 0

	UnknownERC721Symbol   = "ERC721_UNKNOWN"
	UnknownERC721Decimals = 0
)

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) (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)
	EvmTransferLogs(context.Context, ethcommon.Hash, ethcommon.Hash) ([]ethtypes.Log, 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) (string, error)
	Peers(context.Context) ([]network.PeerInfo, error)
	GetContractCurrency(ethcommon.Address, bool) (*ContractCurrency, error)
	CallContract(context.Context, interfaces.CallMsg, *big.Int) ([]byte, error)
}

func NewClient

func NewClient(endpoint string) (Client, error)

NewClient returns a new client for Avalanche APIs

type ContractClient added in v0.0.26

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

ContractClient is a client for the calling contract information

func NewContractClient added in v0.0.26

func NewContractClient(c ethclient.Client) *ContractClient

NewContractClient returns a new ContractInfo client

func (*ContractClient) GetContractCurrency added in v0.1.0

func (c *ContractClient) GetContractCurrency(addr common.Address, erc20 bool) (*ContractCurrency, error)

GetContractCurrency returns the currency for a specific address

type ContractCurrency added in v0.1.0

type ContractCurrency struct {
	Symbol   string `json:"symbol"`
	Decimals int32  `json:"decimals"`
}

type ContractInfoToken added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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

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

func NewContractInfoTokenCaller added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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

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

func NewContractInfoTokenFilterer added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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

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

func NewContractInfoTokenTransactor added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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(endpoint string) (*EthClient, error)

NewEthClient returns a new EVM client

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 EvmLogsClient added in v0.0.26

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

EvmLogsClient is a client for requesting evm logs

func NewEvmLogsClient added in v0.0.26

func NewEvmLogsClient(c ethclient.Client) *EvmLogsClient

NewEvmLogsClient returns a new EVM Logs client

func (*EvmLogsClient) EvmTransferLogs added in v0.0.26

func (c *EvmLogsClient) EvmTransferLogs(
	ctx context.Context,
	blockHash common.Hash,
	transactionHash common.Hash,
) ([]types.Log, error)

EvmTransferLogs returns a set of evm logs based on the requested block hash and transaction hash

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