models

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEventDecoderConfig added in v0.12.0

func GetEventDecoderConfig() mapstructure.DecoderConfig

func StringToNftIDHookFunc added in v0.7.3

func StringToNftIDHookFunc() mapstructure.DecodeHookFunc

StringToNftIDHookFunc is a mapstructure hook function that converts a string to a NftID.

Types

type Account added in v0.7.3

type Account struct {
	Address common.Address `json:"address"`
}

type Chain added in v0.11.0

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

type CollectionCriteria added in v0.11.0

type CollectionCriteria struct {
	Slug string `json:"slug" mapstructure:"slug"`
}

func (*CollectionCriteria) String added in v0.11.0

func (c *CollectionCriteria) String() string

type CollectionOffer added in v0.7.3

type CollectionOffer struct {
	EventType string                 `json:"event_type" mapstructure:"event_type"`
	SentAt    time.Time              `json:"sent_at"    mapstructure:"sent_at"`
	Payload   collectionOfferPayload `json:"payload"    mapstructure:"payload"`

	Other map[string]interface{} `mapstructure:",remain"`
}

type Consideration added in v0.7.3

type Consideration struct {
	EndAmount            *big.Int       `json:"endAmount"            mapstructure:"endAmount"`
	IdentifierOrCriteria string         `json:"identifierOrCriteria" mapstructure:"identifierOrCriteria"`
	ItemType             int            `json:"itemType"             mapstructure:"itemType"`
	Recipient            common.Address `json:"recipient,omitempty"  mapstructure:"recipient,omitempty"`
	StartAmount          *big.Int       `json:"startAmount"          mapstructure:"startAmount"`
	Token                common.Address `json:"token"                mapstructure:"token"`
}

type ContractCriteria added in v0.11.0

type ContractCriteria struct {
	Address common.Address `json:"address" mapstructure:"address"`
}

type EventPayload added in v0.7.3

type EventPayload struct {
	OrderHash common.Hash `json:"order_hash" mapstructure:"order_hash"`

	EventTimestamp time.Time `json:"event_timestamp" mapstructure:"event_timestamp"`
	ExpirationDate time.Time `json:"expiration_date" mapstructure:"expiration_date"`

	CollectionCriteria `json:"collection" mapstructure:"collection"`

	Maker Account `json:"maker,omitempty" mapstructure:"maker,omitempty"`
	Taker Account `json:"taker,omitempty" mapstructure:"taker,omitempty"`

	BasePrice    *big.Int `json:"base_price"    mapstructure:"base_price"`
	Quantity     int      `json:"quantity"      mapstructure:"quantity"`
	PaymentToken `json:"payment_token" mapstructure:"payment_token"`

	ProtocolAddress common.Address `json:"protocol_address,omitempty" mapstructure:"protocol_address,omitempty"`
	ProtocolData    ProtocolData   `json:"protocol_data,omitempty"    mapstructure:"protocol_data,omitempty"`

	// "item" is weird Oo it afaik just exists in the *collection*Offer event and is always empty!?
	Item interface{} `json:"item,omitempty" mapstructure:"item,omitempty"`

	Other map[string]interface{} `mapstructure:",remain"`
}

func (EventPayload) GetPrice added in v0.7.3

func (ep EventPayload) GetPrice() *price.Price

type GeneralEvent added in v0.12.0

type GeneralEvent struct {
	EventType string             `json:"event_type" mapstructure:"event_type"`
	SentAt    time.Time          `json:"sent_at"    mapstructure:"sent_at"`
	Payload   ItemGenericPayload `json:"payload"    mapstructure:"payload"`

	Other map[string]interface{} `mapstructure:",remain"`
	// contains filtered or unexported fields
}

func (*GeneralEvent) BasePrice added in v0.12.0

func (e *GeneralEvent) BasePrice() *price.Price

func (*GeneralEvent) ContractAddress added in v0.12.0

func (e *GeneralEvent) ContractAddress() *common.Address

func (*GeneralEvent) ItemName added in v0.12.0

func (e *GeneralEvent) ItemName() string

