accounts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountsClient

type AccountsClient struct {
	API *httpapi.APIClient
}

AccountsClient is the client for accounts actions.

func (*AccountsClient) GetETHBalance

func (c *AccountsClient) GetETHBalance(
	ctx context.Context, req *ETHBalanceRequest,
) (*big.Int, error)

GetETHBalance returns the Ether balance for a single address.

func (*AccountsClient) GetHistoricalETHBalance

func (c *AccountsClient) GetHistoricalETHBalance(
	ctx context.Context, req *HistoricalETHRequest,
) (result *big.Int, err error)

GetHistoricalETHBalance retrieves the ETH balance for an address at a particular block number.

func (*AccountsClient) GetInternalTxsByBlockRange

func (c *AccountsClient) GetInternalTxsByBlockRange(
	ctx context.Context,
	req *BlockRangeRequest,
) (result []InternalTxInfo, err error)

GetInternalTxsByBlockRange returns the list of internal transactions performed within a block range.

func (*AccountsClient) GetInternalTxsByHash

func (c *AccountsClient) GetInternalTxsByHash(
	ctx context.Context, hash common.Hash,
) (result []InternalTxInfoByHash, err error)

GetInternalTxsByHash returns the list of internal transactions performed within a transaction.

func (*AccountsClient) GetMultiETHBalances

func (c *AccountsClient) GetMultiETHBalances(
	ctx context.Context, req *MultiETHBalancesRequest,
) (result []MultiBalanceResponse, err error)

GetMultiETHBalances returns the balance of accounts from a list of addresses.

func (*AccountsClient) ListBlocksMined

func (c *AccountsClient) ListBlocksMined(
	ctx context.Context, req *ListBlocksRequest,
) (result []BlockInfo, err error)

ListBlocksMined lists blocks that were mined by a specific address.

func (*AccountsClient) ListInternalTransactions

func (c *AccountsClient) ListInternalTransactions(
	ctx context.Context, req *ListTxRequest,
) (result []InternalTxInfo, err error)

ListInternalTransactions returns the list of internal transactions performed by an address.

func (*AccountsClient) ListNFTTransfers

func (c *AccountsClient) ListNFTTransfers(
	ctx context.Context, req *ListNFTTransferRequest,
) (result []NFTTransferInfo, err error)

ListNFTTransfers lists the NFT token transfers for an address.

func (*AccountsClient) ListNormalTransactions

func (c *AccountsClient) ListNormalTransactions(
	ctx context.Context, req *ListTxRequest,
) (result []NormalTxInfo, err error)

ListNormalTransactions returns the list of transactions performed by an address.

func (*AccountsClient) ListTokenTransfers

func (c *AccountsClient) ListTokenTransfers(
	ctx context.Context, req *TokenTransfersRequest,
) (result []TokenTransferInfo, err error)

ListTokenTransfers lists the ERC20 token transfers for an address.

type BaseTokenTransferInfo

type BaseTokenTransferInfo struct {
	BlockNumber       uint64    `etherscan:"blockNumber"`
	Timestamp         time.Time `etherscan:"timeStamp"`
	Hash              common.Hash
	Nonce             uint64
	BlockHash         common.Hash `etherscan:"blockHash"`
	From              common.Address
	ContractAddress   common.Address `etherscan:"contractAddress"`
	To                common.Address
	TokenName         string `etherscan:"tokenName"`
	TokenSymbol       string `etherscan:"tokenSymbol"`
	TokenDecimal      uint32 `etherscan:"tokenDecimal"`
	TransactionIndex  uint32 `etherscan:"transactionIndex"`
	Gas               uint64
	GasPrice          *big.Int `etherscan:"gasPrice"`
	GasUsed           uint64   `etherscan:"gasUsed"`
	CumulativeGasUsed uint64   `etherscan:"cumulativeGasUsed"`
	Confirmations     uint64
}

BaseTokenTransferInfo contains common token transfer information.

type BlockInfo

type BlockInfo struct {
	BlockNumber uint64    `etherscan:"blockNumber"`
	Timestamp   time.Time `etherscan:"timeStamp"`
	BlockReward *big.Int  `etherscan:"blockReward"`
}

BlockInfo contains information on a specific ethereum block.

type BlockRangeRequest

type BlockRangeRequest struct {
	StartBlock uint64
	EndBlock   uint64
	Sort       ecommon.SortingPreference
}

