Documentation ¶
Index ¶
- Variables
- func LatestBlockNumber(c *ethclient.Client, interval time.Duration) <-chan uint64
- func RequestTokenMetadata(INFURA_KEY string, INFURA_KEY_SECRET string, meta MetadataRequest) string
- func RequestTokenPrice(c *ethclient.Client, contractAddress common.Address) (*big.Float, string)
- func Watcher(c *ethclient.Client, contractAddress common.Address, ...)
- type ImageMetadata
- type MetadataRequest
- type Pair
- type WatcherEvent
- type WatcherEvents
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BasicOrderFulfilled = common.HexToHash("0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31") ERC721InterfaceId = common.BytesToHash([]byte("0x80ac58cd")) ERC1155InterfaceId = common.BytesToHash([]byte("0xd9b67a26")) ChainlinkMaticPairs = "https://reference-data-directory.vercel.app/feeds-matic-mainnet.json" )
Common variables
Functions ¶
func LatestBlockNumber ¶
Helper function to get the latest block number from the node
func RequestTokenMetadata ¶
func RequestTokenMetadata(INFURA_KEY string, INFURA_KEY_SECRET string, meta MetadataRequest) string
Function to request the NFT metadata from the infura nft api
func RequestTokenPrice ¶
Function to request pair price (if available) from the chainlink oracle
Types ¶
type ImageMetadata ¶
type ImageMetadata struct {
Token string `json:"image"`
}
type MetadataRequest ¶
type Pair ¶
type Pair struct { CompareOffchain string `json:"compareOffchain"` ContractAddress string `json:"contractAddress"` ContractType string `json:"contractType"` ContractVersion int `json:"contractVersion"` DecimalPlaces int `json:"decimalPlaces"` Ens string `json:"ens"` FormatDecimalPlaces int `json:"formatDecimalPlaces"` HealthPrice string `json:"healthPrice"` Heartbeat int `json:"heartbeat"` History bool `json:"history"` Multiply string `json:"multiply"` Name string `json:"name"` Pair []string `json:"pair"` Path string `json:"path"` ProxyAddress string `json:"proxyAddress"` Threshold float64 `json:"threshold"` ValuePrefix string `json:"valuePrefix"` AssetName string `json:"assetName"` FeedCategory string `json:"feedCategory"` FeedType string `json:"feedType"` Docs struct { AssetName string `json:"assetName"` FeedCategory string `json:"feedCategory"` FeedType string `json:"feedType"` } `json:"docs"` Decimals int `json:"decimals"` }
type WatcherEvent ¶
type WatcherEvent struct { UUID string `json:"uuid"` BlockNumber uint64 `json:"blockNumber"` Event string `json:"event"` SalePrice string `json:"salePrice"` SaleCurrency string `json:"saleCurrency"` TokenContractAddress string `json:"tokenContractAddress"` Image string `json:"image"` Currency string `json:"currency"` Symbol string `json:"symbol"` }
Struct to hold watcher event data
type WatcherEvents ¶
type WatcherEvents struct {
Block []WatcherEvent `json:"events"`
}
Struct to hold a collection of watcher events
Click to show internal directories.
Click to hide internal directories.