type Item added in v0.7.3

type Item struct {
	Metadata  `json:"metadata"  mapstructure:"metadata"`
	NftID     `json:"nft_id"    mapstructure:"nft_id"`
	Chain     Chain  `json:"chain"     mapstructure:"chain"`
	Permalink string `json:"permalink" mapstructure:"permalink"`

	Other map[string]interface{} `mapstructure:",remain"`
}

type ItemGenericPayload added in v0.11.0

type ItemGenericPayload struct {
	Item        `json:"item"         mapstructure:"item,omitempty"`
	CreatedDate time.Time `json:"created_date" mapstructure:"created_date,omitempty"`

	CollectionCriteria `json:"collection_criteria"     mapstructure:"collection_criteria,omitempty"`
	ContractCriteria   `json:"asset_contract_criteria" mapstructure:"asset_contract_criteria,omitempty"`
	TraitCriteria      `json:"trait_criteria"          mapstructure:"trait_criteria,omitempty"`

	EventPayload `json:"payload" mapstructure:",squash,omitempty"`

	IsPrivate   bool        `json:"is_private"   mapstructure:"is_private"`
	ListingDate time.Time   `json:"listing_date" mapstructure:"listing_date"`
	ListingType interface{} `json:"listing_type" mapstructure:"listing_type"`

	Other map[string]interface{} `mapstructure:",remain"`
}

type ItemListed added in v0.7.3

type ItemListed struct {
	EventType string            `json:"event_type" mapstructure:"event_type"`
	SentAt    time.Time         `json:"sent_at"    mapstructure:"sent_at"`
	Payload   ItemListedPayload `json:"payload"    mapstructure:"payload"`

	Other map[string]interface{} `mapstructure:",remain"`
}

type ItemListedPayload added in v0.11.1

type ItemListedPayload struct {
	EventPayload `mapstructure:",squash"`
	Item         Item        `json:"item"            mapstructure:"item"`
	IsPrivate    bool        `json:"is_private"      mapstructure:"is_private"`
	ListingDate  time.Time   `json:"listing_date"    mapstructure:"listing_date"`
	ListingType  interface{} `json:"listing_type"    mapstructure:"listing_type"`

	Other map[string]interface{} `mapstructure:",remain"`
}

type ItemMetadataUpdated added in v0.11.0

type ItemMetadataUpdated struct {
	Event   string                     `json:"event_type" mapstructure:"event_type"`
	SentAt  time.Time                  `json:"sent_at"    mapstructure:"sent_at"`
	Payload itemMetadataUpdatedPayload `json:"payload"    mapstructure:"payload"`

	Other map[string]interface{} `mapstructure:",remain"`
}

type ItemReceivedBid added in v0.7.3

type ItemReceivedBid struct {
	EventType string                 `json:"event_type" mapstructure:"event_type"`
	SentAt    time.Time              `json:"sent_at"    mapstructure:"sent_at"`
	Payload   ItemReceivedBidPayload `json:"payload"    mapstructure:"payload"`

	Other map[string]interface{} `mapstructure:",remain"`
}

type ItemReceivedBidPayload added in v0.7.3

type ItemReceivedBidPayload struct {
	Item         `json:"item"    mapstructure:"item"`
	EventPayload `json:"payload" mapstructure:",squash"`

	CreatedDate time.Time `json:"created_date" mapstructure:"created_date"`

	Other map[string]interface{} `mapstructure:",remain"`
}

type Metadata added in v0.11.0

type Metadata struct {
	Name            string          `json:"name"             mapstructure:"name"`
	Description     string          `json:"description"      mapstructure:"description"`
	BackgroundColor string          `json:"background_color" mapstructure:"background_color"`
	AnimationURL    string          `json:"animation_url"    mapstructure:"animation_url"`
	ImageURL        string          `json:"image_url"        mapstructure:"image_url"`
	MetadataURL     string          `json:"metadata_url"     mapstructure:"metadata_url"`
	Traits          []degendb.Trait `json:"traits"           mapstructure:"traits"`
}

