Documentation
¶
Index ¶
- Variables
- type AlchemyProvider
- func (p *AlchemyProvider) Appearances(ctx context.Context, query *Query, errorChan chan error) (appChan chan types.Appearance)
- func (p *AlchemyProvider) Count(ctx context.Context, query *Query, errorChan chan error) (monitorChan chan types.Monitor)
- func (p *AlchemyProvider) NewPaginator(query *Query) Paginator
- func (p *AlchemyProvider) PrintProgress() bool
- func (p *AlchemyProvider) SetPrintProgress(print bool)
- func (p *AlchemyProvider) TransactionsByAddress(ctx context.Context, query *Query, errorChan chan error) (txChan chan types.Slurp)
- type AlchemyTx
- type CovalentProvider
- func (p *CovalentProvider) Appearances(ctx context.Context, query *Query, errorChan chan error) (appChan chan types.Appearance)
- func (p *CovalentProvider) Count(ctx context.Context, query *Query, errorChan chan error) (monitorChan chan types.Monitor)
- func (p *CovalentProvider) NewPaginator(query *Query) Paginator
- func (p *CovalentProvider) PrintProgress() bool
- func (p *CovalentProvider) SetPrintProgress(print bool)
- func (p *CovalentProvider) TransactionsByAddress(ctx context.Context, query *Query, errorChan chan error) (txChan chan types.Slurp)
- type EtherscanProvider
- func (p *EtherscanProvider) Appearances(ctx context.Context, query *Query, errorChan chan error) (appChan chan types.Appearance)
- func (p *EtherscanProvider) Count(ctx context.Context, query *Query, errorChan chan error) (monitorChan chan types.Monitor)
- func (p *EtherscanProvider) NewPaginator(query *Query) Paginator
- func (p *EtherscanProvider) PrintProgress() bool
- func (p *EtherscanProvider) SetPrintProgress(print bool)
- func (p *EtherscanProvider) TransactionsByAddress(ctx context.Context, query *Query, errorChan chan error) (txChan chan types.Slurp)
- type KeyAppearance
- type KeyProvider
- func (p *KeyProvider) Appearances(ctx context.Context, query *Query, errorChan chan error) (appChan chan types.Appearance)
- func (p *KeyProvider) Count(ctx context.Context, query *Query, errorChan chan error) (monitorChan chan types.Monitor)
- func (p *KeyProvider) NewPaginator(query *Query) Paginator
- func (p *KeyProvider) PrintProgress() bool
- func (p *KeyProvider) SetPrintProgress(print bool)
- func (p *KeyProvider) TransactionsByAddress(ctx context.Context, query *Query, errorChan chan error) (txChan chan types.Slurp)
- type Meta
- type PageIdPaginator
- func (p *PageIdPaginator) Done() bool
- func (p *PageIdPaginator) NextPage() error
- func (p *PageIdPaginator) Page() any
- func (p *PageIdPaginator) PerPage() int
- func (p *PageIdPaginator) SetDone(done bool)
- func (p *PageIdPaginator) SetNextPage(newPage any) error
- func (p *PageIdPaginator) SetPage(newPage any) error
- type PageNumberPaginator
- func (p *PageNumberPaginator) Done() bool
- func (p *PageNumberPaginator) NextPage() error
- func (p *PageNumberPaginator) Page() any
- func (p *PageNumberPaginator) PerPage() int
- func (p *PageNumberPaginator) SetDone(done bool)
- func (p *PageNumberPaginator) SetNextPage(newPage any) error
- func (p *PageNumberPaginator) SetPage(newPage any) error
- type Paginator
- type Provider
- type Query
- type SlurpedPageItem
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPaginatorDone = errors.New("calling paginator that is in done state")
View Source
var ErrPaginatorNoIdForPage = errors.New("no id for requested page")
Functions ¶
This section is empty.
Types ¶
type AlchemyProvider ¶
type AlchemyProvider struct {
// contains filtered or unexported fields
}
func NewAlchemyProvider ¶
func NewAlchemyProvider(conn *rpc.Connection, chain string) (p *AlchemyProvider, err error)
func (*AlchemyProvider) Appearances ¶
func (p *AlchemyProvider) Appearances(ctx context.Context, query *Query, errorChan chan error) (appChan chan types.Appearance)
func (*AlchemyProvider) NewPaginator ¶
func (p *AlchemyProvider) NewPaginator(query *Query) Paginator
func (*AlchemyProvider) PrintProgress ¶
func (p *AlchemyProvider) PrintProgress() bool
func (*AlchemyProvider) SetPrintProgress ¶
func (p *AlchemyProvider) SetPrintProgress(print bool)
func (*AlchemyProvider) TransactionsByAddress ¶
type AlchemyTx ¶
type CovalentProvider ¶
type CovalentProvider struct {
// contains filtered or unexported fields
}
func NewCovalentProvider ¶
func NewCovalentProvider(conn *rpc.Connection, chain string) (p *CovalentProvider, err error)
func (*CovalentProvider) Appearances ¶
func (p *CovalentProvider) Appearances(ctx context.Context, query *Query, errorChan chan error) (appChan chan types.Appearance)
func (*CovalentProvider) NewPaginator ¶
func (p *CovalentProvider) NewPaginator(query *Query) Paginator
func (*CovalentProvider) PrintProgress ¶
func (p *CovalentProvider) PrintProgress() bool
func (*CovalentProvider) SetPrintProgress ¶
func (p *CovalentProvider) SetPrintProgress(print bool)
func (*CovalentProvider) TransactionsByAddress ¶
type EtherscanProvider ¶
type EtherscanProvider struct {
// contains filtered or unexported fields
}
func NewEtherscanProvider ¶
func NewEtherscanProvider(conn *rpc.Connection) (p *EtherscanProvider, err error)
func (*EtherscanProvider) Appearances ¶
func (p *EtherscanProvider) Appearances(ctx context.Context, query *Query, errorChan chan error) (appChan chan types.Appearance)
func (*EtherscanProvider) NewPaginator ¶
func (p *EtherscanProvider) NewPaginator(query *Query) Paginator
func (*EtherscanProvider) PrintProgress ¶
func (p *EtherscanProvider) PrintProgress() bool
func (*EtherscanProvider) SetPrintProgress ¶
func (p *EtherscanProvider) SetPrintProgress(print bool)
func (*EtherscanProvider) TransactionsByAddress ¶
type KeyAppearance ¶
type KeyAppearance struct {
BlockNumber string `json:"blockNumber"`
TransactionIndex string `json:"transactionIndex"`
}
func (*KeyAppearance) Appearance ¶
func (k *KeyAppearance) Appearance(address base.Address) (a types.Appearance, err error)
type KeyProvider ¶
type KeyProvider struct {
// contains filtered or unexported fields
}
func NewKeyProvider ¶
func NewKeyProvider(conn *rpc.Connection, chain string) (p *KeyProvider, err error)
func (*KeyProvider) Appearances ¶
func (p *KeyProvider) Appearances(ctx context.Context, query *Query, errorChan chan error) (appChan chan types.Appearance)
func (*KeyProvider) NewPaginator ¶
func (p *KeyProvider) NewPaginator(query *Query) Paginator
func (*KeyProvider) PrintProgress ¶
func (p *KeyProvider) PrintProgress() bool
func (*KeyProvider) SetPrintProgress ¶
func (p *KeyProvider) SetPrintProgress(print bool)
func (*KeyProvider) TransactionsByAddress ¶
type PageIdPaginator ¶
type PageIdPaginator struct {
// contains filtered or unexported fields
}
PageIdPaginator can be used for providers that use keyset pagination: i.e. page tokens instead of numbers
func NewPageIdPaginator ¶
func NewPageIdPaginator(page string, firstPage string, perPage int) *PageIdPaginator
func (*PageIdPaginator) Done ¶
func (p *PageIdPaginator) Done() bool
func (*PageIdPaginator) NextPage ¶
func (p *PageIdPaginator) NextPage() error
func (*PageIdPaginator) Page ¶
func (p *PageIdPaginator) Page() any
func (*PageIdPaginator) PerPage ¶
func (p *PageIdPaginator) PerPage() int
func (*PageIdPaginator) SetDone ¶
func (p *PageIdPaginator) SetDone(done bool)
func (*PageIdPaginator) SetNextPage ¶
func (p *PageIdPaginator) SetNextPage(newPage any) error
func (*PageIdPaginator) SetPage ¶
func (p *PageIdPaginator) SetPage(newPage any) error
type PageNumberPaginator ¶
type PageNumberPaginator struct {
// contains filtered or unexported fields
}
PageNumberPaginator is a paginator for providers that use page numbers
func NewPageNumberPaginator ¶
func NewPageNumberPaginator(page uint, firstPage uint, perPage int) *PageNumberPaginator
func (*PageNumberPaginator) Done ¶
func (p *PageNumberPaginator) Done() bool
func (*PageNumberPaginator) NextPage ¶
func (p *PageNumberPaginator) NextPage() error
func (*PageNumberPaginator) Page ¶
func (p *PageNumberPaginator) Page() any
func (*PageNumberPaginator) PerPage ¶
func (p *PageNumberPaginator) PerPage() int
func (*PageNumberPaginator) SetDone ¶
func (p *PageNumberPaginator) SetDone(done bool)
func (*PageNumberPaginator) SetNextPage ¶
func (p *PageNumberPaginator) SetNextPage(newPage any) error
func (*PageNumberPaginator) SetPage ¶
func (p *PageNumberPaginator) SetPage(newPage any) error
type Paginator ¶
type Paginator interface {
// Page returns current page
Page() any
// PerPage returns number of items we request per page
PerPage() int
NextPage() error
// Done returns true if we fetched all pages
Done() bool
SetPage(page any) error
SetNextPage(page any) error
SetDone(bool)
}
Paginator takes care of telling us either which page to fetch next or that we fetched all pages.
type Provider ¶
type Provider interface {
// TransactionsByAddress returns a channel that will be populated with transactions
TransactionsByAddress(context.Context, *Query, chan error) chan types.Slurp
// Appearances returns a channel that will be populated with appearances
Appearances(context.Context, *Query, chan error) chan types.Appearance
// Count returns a channel that will be populated with monitors, one for each address.
// These monitors will only have NRecords set.
Count(context.Context, *Query, chan error) chan types.Monitor
// NewPaginator creates and returns Paginator that should be used for given service
NewPaginator(*Query) Paginator
// PrintProgress returns true if Provider should print progress bar
PrintProgress() bool
SetPrintProgress(bool)
}
Provider is an abstraction over different RPC services, like Etherscan or Key
type Query ¶
type Query struct {
Chain string
Addresses []base.Address
BlockRange []identifiers.Identifier
// Etherscan calls them "modules"
Resources []string
StartPage uint
StartPageId string
PerPage uint
}
type SlurpedPageItem ¶
type SlurpedPageItem struct {
Appearance *types.Appearance
Transaction *types.Slurp
}
SlurpedPageItem carries Transaction (if available) and Appearance (to give more info about Transaction, like Address). Either Transaction or Appearance comes from 3rd party RPC provider. For example, from Etherscan we get Transaction, but from Key - Appearance.
Click to show internal directories.
Click to hide internal directories.