models

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address string `mapstructure:"address"`
}

type AssetCollection

type AssetCollection struct {
	Editors                 []string               `json:"editors"`
	PaymentTokens           []AssetPaymentToken    `json:"payment_tokens"`
	PrimaryAssetContracts   []PrimaryAssetContract `json:"primary_asset_contracts"`
	Traits                  struct{}               `json:"traits"`
	Stats                   CollectionStats        `json:"stats"`
	BannerImageURL          string                 `json:"banner_image_url"`
	ChatURL                 any                    `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            any    `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               any    `json:"large_image_url"`
	MediumUsername              any    `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               any    `json:"payout_address"`
	RequireEmail                bool   `json:"require_email"`
	ShortDescription            any    `json:"short_description"`
	Slug                        string `json:"slug"`
	TelegramURL                 any    `json:"telegram_url"`
	TwitterUsername             any    `json:"twitter_username"`
	InstagramUsername           any    `json:"instagram_username"`
	WikiURL                     any    `json:"wiki_url"`
	OwnedAssetCount             int    `json:"owned_asset_count"`
}

type AssetContract

type AssetContract struct {
	Collection                  OSCollection `json:"collection"`
	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              any          `json:"opensea_version"`
	Owner                       int          `json:"owner"`
	SchemaName                  string       `json:"schema_name"`
	Symbol                      string       `json:"symbol"`
	TotalSupply                 any          `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"`
}

type AssetEvent

type AssetEvent struct {
	ApprovedAccount         any          `json:"approved_account"`
	Asset                   OrderAsset   `json:"asset"`
	AssetBundle             any          `json:"asset_bundle"`
	AuctionType             string       `json:"auction_type"`
	BidAmount               any          `json:"bid_amount"`
	CollectionSlug          string       `json:"collection_slug"`
	ContractAddress         string       `json:"contract_address"`
	CreatedDate             string       `json:"created_date"`
	CustomEventName         any          `json:"custom_event_name"`
	DevFeePaymentEvent      any          `json:"dev_fee_payment_event"`
	DevSellerFeeBasisPoints int          `json:"dev_seller_fee_basis_points"`
	Duration                string       `json:"duration"`
	EndingPrice             string       `json:"ending_price"`
	EventType               string       `json:"event_type"`
	FromAccount             OSAccount    `json:"from_account"`
	ID                      int64        `json:"id"`
	IsPrivate               bool         `json:"is_private"`
	OwnerAccount            any          `json:"owner_account"`
	PaymentToken            PaymentToken `json:"payment_token"`
	Quantity                string       `json:"quantity"`
	Seller                  OSAccount    `json:"seller"`
	StartingPrice           string       `json:"starting_price"`
	ToAccount               any          `json:"to_account"`
	TotalPrice              any          `json:"total_price"`
	Transaction             any          `json:"transaction"`
	WinnerAccount           any          `json:"winner_account"`
	ListingTime             string       `json:"listing_time"`
}

type AssetEventsResponse

type AssetEventsResponse struct {
	// AssetEvents []any `json:"asset_events"`
	AssetEvents []AssetEvent `json:"asset_events"`
}

type AssetPaymentToken

type AssetPaymentToken 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"`
}

type BaseItemMetadataType

type BaseItemMetadataType struct {
	Name         string `mapstructure:"name"`
	ImageURL     string `mapstructure:"image_url"`
	AnimationURL string `mapstructure:"animation_url"`
	MetadataURL  string `mapstructure:"metadata_url"`
}

type BaseItemType

type BaseItemType struct {
	NftID     string               `mapstructure:"nft_id"`
	Permalink string               `mapstructure:"permalink"`
	Metadata  BaseItemMetadataType `mapstructure:"metadata"`
	Chain     Chain                `mapstructure:"chain"`
}

type BaseStreamMessage

type BaseStreamMessage struct {
	StreamEvent string `mapstructure:"event_type"`
	SentAt      string `mapstructure:"sent_at"`
}

type Chain

type Chain struct {
	Name string `mapstructure:"name"`
}

type CollectionSlug

type CollectionSlug struct {
	Slug string `mapstructure:"slug"`
}

type CollectionStats

type CollectionStats struct {
	OneDayVolume          float64 `json:"one_day_volume"`
	OneDayChange          float64 `json:"one_day_change"`
	OneDaySales           float64 `json:"one_day_sales"`
	OneDayAveragePrice    float64 `json:"one_day_average_price"`
	SevenDayVolume        float64 `json:"seven_day_volume"`
	SevenDayChange        float64 `json:"seven_day_change"`
	SevenDaySales         float64 `json:"seven_day_sales"`
	SevenDayAveragePrice  float64 `json:"seven_day_average_price"`
	ThirtyDayVolume       float64 `json:"thirty_day_volume"`
	ThirtyDayChange       float64 `json:"thirty_day_change"`
	ThirtyDaySales        float64 `json:"thirty_day_sales"`
	ThirtyDayAveragePrice float64 `json:"thirty_day_average_price"`
	TotalVolume           float64 `json:"total_volume"`
	TotalSales            float64 `json:"total_sales"`
	TotalSupply           float64 `json:"total_supply"`
	Count                 float64 `json:"count"`
	NumOwners             float64 `json:"num_owners"`
	AveragePrice          float64 `json:"average_price"`
	NumReports            float64 `json:"num_reports"`
	MarketCap             float64 `json:"market_cap"`
	FloorPrice            float64 `json:"floor_price"`
}

