etherscan

package
v0.73.9 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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(
	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) 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