etherscan

package
v0.0.0-...-2c9d471 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtherscanClient

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

func NewEtherscanClient

func NewEtherscanClient(apiURL string, apiKey string) (*EtherscanClient, error)

func NewEtherscanClientWithNetwork

func NewEtherscanClientWithNetwork(ethNetwork types.ETHNetwork, apiKey string) (*EtherscanClient, error)

func (*EtherscanClient) GetSmartContractData

func (c *EtherscanClient) GetSmartContractData(
	ctx context.Context,
	hexAddress string,
) (*SmartContractData, error)

func (*EtherscanClient) GetSourcecode

func (c *EtherscanClient) GetSourcecode(ctx context.Context, hexAddress string) (*EtherscanGetSourcecodeResponse, string, error)

func (*EtherscanClient) GetTokenBalance

func (c *EtherscanClient) GetTokenBalance(address string, tokenAddress string) (*big.Int, error)

func (*EtherscanClient) GetTxlist

func (c *EtherscanClient) GetTxlist(ctx context.Context, hexAddress string) (*EtherscanGetTxlistResponse, error)

type EtherscanGetSourcecodeResponse

type EtherscanGetSourcecodeResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
	Result  []struct {
		SourceCode           string `json:"SourceCode"`
		ABI                  string `json:"ABI"`
		ContractName         string `json:"ContractName"`
		CompilerVersion      string `json:"CompilerVersion"`
		ConstructorArguments string `json:"ConstructorArguments"`
	} `json:"result"`
}

API: contract -> getsourcecode

type EtherscanGetTxlistResponse

type EtherscanGetTxlistResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
	Result  []struct {
		Input string `json:"input"`
	} `json:"result"`
}

API: account -> txlist

type SmartContractData

type SmartContractData struct {
	SourceCode          map[string]string
	ABI                 string
	ContractName        string
	CreationHexByteCode string
	DownloadURL         string
}

Helper: Get Smart Contract Data

Jump to

Keyboard shortcuts

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