provider

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockNumber        methodCall = "eth_blockNumber"
	TransactionByHash  methodCall = "eth_getTransactionByHash" //nolint:gosec
	TransactionReceipt methodCall = "eth_getTransactionReceipt"

	TokenImageURI methodCall = "token_image_uri" //nolint:gosec

	ERC721CollectionName     methodCall = "erc721_collection_name"
	ERC721CollectionMetadata methodCall = "erc721_collection_metadata"

	ERC1155TokenName   methodCall = "erc1155_token_name" //nolint:gosec
	ERC1155TotalSupply methodCall = "erc1155_total_supply"

	ReverseResolveENS methodCall = "resolve_ens_address"
	ResolveENS        methodCall = "resolve_ens"

	GasInfo methodCall = "gas_info"

	CodeAt  methodCall = "bytecode"
	NonceAt methodCall = "nonce"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	LastLogReceivedAt time.Time `json:"-" mapstructure:"-"`

	Rueidi *rueidica.Rueidica
	// contains filtered or unexported fields
}

func FromConfig

func FromConfig(config interface{}) (*Pool, error)

func (*Pool) BlockNumber added in v0.4.3

func (pp *Pool) BlockNumber(ctx context.Context) (uint64, error)

BlockNumber returns the most recent block number.

func (*Pool) ERC1155TokenName

func (pp *Pool) ERC1155TokenName(ctx context.Context, contractAddress common.Address, tokenID *big.Int) (string, error)

func (*Pool) ERC1155TotalSupply

func (pp *Pool) ERC1155TotalSupply(ctx context.Context, contractAddress common.Address, tokenID *big.Int) (*big.Int, error)

ERC1155TotalSupply returns the (current) total supply of a token.

func (*Pool) ERC721CollectionMetadata

func (pp *Pool) ERC721CollectionMetadata(ctx context.Context, contractAddress common.Address) (map[string]interface{}, error)

func (*Pool) ERC721CollectionName

func (pp *Pool) ERC721CollectionName(ctx context.Context, contractAddress common.Address) (string, error)

func (*Pool) GeERC20ABI added in v0.6.1

func (pp *Pool) GeERC20ABI(contractAddress common.Address) (*erc20.ERC20, error)

func (*Pool) GetCodeAt added in v0.11.0

func (pp *Pool) GetCodeAt(ctx context.Context, address common.Address) ([]byte, error)

get bytecode of address to check if its a EOA or contract.

func (*Pool) GetCurrentGasInfo

func (pp *Pool) GetCurrentGasInfo() (*nemo.GasInfo, error)

func (*Pool) GetERC1155ABI

func (pp *Pool) GetERC1155ABI(contractAddress common.Address) (*abis.ERC1155, error)

func (*Pool) GetLogsByBlockNumber added in v0.6.0

func (pp *Pool) GetLogsByBlockNumber(blockNumber int64) []types.Log

func (*Pool) GetNonceAt added in v0.11.0

func (pp *Pool) GetNonceAt(ctx context.Context, address common.Address) (uint64, error)

func (*Pool) GetProviders added in v0.6.1

func (pp *Pool) GetProviders() []*Provider

func (*Pool) GetTokenImageURI

func (pp *Pool) GetTokenImageURI(ctx context.Context, contractAddress common.Address, tokenID *big.Int) (string, error)

func (*Pool) GetWETHABI

func (pp *Pool) GetWETHABI(contractAddress common.Address) (*abis.WETH, error)

func (*Pool) IsContract added in v0.11.2

func (pp *Pool) IsContract(address common.Address) bool

IsContract returns true if the given address is a contract address. to resource intensive to check this for every address we encounter, so we cache the result.

func (*Pool) PreferredProviderAvailable

func (pp *Pool) PreferredProviderAvailable() bool

func (*Pool) ReconnectProviders

func (pp *Pool) ReconnectProviders()

func (pp *Pool) ReconnectProviders(queueLogs *chan types.Log) {.

func (*Pool) ResolveENS added in v0.6.0

func (pp *Pool) ResolveENS(ctx context.Context, ensName string) (common.Address, error)

func (*Pool) ReverseResolveAddressToENS added in v0.6.0

func (pp *Pool) ReverseResolveAddressToENS(ctx context.Context, address common.Address) (string, error)

func (*Pool) Subscribe

func (pp *Pool) Subscribe(queueLogs chan types.Log) (uint64, error)

func (*Pool) SubscribeToAddresses added in v0.6.2

func (pp *Pool) SubscribeToAddresses(queueLogs chan types.Log, addresses []common.Address) (uint64, error)

func (*Pool) SubscribeToEverything added in v0.6.0

func (pp *Pool) SubscribeToEverything(queueLogs chan types.Log) (uint64, error)

func (*Pool) SubscribeToEverythingPending added in v0.6.0

func (pp *Pool) SubscribeToEverythingPending(queuePendingTx chan *types.Transaction) (uint64, error)

func (*Pool) SubscribeToTopics added in v0.6.1

func (pp *Pool) SubscribeToTopics(queueLogs chan types.Log, topics [][]common.Hash) (uint64, error)

func (*Pool) TransactionByHash

func (pp *Pool) TransactionByHash(ctx context.Context, txHash common.Hash) (*types.Transaction, error)

TransactionByHash returns the transaction for the given hash.

func (*Pool) TransactionReceipt

func (pp *Pool) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

TransactionReceipt returns the receipt of a transaction by transaction hash.

type Provider added in v0.6.1

type Provider struct {
	Name      string `json:"name"      mapstructure:"name"`
	Endpoint  string `json:"endpoint"  mapstructure:"endpoint"`
	Preferred bool   `json:"preferred" mapstructure:"preferred"`

	Color lipgloss.Color `json:"color" mapstructure:"color"`

	PID common.Hash `json:"pid" mapstructure:"pid"`

	Client     *ethclient.Client  `json:"-" mapstructure:"-"`
	GethClient *gethclient.Client `json:"-" mapstructure:"-"`
}

Provider represents a rpc-endpoint Provider configuration.

func (*Provider) ID added in v0.6.1

func (p *Provider) ID() string

ID returns the provider id consisting of the first and last 4 characters of the pid in a human readable format.

Jump to

Keyboard shortcuts

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