Documentation ¶
Index ¶
- Constants
- Variables
- func GetDepositMoments(startheight, endheight uint64, flowClient *client.Client) (depositMoments []cadence.Event, blockNumbers []uint64, err error)
- func GetPurchasedMoments(startheight, endheight uint64, flowClient *client.Client) (purchasedMoments []flow.Event, timestamps []time.Time, blockNumbers []uint64, ...)
- type CryptoKittiesScraper
- type CryptoPunkScraper
- type DepositEvent
- type LooksRareScraper
- type LooksRareScraperConfig
- type LooksRareScraperState
- type MomentPurchasedEvent
- type NBATopshotScraper
- func (scraper *NBATopshotScraper) Close() error
- func (scraper *NBATopshotScraper) FetchTrades() (err error)
- func (scraper *NBATopshotScraper) GetAllDepositMoments(startheight uint64) (depositMoments []cadence.Event, blocknumbers []uint64, err error)
- func (scraper *NBATopshotScraper) GetAllMomentsPurchased(startheight uint64) (purchasedMoments []flow.Event, timestamps []time.Time, blocknumbers []uint64, ...)
- func (scraper *NBATopshotScraper) GetTradeChannel() chan dia.NFTTrade
- type NFTTradeScraper
- type OpenSeaBAYCScraper
- type OpenSeaBAYCScraperConfig
- type OpenSeaBAYCScraperState
- type OpenSeaScraper
- type OpenSeaScraperConfig
- type OpenSeaScraperState
- type TofuNFTScraper
- type TofuNFTScraperConfig
- type TofuNFTScraperState
- type TradeScraper
Constants ¶
const (
CryptoKittiesRefreshDelay = time.Second * 60 * 10
)
const (
CryptoPunkRefreshDelay = time.Second * 60 * 10
)
const (
LooksRare = "LooksRare"
)
const (
OpenSeaBAYC = "OpenSeaBayc"
)
const (
TopshotAddress = "0x0b2a3299cc857e29"
)
Variables ¶
var (
// This string is the identifier of the scraper in conf and state fields in postgres.
OpenSea = ""
)
var (
// This string is the identifier of the scraper in conf and state fields in postgres.
TofuNFT = ""
)
Functions ¶
func GetDepositMoments ¶
func GetDepositMoments(startheight, endheight uint64, flowClient *client.Client) (depositMoments []cadence.Event, blockNumbers []uint64, err error)
GetDepositMoments returns all moments minted between blocks @startheight and @endheight. The difference @endheight-@starthight is limited to 250. The range @startheight, @endheight must not be spread over more than the given @flowClient. https://docs.onflow.org/node-operation/past-sporks/
func GetPurchasedMoments ¶
func GetPurchasedMoments(startheight, endheight uint64, flowClient *client.Client) (purchasedMoments []flow.Event, timestamps []time.Time, blockNumbers []uint64, err error)
GetPurchasedMoments returns all moments minted between blocks @startheight and @endheight. The difference @endheight-@starthight is limited to 250. The range @startheight, @endheight must not be spread over more than the given @flowClient. https://docs.onflow.org/node-operation/past-sporks/
Types ¶
type CryptoKittiesScraper ¶
type CryptoKittiesScraper struct {
// contains filtered or unexported fields
}
func NewCryptoKittiesScraper ¶
func NewCryptoKittiesScraper(rdb *models.RelDB) *CryptoKittiesScraper
func (*CryptoKittiesScraper) Close ¶
func (scraper *CryptoKittiesScraper) Close() error
Close closes any existing API connections
func (*CryptoKittiesScraper) FetchTrades ¶
func (scraper *CryptoKittiesScraper) FetchTrades() error
func (*CryptoKittiesScraper) GetTradeChannel ¶
func (scraper *CryptoKittiesScraper) GetTradeChannel() chan dia.NFTTrade
GetDataChannel returns the scrapers data channel.
type CryptoPunkScraper ¶
type CryptoPunkScraper struct {
// contains filtered or unexported fields
}
func NewCryptoPunkScraper ¶
func NewCryptoPunkScraper(rdb *models.RelDB) *CryptoPunkScraper
func (*CryptoPunkScraper) Close ¶
func (scraper *CryptoPunkScraper) Close() error
Close closes any existing API connections
func (*CryptoPunkScraper) FetchTrades ¶
func (scraper *CryptoPunkScraper) FetchTrades() error
func (*CryptoPunkScraper) GetTradeChannel ¶
func (scraper *CryptoPunkScraper) GetTradeChannel() chan dia.NFTTrade
GetDataChannel returns the scrapers data channel.
type DepositEvent ¶
pub event Deposit(id: UInt64, to: Address?)
func (DepositEvent) String ¶
func (evt DepositEvent) String() string
type LooksRareScraper ¶ added in v1.4.2
type LooksRareScraper struct {
// contains filtered or unexported fields
}
func NewLooksRareScraper ¶ added in v1.4.2
func NewLooksRareScraper(rdb *models.RelDB) *LooksRareScraper
func (*LooksRareScraper) Close ¶ added in v1.4.2
func (s *LooksRareScraper) Close() error
func (*LooksRareScraper) FetchTrades ¶ added in v1.4.2
func (s *LooksRareScraper) FetchTrades() error
FetchTrades searches for trades on-chain by the next block range
func (*LooksRareScraper) GetTradeChannel ¶ added in v1.4.2
func (s *LooksRareScraper) GetTradeChannel() chan dia.NFTTrade
GetDataChannel returns the scrapers data channel.
type LooksRareScraperConfig ¶ added in v1.4.2
type LooksRareScraperConfig struct { // looksrare's exchange contract address on connected blockchain network ContractAddr string `json:"contract_addr"` // indicates the batch size during read the filtered events BatchSize int `json:"batch_size"` // wait for a while between batch retrieval of filtered events WaitPeriod time.Duration `json:"wait_per_batch"` // it enables read contract data from the event's block // height instead of the last state FollowDist int `json:"following_distance_blocks"` // if set it will read erc721 attributes at the currently // processing block UseArchiveNode bool `json:"use_archive_node_fetaures"` // indicates the number of retries to scrape the target // in case of an unexpected error MaxRetry int `json:"max_retry"` // if true the scraper will skip the currently scraping // block when retries reach to the value MaxRetry SkipOnErr bool `json:"skip_on_error"` // it limits read bytes for NFT's metadata from external url MaxMetadataSize int `json:"max_metadata_size"` // it limits duration of read for NFT's metadata from external url MetadataTimeout time.Duration `json:"metadata_timeout"` }
type LooksRareScraperState ¶ added in v1.4.2
type LooksRareScraperState struct { // last block number has been processed LastBlockNum uint64 `json:"last_block_num"` // last transaction index in the block(curr) has been processed LastTxIndex uint `json:"last_tx_index"` // holds the latest error message that occurred while scraping LastErr string `json:"last_error"` // indicates the number of consecutive error, reset on any successful operation ErrCounter int `json:"count_of_error"` }
type MomentPurchasedEvent ¶
pub event MomentPurchased(id: UInt64, price: UFix64, seller: Address?)
func (MomentPurchasedEvent) Id ¶
func (evt MomentPurchasedEvent) Id() uint64
func (MomentPurchasedEvent) Price ¶
func (evt MomentPurchasedEvent) Price() float64
func (MomentPurchasedEvent) Seller ¶
func (evt MomentPurchasedEvent) Seller() *flow.Address
func (MomentPurchasedEvent) String ¶
func (evt MomentPurchasedEvent) String() string
type NBATopshotScraper ¶
type NBATopshotScraper struct {
// contains filtered or unexported fields
}
func NewNBATopshotScraper ¶
func NewNBATopshotScraper(rdb *models.RelDB) *NBATopshotScraper
func (*NBATopshotScraper) Close ¶
func (scraper *NBATopshotScraper) Close() error
Close closes any existing API connections
func (*NBATopshotScraper) FetchTrades ¶
func (scraper *NBATopshotScraper) FetchTrades() (err error)
func (*NBATopshotScraper) GetAllDepositMoments ¶
func (scraper *NBATopshotScraper) GetAllDepositMoments(startheight uint64) (depositMoments []cadence.Event, blocknumbers []uint64, err error)
GetAllDepositMoments returns all moments from genesis to the latest block by iterating through blocks and looking for Deposit events.
func (*NBATopshotScraper) GetAllMomentsPurchased ¶
func (scraper *NBATopshotScraper) GetAllMomentsPurchased(startheight uint64) (purchasedMoments []flow.Event, timestamps []time.Time, blocknumbers []uint64, err error)
GetAllMomentsPurchased returns all moments from genesis to the latest block by iterating through blocks and looking for MomentPurchased events.
func (*NBATopshotScraper) GetTradeChannel ¶
func (scraper *NBATopshotScraper) GetTradeChannel() chan dia.NFTTrade
GetDataChannel returns the scrapers data channel.
type NFTTradeScraper ¶
type OpenSeaBAYCScraper ¶ added in v1.4.2
type OpenSeaBAYCScraper struct {
// contains filtered or unexported fields
}
func NewOpenSeaBAYCScraper ¶ added in v1.4.2
func NewOpenSeaBAYCScraper(rdb *models.RelDB) *OpenSeaBAYCScraper
func (*OpenSeaBAYCScraper) Close ¶ added in v1.4.2
func (s *OpenSeaBAYCScraper) Close() error
func (*OpenSeaBAYCScraper) FetchTrades ¶ added in v1.4.2
func (s *OpenSeaBAYCScraper) FetchTrades() error
FetchTrades searches for trades on-chain by the next block range
func (*OpenSeaBAYCScraper) GetTradeChannel ¶ added in v1.4.2
func (s *OpenSeaBAYCScraper) GetTradeChannel() chan dia.NFTTrade
GetDataChannel returns the scrapers data channel.
type OpenSeaBAYCScraperConfig ¶ added in v1.4.2
type OpenSeaBAYCScraperConfig struct { // opensea's exchange contract address on connected blockchain network ContractAddr string `json:"contract_addr"` // indicates the batch size during read the filtered events BatchSize int `json:"batch_size"` // wait for a while between batch retrieval of filtered events WaitPeriod time.Duration `json:"wait_per_batch"` // it enables read contract data from the event's block // height instead of the last state FollowDist int `json:"following_distance_blocks"` // if set it will read erc721 attributes at the currently // processing block UseArchiveNode bool `json:"use_archive_node_fetaures"` // indicates the number of retries to scrape the target // in case of an unexpected error MaxRetry int `json:"max_retry"` // if true the scraper will skip the currently scraping // block when retries reach to the value MaxRetry SkipOnErr bool `json:"skip_on_error"` // it limits read bytes for NFT's metadata from external url MaxMetadataSize int `json:"max_metadata_size"` // it limits duration of read for NFT's metadata from external url MetadataTimeout time.Duration `json:"metadata_timeout"` }
type OpenSeaBAYCScraperState ¶ added in v1.4.2
type OpenSeaBAYCScraperState struct { // last block number has been processed LastBlockNum uint64 `json:"last_block_num"` // last transaction index in the block(curr) has been processed LastTxIndex uint `json:"last_tx_index"` // holds the latest error message that occurred while scraping LastErr string `json:"last_error"` // indicates the number of consecutive error, reset on any successful operation ErrCounter int `json:"count_of_error"` }
type OpenSeaScraper ¶
type OpenSeaScraper struct {
// contains filtered or unexported fields
}
func NewOpenSeaScraper ¶
func NewOpenSeaScraper(rdb *models.RelDB) *OpenSeaScraper
func (*OpenSeaScraper) Close ¶
func (s *OpenSeaScraper) Close() error
func (*OpenSeaScraper) FetchTrades ¶
func (s *OpenSeaScraper) FetchTrades() error
FetchTrades searches for trades on-chain by the next block range
func (*OpenSeaScraper) GetTradeChannel ¶
func (s *OpenSeaScraper) GetTradeChannel() chan dia.NFTTrade
GetDataChannel returns the scrapers data channel.
type OpenSeaScraperConfig ¶
type OpenSeaScraperConfig struct { // opensea's exchange contract address on connected blockchain network ContractAddr string `json:"contract_addr"` // indicates the batch size during read the filtered events BatchSize int `json:"batch_size"` // wait for a while between batch retrieval of filtered events WaitPeriod time.Duration `json:"wait_per_batch"` // it enables read contract data from the event's block // height instead of the last state FollowDist int `json:"following_distance_blocks"` // if set it will read erc721 attributes at the currently // processing block UseArchiveNode bool `json:"use_archive_node_fetaures"` // indicates the number of retries to scrape the target // in case of an unexpected error MaxRetry int `json:"max_retry"` // if true the scraper will skip the currently scraping // block when retries reach to the value MaxRetry SkipOnErr bool `json:"skip_on_error"` // it limits read bytes for NFT's metadata from external url MaxMetadataSize int `json:"max_metadata_size"` // it limits duration of read for NFT's metadata from external url MetadataTimeout time.Duration `json:"metadata_timeout"` }
type OpenSeaScraperState ¶
type OpenSeaScraperState struct { // last block number has been processed LastBlockNum uint64 `json:"last_block_num"` // last transaction index in the block(curr) has been processed LastTxIndex uint `json:"last_tx_index"` // holds the latest error message that occurred while scraping LastErr string `json:"last_error"` // indicates the number of consecutive error, reset on any successful operation ErrCounter int `json:"count_of_error"` }
type TofuNFTScraper ¶ added in v1.4.2
type TofuNFTScraper struct {
// contains filtered or unexported fields
}
func NewTofuNFTScraper ¶ added in v1.4.2
func NewTofuNFTScraper(rdb *models.RelDB) *TofuNFTScraper
func (*TofuNFTScraper) Close ¶ added in v1.4.2
func (s *TofuNFTScraper) Close() error
func (*TofuNFTScraper) FetchTrades ¶ added in v1.4.2
func (s *TofuNFTScraper) FetchTrades() error
FetchTrades searches for trades on-chain by the next block range
func (*TofuNFTScraper) GetTradeChannel ¶ added in v1.4.2
func (s *TofuNFTScraper) GetTradeChannel() chan dia.NFTTrade
GetDataChannel returns the scrapers data channel.
type TofuNFTScraperConfig ¶ added in v1.4.2
type TofuNFTScraperConfig struct { // tofunft's exchange contract address on connected blockchain network ContractAddr string `json:"contract_addr"` // indicates the batch size during read the filtered events BatchSize int `json:"batch_size"` // wait for a while between batch retrieval of filtered events WaitPeriod time.Duration `json:"wait_per_batch"` // it enables read contract data from the event's block // height instead of the last state FollowDist int `json:"following_distance_blocks"` // if set it will read erc721 attributes at the currently // processing block UseArchiveNode bool `json:"use_archive_node_fetaures"` // indicates the number of retries to scrape the target // in case of an unexpected error MaxRetry int `json:"max_retry"` // if true the scraper will skip the currently scraping // block when retries reach to the value MaxRetry SkipOnErr bool `json:"skip_on_error"` // it limits read bytes for NFT's metadata from external url MaxMetadataSize int `json:"max_metadata_size"` // it limits duration of read for NFT's metadata from external url MetadataTimeout time.Duration `json:"metadata_timeout"` }
type TofuNFTScraperState ¶ added in v1.4.2
type TofuNFTScraperState struct { // last block number has been processed LastBlockNum uint64 `json:"last_block_num"` // last transaction index in the block(curr) has been processed LastTxIndex uint `json:"last_tx_index"` // holds the latest error message that occurred while scraping LastErr string `json:"last_error"` // indicates the number of consecutive error, reset on any successful operation ErrCounter int `json:"count_of_error"` }
type TradeScraper ¶
type TradeScraper struct {
// contains filtered or unexported fields
}