type CollectionStatsResponse

type CollectionStatsResponse struct {
	Stats CollectionStats `json:"stats"`
}

type ItemCancelledEvent

type ItemCancelledEvent struct {
	BaseStreamMessage `mapstructure:",squash"`
	Payload           ItemCancelledEventPayload `mapstructure:"payload"`
}

type ItemCancelledEventPayload

type ItemCancelledEventPayload struct {
	PayloadItemAndColl `mapstructure:",squash"`
	Quantity           int          `mapstructure:"quantity"`
	ListingType        string       `mapstructure:"listing_type"`
	Transaction        Transaction  `mapstructure:"transaction"`
	PaymentToken       PaymentToken `mapstructure:"payment_token"`
	EventTimestamp     string       `mapstructure:"event_timestamp"`
}

type ItemListedEvent

type ItemListedEvent struct {
	BaseStreamMessage `mapstructure:",squash"`
	Payload           ItemListedEventPayload `mapstructure:"payload"`
}

type ItemListedEventPayload

type ItemListedEventPayload struct {
	PayloadItemAndColl `mapstructure:",squash"`
	Quantity           int          `mapstructure:"quantity"`
	ListingType        string       `mapstructure:"listing_type"`
	ListingDate        string       `mapstructure:"listing_date"`
	ExpirationDate     string       `mapstructure:"expiration_date"`
	Maker              Account      `mapstructure:"maker"`
	Taker              Account      `mapstructure:"taker"`
	BasePrice          string       `mapstructure:"base_price"`
	PaymentToken       PaymentToken `mapstructure:"payment_token"`
	IsPrivate          bool         `mapstructure:"is_private"`
	EventTimestamp     string       `mapstructure:"event_timestamp"`
}

type ItemMetadataUpdateEvent

type ItemMetadataUpdateEvent struct {
	BaseStreamMessage `mapstructure:",squash"`
	Payload           ItemMetadataUpdatePayload `mapstructure:"payload"`
}

type ItemMetadataUpdatePayload

type ItemMetadataUpdatePayload struct {
	PayloadItemAndColl   `mapstructure:",squash"`
	BaseItemMetadataType `mapstructure:",squash"`
	Description          string  `mapstructure:"description"`
	BackgroundColor      string  `mapstructure:"background_color"`
	Traits               []Trait `mapstructure:"traits"`
}

type ItemReceivedBidEvent

type ItemReceivedBidEvent struct {
	BaseStreamMessage `mapstructure:",squash"`
	Payload           ItemReceivedBidEventPayload `mapstructure:"payload"`
}

type ItemReceivedBidEventPayload

type ItemReceivedBidEventPayload struct {
	PayloadItemAndColl `mapstructure:",squash"`
	Quantity           int          `mapstructure:"quantity"`
	CreatedDate        string       `mapstructure:"created_date"`
	ExpirationDate     string       `mapstructure:"expiration_date"`
	Maker              Account      `mapstructure:"maker"`
	Taker              Account      `mapstructure:"taker"`
	BasePrice          string       `mapstructure:"base_price"`
	PaymentToken       PaymentToken `mapstructure:"payment_token"`
	EventTimestamp     string       `mapstructure:"event_timestamp"`
}

type ItemReceivedOfferEvent

type ItemReceivedOfferEvent struct {
	BaseStreamMessage `mapstructure:",squash"`
	Payload           ItemReceivedOfferEventPayload `mapstructure:"payload"`
}

type ItemReceivedOfferEventPayload

type ItemReceivedOfferEventPayload struct {
	PayloadItemAndColl `mapstructure:",squash"`
	Quantity           int          `mapstructure:"quantity"`
	CreatedDate        string       `mapstructure:"created_date"`
	ExpirationDate     string       `mapstructure:"expiration_date"`
	Maker              Account      `mapstructure:"maker"`
	Taker              Account      `mapstructure:"taker"`
	BasePrice          string       `mapstructure:"base_price"`
	PaymentToken       PaymentToken `mapstructure:"payment_token"`
	EventTimestamp     string       `mapstructure:"event_timestamp"`
}

type ItemSoldEvent

type ItemSoldEvent struct {
	BaseStreamMessage `mapstructure:",squash"`
	Payload           ItemSoldEventPayload `mapstructure:"payload"`
}

type ItemSoldEventPayload

type ItemSoldEventPayload struct {
	PayloadItemAndColl `mapstructure:",squash"`
	ListingType        string       `mapstructure:"listing_type"`
	ClosingDate        string       `mapstructure:"closing_date"`
	Transaction        Transaction  `mapstructure:"transaction"`
	Maker              Account      `mapstructure:"maker"`
	Taker              Account      `mapstructure:"taker"`
	SalePrice          string       `mapstructure:"sale_price"`
	PaymentToken       PaymentToken `mapstructure:"payment_token"`
	IsPrivate          bool         `mapstructure:"is_private"`
	EventTimestamp     string       `mapstructure:"event_timestamp"`
}

