base

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 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 BaseClient

type BaseClient struct {
	Verbose       bool
	BeforeRequest func(name, module, action string, param map[string]interface{}) error
	AfterRequest  func(name, module, action string, param map[string]interface{}, outcome interface{}, requestErr error)
	// contains filtered or unexported fields
}

func NewBaseClient

func NewBaseClient(apiKey string, baseUrl string, verbose bool, timeout time.Duration) *BaseClient

func NewCustomizedClient

func NewCustomizedClient(cc CustomizationClient) *BaseClient

func (*BaseClient) Call

func (bc *BaseClient) Call(name, module, action, apiUrl string, param map[string]interface{}, outcome interface{}) (err error)

func (*BaseClient) CraftEtherScanURL

func (bc *BaseClient) CraftEtherScanURL(module, action string, param map[string]interface{}) (URL string)

func (*BaseClient) CraftOkLinkURL

func (bc *BaseClient) CraftOkLinkURL(apiUrl string) (URL string)

func (*BaseClient) CraftSolScanURL

func (bc *BaseClient) CraftSolScanURL(apiUrl string, param map[string]interface{}) (URL string)

func (*BaseClient) HandleEtherscanResponse

func (bc *BaseClient) HandleEtherscanResponse(action string, data []byte, outcome interface{}) error

func (*BaseClient) HandleOklinkResponse

func (bc *BaseClient) HandleOklinkResponse(data []byte, outcome interface{}) error

func (*BaseClient) HandleSolScanResponse

func (bc *BaseClient) HandleSolScanResponse(data []byte, outcome interface{}) error

type BlockRewards

type BlockRewards struct {
	BlockNumber int            `json:"blockNumber,string"`
	TimeStamp   common.Time    `json:"timeStamp"`
	BlockMiner  string         `json:"blockMiner"`
	BlockReward *common.BigInt `json:"blockReward"`
	Uncles      []struct {
		Miner         string         `json:"miner"`
		UnclePosition int            `json:"unclePosition,string"`
		BlockReward   *common.BigInt `json:"blockreward"`
	} `json:"uncles"`
	UncleInclusionReward *common.BigInt `json:"uncleInclusionReward"`
}

type ContractSource

type ContractSource struct {
	SourceCode           string `json:"SourceCode"`
	ABI                  string `json:"ABI"`
	ContractName         string `json:"ContractName"`
	CompilerVersion      string `json:"CompilerVersion"`
	OptimizationUsed     int    `json:"OptimizationUsed,string"`
	Runs                 int    `json:"Runs,string"`
	ConstructorArguments string `json:"ConstructorArguments"`
	EVMVersion           string `json:"EVMVersion"`
	Library              string `json:"Library"`
	LicenseType          string `json:"LicenseType"`
	Proxy                string `json:"Proxy"`
	Implementation       string `json:"Implementation"`
	SwarmSource          string `json:"SwarmSource"`
}

type CustomizationClient

type CustomizationClient struct {
	Timeout       time.Duration
	Key           string
	BaseURL       string
	Verbose       bool
	Client        *http.Client
	BeforeRequest func(name, module, action string, param map[string]interface{}) error
	AfterRequest  func(name, module, action string, param map[string]interface{}, outcome interface{}, requestErr error)
}

type ERC1155Transfer

type ERC1155Transfer struct {
	BlockNumber       int            `json:"blockNumber,string"`
	TimeStamp         common.Time    `json:"timeStamp"`
	Hash              string         `json:"hash"`
	Nonce             int            `json:"nonce,string"`
	BlockHash         string         `json:"blockHash"`
	From              string         `json:"from"`
	ContractAddress   string         `json:"contractAddress"`
	To                string         `json:"to"`
	TokenID           *common.BigInt `json:"tokenID"`
	TokenName         string         `json:"tokenName"`
	TokenSymbol       string         `json:"tokenSymbol"`
	TokenDecimal      uint8          `json:"tokenDecimal,string"`
	TokenValue        uint8          `json:"tokenValue,string"`
	TransactionIndex  int            `json:"transactionIndex,string"`
	Gas               int            `json:"gas,string"`
	GasPrice          *common.BigInt `json:"gasPrice"`
	GasUsed           int            `json:"gasUsed,string"`
	CumulativeGasUsed int            `json:"cumulativeGasUsed,string"`
	Input             string         `json:"input"`
	Confirmations     int            `json:"confirmations,string"`
}

