Documentation
¶
Index ¶
- func GetCreationTime(playerResp []byte) (time.Time, error)
- func GetCreatorAddress(playerResp []byte) (common.Address, error)
- func GetCryptopunkAddress(punkResp []byte) (common.Address, error)
- func GetCryptopunkCreationTime(punkResp []byte) (time.Time, error)
- type Club
- type CryptopunkOutput
- type CryptopunkScraper
- func (scraper *CryptopunkScraper) Close() error
- func (scraper *CryptopunkScraper) FetchData() (nfts []dia.NFT, err error)
- func (scraper *CryptopunkScraper) GetDataChannel() chan dia.NFT
- func (scraper *CryptopunkScraper) GetOpenSeaPunk(index *big.Int) ([]CryptopunkTraits, common.Address, time.Time, error)
- func (scraper *CryptopunkScraper) GetTotalSupply() (*big.Int, error)
- func (scraper *CryptopunkScraper) TokenByIndex(index *big.Int) (common.Address, error)
- func (scraper *CryptopunkScraper) UpdateNFT() error
- type CryptopunkTraits
- type NFTDataScraper
- type NFTScraper
- type OpenSeaCryptopunkResponse
- type OpenSeaResponse
- type SorareCard
- type SorareClub
- type SorareOutput
- type SorarePlayer
- type SorareScraper
- func (scraper *SorareScraper) Close() error
- func (scraper *SorareScraper) FetchData() ([]dia.NFT, error)
- func (scraper *SorareScraper) GetCard(index *big.Int) (SorareCard, error)
- func (scraper *SorareScraper) GetClub(index uint16) (SorareClub, error)
- func (scraper *SorareScraper) GetDataChannel() chan dia.NFT
- func (scraper *SorareScraper) GetOpenSeaPlayer(index *big.Int) ([]SorareTrait, common.Address, time.Time, error)
- func (scraper *SorareScraper) GetPlayer(index *big.Int) (SorarePlayer, error)
- func (scraper *SorareScraper) GetTokenURI(index *big.Int) (string, error)
- func (scraper *SorareScraper) GetTotalSupply() (*big.Int, error)
- func (scraper *SorareScraper) TokenByIndex(index *big.Int) (*big.Int, error)
- func (scraper *SorareScraper) UpdateNFT() error
- type SorareTrait
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCreationTime ¶
GetCreationTime returns the creation time from Opensea
func GetCreatorAddress ¶
GetCreatorAddress returns the creator address from Opensea
func GetCryptopunkAddress ¶
GetCryptopunkAddress returns the creator address from Opensea
Types ¶
type CryptopunkOutput ¶
type CryptopunkOutput struct {
Traits []CryptopunkTraits `structs:",flatten"`
}
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) FetchData ¶
func (scraper *CryptopunkScraper) FetchData() (nfts []dia.NFT, err error)
func (*CryptopunkScraper) GetDataChannel ¶
func (scraper *CryptopunkScraper) GetDataChannel() chan dia.NFT
GetDataChannel returns the scrapers data channel.
func (*CryptopunkScraper) GetOpenSeaPunk ¶
func (scraper *CryptopunkScraper) GetOpenSeaPunk(index *big.Int) ([]CryptopunkTraits, common.Address, time.Time, error)
GetOpenSeaPunk returns the scraped data from Opensea for a given punk
func (*CryptopunkScraper) GetTotalSupply ¶
func (scraper *CryptopunkScraper) GetTotalSupply() (*big.Int, error)
GetTotalSupply returns the total supply of the NFT from on-chain.
func (*CryptopunkScraper) TokenByIndex ¶
TokenByIndex returns the address of a punk whose id is passed as a parameter from on-chain.
func (*CryptopunkScraper) UpdateNFT ¶
func (scraper *CryptopunkScraper) UpdateNFT() error
type CryptopunkTraits ¶
type CryptopunkTraits struct {
TraitType string `json:"trait_type"`
Value string `json:"value"`
DisplayType interface{} `json:"display_type"`
MaxValue interface{} `json:"max_value"`
TraitCount int `json:"trait_count"`
Order interface{} `json:"order"`
}
func GetCryptopunkTraits ¶
func GetCryptopunkTraits(punkResp []byte) ([]CryptopunkTraits, error)
GetCryptopunkTraits returns the parsed traits data from Opensea for a given punk
type NFTDataScraper ¶
type NFTScraper ¶
type NFTScraper struct {
// contains filtered or unexported fields
}
type OpenSeaCryptopunkResponse ¶
type OpenSeaCryptopunkResponse struct {
ID int `json:"id"`
TokenID string `json:"token_id"`
NumSales int `json:"num_sales"`
BackgroundColor interface{} `json:"background_color"`
ImageURL string `json:"image_url"`
ImagePreviewURL string `json:"image_preview_url"`
ImageThumbnailURL string `json:"image_thumbnail_url"`
ImageOriginalURL string `json:"image_original_url"`
AnimationURL interface{} `json:"animation_url"`
AnimationOriginalURL interface{} `json:"animation_original_url"`
Name string `json:"name"`
Description interface{} `json:"description"`
ExternalLink string `json:"external_link"`
AssetContract struct {
Address string `json:"address"`
AssetContractType string `json:"asset_contract_type"`
CreatedDate string `json:"created_date"`
Name string `json:"name"`
NftVersion string `json:"nft_version"`
OpenseaVersion interface{} `json:"opensea_version"`
Owner interface{} `json:"owner"`
SchemaName string `json:"schema_name"`
Symbol string `json:"symbol"`
TotalSupply interface{} `json:"total_supply"`
Description string `json:"description"`
ExternalLink string `json:"external_link"`
ImageURL string `json:"image_url"`
DefaultToFiat bool `json:"default_to_fiat"`
DevBuyerFeeBasisPoints int `json:"dev_buyer_fee_basis_points"`
DevSellerFeeBasisPoints int `json:"dev_seller_fee_basis_points"`
OnlyProxiedTransfers bool `json:"only_proxied_transfers"`
OpenseaBuyerFeeBasisPoints int `json:"opensea_buyer_fee_basis_points"`
OpenseaSellerFeeBasisPoints int `json:"opensea_seller_fee_basis_points"`
BuyerFeeBasisPoints int `json:"buyer_fee_basis_points"`
SellerFeeBasisPoints int `json:"seller_fee_basis_points"`
PayoutAddress interface{} `json:"payout_address"`
} `json:"asset_contract"`
Owner struct {
User interface{} `json:"user"`
ProfileImgURL string `json:"profile_img_url"`
Address string `json:"address"`
Config string `json:"config"`
DiscordID string `json:"discord_id"`
} `json:"owner"`
Permalink string `json:"permalink"`
Collection struct {
PaymentTokens []struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Address string `json:"address"`
ImageURL string `json:"image_url"`
Name string `json:"name"`
Decimals int `json:"decimals"`
EthPrice float64 `json:"eth_price"`
UsdPrice float64 `json:"usd_price"`
} `json:"payment_tokens"`
PrimaryAssetContracts []struct {
Address string `json:"address"`
AssetContractType string `json:"asset_contract_type"`
CreatedDate string `json:"created_date"`
Name string `json:"name"`
NftVersion string `json:"nft_version"`
OpenseaVersion interface{} `json:"opensea_version"`
Owner interface{} `json:"owner"`
SchemaName string `json:"schema_name"`
Symbol string `json:"symbol"`
TotalSupply interface{} `json:"total_supply"`
Description string `json:"description"`
ExternalLink string `json:"external_link"`
ImageURL string `json:"image_url"`
DefaultToFiat bool `json:"default_to_fiat"`
DevBuyerFeeBasisPoints int `json:"dev_buyer_fee_basis_points"`
DevSellerFeeBasisPoints int `json:"dev_seller_fee_basis_points"`
OnlyProxiedTransfers bool `json:"only_proxied_transfers"`
OpenseaBuyerFeeBasisPoints int `json:"opensea_buyer_fee_basis_points"`
OpenseaSellerFeeBasisPoints int `json:"opensea_seller_fee_basis_points"`
BuyerFeeBasisPoints int `json:"buyer_fee_basis_points"`
SellerFeeBasisPoints int `json:"seller_fee_basis_points"`
PayoutAddress interface{} `json:"payout_address"`
} `json:"primary_asset_contracts"`
Traits struct {
} `json:"traits"`
Stats struct {
SevenDayVolume float64 `json:"seven_day_volume"`
TotalVolume float64 `json:"total_volume"`
SevenDayChange float64 `json:"seven_day_change"`
SevenDaySales float64 `json:"seven_day_sales"`
TotalSales float64 `json:"total_sales"`
TotalSupply float64 `json:"total_supply"`
Count float64 `json:"count"`
NumOwners int `json:"num_owners"`
SevenDayAveragePrice float64 `json:"seven_day_average_price"`
AveragePrice float64 `json:"average_price"`
NumReports int `json:"num_reports"`
MarketCap float64 `json:"market_cap"`
} `json:"stats"`
BannerImageURL string `json:"banner_image_url"`
ChatURL interface{} `json:"chat_url"`
CreatedDate string `json:"created_date"`
DefaultToFiat bool `json:"default_to_fiat"`
Description string `json:"description"`
DevBuyerFeeBasisPoints string `json:"dev_buyer_fee_basis_points"`
DevSellerFeeBasisPoints string `json:"dev_seller_fee_basis_points"`
DiscordURL string `json:"discord_url"`
DisplayData struct {
CardDisplayStyle string `json:"card_display_style"`
} `json:"display_data"`
ExternalURL string `json:"external_url"`
Featured bool `json:"featured"`
FeaturedImageURL string `json:"featured_image_url"`
Hidden bool `json:"hidden"`
SafelistRequestStatus string `json:"safelist_request_status"`
ImageURL string `json:"image_url"`
IsSubjectToWhitelist bool `json:"is_subject_to_whitelist"`
LargeImageURL string `json:"large_image_url"`
MediumUsername interface{} `json:"medium_username"`
Name string `json:"name"`
OnlyProxiedTransfers bool `json:"only_proxied_transfers"`
OpenseaBuyerFeeBasisPoints string `json:"opensea_buyer_fee_basis_points"`
OpenseaSellerFeeBasisPoints string `json:"opensea_seller_fee_basis_points"`
PayoutAddress interface{} `json:"payout_address"`
RequireEmail bool `json:"require_email"`
ShortDescription interface{} `json:"short_description"`
Slug string `json:"slug"`
TelegramURL interface{} `json:"telegram_url"`
TwitterUsername string `json:"twitter_username"`
InstagramUsername interface{} `json:"instagram_username"`
WikiURL interface{} `json:"wiki_url"`
} `json:"collection"`
Decimals interface{} `json:"decimals"`
TokenMetadata string `json:"token_metadata"`
SellOrders interface{} `json:"sell_orders"`
Creator interface{} `json:"creator"`
Traits []CryptopunkTraits `json:"traits"`
LastSale struct {
Asset struct {
TokenID string `json:"token_id"`
Decimals interface{} `json:"decimals"`
} `json:"asset"`
AssetBundle interface{} `json:"asset_bundle"`
EventType string `json:"event_type"`
EventTimestamp string `json:"event_timestamp"`
AuctionType interface{} `json:"auction_type"`
TotalPrice string `json:"total_price"`
PaymentToken struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Address string `json:"address"`
ImageURL string `json:"image_url"`
Name string `json:"name"`
Decimals int `json:"decimals"`
EthPrice string `json:"eth_price"`
UsdPrice string `json:"usd_price"`
} `json:"payment_token"`
Transaction struct {
BlockHash string `json:"block_hash"`
BlockNumber string `json:"block_number"`
FromAccount struct {
User interface{} `json:"user"`
ProfileImgURL string `json:"profile_img_url"`
Address string `json:"address"`
Config string `json:"config"`
DiscordID string `json:"discord_id"`
} `json:"from_account"`
ID int `json:"id"`
Timestamp string `json:"timestamp"`
ToAccount struct {
User interface{} `json:"user"`
ProfileImgURL string `json:"profile_img_url"`
Address string `json:"address"`
Config string `json:"config"`
DiscordID string `json:"discord_id"`
} `json:"to_account"`
TransactionHash string `json:"transaction_hash"`
TransactionIndex string `json:"transaction_index"`
} `json:"transaction"`
CreatedDate string `json:"created_date"`
Quantity string `json:"quantity"`
} `json:"last_sale"`
TopBid interface{} `json:"top_bid"`
ListingDate interface{} `json:"listing_date"`
IsPresale bool `json:"is_presale"`
TransferFeePaymentToken interface{} `json:"transfer_fee_payment_token"`
TransferFee interface{} `json:"transfer_fee"`
RelatedAssets []interface{} `json:"related_assets"`
Orders []interface{} `json:"orders"`
Auctions []interface{} `json:"auctions"`
SupportsWyvern bool `json:"supports_wyvern"`
TopOwnerships []struct {
Owner struct {
User interface{} `json:"user"`
ProfileImgURL string `json:"profile_img_url"`
Address string `json:"address"`
Config string `json:"config"`
DiscordID string `json:"discord_id"`
} `json:"owner"`
Quantity string `json:"quantity"`
} `json:"top_ownerships"`
Ownership interface{} `json:"ownership"`
HighestBuyerCommitment interface{} `json:"highest_buyer_commitment"`
}
type OpenSeaResponse ¶
type OpenSeaResponse struct {
ID int `json:"id"`
TokenID string `json:"token_id"`
NumSales int `json:"num_sales"`
BackgroundColor string `json:"background_color"`
ImageURL string `json:"image_url"`
ImagePreviewURL string `json:"image_preview_url"`
ImageThumbnailURL string `json:"image_thumbnail_url"`
ImageOriginalURL string `json:"image_original_url"`
AnimationURL interface{} `json:"animation_url"`
AnimationOriginalURL interface{} `json:"animation_original_url"`
Name string `json:"name"`
Description string `json:"description"`
ExternalLink string `json:"external_link"`
AssetContract struct {
Address string `json:"address"`
AssetContractType string `json:"asset_contract_type"`
CreatedDate string `json:"created_date"`
Name string `json:"name"`
NftVersion string `json:"nft_version"`
OpenseaVersion interface{} `json:"opensea_version"`
Owner int `json:"owner"`
SchemaName string `json:"schema_name"`
Symbol string `json:"symbol"`
TotalSupply interface{} `json:"total_supply"`
Description string `json:"description"`
ExternalLink string `json:"external_link"`
ImageURL string `json:"image_url"`
DefaultToFiat bool `json:"default_to_fiat"`
DevBuyerFeeBasisPoints int `json:"dev_buyer_fee_basis_points"`
DevSellerFeeBasisPoints int `json:"dev_seller_fee_basis_points"`
OnlyProxiedTransfers bool `json:"only_proxied_transfers"`
OpenseaBuyerFeeBasisPoints int `json:"opensea_buyer_fee_basis_points"`
OpenseaSellerFeeBasisPoints int `json:"opensea_seller_fee_basis_points"`
BuyerFeeBasisPoints int `json:"buyer_fee_basis_points"`
SellerFeeBasisPoints int `json:"seller_fee_basis_points"`
PayoutAddress string `json:"payout_address"`
} `json:"asset_contract"`
Owner struct {
User interface{} `json:"user"`
ProfileImgURL string `json:"profile_img_url"`
Address string `json:"address"`
Config string `json:"config"`
DiscordID string `json:"discord_id"`
} `json:"owner"`
Permalink string `json:"permalink"`
Collection struct {
PaymentTokens []struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Address string `json:"address"`
ImageURL string `json:"image_url"`
Name string `json:"name"`
Decimals int `json:"decimals"`
EthPrice float64 `json:"eth_price"`
UsdPrice float64 `json:"usd_price"`
} `json:"payment_tokens"`
PrimaryAssetContracts []struct {
Address string `json:"address"`
AssetContractType string `json:"asset_contract_type"`
CreatedDate string `json:"created_date"`
Name string `json:"name"`
NftVersion string `json:"nft_version"`
OpenseaVersion interface{} `json:"opensea_version"`
Owner int `json:"owner"`
SchemaName string `json:"schema_name"`
Symbol string `json:"symbol"`
TotalSupply interface{} `json:"total_supply"`
Description string `json:"description"`
ExternalLink string `json:"external_link"`
ImageURL string `json:"image_url"`
DefaultToFiat bool `json:"default_to_fiat"`
DevBuyerFeeBasisPoints int `json:"dev_buyer_fee_basis_points"`
DevSellerFeeBasisPoints int `json:"dev_seller_fee_basis_points"`
OnlyProxiedTransfers bool `json:"only_proxied_transfers"`
OpenseaBuyerFeeBasisPoints int `json:"opensea_buyer_fee_basis_points"`
OpenseaSellerFeeBasisPoints int `json:"opensea_seller_fee_basis_points"`
BuyerFeeBasisPoints int `json:"buyer_fee_basis_points"`
SellerFeeBasisPoints int `json:"seller_fee_basis_points"`
PayoutAddress string `json:"payout_address"`
} `json:"primary_asset_contracts"`
Traits struct {
XP struct {
Min int `json:"min"`
Max int `json:"max"`
} `json:"XP"`
PrintDate struct {
Min float64 `json:"min"`
Max float64 `json:"max"`
} `json:"print_date"`
Power struct {
Min float64 `json:"min"`
Max float64 `json:"max"`
} `json:"power"`
SerialNumber struct {
Min int `json:"min"`
Max int `json:"max"`
} `json:"serial_number"`
Level struct {
Min int `json:"min"`
Max int `json:"max"`
} `json:"level"`
} `json:"traits"`
Stats struct {
SevenDayVolume float64 `json:"seven_day_volume"`
TotalVolume float64 `json:"total_volume"`
SevenDayChange float64 `json:"seven_day_change"`
SevenDaySales float64 `json:"seven_day_sales"`
TotalSales float64 `json:"total_sales"`
TotalSupply float64 `json:"total_supply"`
Count float64 `json:"count"`
NumOwners int `json:"num_owners"`
SevenDayAveragePrice float64 `json:"seven_day_average_price"`
AveragePrice float64 `json:"average_price"`
NumReports int `json:"num_reports"`
MarketCap float64 `json:"market_cap"`
} `json:"stats"`
BannerImageURL string `json:"banner_image_url"`
ChatURL string `json:"chat_url"`
CreatedDate string `json:"created_date"`
DefaultToFiat bool `json:"default_to_fiat"`
Description string `json:"description"`
DisplayData struct {
CardDisplayStyle string `json:"card_display_style"`
} `json:"display_data"`
ExternalURL string `json:"external_url"`
Featured bool `json:"featured"`
FeaturedImageURL interface{} `json:"featured_image_url"`
Hidden bool `json:"hidden"`
SafelistRequestStatus string `json:"safelist_request_status"`
ImageURL string `json:"image_url"`
IsSubjectToWhitelist bool `json:"is_subject_to_whitelist"`
LargeImageURL string `json:"large_image_url"`
MediumUsername interface{} `json:"medium_username"`
Name string `json:"name"`
OnlyProxiedTransfers bool `json:"only_proxied_transfers"`
OpenseaBuyerFeeBasisPoints string `json:"opensea_buyer_fee_basis_points"`
OpenseaSellerFeeBasisPoints string `json:"opensea_seller_fee_basis_points"`
PayoutAddress string `json:"payout_address"`
RequireEmail bool `json:"require_email"`
ShortDescription interface{} `json:"short_description"`
Slug string `json:"slug"`
TelegramURL string `json:"telegram_url"`
TwitterUsername string `json:"twitter_username"`
InstagramUsername interface{} `json:"instagram_username"`
WikiURL interface{} `json:"wiki_url"`
} `json:"collection"`
Decimals int `json:"decimals"`
SellOrders interface{} `json:"sell_orders"`
Creator struct {
User struct {
Username string `json:"username"`
} `json:"user"`
ProfileImgURL string `json:"profile_img_url"`
Address string `json:"address"`
Config string `json:"config"`
DiscordID string `json:"discord_id"`
} `json:"creator"`
Traits []SorareTrait `json:"traits"`
LastSale interface{} `json:"last_sale"`
TopBid interface{} `json:"top_bid"`
ListingDate interface{} `json:"listing_date"`
IsPresale bool `json:"is_presale"`
TransferFeePaymentToken interface{} `json:"transfer_fee_payment_token"`
TransferFee interface{} `json:"transfer_fee"`
RelatedAssets []interface{} `json:"related_assets"`
Orders []interface{} `json:"orders"`
Auctions []interface{} `json:"auctions"`
SupportsWyvern bool `json:"supports_wyvern"`
TopOwnerships []struct {
Owner struct {
User interface{} `json:"user"`
ProfileImgURL string `json:"profile_img_url"`
Address string `json:"address"`
Config string `json:"config"`
DiscordID string `json:"discord_id"`
} `json:"owner"`
Quantity string `json:"quantity"`
} `json:"top_ownerships"`
Ownership interface{} `json:"ownership"`
HighestBuyerCommitment interface{} `json:"highest_buyer_commitment"`
}
type SorareCard ¶
type SorareClub ¶
type SorareOutput ¶
type SorareOutput struct {
Card SorareCard `structs:",flatten"`
Player SorarePlayer `structs:",flatten"`
Club Club `structs:",flatten"`
Traits []SorareTrait `structs:",flatten"`
}
type SorarePlayer ¶
type SorareScraper ¶
type SorareScraper struct {
// contains filtered or unexported fields
}
func NewSorareScraper ¶
func NewSorareScraper(rdb *models.RelDB) *SorareScraper
func (*SorareScraper) Close ¶
func (scraper *SorareScraper) Close() error
Close closes any existing API connections
func (*SorareScraper) GetCard ¶
func (scraper *SorareScraper) GetCard(index *big.Int) (SorareCard, error)
GetCard returns data for a given card from on-chain.
func (*SorareScraper) GetClub ¶
func (scraper *SorareScraper) GetClub(index uint16) (SorareClub, error)
GetClub returns data for a given club from on-chain.
func (*SorareScraper) GetDataChannel ¶
func (scraper *SorareScraper) GetDataChannel() chan dia.NFT
GetDataChannel returns the scrapers data channel.
func (*SorareScraper) GetOpenSeaPlayer ¶
func (scraper *SorareScraper) GetOpenSeaPlayer(index *big.Int) ([]SorareTrait, common.Address, time.Time, error)
GetOpenSeaPlayer returns the scraped data from Opensea for a given player
func (*SorareScraper) GetPlayer ¶
func (scraper *SorareScraper) GetPlayer(index *big.Int) (SorarePlayer, error)
GetPlayer returns data for a given player from on-chain.
func (*SorareScraper) GetTokenURI ¶
func (scraper *SorareScraper) GetTokenURI(index *big.Int) (string, error)
GetTokenURI returns the token URI.
func (*SorareScraper) GetTotalSupply ¶
func (scraper *SorareScraper) GetTotalSupply() (*big.Int, error)
GetTotalSupply returns the total supply of the NFT from on-chain.
func (*SorareScraper) TokenByIndex ¶
TokenByIndex returns the token address from on-chain.
func (*SorareScraper) UpdateNFT ¶
func (scraper *SorareScraper) UpdateNFT() error
type SorareTrait ¶
type SorareTrait struct {
TraitType string `json:"trait_type"`
Value interface{} `json:"value"`
DisplayType interface{} `json:"display_type"`
MaxValue interface{} `json:"max_value"`
TraitCount int `json:"trait_count"`
Order interface{} `json:"order"`
}
func GetPlayerTraits ¶
func GetPlayerTraits(playerResp []byte) ([]SorareTrait, error)
GetPlayerTraits returns the parsed traits data from Opensea for a given player