etherscan

package
v0.75.8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 10 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(
	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