models

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 CollectionOffer added in v0.7.3

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

type CollectionSlug added in v0.7.3

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

func (*CollectionSlug) GetCollectionSlug added in v0.7.3

func (c *CollectionSlug) GetCollectionSlug() string

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

	Collection CollectionSlug `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 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"`

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

func (EventPayload) GetPrice added in v0.7.3

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

type Item added in v0.7.3

type Item struct {
	Chain struct {
		Name string `json:"name" mapstructure:"name"`
	} `json:"chain" mapstructure:"chain"`
	Metadata struct {
		AnimationURL string `json:"animation_url" mapstructure:"animation_url"`
		ImageURL     string `json:"image_url"     mapstructure:"image_url"`
		MetadataURL  string `json:"metadata_url"  mapstructure:"metadata_url"`
		Name         string `json:"name"          mapstructure:"name"`
	} `json:"metadata"`
	NftID     NftID  `json:"nft_id"    mapstructure:"nft_id"`
	Permalink string `json:"permalink" mapstructure:"permalink"`

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

type ItemListed added in v0.7.3

type ItemListed struct {
	// Event     string            `json:"event"      mapstructure:"event"`
	Event   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 ItemReceivedBid added in v0.7.3

type ItemReceivedBid struct {
	// EventType string                 `json:"event_type" mapstructure:"event_type"`
	Event   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 {
	EventPayload `mapstructure:",squash"`

	Item Item `json:"item" mapstructure:"item"`

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

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

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

func ParseNftID added in v0.7.3

func ParseNftID(combinedNftID string) NftID

func (NftID) Chain added in v0.7.3

func (n NftID) Chain() string

func (NftID) ContractAddress added in v0.7.3

func (n NftID) ContractAddress() common.Address

func (NftID) Equal added in v0.7.3

func (n NftID) Equal(other NftID) bool

func (NftID) LinkOS added in v0.7.3

func (n NftID) LinkOS() string

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

func (NftID) TokenID added in v0.7.3

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

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 struct {
		ConduitKey                      string          `json:"conduitKey"`
		Consideration                   []Consideration `json:"consideration,omitempty"         mapstructure:"consideration,omitempty"`
		Counter                         interface{}     `json:"counter"`
		EndTime                         time.Time       `json:"endTime"`
		Offer                           []Consideration `json:"offer,omitempty"                 mapstructure:"offer,omitempty"`
		Offerer                         string          `json:"offerer"`
		OrderType                       int             `json:"orderType"`
		Salt                            string          `json:"salt,omitempty"                  mapstructure:"salt,omitempty"`
		StartTime                       time.Time       `json:"startTime"`
		TotalOriginalConsiderationItems int             `json:"totalOriginalConsiderationItems"`
		Zone                            common.Address  `json:"zone"`
		ZoneHash                        common.Hash     `json:"zoneHash"`
	} `json:"parameters,omitempty"                        mapstructure:"parameters,omitempty"`
	Signature                             string `json:"signature"`
	UseLazyMintAdapterForSharedStorefront bool   `json:"use_lazy_mint_adapter_for_shared_storefront"`
}

Jump to

Keyboard shortcuts

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