Documentation
¶
Index ¶
- Constants
- Variables
- type AlchemyRawContract
- type AlchemyTransfer
- type GetAssetTransfersParams
- type GetAssetTransfersResult
- type Provider
- func (p *Provider) BatchBlockByNumber(numberList []common.BigInt) ([]*common.Block, error)
- func (p *Provider) BatchTransactionByHash(hashList []common.Hash) (common.Transactions, error)
- func (p *Provider) CallContract(address common.Address, abi *abi.ABI, method string, args ...any) ([]any, error)
- func (p *Provider) EstimateGas(address common.Address, from common.Address, input []byte) (uint64, error)
- func (p *Provider) GetAssetTransfers(params GetAssetTransfersParams) (*GetAssetTransfersResult, error)
- func (p *Provider) GetBalance(addr common.Address) (common.BigInt, error)
- func (p *Provider) GetBlockByHash(hash common.Hash) (*common.Block, error)
- func (p *Provider) GetBlockByNumber(number common.BigInt) (*common.Block, error)
- func (p *Provider) GetBlockHeight() (uint64, error)
- func (p *Provider) GetCode(addr common.Address) ([]byte, error)
- func (p *Provider) GetGasPrice() (common.BigInt, error)
- func (p *Provider) GetNetwork() (common.BigInt, error)
- func (p *Provider) GetSigner() (types.Signer, error)
- func (p *Provider) GetType() string
- func (p *Provider) SendTransaction(txnReq *common.TxnRequest) (common.Hash, error)
- func (p *Provider) SubscribeNewHead(ch chan<- *common.Header) (ethereum.Subscription, error)
Constants ¶
View Source
const ( // ProviderLocal represents a local node provider such as Geth, Hardhat etc. ProviderLocal string = "local" // ProviderAlchemy represents blockchain provider ProviderAlchemy (https://www.alchemy.com/) ProviderAlchemy = "alchemy" // DefaultTimeout is the default value for request timeout DefaultTimeout = 30 * time.Second )
Variables ¶
View Source
var (
ErrProviderNotSupport = errors.New("provider does not support this vendor-specific api")
)
Functions ¶
This section is empty.
Types ¶
type AlchemyRawContract ¶
type AlchemyTransfer ¶
type AlchemyTransfer struct { Category string `json:"category"` BlockNum string `json:"blockNum"` From string `json:"from"` To string `json:"to"` Value float64 `json:"value"` TokenId string `json:"tokenId"` Asset string `json:"asset"` UniqueId string `json:"uniqueId"` Hash string `json:"hash"` RawContract *AlchemyRawContract `json:"rawContract"` }
type GetAssetTransfersParams ¶
type GetAssetTransfersParams struct { FromBlock string `json:"fromBlock,omitempty"` ToBlock string `json:"toBlock,omitempty"` FromAddress string `json:"fromAddress,omitempty"` ToAddress string `json:"toAddress,omitempty"` ContractAddresses []string `json:"contractAddresses,omitempty"` Category []string `json:"category,omitempty"` Order string `json:"order,omitempty"` WithMetadata bool `json:"withMetadata,omitempty"` ExcludeZeroValue bool `json:"excludeZeroValue,omitempty"` MaxCount string `json:"maxCount,omitempty"` PageKey string `json:"pageKey,omitempty"` }
type GetAssetTransfersResult ¶
type GetAssetTransfersResult struct { PageKey string `json:"pageKey"` Transfers []*AlchemyTransfer `json:"transfers"` }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) BatchBlockByNumber ¶ added in v0.2.1
func (*Provider) BatchTransactionByHash ¶
func (*Provider) CallContract ¶
func (*Provider) EstimateGas ¶
func (*Provider) GetAssetTransfers ¶
func (p *Provider) GetAssetTransfers(params GetAssetTransfersParams) (*GetAssetTransfersResult, error)
func (*Provider) GetBalance ¶
func (*Provider) GetBlockByHash ¶
func (*Provider) GetBlockByNumber ¶
func (*Provider) GetBlockHeight ¶
func (*Provider) SendTransaction ¶
Click to show internal directories.
Click to hide internal directories.