type ItemTransferredEvent

type ItemTransferredEvent struct {
	BaseStreamMessage `mapstructure:",squash"`
	Payload           ItemTransferredEventPayload `mapstructure:"payload"`
}

type ItemTransferredEventPayload

type ItemTransferredEventPayload struct {
	PayloadItemAndColl `mapstructure:",squash"`
	FromAccount        Account     `mapstructure:"from_account"`
	Quantity           int         `mapstructure:"quantity"`
	ToAccount          Account     `mapstructure:"to_account"`
	Transaction        Transaction `mapstructure:"transaction"`
	EventTimestamp     string      `mapstructure:"event_timestamp"`
}

type OSAccount

type OSAccount struct {
	User struct {
		Username string `json:"username"`
	} `json:"user"`
	ProfileImgURL string `json:"profile_img_url"`
	Address       string `json:"address"`
	Config        string `json:"config"`
}

type OSCollection

type OSCollection struct {
	BannerImageURL          string `json:"banner_image_url"`
	ChatURL                 any    `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            any    `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               any    `json:"large_image_url"`
	MediumUsername              any    `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            any    `json:"short_description"`
	Slug                        string `json:"slug"`
	TelegramURL                 any    `json:"telegram_url"`
	TwitterUsername             any    `json:"twitter_username"`
	InstagramUsername           any    `json:"instagram_username"`
	WikiURL                     any    `json:"wiki_url"`
}

type OrderAsset

type OrderAsset struct {
	ID                   int           `json:"id"`
	TokenID              string        `json:"token_id"`
	NumSales             int           `json:"num_sales"`
	BackgroundColor      any           `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         any           `json:"animation_url"`
	AnimationOriginalURL any           `json:"animation_original_url"`
	Name                 string        `json:"name"`
	Description          string        `json:"description"`
	ExternalLink         any           `json:"external_link"`
	AssetContract        AssetContract `json:"asset_contract"`
	Permalink            string        `json:"permalink"`
	Collection           OSCollection  `json:"collection"`
	Decimals             int           `json:"decimals"`
	TokenMetadata        string        `json:"token_metadata"`
	Owner                OSAccount     `json:"owner"`
}

type PayloadItemAndColl

type PayloadItemAndColl struct {
	Item       BaseItemType   `mapstructure:"item"`
	Collection CollectionSlug `mapstructure:"collection"`
}

type PaymentToken

type 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"`
}

type PrimaryAssetContract

type PrimaryAssetContract 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              any    `json:"opensea_version"`
	Owner                       any    `json:"owner"`
	SchemaName                  string `json:"schema_name"`
	Symbol                      string `json:"symbol"`
	TotalSupply                 string `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               any    `json:"payout_address"`
}

type Trait

type Trait struct {
	TraitType   string `mapstructure:"trait_type"`
	Value       string `mapstructure:"value"`
	DisplayType string `mapstructure:"display_type"`
	MaxValue    int    `mapstructure:"max_value"`
	TraitCount  string `mapstructure:"trait_count"`
	Order       int    `mapstructure:"order"`
}

type Transaction

type Transaction struct {
	Hash      string `mapstructure:"hash"`
	Timestamp string `mapstructure:"timestamp"`
}

type Wallet

type Wallet struct {
	Name          string         `mapstructure:"name"`
	Address       common.Address `mapstructure:"address"`
	ENS           *ens.Name      `mapstructure:"ens"`
	Balance       *big.Int       `mapstructure:"balance"`
	BalanceBefore *big.Int       `mapstructure:"balance_before"`
	BalanceTrend  string         `mapstructure:"balance_trend"`
	Color         lipgloss.Color `mapstructure:"color"`
}

Wallet represents the wallets configured by the user.

func (*Wallet) ColoredName

func (w *Wallet) ColoredName(maxWalletNameLength int) string

type Wallets

type Wallets map[common.Address]*Wallet

func (*Wallets) Addresses

func (ws *Wallets) Addresses() []common.Address

func (*Wallets) Contains

func (ws *Wallets) Contains(address common.Address) bool

Contains returns true if the given string is in the slice.

func (*Wallets) FormattedNames

func (ws *Wallets) FormattedNames() []string

func (*Wallets) GetAll

func (ws *Wallets) GetAll() WalletsSlice

func (*Wallets) StringAddresses

func (ws *Wallets) StringAddresses() []string

type WalletsSlice

type WalletsSlice []*Wallet

func (WalletsSlice) Len

func (w WalletsSlice) Len() int

func (WalletsSlice) Less

func (w WalletsSlice) Less(i, j int) bool

func (WalletsSlice) Swap

func (w WalletsSlice) Swap(i, j int)

type WorkerChannels

type WorkerChannels struct {
	NewLogs chan *types.Log

	EventsToFormat chan *collections.Event

	OutputWs    chan *collections.Event
	OutputLines chan string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL