opensea

package module
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 13 Imported by: 0

README

opensea-go-api

Golang library for OpenSea APIs (https://docs.opensea.io/reference).

Get Started

Get it:

go get github.com/DevilsTear/opensea-go-api

Use it:

TBD

API Support

This SDK supports the following:

Development

TBD.

TODOS

  • reasonable integration tests (running nightly)
  • expose the APIs as methods in the Opensea type

Acknowledgement

This library was forked and reworked from https://github.com/rmanzoku/go-opensea, at this commit. Thanks for it! 🎉

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHexAddress

func IsHexAddress(s string) bool

Types

type Account

type Account struct {
	User          User    `json:"user" bson:"user"`
	ProfileImgURL string  `json:"profile_img_url" bson:"profile_img_url"`
	Address       Address `json:"address" bson:"address"`
	Config        string  `json:"config" bson:"config"`
	DiscordID     string  `json:"discord_id" bson:"discord_id"`
}

type Address

type Address string
const NullAddress Address = "0x0000000000000000000000000000000000000000"

func ParseAddress

func ParseAddress(address string) (Address, error)

func (Address) IsNullAddress

func (a Address) IsNullAddress() bool

func (Address) MarshalJSON

func (a Address) MarshalJSON() ([]byte, error)

func (Address) String

func (a Address) String() string

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(b []byte) error

type Asset

type Asset struct {
	ID                      int64          `json:"id" bson:"id"`
	TokenID                 string         `json:"token_id" bson:"token_id"`
	NumSales                int64          `json:"num_sales" bson:"num_sales"`
	BackgroundColor         string         `json:"background_color" bson:"background_color"`
	ImageURL                string         `json:"image_url" bson:"image_url"`
	ImagePreviewURL         string         `json:"image_preview_url" bson:"image_preview_url"`
	ImageThumbnailURL       string         `json:"image_thumbnail_url" bson:"image_thumbnail_url"`
	ImageOriginalURL        string         `json:"image_original_url" bson:"image_original_url"`
	AnimationURL            string         `json:"animation_url" bson:"animation_url"`
	AnimationOriginalURL    string         `json:"animation_original_url" bson:"animation_original_url"`
	Name                    string         `json:"name" bson:"name"`
	Description             string         `json:"description" bson:"description"`
	ExternalLink            string         `json:"external_link" bson:"external_link"`
	AssetContract           *AssetContract `json:"asset_contract" bson:"asset_contract"`
	Owner                   *Account       `json:"owner" bson:"owner"`
	Creator                 *Account       `json:"creator" bson:"creator"`
	Permalink               string         `json:"permalink" bson:"permalink"`
	Collection              *Collection    `json:"collection" bson:"collection"`
	Decimals                int64          `json:"decimals" bson:"decimals"`
	TokenMetadata           string         `json:"token_metadata" bson:"token_metadata"`
	Traits                  interface{}    `json:"traits" bson:"traits"`
	IsNSFW                  bool           `json:"is_nsfw" bson:"is_nsfw"`
	SellOrders              interface{}    `json:"sell_orders" bson:"sell_orders"`
	LastSale                string         `json:"last_sale" bson:"last_sale"`
	TopBid                  float64        `json:"top_bid" bson:"top_bid"`
	ListingDate             string         `json:"listing_date" bson:"listing_date"`
	IsPreSale               bool           `json:"is_presale" bson:"is_presale"`
	TransferFeePaymentToken string         `json:"transfer_fee_payment_token" bson:"transfer_fee_payment_token"`
	TransferFee             float64        `json:"transfer_fee" bson:"transfer_fee"`
}

type AssetBundle

type AssetBundle struct {
	Maker         *Account       `json:"maker" bson:"maker"`
	Slug          string         `json:"slug" bson:"slug"`
	Assets        []*Asset       `json:"assets" bson:"assets"`
	Name          string         `json:"name" bson:"name"`
	Description   string         `json:"description" bson:"description"`
	ExternalLink  string         `json:"external_link" bson:"external_link"`
	AssetContract *AssetContract `json:"asset_contract" bson:"asset_contract"`
	Permalink     string         `json:"permalink" bson:"permalink"`
	SellOrders    interface{}    `json:"sell_orders" bson:"sell_orders"`
}

type AssetContract

type AssetContract struct {
	Address                     Address     `json:"address" bson:"address"`
	AssetContractType           string      `json:"asset_contract_type" bson:"asset_contract_type"`
	CreatedDate                 string      `json:"created_date" bson:"created_date"`
	Name                        string      `json:"name" bson:"name"`
	NftVersion                  string      `json:"nft_version" bson:"nft_version"`
	OpenseaVersion              interface{} `json:"opensea_version" bson:"opensea_version"`
	Owner                       int64       `json:"owner" bson:"owner"`
	SchemaName                  string      `json:"schema_name" bson:"schema_name"`
	Symbol                      string      `json:"symbol" bson:"symbol"`
	TotalSupply                 string      `json:"total_supply" bson:"total_supply"` //int64 `json:"total_supply,string,omitempty" bson:"total_supply"`
	Description                 string      `json:"description" bson:"description"`
	ExternalLink                string      `json:"external_link" bson:"external_link"`
	ImageURL                    string      `json:"image_url" bson:"image_url"`
	DefaultToFiat               bool        `json:"default_to_fiat" bson:"default_to_fiat"`
	DevBuyerFeeBasisPoints      int64       `json:"dev_buyer_fee_basis_points" bson:"dev_buyer_fee_basis_points"`
	DevSellerFeeBasisPoints     int64       `json:"dev_seller_fee_basis_points" bson:"dev_seller_fee_basis_points"`
	OnlyProxiedTransfers        bool        `json:"only_proxied_transfers" bson:"only_proxied_transfers"`
	OpenseaBuyerFeeBasisPoints  int64       `json:"opensea_buyer_fee_basis_points" bson:"opensea_buyer_fee_basis_points"`
	OpenseaSellerFeeBasisPoints int64       `json:"opensea_seller_fee_basis_points" bson:"opensea_seller_fee_basis_points"`
	BuyerFeeBasisPoints         int64       `json:"buyer_fee_basis_points" bson:"buyer_fee_basis_points"`
	SellerFeeBasisPoints        int64       `json:"seller_fee_basis_points" bson:"seller_fee_basis_points"`
	PayoutAddress               Address     `json:"payout_address" bson:"payout_address"`
}

type AssetEventsResponse

type AssetEventsResponse struct {
	AssetEvents []Event `json:"asset_events" bson:"asset_events"`
}

type AssetResponse

type AssetResponse struct {
	Assets []Asset `json:"assets" bson:"assets"`
}

type AuctionType

type AuctionType string
const (
	AuctionTypeNone     AuctionType = ""
	AuctionTypeEnglish  AuctionType = "english"
	AuctionTypeDutch    AuctionType = "dutch"
	AuctionTypeMinPrice AuctionType = "min-price"
)

type Bundle

type Bundle struct {
	Maker         Account       `json:"maker" bson:"maker"`
	Slug          string        `json:"slug" bson:"slug"`
	Assets        interface{}   `json:"assets" bson:"assets"`
	Name          string        `json:"name" bson:"name"`
	Description   string        `json:"description" bson:"description"`
	ExternalLink  string        `json:"external_link" bson:"external_link"`
	AssetContract AssetContract `json:"asset_contract" bson:"asset_contract"`
	PermaLink     string        `json:"permalink" bson:"permalink"`
	SellOrders    interface{}   `json:"sell_orders" bson:"sell_orders"`
}

type Bundles

type Bundles struct {
	Bundles interface{} `json:"bundles" bson:"bundles"`
}

type Bytes

type Bytes []byte

func (Bytes) Bytes32

func (by Bytes) Bytes32() [32]byte

func (Bytes) MarshalJSON

func (by Bytes) MarshalJSON() ([]byte, error)

func (*Bytes) UnmarshalJSON

func (by *Bytes) UnmarshalJSON(b []byte) error

type Collection

type Collection struct {
	BannerImageUrl              string      `json:"banner_image_url" bson:"banner_image_url"`
	ChatUrl                     string      `json:"chat_url" bson:"chat_url"`
	CreatedDate                 string      `json:"created_date" bson:"created_date"`
	DefaultToFiat               bool        `json:"default_to_fiat" bson:"default_to_fiat"`
	Description                 string      `json:"description" bson:"description"`
	DevBuyerFeeBasisPoints      string      `json:"dev_buyer_fee_basis_points" bson:"dev_buyer_fee_basis_points"`
	DevSellerFeeBasisPoints     string      `json:"dev_seller_fee_basis_points" bson:"dev_seller_fee_basis_points"`
	DiscordUrl                  string      `json:"discord_url" bson:"discord_url"`
	DisplayData                 DisplayData `json:"display_data" bson:"display_data"`
	ExternalUrl                 string      `json:"external_url" bson:"external_url"`
	Featured                    bool        `json:"featured" bson:"featured"`
	FeaturedImageUrl            string      `json:"featured_image_url" bson:"featured_image_url"`
	Hidden                      bool        `json:"hidden" bson:"hidden"`
	SafelistRequestStatus       string      `json:"safelist_request_status" bson:"safelist_request_status"`
	ImageUrl                    string      `json:"image_url" bson:"image_url"`
	IsSubjectToWhitelist        bool        `json:"is_subject_to_whitelist" bson:"is_subject_to_whitelist"`
	LargeImageUrl               string      `json:"large_image_url" bson:"large_image_url"`
	MediumUsername              string      `json:"medium_username" bson:"medium_username"`
	Name                        string      `json:"name" bson:"name"`
	OnlyProxiedTransfers        bool        `json:"only_proxied_transfers" bson:"only_proxied_transfers"`
	OpenseaBuyerFeeBasisPoints  string      `json:"opensea_buyer_fee_basis_points" bson:"opensea_buyer_fee_basis_points"`
	OpenseaSellerFeeBasisPoints string      `json:"opensea_seller_fee_basis_points" bson:"opensea_seller_fee_basis_points"`
	PayoutAddress               string      `json:"payout_address" bson:"payout_address"`
	RequireEmail                bool        `json:"require_email" bson:"require_email"`
	ShortDescription            string      `json:"short_description" bson:"short_description"`
	Slug                        string      `json:"slug" bson:"slug"`
	TelegramUrl                 string      `json:"telegram_url" bson:"telegram_url"`
	TwitterUsername             string      `json:"twitter_username" bson:"twitter_username"`
	InstagramUsername           string      `json:"instagram_username" bson:"instagram_username"`
	WikiUrl                     string      `json:"wiki_url" bson:"wiki_url"`
	IsNSFW                      bool        `json:"is_nsfw" bson:"is_nsfw"`
}

type CollectionSingle

type CollectionSingle struct {
	Editors               []Address      `json:"editors" bson:"editors"`
	PaymentTokens         []PaymentToken `json:"payment_tokens" bson:"payment_tokens"`
	PrimaryAssetContracts []Contract     `json:"primary_asset_contracts" bson:"primary_asset_contracts"`
	Traits                interface{}    `json:"traits" bson:"traits"`
	Collection
}

type CollectionSingleResponse

type CollectionSingleResponse struct {
	Collection CollectionSingle `json:"collection" bson:"collection"`
}

type Contract

type Contract struct {
	Collection                  Collection  `json:"collection" bson:"collection"`
	Address                     Address     `json:"address" bson:"address"`
	AssetContractType           string      `json:"asset_contract_type" bson:"asset_contract_type"`
	CreatedDate                 string      `json:"created_date" bson:"created_date"`
	Name                        string      `json:"name" bson:"name"`
	NFTVersion                  string      `json:"nft_version" bson:"nft_version"`
	OpenseaVersion              interface{} `json:"opensea_version" bson:"opensea_version"`
	Owner                       int64       `json:"owner" bson:"owner"`
	SchemaName                  string      `json:"schema_name" bson:"schema_name"`
	Symbol                      string      `json:"symbol" bson:"symbol"`
	TotalSupply                 interface{} `json:"total_supply" bson:"total_supply"`
	Description                 string      `json:"description" bson:"description"`
	ExternalLink                string      `json:"external_link" bson:"external_link"`
	ImageURL                    string      `json:"image_url" bson:"image_url"`
	DefaultToFiat               bool        `json:"default_to_fiat" bson:"default_to_fiat"`
	DevBuyerFeeBasisPoints      int64       `json:"dev_buyer_fee_basis_points" bson:"dev_buyer_fee_basis_points"`
	DevSellerFeeBasisPoints     int64       `json:"dev_seller_fee_basis_points" bson:"dev_seller_fee_basis_points"`
	OnlyProxiedTransfers        bool        `json:"only_proxied_transfers" bson:"only_proxied_transfers"`
	OpenseaBuyerFeeBasisPoints  int64       `json:"opensea_buyer_fee_basis_points" bson:"opensea_buyer_fee_basis_points"`
	OpenseaSellerFeeBasisPoints int64       `json:"opensea_seller_fee_basis_points" bson:"opensea_seller_fee_basis_points"`
	BuyerFeeBasisPoints         int64       `json:"buyer_fee_basis_points" bson:"buyer_fee_basis_points"`
	SellerFeeBasisPoints        int64       `json:"seller_fee_basis_points" bson:"seller_fee_basis_points"`
	PayoutAddress               Address     `json:"payout_address" bson:"payout_address"`
}

type DevFeePaymentEvent

type DevFeePaymentEvent struct {
	EventType      string       `json:"event_type" bson:"event_type"`
	EventTimestamp string       `json:"event_timestamp" bson:"event_timestamp"`
	AuctionType    interface{}  `json:"auction_type" bson:"auction_type"`
	TotalPrice     interface{}  `json:"total_price" bson:"total_price"`
	Transaction    Transaction  `json:"transaction" bson:"transaction"`
	PaymentToken   PaymentToken `json:"payment_token" bson:"payment_token"`
}

DevFeePaymentEvent is fee transfer event from OpenSea to Dev, It appears to be running in bulk on a regular basis.

type DisplayData

type DisplayData struct {
	CardDisplayStyle string      `json:"card_display_style" bson:"card_display_style"`
	Images           interface{} `json:"images" bson:"images"`
}

type Event

type Event struct {
	ID                  uint64              `json:"id" bson:"id"`
	Transaction         *Transaction        `json:"transaction" bson:"transaction"`
	PaymentToken        *PaymentToken       `json:"payment_token" bson:"payment_token"`
	Asset               *Asset              `json:"asset" bson:"asset"`
	AssetBundle         *AssetBundle        `json:"asset_bundle" bson:"asset_bundle"`
	WinnerAccount       *Account            `json:"winner_account" bson:"winner_account"`
	FromAccount         *Account            `json:"from_account" bson:"from_account"`
	ToAccount           *Account            `json:"to_account" bson:"to_account"`
	OwnerAccount        *Account            `json:"owner_account" bson:"owner_account"`
	ApprovedAccount     *Account            `json:"approved_account" bson:"approved_account"`
	Seller              *Account            `json:"seller" bson:"seller"`
	DevFeePaymentEvent  *DevFeePaymentEvent `json:"dev_fee_payment_event" bson:"dev_fee_payment_event"`
	CollectionSlug      string              `json:"collection_slug" bson:"collection_slug"`
	CreatedDate         TimeNano            `json:"created_date" bson:"created_date"`
	ModifiedDate        TimeNano            `json:"modified_date" bson:"modified_date"`
	ContractAddress     Address             `json:"contract_address" bson:"contract_address"`
	LogIndex            interface{}         `json:"log_index" bson:"log_index"`
	EventType           EventType           `json:"event_type" bson:"event_type"`
	AuctionType         string              `json:"auction_type" bson:"auction_type"`
	StartingPrice       string              `json:"starting_price" bson:"starting_price"`
	EndingPrice         string              `json:"ending_price" bson:"ending_price"`
	Duration            interface{}         `json:"duration" bson:"duration"`
	MinPrice            Number              `json:"min_price" bson:"min_price"`
	OfferedTo           Number              `json:"offered_to" bson:"offered_to"`
	BidAmount           Number              `json:"bid_amount" bson:"bid_amount"`
	TotalPrice          Number              `json:"total_price" bson:"total_price"`
	CustomEventName     interface{}         `json:"custom_event_name" bson:"custom_event_name"`
	Quantity            string              `json:"quantity" bson:"quantity"`
	PayoutAmount        interface{}         `json:"payout_amount" bson:"payout_amount"`
	EventTimestamp      TimeNano            `json:"event_timestamp" bson:"event_timestamp"`
	Relayer             string              `json:"relayer" bson:"relayer"`
	Collection          uint64              `json:"collection" bson:"collection"`
	PayoutAccount       interface{}         `json:"payout_account" bson:"payout_account"`
	PayoutAssetContract interface{}         `json:"payout_asset_contract" bson:"payout_asset_contract"`
	PayoutCollection    interface{}         `json:"payout_collection" bson:"payout_collection"`
	BuyOrder            uint64              `json:"buy_order" bson:"buy_order"`
	SellOrder           uint64              `json:"sell_order" bson:"sell_order"`
}

func (Event) IsBundle

func (e Event) IsBundle() bool

type EventType

type EventType string
const (
	EventTypeNone               EventType = ""
	EventTypeCreated            EventType = "created"
	EventTypeSuccessful         EventType = "successful"
	EventTypeCancelled          EventType = "cancelled"
	EventTypeBidEntered         EventType = "bid_entered"
	EventTypeBidWithdrawn       EventType = "bid_withdrawn"
	EventTypeTransfer           EventType = "transfer"
	EventTypeApprove            EventType = "approve"
	EventTypeCompositionCreated EventType = "composition_created"
)

type FeeMethod

type FeeMethod uint8
const (
	ProtocolFee FeeMethod = iota
	SplitFee
)

type GetAssetsParams

type GetAssetsParams struct {
	Owner                  Address   `json:"owner" bson:"owner"`
	TokenIDs               []int32   `json:"token_ids" bson:"token_ids"`
	Collection             string    `json:"collection" bson:"collection"`
	CollectionSlug         string    `json:"collection_slug" bson:"collection_slug"`
	CollectionEditor       string    `json:"collection_editor" bson:"collection_editor"`
	OrderDirection         string    `json:"order_direction" bson:"order_direction"`
	AssetContractAddress   Address   `json:"asset_contract_address" bson:"asset_contract_address"`
	AssetContractAddresses []Address `json:"asset_contract_addresses" bson:"asset_contract_addresses"`
	Cursor                 *int      `json:"cursor" bson:"cursor"`
	Limit                  *int      `json:"limit" bson:"limit"`
	IncludeOrders          *bool     `json:"include_orders" bson:"include_orders"`
}

GetAssetsParams model info @Description Asset listing params

func (GetAssetsParams) Encode

func (p GetAssetsParams) Encode() string

type HowToCall

type HowToCall uint8
const (
	Call HowToCall = iota
	DelegateCall
)

type Number

type Number string

func (Number) Big

func (n Number) Big() *big.Int

type Opensea

type Opensea struct {
	API    string
	APIKey string
	// contains filtered or unexported fields
}

func NewOpensea

func NewOpensea(apiKey string) (*Opensea, error)

func NewOpenseaRinkeby

func NewOpenseaRinkeby(apiKey string) (*Opensea, error)

func (Opensea) GetAssets

func (o Opensea) GetAssets(params GetAssetsParams) (*AssetResponse, error)

func (Opensea) GetAssetsTest added in v1.0.15

func (o Opensea) GetAssetsTest(params GetAssetsParams) (*AssetResponse, error)

func (Opensea) GetAssetsWithContext

func (o Opensea) GetAssetsWithContext(ctx context.Context, params GetAssetsParams) (*AssetResponse, error)

func (Opensea) GetAssetsWithContextTest added in v1.0.15

func (o Opensea) GetAssetsWithContextTest(ctx context.Context, params GetAssetsParams) (*AssetResponse, error)

func (Opensea) GetOrders

func (o Opensea) GetOrders(assetContractAddress string, listedAfter int64) ([]*Order, error)

func (Opensea) GetOrdersWithContext

func (o Opensea) GetOrdersWithContext(ctx context.Context, assetContractAddress string, listedAfter int64) (orders []*Order, err error)

func (Opensea) GetPath

func (o Opensea) GetPath(ctx context.Context, path string) ([]byte, error)

func (Opensea) GetPathTest added in v1.0.15

func (o Opensea) GetPathTest(ctx context.Context, path string) ([]byte, error)

func (Opensea) GetSingleAsset

func (o Opensea) GetSingleAsset(assetContractAddress string, tokenID *big.Int) (*Asset, error)

func (Opensea) GetSingleAssetWithContext

func (o Opensea) GetSingleAssetWithContext(ctx context.Context, assetContractAddress string, tokenID *big.Int) (*Asset, error)

func (Opensea) GetSingleContract

func (o Opensea) GetSingleContract(assetContractAddress string) (*Contract, error)

func (Opensea) GetSingleContractWithContext

func (o Opensea) GetSingleContractWithContext(ctx context.Context, assetContractAddress string) (contract *Contract, err error)

func (Opensea) RetrievingEvents

func (o Opensea) RetrievingEvents(params *RetrievingEventsParams) ([]*Event, error)

func (Opensea) RetrievingEventsWithContext

func (o Opensea) RetrievingEventsWithContext(ctx context.Context, params *RetrievingEventsParams) (events []*Event, err error)

type Order

type Order struct {
	ID    int64 `json:"id" bson:"id"`
	Asset Asset `json:"asset" bson:"asset"`
	// AssetBundle          interface{}          `json:"asset_bundle" bson:"asset_bundle"`
	CreatedDate *TimeNano `json:"created_date" bson:"created_date"`
	ClosingDate *TimeNano `json:"closing_date" bson:"closing_date"`
	// ClosingExtendable bool      `json:"closing_extendable" bson:"closing_extendable"`
	ExpirationTime int64 `json:"expiration_time" bson:"expiration_time"`
	ListingTime    int64 `json:"listing_time" bson:"listing_time"`
	// OrderHash            string               `json:"order_hash" bson:"order_hash"`
	// Metadata Metadata `json:"metadata" bson:"metadata"`
	Exchange     Address `json:"exchange" bson:"exchange"`
	Maker        Account `json:"maker" bson:"maker"`
	Taker        Account `json:"taker" bson:"taker"`
	CurrentPrice Number  `json:"current_price" bson:"current_price"`
	// CurrentBounty        string               `json:"current_bounty" bson:"current_bounty"`
	// BountyMultiple       string               `json:"bounty_multiple" bson:"bounty_multiple"`
	MakerRelayerFee    Number    `json:"maker_relayer_fee" bson:"maker_relayer_fee"`
	TakerRelayerFee    Number    `json:"taker_relayer_fee" bson:"taker_relayer_fee"`
	MakerProtocolFee   Number    `json:"maker_protocol_fee" bson:"maker_protocol_fee"`
	TakerProtocolFee   Number    `json:"taker_protocol_fee" bson:"taker_protocol_fee"`
	MakerReferrerFee   Number    `json:"maker_referrer_fee" bson:"maker_referrer_fee"`
	FeeRecipient       Account   `json:"fee_recipient" bson:"fee_recipient"`
	FeeMethod          FeeMethod `json:"fee_method" bson:"fee_method"`
	Side               Side      `json:"side" bson:"side"` // 0 for buy orders and 1 for sell orders.
	SaleKind           SaleKind  `json:"sale_kind" bson:"sale_kind"`
	Target             Address   `json:"target" bson:"target"`
	HowToCall          HowToCall `json:"how_to_call" bson:"how_to_call"`
	Calldata           Bytes     `json:"calldata" bson:"calldata"`
	ReplacementPattern Bytes     `json:"replacement_pattern" bson:"replacement_pattern"`
	StaticTarget       Address   `json:"static_target" bson:"static_target"`
	StaticExtradata    Bytes     `json:"static_extradata" bson:"static_extradata"`
	PaymentToken       Address   `json:"payment_token" bson:"payment_token"`
	// PaymentTokenContract PaymentTokenContract `json:"payment_token_contract" bson:"payment_token_contract"`
	BasePrice       Number `json:"base_price" bson:"base_price"`
	Extra           Number `json:"extra" bson:"extra"`
	Quantity        string `json:"quantity" bson:"quantity"`
	Salt            Number `json:"salt" bson:"salt"`
	V               *uint8 `json:"v" bson:"v"`
	R               *Bytes `json:"r" bson:"r"`
	S               *Bytes `json:"s" bson:"s"`
	ApprovedOnChain bool   `json:"approved_on_chain" bson:"approved_on_chain"`
	Cancelled       bool   `json:"cancelled" bson:"cancelled"`
	Finalized       bool   `json:"finalized" bson:"finalized"`
	MarkedInvalid   bool   `json:"marked_invalid" bson:"marked_invalid"`
}

func (Order) IsPrivate

func (o Order) IsPrivate() bool

type PaymentToken

type PaymentToken struct {
	Symbol   string      `json:"symbol" bson:"symbol"`
	Address  Address     `json:"address" bson:"address"`
	ImageURL string      `json:"image_url" bson:"image_url"`
	Name     string      `json:"name" bson:"name"`
	Decimals int64       `json:"decimals" bson:"decimals"`
	EthPrice interface{} `json:"eth_price" bson:"eth_price"`
	UsdPrice interface{} `json:"usd_price" bson:"usd_price"`
}

type RetrievingEventsParams

type RetrievingEventsParams struct {
	AssetContractAddress Address
	TokenID              int32
	AccountAddress       Address
	EventType            EventType
	OnlyOpensea          bool
	AuctionType          AuctionType
	Offset               int
	Limit                int
	OccurredBefore       int64
	OccurredAfter        int64
}

func NewRetrievingEventsParams

func NewRetrievingEventsParams() *RetrievingEventsParams

func (RetrievingEventsParams) Encode

func (p RetrievingEventsParams) Encode() string

func (*RetrievingEventsParams) SetAccountAddress

func (p *RetrievingEventsParams) SetAccountAddress(addr string) (err error)

func (*RetrievingEventsParams) SetAssetContractAddress

func (p *RetrievingEventsParams) SetAssetContractAddress(addr string) (err error)

type SaleKind

type SaleKind uint8
const (
	FixedOrMinBit SaleKind = iota // 0 for fixed-price sales or min-bid auctions
	DutchAuctions                 // 1 for declining-price Dutch Auctions
)

type SellOrder

type SellOrder struct {
}

type Side

type Side uint8
const (
	Buy Side = iota
	Sell
)

type Stat

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

type StatResponse

type StatResponse struct {
	Stats Stat `json:"stats" bson:"stats"`
}

type TimeNano

type TimeNano time.Time

func (TimeNano) MarshalJSON

func (t TimeNano) MarshalJSON() ([]byte, error)

func (TimeNano) Time

func (t TimeNano) Time() time.Time

func (*TimeNano) UnmarshalJSON

func (t *TimeNano) UnmarshalJSON(b []byte) error

type Trait

type Trait struct {
	TraitType   string          `json:"trait_type" bson:"trait_type"`
	Value       json.RawMessage `json:"value" bson:"value"`
	DisplayType interface{}     `json:"display_type" bson:"display_type"`
	MaxValue    interface{}     `json:"max_value" bson:"max_value"`
	TraitCount  int64           `json:"trait_count" bson:"trait_count"`
	Order       interface{}     `json:"order" bson:"order"`
}

type Transaction

type Transaction struct {
	ID               int64    `json:"id" bson:"id"`
	FromAccount      Account  `json:"from_account" bson:"from_account"`
	ToAccount        Account  `json:"to_account" bson:"to_account"`
	CreatedDate      TimeNano `json:"created_date" bson:"created_date"`
	ModifiedDate     TimeNano `json:"modified_date" bson:"modified_date"`
	TransactionHash  string   `json:"transaction_hash" bson:"transaction_hash"`
	TransactionIndex string   `json:"transaction_index" bson:"transaction_index"`
	BlockNumber      string   `json:"block_number" bson:"block_number"`
	BlockHash        string   `json:"block_hash" bson:"block_hash"`
	Timestamp        string   `json:"timestamp" bson:"timestamp"`
}

type User

type User struct {
	Username string `json:"username" bson:"username"`
}

type Value

type Value struct {
	Integer *int64
	String  *string
}

Jump to

Keyboard shortcuts

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