nodes

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WeiToEther

func WeiToEther(wei *big.Int) *big.Float

func WeiToGwei

func WeiToGwei(wei *big.Int) *big.Float

Types

type GasInfo

type GasInfo struct {
	LastBlock         uint64   `json:"lastBlock"`
	LastBlockGasLimit uint64   `json:"lastBlockGasLimit"`
	GasPriceWei       *big.Int `json:"gasPrice"`
	GasTipWei         *big.Int `json:"gasTip"`
}

type Node

type Node struct {
	NodeID             int            `mapstructure:"id"`
	Name               string         `mapstructure:"name"`
	Color              lipgloss.Color `mapstructure:"color"`
	Marker             string         `mapstructure:"marker"`
	WebsocketsEndpoint string         `mapstructure:"endpoint"`
	LocalNode          bool           `mapstructure:"local"`
	Client             *ethclient.Client
	ClientGeth         *gethclient.Client
	NumLogsReceived    uint64
	LastLogReceived    int64
}

Node represents a w3 provider configuration.

func (*Node) Connect

func (n *Node) Connect() error

Connect returns a new node if the connection to the given endpoint succeeds.

func (*Node) ERC1155Supported

func (n *Node) ERC1155Supported(contractAddress common.Address) bool

func (*Node) GetCollectionMetadata

func (n *Node) GetCollectionMetadata(contractAddress common.Address) map[string]interface{}

func (*Node) GetCurrentGasInfo

func (n *Node) GetCurrentGasInfo() (*GasInfo, error)

GetCurrentGasInfo returns the current gas price and tip

func (*Node) GetERC1155TokenID

func (n *Node) GetERC1155TokenID(data []byte) *big.Int

func (*Node) GetERC1155TokenName

func (n *Node) GetERC1155TokenName(contractAddress common.Address, tokenID *big.Int) (string, error)

func (*Node) GetERC721CollectionName

func (n *Node) GetERC721CollectionName(contractAddress common.Address) (string, error)

func (*Node) GetSupportedStandards

func (n *Node) GetSupportedStandards(contractAddress common.Address) []standard.Standard

func (*Node) GetTokenImageURI

func (n *Node) GetTokenImageURI(contractAddress common.Address, tokenID *big.Int) (string, error)

func (*Node) GetTokenMetadata

func (n *Node) GetTokenMetadata(tokenURI string) (*models.MetadataERC721, error)

func (*Node) GetTokenURI

func (n *Node) GetTokenURI(contractAddress common.Address, tokenID *big.Int) (string, error)

func (*Node) SubscribeToContract

func (n *Node) SubscribeToContract(queueLogs chan types.Log, contractAddress common.Address) (ethereum.Subscription, error)

func (*Node) SubscribeToOrderFulfilled

func (n *Node) SubscribeToOrderFulfilled(queueLogs chan types.Log) (ethereum.Subscription, error)

func (*Node) SubscribeToOrdersMatched

func (n *Node) SubscribeToOrdersMatched(queueLogs chan types.Log) (ethereum.Subscription, error)

func (*Node) SubscribeToPendingTransactions

func (n *Node) SubscribeToPendingTransactions(queueLogs chan<- common.Hash) (ethereum.Subscription, error)

func (*Node) SubscribeToSingleTransfers

func (n *Node) SubscribeToSingleTransfers(queueLogs chan types.Log) (ethereum.Subscription, error)

func (*Node) SubscribeToSingleTransfersFor

func (n *Node) SubscribeToSingleTransfersFor(queueLogs chan types.Log, contractAddresses []common.Address) (ethereum.Subscription, error)

func (*Node) SubscribeToTransfers

func (n *Node) SubscribeToTransfers(queueLogs chan types.Log) (ethereum.Subscription, error)

func (*Node) SubscribeToTransfersFor

func (n *Node) SubscribeToTransfersFor(queueLogs chan types.Log, contractAddresses []common.Address) (ethereum.Subscription, error)

type Nodes

type Nodes []*Node

func (*Nodes) ConnectAllNodes

func (nc *Nodes) ConnectAllNodes() *Nodes

func (*Nodes) ERC1155Supported

func (nc *Nodes) ERC1155Supported(contractAddress common.Address) bool

func (*Nodes) GetCollectionMetadata

func (nc *Nodes) GetCollectionMetadata(contractAddress common.Address) map[string]interface{}

func (*Nodes) GetCurrentGasInfo

func (nc *Nodes) GetCurrentGasInfo() (*GasInfo, error)

func (*Nodes) GetENSForAddress

func (nc *Nodes) GetENSForAddress(address common.Address) (string, error)

func (*Nodes) GetERC1155TokenID

func (nc *Nodes) GetERC1155TokenID(data []byte) *big.Int

func (*Nodes) GetERC1155TokenName

func (nc *Nodes) GetERC1155TokenName(contractAddress common.Address, tokenID *big.Int) (string, error)

func (*Nodes) GetERC721CollectionName

func (nc *Nodes) GetERC721CollectionName(contractAddress common.Address) (string, error)

func (*Nodes) GetLocalNodes

func (nc *Nodes) GetLocalNodes() []*Node

func (*Nodes) GetNodeByID

func (nc *Nodes) GetNodeByID(nodeID int) *Node

GetNodeByID rer

func (*Nodes) GetRandomLocalNode

func (nc *Nodes) GetRandomLocalNode() *Node

func (*Nodes) GetSupportedStandards

func (nc *Nodes) GetSupportedStandards(contractAddress common.Address) []standard.Standard

func (*Nodes) GetTokenImageURI

func (nc *Nodes) GetTokenImageURI(contractAddress common.Address, tokenID *big.Int) (string, error)

func (*Nodes) GetTransactionByHash

func (nc *Nodes) GetTransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)

func (*Nodes) GetTransactionReceipt

func (nc *Nodes) GetTransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

func (*Nodes) ReverseResolveAllENS

func (nc *Nodes) ReverseResolveAllENS(wallets *wallet.Wallets)

Jump to

Keyboard shortcuts

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