type ERC20Transfer

type ERC20Transfer struct {
	BlockNumber       int            `json:"blockNumber,string"`
	TimeStamp         common.Time    `json:"timeStamp"`
	Hash              string         `json:"hash"`
	Nonce             int            `json:"nonce,string"`
	BlockHash         string         `json:"blockHash"`
	From              string         `json:"from"`
	ContractAddress   string         `json:"contractAddress"`
	To                string         `json:"to"`
	Value             *common.BigInt `json:"value"`
	TokenName         string         `json:"tokenName"`
	TokenSymbol       string         `json:"tokenSymbol"`
	TokenDecimal      uint8          `json:"tokenDecimal,string"`
	TransactionIndex  int            `json:"transactionIndex,string"`
	Gas               int            `json:"gas,string"`
	GasPrice          *common.BigInt `json:"gasPrice"`
	GasUsed           int            `json:"gasUsed,string"`
	CumulativeGasUsed int            `json:"cumulativeGasUsed,string"`
	Input             string         `json:"input"`
	Confirmations     int            `json:"confirmations,string"`
}

type ERC721Transfer

type ERC721Transfer struct {
	BlockNumber       int            `json:"blockNumber,string"`
	TimeStamp         common.Time    `json:"timeStamp"`
	Hash              string         `json:"hash"`
	Nonce             int            `json:"nonce,string"`
	BlockHash         string         `json:"blockHash"`
	From              string         `json:"from"`
	ContractAddress   string         `json:"contractAddress"`
	To                string         `json:"to"`
	TokenID           *common.BigInt `json:"tokenID"`
	TokenName         string         `json:"tokenName"`
	TokenSymbol       string         `json:"tokenSymbol"`
	TokenDecimal      uint8          `json:"tokenDecimal,string"`
	TransactionIndex  int            `json:"transactionIndex,string"`
	Gas               int            `json:"gas,string"`
	GasPrice          *common.BigInt `json:"gasPrice"`
	GasUsed           int            `json:"gasUsed,string"`
	CumulativeGasUsed int            `json:"cumulativeGasUsed,string"`
	Input             string         `json:"input"`
	Confirmations     int            `json:"confirmations,string"`
}

type EtherscanEnvelope

type EtherscanEnvelope struct {
	Status  int             `json:"status,string"`
	Message string          `json:"message"`
	Result  json.RawMessage `json:"result"`
}

type ExecutionStatus

type ExecutionStatus struct {
	IsError        int    `json:"isError,string"`
	ErrDescription string `json:"errDescription"`
}

type GasPrices

type GasPrices struct {
	LastBlock            int
	SafeGasPrice         float64
	ProposeGasPrice      float64
	FastGasPrice         float64
	SuggestBaseFeeInGwei float64   `json:"suggestBaseFee"`
	GasUsedRatio         []float64 `json:"gasUsedRatio"`
}

func (*GasPrices) UnmarshalJSON

func (gp *GasPrices) UnmarshalJSON(data []byte) error

type InternalTx

type InternalTx struct {
	BlockNumber     int            `json:"blockNumber,string"`
	TimeStamp       common.Time    `json:"timeStamp"`
	Hash            string         `json:"hash"`
	From            string         `json:"from"`
	To              string         `json:"to"`
	Value           *common.BigInt `json:"value"`
	ContractAddress string         `json:"contractAddress"`
	Input           string         `json:"input"`
	Type            string         `json:"type"`
	Gas             int            `json:"gas,string"`
	GasUsed         int            `json:"gasUsed,string"`
	TraceID         string         `json:"traceId"`
	IsError         int            `json:"isError,string"`
	ErrCode         string         `json:"errCode"`
}

