nft

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParseAddress = mavryk.ParseAddress
)

Functions

This section is empty.

Types

type Address

type Address = mavryk.Address

type NftAPI

type NftAPI interface {
	GetMarket(context.Context, Address) (*NftMarket, error)
	ListMarketEvents(context.Context, Address, Query) ([]*NftEvent, error)
	ListMarketPositions(context.Context, Address, Query) ([]*NftPosition, error)
	ListMarketTrades(context.Context, Address, Query) ([]*NftTrade, error)

	// firehose
	ListMarkets(context.Context, Query) ([]*NftMarket, error)
	ListEvents(context.Context, Query) ([]*NftEvent, error)
	ListPositions(context.Context, Query) ([]*NftPosition, error)
	ListTrades(context.Context, Query) ([]*NftTrade, error)
}

func NewNftAPI

func NewNftAPI(c *client.Client) NftAPI

type NftEvent

type NftEvent struct {
	Id         uint64    `json:"id"`
	Contract   Address   `json:"contract"`
	Name       string    `json:"name"`
	Entity     string    `json:"entity"`
	Category   string    `json:"category"`
	EventType  string    `json:"event_type"`
	SaleId     int64     `json:"sale_id"`
	SaleType   string    `json:"sale_type"`
	Collection Address   `json:"collection"`
	TokenId    Z         `json:"token_id,omitempty"`
	Currency   *Token    `json:"currency,omitempty"`
	NumUnits   int64     `json:"num_units,omitempty"`
	Amount     Z         `json:"amount,omitempty"`
	Fee        Z         `json:"fee,omitempty"`
	Royalty    Z         `json:"royalty,omitempty"`
	RoyaltyBps int64     `json:"royalty_bps,omitempty"`
	Signer     Address   `json:"signer"`
	Sender     Address   `json:"sender"`
	TxHash     OpHash    `json:"tx_hash"`
	TxFee      int64     `json:"tx_fee,string"`
	Block      int64     `json:"block"`
	Time       time.Time `json:"time"`
}

type NftMarket

type NftMarket struct {
	Id         uint64    `json:"id"`
	Contract   Address   `json:"contract"`
	Kind       string    `json:"kind"`
	Creator    Address   `json:"creator"`
	Name       string    `json:"name"`
	Entity     string    `json:"entity"`
	Tags       []string  `json:"tags"`
	FirstBlock int64     `json:"first_block"`
	FirstTime  time.Time `json:"first_time"`
}

type NftPosition

type NftPosition struct {
	Id         uint64     `json:"id"`
	Contract   Address    `json:"contract"`
	Name       string     `json:"name"`
	Entity     string     `json:"entity"`
	Category   string     `json:"category"`
	SaleId     int64      `json:"sale_id"`
	SaleType   string     `json:"sale_type"`
	SaleStatus string     `json:"sale_status"`
	IsClosed   bool       `json:"is_closed"`
	Collection Address    `json:"collection"`
	TokenId    Z          `json:"token_id"`
	Currency   *Token     `json:"currency"`
	Seller     Address    `json:"seller"`
	Buyer      Address    `json:"buyer"`
	AskPrice   Z          `json:"ask_price"`
	BidPrice   Z          `json:"bid_price"`
	MaxUnits   int64      `json:"max_units"`
	SoldUnits  int64      `json:"sold_units"`
	RoyaltyBps int64      `json:"royalty_bps"`
	OpenBlock  int64      `json:"open_block"`
	OpenTime   time.Time  `json:"open_time"`
	CloseBlock int64      `json:"close_block,omitempty"`
	CloseTime  *time.Time `json:"close_time,omitempty"`
}

type NftTrade

type NftTrade struct {
	Id         uint64    `json:"id"`
	Contract   Address   `json:"contract"`
	Name       string    `json:"name"`
	Entity     string    `json:"entity"`
	Category   string    `json:"category"`
	SaleId     int64     `json:"sale_id"`
	SaleType   string    `json:"sale_type"`
	Collection Address   `json:"collection"`
	TokenId    Z         `json:"token_id"`
	NumUnits   int64     `json:"num_units"`
	Currency   *Token    `json:"currency"`
	Price      Z         `json:"price"`
	Fee        Z         `json:"fee"`
	Royalty    Z         `json:"royalty"`
	Seller     Address   `json:"seller"`
	Buyer      Address   `json:"buyer"`
	TxHash     OpHash    `json:"tx_hash"`
	TxFee      int64     `json:"tx_fee,string"`
	Block      int64     `json:"block"`
	Time       time.Time `json:"time"`
}

type OpHash

type OpHash = mavryk.OpHash

type Query

type Query = client.Query

type Token

type Token = token.Token

type Z

type Z = mavryk.Z

Jump to

Keyboard shortcuts

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