Documentation ¶
Index ¶
- Constants
- func GetDSN() string
- func GetDonationStats(db *sqlx.DB) (decimal.Decimal, decimal.Decimal, error)
- func GetETHPrice(db *sqlx.DB, ts time.Time) (decimal.Decimal, error)
- func GetLatestETHPrice(db *sqlx.DB) (decimal.Decimal, error)
- func HTTPGet(params HTTPParams) ([]byte, error)
- func HTTPPost(params HTTPParams) ([]byte, error)
- func HexStringToDecimal(hexValue string) (decimal.Decimal, error)
- type Block
- type Context
- type ContextKey
- type CrawlerType
- type ERC20
- type Fetchable
- type Fetcher
- type FinalizedBlock
- type HTTPParams
- type Hashable
- type SaleParam
- type TXH
- type Transaction
- type TxByHash
- type TxReceipt
Constants ¶
View Source
const MaxWaitInSeconds = 10
Variables ¶
This section is empty.
Functions ¶
func GetDonationStats ¶
func HTTPGet ¶
func HTTPGet(params HTTPParams) ([]byte, error)
func HTTPPost ¶
func HTTPPost(params HTTPParams) ([]byte, error)
Types ¶
type Block ¶
type Block struct { Hash string `db:"block_hash" json:"hash"` Number uint64 `db:"block_number" json:"-"` Timestamp time.Time `db:"block_time" json:"-"` Transactions []Transaction `db:"-" json:"transactions"` }
func (*Block) UnmarshalJSON ¶
type Context ¶
type Context struct { ABI map[string]abi.ABI BlockCache string CrawlerType CrawlerType DB *sqlx.DB DebugDataStore string ETHRPCURL string MaxWaitInSeconds int ReceivingAddr string SaleParams []SaleParam StableCoins map[string]ERC20 UpdateLastBlock bool }
func GetContext ¶
func (Context) NewTokenPrice ¶
func (Context) TokenSaleLimit ¶
type ContextKey ¶
type ContextKey int
const ( DBHandle ContextKey = iota BuckContext )
func (ContextKey) String ¶
func (ck ContextKey) String() string
type CrawlerType ¶
type CrawlerType int
const ( Latest CrawlerType = iota Finalized OldUnconfirmed )
func (CrawlerType) String ¶
func (ct CrawlerType) String() string
type FinalizedBlock ¶
type FinalizedBlock struct { BaseFeePerGas string `db:"base_fee_per_gas" json:"baseFeePerGas"` GasLimit string `db:"gas_limit" json:"gasLimit"` GasUsed string `db:"gas_used" json:"gasUsed"` Hash string `db:"block_hash" json:"hash"` Number uint64 `db:"block_number" json:"-"` ReceiptsRoot string `db:"receipts_root" json:"receiptsRoot"` Size string `db:"block_size" json:"size"` StateRoot string `db:"state_root" json:"stateRoot"` Timestamp time.Time `db:"block_time" json:"-"` Transactions []string `db:"transactions" json:"transactions"` }
func (*FinalizedBlock) TXMap ¶
func (fb *FinalizedBlock) TXMap() map[string]bool
type HTTPParams ¶
type Transaction ¶
type Transaction struct { TXH From string `db:"address" json:"from"` To string `db:"-" json:"to"` Value string `db:"amount" json:"value"` Gas string `db:"-" json:"gas"` Nonce string `db:"-" json:"nonce"` Input string `db:"-" json:"input"` Type string `db:"-" json:"type"` Status string `db:"status" json:"-"` Asset string `db:"asset" json:"-"` Price string `db:"price" json:"-"` Tokens decimal.Decimal `db:"tokens" json:"-"` USDAmount decimal.Decimal `db:"usd_amount" json:"-"` BlockNumber uint64 `db:"block_number" json:"-"` BlockHash string `db:"block_hash" json:"blockhash"` BlockTime time.Time `db:"block_time" json:"-"` }
type TxByHash ¶
type TxByHash struct { BlockHash string `json:"blockHash"` BlockNumber uint64 `json:"blockNumber"` From string `json:"from"` Hash string `json:"hash"` To string `json:"to"` TransactionIndex uint64 `json:"transactionIndex"` FBBlockTime time.Time FBBlockHash string FBContainsTx bool }
func (*TxByHash) UnmarshalJSON ¶
type TxReceipt ¶
type TxReceipt struct { BlockHash string `json:"blockHash"` BlockNumber string `json:"blockNumber"` ContractAddress string `json:"contractAddress"` CumulativeGasUsed string `json:"cumulativeGasUsed"` EffectiveGasPrice string `json:"effectiveGasPrice"` From string `json:"from"` GasUsed string `json:"gasUsed"` Status string `json:"status"` To string `json:"to"` TransactionHash string `json:"transactionHash"` TransactionIndex string `json:"transactionIndex"` Type string `json:"type"` }
Click to show internal directories.
Click to hide internal directories.