Documentation ¶
Overview ¶
Package fetcher provides fetchers to fetch data from Scribe, BridgeConfig, and Swap.
Index ¶
- func GetDefiLlamaData(ctx context.Context, timestamp int, coinGeckoID string) (*float64, *string)
- type BridgeConfigFetcher
- func (b *BridgeConfigFetcher) GetToken(ctx context.Context, chainID uint32, tokenID *string, blockNumber uint32) (token *bridgeconfig.BridgeConfigV3Token, err error)
- func (b *BridgeConfigFetcher) GetTokenID(ctx context.Context, chainID *big.Int, tokenAddress common.Address) (tokenID *string, err error)
- type ScribeFetcher
- func (s ScribeFetcher) FetchLastIndexed(ctx context.Context, chainID uint32, contractAddress string) (uint64, error)
- func (s ScribeFetcher) FetchLogsInRange(ctx context.Context, chainID uint32, startBlock, endBlock uint64, ...) ([]ethTypes.Log, error)
- func (s ScribeFetcher) FetchTxSender(ctx context.Context, chainID uint32, txHash string) (string, error)
- type SwapFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BridgeConfigFetcher ¶
type BridgeConfigFetcher struct { // contains filtered or unexported fields } // TODO switch bridge config based on block number
BridgeConfigFetcher is the fetcher for the bridge config contract.
func NewBridgeConfigFetcher ¶
func NewBridgeConfigFetcher(bridgeConfigAddress common.Address, bridgeConfigRef *bridgeconfig.BridgeConfigRef) (*BridgeConfigFetcher, error)
NewBridgeConfigFetcher creates a new config fetcher. Backend must be an archive backend.
func (*BridgeConfigFetcher) GetToken ¶
func (b *BridgeConfigFetcher) GetToken(ctx context.Context, chainID uint32, tokenID *string, blockNumber uint32) (token *bridgeconfig.BridgeConfigV3Token, err error)
GetToken gets the token from the bridge config contract. Requires an archived note.
type ScribeFetcher ¶
ScribeFetcher is the fetcher for the events. It uses GQL.
func NewFetcher ¶
func NewFetcher(fetchClient *client.Client) *ScribeFetcher
NewFetcher creates a new fetcher.
func (ScribeFetcher) FetchLastIndexed ¶
func (s ScribeFetcher) FetchLastIndexed(ctx context.Context, chainID uint32, contractAddress string) (uint64, error)
FetchLastIndexed fetches the last indexed block per contract.
func (ScribeFetcher) FetchLogsInRange ¶
func (s ScribeFetcher) FetchLogsInRange(ctx context.Context, chainID uint32, startBlock, endBlock uint64, contractAddress common.Address) ([]ethTypes.Log, error)
FetchLogsInRange fetches logs in a range with the GQL client.
func (ScribeFetcher) FetchTxSender ¶
func (s ScribeFetcher) FetchTxSender(ctx context.Context, chainID uint32, txHash string) (string, error)
FetchTxSender fetches the sender of a transaction.
type SwapFetcher ¶
type SwapFetcher struct {
// contains filtered or unexported fields
}
SwapFetcher is the fetcher for token data from the swap contract.
func NewSwapFetcher ¶
func NewSwapFetcher(swapAddress common.Address, backend bind.ContractBackend) (*SwapFetcher, error)
NewSwapFetcher creates a new swap fetcher. Backend must be an archive backend.
func (*SwapFetcher) GetTokenMetaData ¶
GetTokenMetaData gets the token from the erc20 token contract given a swap contract token id.