BlockRangeRequest contains the request parameters for GetInternalTxsByBlockRange.

type BlockType

type BlockType int32

BlockType is an enumeration of block types. ENUM(blocks,uncles)

const (
	// BlockTypeBlocks is a BlockType of type Blocks.
	BlockTypeBlocks BlockType = iota
	// BlockTypeUncles is a BlockType of type Uncles.
	BlockTypeUncles
)

func ParseBlockType

func ParseBlockType(name string) (BlockType, error)

ParseBlockType attempts to convert a string to a BlockType

func (BlockType) String

func (x BlockType) String() string

String implements the Stringer interface.

type ETHBalanceRequest

type ETHBalanceRequest struct {
	Address common.Address
	Tag     ecommon.BlockParameter
}

ETHBalanceRequest contains the request parameters for GetETHBalance.

type HistoricalETHRequest

type HistoricalETHRequest struct {
	Address     common.Address
	BlockNumber uint64 `etherscan:"blockno"`
}

HistoricalETHRequest contains the request parameters for GetHistoricalETHBalance.

type InternalTxInfo

type InternalTxInfo struct {
	TransactionInfo
	Hash    common.Hash
	TraceID string `etherscan:"traceId"`
	Type    string
}

InternalTxInfo contains information on internal transactions.

type InternalTxInfoByHash

type InternalTxInfoByHash struct {
	TransactionInfo
	Type string
}

InternalTxInfoByHash contains information on internal transactions returned by GetInternalTxsByHash

type ListBlocksRequest

type ListBlocksRequest struct {
	Address common.Address
	Type    BlockType `etherscan:"blocktype"`
}

ListBlocksRequest contains the request parameters for ListBlocksMined.

type ListNFTTransferRequest

type ListNFTTransferRequest struct {
	Address         *common.Address
	ContractAddress *common.Address
	Sort            ecommon.SortingPreference
}

ListNFTTransferRequest contains the request parameters for ListNFTTransfers.

type ListTxRequest

type ListTxRequest struct {
	Address    common.Address
	StartBlock uint64
	EndBlock   uint64
	Sort       ecommon.SortingPreference
}

ListTxRequest contains the request parameters for ListNormalTransactions.

type MultiBalanceResponse

type MultiBalanceResponse struct {
	Account common.Address
	Balance *big.Int
}

MultiBalanceResponse contains the Ether balance for a specific address.

type MultiETHBalancesRequest

type MultiETHBalancesRequest struct {
	Addresses []common.Address `etherscan:"address"`
	Tag       ecommon.BlockParameter
}

MultiETHBalancesRequest contains the request parameters for GetMultiETHBalances.

type NFTTransferInfo

type NFTTransferInfo struct {
	BaseTokenTransferInfo
	TokenID string `etherscan:"tokenID"`
}

NFTTransferInfo contains the information on an NFT token transfer.

type NormalTxInfo

type NormalTxInfo struct {
	TransactionInfo
	Hash              common.Hash
	Nonce             uint64
	BlockHash         common.Hash `etherscan:"blockHash"`
	TransactionIndex  uint64      `etherscan:"transactionIndex"`
	GasPrice          *big.Int    `etherscan:"gasPrice"`
	TxReceiptStatus   string      `etherscan:"txreceipt_status"`
	CumulativeGasUsed uint64      `etherscan:"cumulativeGasUsed"`
	Confirmations     uint64
}

NormalTxInfo contains information on normal transactions returned by ListNormalTransactions.

type TokenTransferInfo

type TokenTransferInfo struct {
	BaseTokenTransferInfo
	Value *big.Int
}

TokenTransferInfo contains information on an ERC20 token transfer.

type TokenTransfersRequest

type TokenTransfersRequest struct {
	Address         common.Address
	ContractAddress common.Address
	Sort            ecommon.SortingPreference
}

TokenTransferRequest

type TransactionInfo

type TransactionInfo struct {
	BlockNumber     uint64    `etherscan:"blockNumber"`
	Timestamp       time.Time `etherscan:"timeStamp"`
	From            common.Address
	To              common.Address
	Value           *big.Int
	ContractAddress *common.Address `etherscan:"contractAddress"`
	Input           []byte
	Gas             uint64
	GasUsed         uint64 `etherscan:"gasUsed"`
	IsError         bool   `etherscan:"isError,num"`
}

TransactionInfo conatins the base transaction info included in multiple response types.

Jump to

Keyboard shortcuts

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