type MgmtAction

type MgmtAction int64
const (
	// client actions.
	Subscribe MgmtAction = iota
	Unsubscribe

	// SendSlugs is used to request the slugs/events to subscribe to from the clients.
	SendSlugs
)

func (MgmtAction) String

func (a MgmtAction) String() string

type MgmtEvent

type MgmtEvent struct {
	Action MgmtAction           `json:"action"`
	Events []osmodels.EventType `json:"events"`
	Slugs  []string             `json:"slugs"`
}

type NftID added in v0.7.3

type NftID []string

func NewNftID added in v0.7.3

func NewNftID(chain string, contractAddress common.Address, tokenID *big.Int) *NftID

NewNftID returns a new NftID.

func ParseNftID added in v0.7.3

func ParseNftID(combinedNftID string) *NftID

ParseNftID parses a NftID from a string in the format "chain/contractAddress/tokenID".

func (*NftID) Chain added in v0.7.3

func (n *NftID) Chain() string

Chain returns the chain of the token.

func (*NftID) ContractAddress added in v0.7.3

func (n *NftID) ContractAddress() common.Address

ContractAddress returns the contract address of the token.

func (*NftID) Equal added in v0.7.3

func (n *NftID) Equal(other NftID) bool

Equal returns true if the NftID is equal to the other NftID.

func (*NftID) LinkOS added in v0.7.3

func (n *NftID) LinkOS() string

LinkOS returns a link to the token on OpenSea.

func (*NftID) String added in v0.7.3

func (n *NftID) String() string

func (*NftID) TID added in v0.7.3

func (n *NftID) TID() string

TID returns a shorter variant of the NftID, lacking the chain.

func (*NftID) TokenID added in v0.7.3

func (n *NftID) TokenID() *big.Int

TokenID returns the tokens ID.

type Parameters added in v0.11.0

type Parameters struct {
	ConduitKey                      string          `json:"conduitKey"                      mapstructure:"conduitKey"`
	Consideration                   []Consideration `json:"consideration,omitempty"         mapstructure:"consideration,omitempty"`
	Counter                         interface{}     `json:"counter"                         mapstructure:"counter"`
	EndTime                         time.Time       `json:"endTime"                         mapstructure:"endTime"`
	Offer                           []Consideration `json:"offer,omitempty"                 mapstructure:"offer,omitempty"`
	Offerer                         string          `json:"offerer"                         mapstructure:"offerer"`
	OrderType                       int             `json:"orderType"                       mapstructure:"orderType"`
	Salt                            string          `json:"salt,omitempty"                  mapstructure:"salt,omitempty"`
	StartTime                       time.Time       `json:"startTime"                       mapstructure:"startTime"`
	TotalOriginalConsiderationItems int             `json:"totalOriginalConsiderationItems" mapstructure:"totalOriginalConsiderationItems"`
	Zone                            common.Address  `json:"zone"                            mapstructure:"zone"`
	ZoneHash                        common.Hash     `json:"zoneHash"                        mapstructure:"zoneHash"`
}

type PaymentToken added in v0.7.3

type PaymentToken struct {
	Address  common.Address `json:"address"`
	Decimals int            `json:"decimals"`
	EthPrice string         `json:"eth_price"`
	Name     string         `json:"name"`
	Symbol   string         `json:"symbol"`
	UsdPrice string         `json:"usd_price"`
}

type ProtocolData added in v0.7.3

type ProtocolData struct {
	Parameters                            `json:"parameters,omitempty"                        mapstructure:"parameters,omitempty"`
	Signature                             string `json:"signature"                                   mapstructure:"signature"`
	UseLazyMintAdapterForSharedStorefront bool   `json:"use_lazy_mint_adapter_for_shared_storefront" mapstructure:"use_lazy_mint_adapter_for_shared_storefront"`
}

type TraitCriteria added in v0.11.0

type TraitCriteria struct {
	TraitName string `json:"trait_name"`
	TraitType string `json:"trait_type"`
}

Jump to

Keyboard shortcuts

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