Documentation
¶
Index ¶
- Constants
- func CopyMap(src map[string]string) map[string]string
- func FreeRateLimiter() func(client *resty.Client, req *resty.Request) error
- func StructToMap(obj any) map[string]string
- func ToStringE(i any) (string, error)
- type BaseResp
- type CheckVerifyStatusReq
- type Client
- type ContractCreatorTxInfo
- type ContractCreatorTxInfoResp
- type ContractSourceCode
- type ContractSourcecodeResp
- type GetContractABIReq
- type GetContractCreatorTxInfoReq
- type GetContractSourceCodeReq
- type GetEventLogsByAddressFilterByTopicsReq
- type GetEventLogsByAddressReq
- type GetEventLogsByTopicsReq
- type Log
- type LogResp
- type Options
- type StringResp
- type VerifySourceCodeReq
- type VerifySourceCodeResp
Constants ¶
View Source
const ( NoRecordsFound = "No records found" ContractCodeAlreadyVerified = "Contract source code already verified" )
Variables ¶
This section is empty.
Functions ¶
func FreeRateLimiter ¶
func FreeRateLimiter() func(client *resty.Client, req *resty.Request) error
func StructToMap ¶
Types ¶
type BaseResp ¶
type BaseResp struct { Status int `json:"status,string"` // 1 for good, 0 for error Message string `json:"message"` // OK for good, other words when Status equals 0 Result json.RawMessage `json:"result"` }
type CheckVerifyStatusReq ¶ added in v1.0.4
type Client ¶
type Client interface { GetContractABI(req GetContractABIReq) (*StringResp, error) GetContractSourceCode(req GetContractSourceCodeReq) (*ContractSourcecodeResp, error) GetContractCreatorTxInfo(req GetContractCreatorTxInfoReq) (*ContractCreatorTxInfoResp, error) VerifySourceCode(req VerifySourceCodeReq) (resp *VerifySourceCodeResp, err error) CheckVerifyStatus(req CheckVerifyStatusReq) (resp *StringResp, err error) GetEventLogsByAddress(req GetEventLogsByAddressReq) (*LogResp, error) GetEventLogsByTopics(req GetEventLogsByTopicsReq) (*LogResp, error) GetEventLogsByAddressFilterByTopics(req GetEventLogsByAddressFilterByTopicsReq) (*LogResp, error) Debug() Client }
Client is the interface for interacting with Etherscan API
func NewWithClient ¶
type ContractCreatorTxInfo ¶
type ContractCreatorTxInfo struct { ContractAddress string `json:"contractAddress"` ContractCreator string `json:"contractCreator"` TxHash string `json:"txHash"` BlockNumber string `json:"blockNumber"` Timestamp string `json:"timeStamp"` ContractFactory string `json:"contractFactory"` CreationBytecode string `json:"creationBytecode"` }
type ContractCreatorTxInfoResp ¶
type ContractCreatorTxInfoResp BaseResp
func (*ContractCreatorTxInfoResp) GetData ¶
func (r *ContractCreatorTxInfoResp) GetData() ([]ContractCreatorTxInfo, error)
type ContractSourceCode ¶
type ContractSourceCode struct { SourceCode string `json:"SourceCode"` ABI string `json:"ABI"` ContractName string `json:"ContractName"` CompilerVersion string `json:"CompilerVersion"` CompilerType string `json:"CompilerType"` OptimizationUsed string `json:"OptimizationUsed"` Runs string `json:"Runs"` ConstructorArguments string `json:"ConstructorArguments"` EVMVersion string `json:"EVMVersion"` Library string `json:"Library"` ContractFileName string `json:"ContractFileName"` LicenseType string `json:"LicenseType"` Proxy string `json:"Proxy"` Implementation string `json:"Implementation"` SwarmSource string `json:"SwarmSource"` SimilarMatch string `json:"SimilarMatch"` }
type ContractSourcecodeResp ¶
type ContractSourcecodeResp BaseResp
func (*ContractSourcecodeResp) GetData ¶
func (r *ContractSourcecodeResp) GetData() ([]ContractSourceCode, error)
type GetContractABIReq ¶
type GetEventLogsByAddressFilterByTopicsReq ¶
type GetEventLogsByAddressFilterByTopicsReq struct { ChainID uint64 `json:"chainid"` Address string `json:"address"` // the string representing the address to check for logs FromBlock uint64 `json:"fromBlock"` // the integer block number to start searching for logs eg. 12878196 ToBlock uint64 `json:"toBlock"` // the integer block number to stop searching for logs eg. 12879196 Topics map[string]string `json:"topics"` // topic & topicOperator Page *int `json:"page"` // the integer page number, if pagination is enabled Offset *int `json:"offset"` // the number of transactions displayed per page, limited to 1000 records per query, use the page parameter for subsequent records }
type GetEventLogsByAddressReq ¶
type GetEventLogsByAddressReq struct { ChainID uint64 `json:"chainid"` Address string `json:"address"` // the string representing the address to check for logs FromBlock uint64 `json:"fromBlock"` // the integer block number to start searching for logs eg. 12878196 ToBlock uint64 `json:"toBlock"` // the integer block number to stop searching for logs eg. 12879196 Page *int `json:"page"` // the integer page number, if pagination is enabled Offset *int `json:"offset"` // the number of transactions displayed per page, limited to 1000 records per query, use the page parameter for subsequent records }
type GetEventLogsByTopicsReq ¶
type GetEventLogsByTopicsReq struct { ChainID uint64 `json:"chainid"` FromBlock uint64 `json:"fromBlock"` // the integer block number to start searching for logs eg. 12878196 ToBlock uint64 `json:"toBlock"` // the integer block number to stop searching for logs eg. 12879196 Topics map[string]string `json:"topics"` // topic & topicOperator Page *int `json:"page"` // the integer page number, if pagination is enabled Offset *int `json:"offset"` // the number of transactions displayed per page, limited to 1000 records per query, use the page parameter for subsequent records }
type Log ¶
type Log struct { Address string `json:"address"` Topics []string `json:"topics"` Data string `json:"data"` BlockNumber string `json:"blockNumber"` BlockHash string `json:"blockHash"` TimeStamp string `json:"timeStamp"` GasPrice string `json:"gasPrice"` GasUsed string `json:"gasUsed"` LogIndex string `json:"logIndex"` TransactionHash string `json:"transactionHash"` TransactionIndex string `json:"transactionIndex"` }
type StringResp ¶ added in v1.0.4
type VerifySourceCodeReq ¶ added in v1.0.4
type VerifySourceCodeReq struct { ChainID uint64 `json:"chainid"` CodeFormat string `json:"codeformat"` // single file, use solidity-single-file JSON file ( recommended ), use solidity-standard-json-input SourceCode string `json:"sourceCode"` // the Solidity source code ContractAddress string `json:"contractaddress"` // the address your contract is deployed at ContractName string `json:"contractname"` // the name of your contract, such as contracts/Verified.sol:Verified CompilerVersion string `json:"compilerversion"` // compiler version used, such as v0.8.24+commit.e11b9ed9 ConstructorArguments *string `json:"constructorArguements"` // optional, include if your contract uses constructor arguments CompilerMode *string `json:"compilermode"` // for ZK Stack, set to solc/zksync ZkSolcVersion *string `json:"zksolcVersion"` // for ZK Stack, zkSolc version used, such as v1.3.14 }
type VerifySourceCodeResp ¶ added in v1.0.4
type VerifySourceCodeResp BaseResp
func (*VerifySourceCodeResp) GetData ¶ added in v1.0.4
func (r *VerifySourceCodeResp) GetData() (string, error)
Click to show internal directories.
Click to hide internal directories.