type LatestPrice

type LatestPrice struct {
	ETHBTC          float64     `json:"ethbtc,string"`
	ETHBTCTimestamp common.Time `json:"ethbtc_timestamp"`
	ETHUSD          float64     `json:"ethusd,string"`
	ETHUSDTimestamp common.Time `json:"ethusd_timestamp"`
}

type Log

type Log struct {
	Address         string   `json:"address"`
	Topics          []string `json:"topics"`
	Data            string   `json:"data"`
	BlockNumber     string   `json:"blockNumber"`
	TransactionHash string   `json:"transactionHash"`
	BlockHash       string   `json:"blockHash"`
	LogIndex        string   `json:"logIndex"`
	Removed         bool     `json:"removed"`
}

type MinedBlock

type MinedBlock struct {
	BlockNumber int            `json:"blockNumber,string"`
	TimeStamp   common.Time    `json:"timeStamp"`
	BlockReward *common.BigInt `json:"blockReward"`
}

type NormalTx

type NormalTx struct {
	BlockNumber       int            `json:"blockNumber,string"`
	TimeStamp         common.Time    `json:"timeStamp"`
	Hash              string         `json:"hash"`
	Nonce             int            `json:"nonce,string"`
	BlockHash         string         `json:"blockHash"`
	TransactionIndex  int            `json:"transactionIndex,string"`
	From              string         `json:"from"`
	To                string         `json:"to"`
	Value             *common.BigInt `json:"value"`
	Gas               int            `json:"gas,string"`
	GasPrice          *common.BigInt `json:"gasPrice"`
	IsError           int            `json:"isError,string"`
	TxReceiptStatus   string         `json:"txreceipt_status"`
	Input             string         `json:"input"`
	ContractAddress   string         `json:"contractAddress"`
	CumulativeGasUsed int            `json:"cumulativeGasUsed,string"`
	GasUsed           int            `json:"gasUsed,string"`
	Confirmations     int            `json:"confirmations,string"`
	FunctionName      string         `json:"functionName"`
	MethodId          string         `json:"methodId"`
}

type OklinkEnvelope

type OklinkEnvelope struct {
	Code string          `json:"code"`
	Msg  string          `json:"msg"`
	Data json.RawMessage `json:"data"`
}

type SolScanEnvelope

type SolScanEnvelope struct {
	Success bool            `json:"success"`
	Data    json.RawMessage `json:"data"`
	Errors  struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
	} `json:"errors"`
}

type SwapTransaction

type SwapTransaction struct {
	BlockNumber       int            `json:"blockNumber,string"`
	TimeStamp         common.Time    `json:"timeStamp"`
	Hash              string         `json:"hash"`
	Nonce             int            `json:"nonce,string"`
	BlockHash         string         `json:"blockHash"`
	From              string         `json:"from"`
	ContractAddress   string         `json:"contractAddress"`
	To                string         `json:"to"`
	TokenID           *common.BigInt `json:"tokenID"`
	TokenName         string         `json:"tokenName"`
	TokenSymbol       string         `json:"tokenSymbol"`
	TokenDecimal      uint8          `json:"tokenDecimal,string"`
	TokenValue        uint8          `json:"tokenValue,string"`
	TransactionIndex  int            `json:"transactionIndex,string"`
	Gas               int            `json:"gas,string"`
	GasPrice          *common.BigInt `json:"gasPrice"`
	GasUsed           int            `json:"gasUsed,string"`
	CumulativeGasUsed int            `json:"cumulativeGasUsed,string"`
	Input             string         `json:"input"`
	MethodId          string         `json:"methodId"`
	FunctionName      string         `json:"functionName"`
	Confirmations     int            `json:"confirmations,string"`
}

Jump to

Keyboard shortcuts

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