marketplace

package
v0.50.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

marketplace-api 864a8df03c02985cd6bfaa4ce719d87e2a08eb67 -- Code generated by webrpc-gen@v0.22.1 with golang generator. DO NOT EDIT.

webrpc-gen -schema=proto/marketplace.ridl -target=golang -pkg=marketplace -client -out=proto/clients/marketplace.gen.go

Index

Constants

View Source
const (
	AdminPathPrefix       = "/rpc/Admin/"
	MarketplacePathPrefix = "/rpc/Marketplace/"
)
View Source
const WebrpcHeader = "Webrpc"
View Source
const WebrpcHeaderValue = "webrpc@v0.22.1;gen-golang@v0.17.0;marketplace-api@v0.0.0-864a8df03c02985cd6bfaa4ce719d87e2a08eb67"

Variables

View Source
var (
	HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"}
	HTTPRequestCtxKey              = &contextKey{"HTTPRequest"}

	ServiceNameCtxKey = &contextKey{"ServiceName"}

	MethodNameCtxKey = &contextKey{"MethodName"}
)
View Source
var (
	ErrWebrpcEndpoint           = WebRPCError{Code: 0, Name: "WebrpcEndpoint", Message: "endpoint error", HTTPStatus: 400}
	ErrWebrpcRequestFailed      = WebRPCError{Code: -1, Name: "WebrpcRequestFailed", Message: "request failed", HTTPStatus: 400}
	ErrWebrpcBadRoute           = WebRPCError{Code: -2, Name: "WebrpcBadRoute", Message: "bad route", HTTPStatus: 404}
	ErrWebrpcBadMethod          = WebRPCError{Code: -3, Name: "WebrpcBadMethod", Message: "bad method", HTTPStatus: 405}
	ErrWebrpcBadRequest         = WebRPCError{Code: -4, Name: "WebrpcBadRequest", Message: "bad request", HTTPStatus: 400}
	ErrWebrpcBadResponse        = WebRPCError{Code: -5, Name: "WebrpcBadResponse", Message: "bad response", HTTPStatus: 500}
	ErrWebrpcServerPanic        = WebRPCError{Code: -6, Name: "WebrpcServerPanic", Message: "server panic", HTTPStatus: 500}
	ErrWebrpcInternalError      = WebRPCError{Code: -7, Name: "WebrpcInternalError", Message: "internal error", HTTPStatus: 500}
	ErrWebrpcClientDisconnected = WebRPCError{Code: -8, Name: "WebrpcClientDisconnected", Message: "client disconnected", HTTPStatus: 400}
	ErrWebrpcStreamLost         = WebRPCError{Code: -9, Name: "WebrpcStreamLost", Message: "stream lost", HTTPStatus: 400}
	ErrWebrpcStreamFinished     = WebRPCError{Code: -10, Name: "WebrpcStreamFinished", Message: "stream finished", HTTPStatus: 200}
)

Webrpc errors

View Source
var (
	ErrUnauthorized        = WebRPCError{Code: 1000, Name: "Unauthorized", Message: "Unauthorized access", HTTPStatus: 401}
	ErrPermissionDenied    = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403}
	ErrSessionExpired      = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403}
	ErrMethodNotFound      = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404}
	ErrTimeout             = WebRPCError{Code: 2000, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408}
	ErrInvalidArgument     = WebRPCError{Code: 2001, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400}
	ErrNotFound            = WebRPCError{Code: 3000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400}
	ErrUserNotFound        = WebRPCError{Code: 3001, Name: "UserNotFound", Message: "User not found", HTTPStatus: 400}
	ErrProjectNotFound     = WebRPCError{Code: 3002, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 400}
	ErrInvalidTier         = WebRPCError{Code: 3003, Name: "InvalidTier", Message: "Invalid subscription tier", HTTPStatus: 400}
	ErrProjectLimitReached = WebRPCError{Code: 3005, Name: "ProjectLimitReached", Message: "Project limit reached", HTTPStatus: 402}
	ErrNotImplemented      = WebRPCError{Code: 9999, Name: "NotImplemented", Message: "Not Implemented", HTTPStatus: 500}
)

Schema errors

View Source
var ActivityAction_name = map[uint8]string{
	0: "unknown",
	1: "listing",
	2: "offer",
	3: "mint",
	4: "sale",
	5: "listingCancel",
	6: "offerCancel",
	7: "transfer",
}
View Source
var ActivityAction_value = map[string]uint8{
	"unknown":       0,
	"listing":       1,
	"offer":         2,
	"mint":          3,
	"sale":          4,
	"listingCancel": 5,
	"offerCancel":   6,
	"transfer":      7,
}
View Source
var CollectibleStatus_name = map[uint8]string{
	0: "unknown",
	1: "active",
	2: "inactive",
}
View Source
var CollectibleStatus_value = map[string]uint8{
	"unknown":  0,
	"active":   1,
	"inactive": 2,
}
View Source
var CollectionPriority_name = map[uint8]string{
	0: "unknown",
	1: "low",
	2: "normal",
	3: "high",
}
View Source
var CollectionPriority_value = map[string]uint8{
	"unknown": 0,
	"low":     1,
	"normal":  2,
	"high":    3,
}
View Source
var CollectionStatus_name = map[uint8]string{
	0:  "unknown",
	1:  "created",
	2:  "syncing_contract_metadata",
	3:  "synced_contract_metadata",
	4:  "syncing_metadata",
	5:  "synced_metadata",
	6:  "syncing_tokens",
	7:  "synced_tokens",
	8:  "syncing_orders",
	9:  "active",
	10: "failed",
	11: "inactive",
	12: "incompatible_type",
}
View Source
var CollectionStatus_value = map[string]uint8{
	"unknown":                   0,
	"created":                   1,
	"syncing_contract_metadata": 2,
	"synced_contract_metadata":  3,
	"syncing_metadata":          4,
	"synced_metadata":           5,
	"syncing_tokens":            6,
	"synced_tokens":             7,
	"syncing_orders":            8,
	"active":                    9,
	"failed":                    10,
	"inactive":                  11,
	"incompatible_type":         12,
}
View Source
var ContractType_name = map[uint16]string{
	0: "UNKNOWN",
	1: "ERC20",
	2: "ERC721",
	3: "ERC1155",
}
View Source
var ContractType_value = map[string]uint16{
	"UNKNOWN": 0,
	"ERC20":   1,
	"ERC721":  2,
	"ERC1155": 3,
}
View Source
var CurrencyStatus_name = map[uint8]string{
	0: "unknown",
	1: "created",
	2: "syncing_metadata",
	3: "active",
	4: "failed",
}
View Source
var CurrencyStatus_value = map[string]uint8{
	"unknown":          0,
	"created":          1,
	"syncing_metadata": 2,
	"active":           3,
	"failed":           4,
}
View Source
var ExecuteType_name = map[uint32]string{
	0: "unknown",
	1: "order",
}
View Source
var ExecuteType_value = map[string]uint32{
	"unknown": 0,
	"order":   1,
}
View Source
var MarketplaceKind_name = map[uint32]string{
	0:  "unknown",
	1:  "sequence_marketplace_v1",
	2:  "sequence_marketplace_v2",
	3:  "blur",
	4:  "zerox",
	5:  "opensea",
	6:  "looks_rare",
	7:  "x2y2",
	8:  "alienswap",
	9:  "payment_processor",
	10: "mintify",
}
View Source
var MarketplaceKind_value = map[string]uint32{
	"unknown":                 0,
	"sequence_marketplace_v1": 1,
	"sequence_marketplace_v2": 2,
	"blur":                    3,
	"zerox":                   4,
	"opensea":                 5,
	"looks_rare":              6,
	"x2y2":                    7,
	"alienswap":               8,
	"payment_processor":       9,
	"mintify":                 10,
}
View Source
var OrderSide_name = map[uint8]string{
	0: "unknown",
	1: "listing",
	2: "offer",
}
View Source
var OrderSide_value = map[string]uint8{
	"unknown": 0,
	"listing": 1,
	"offer":   2,
}
View Source
var OrderStatus_name = map[uint8]string{
	0: "unknown",
	1: "active",
	2: "inactive",
	3: "expired",
	4: "cancelled",
	5: "filled",
	6: "decimals_missing",
}
View Source
var OrderStatus_value = map[string]uint8{
	"unknown":          0,
	"active":           1,
	"inactive":         2,
	"expired":          3,
	"cancelled":        4,
	"filled":           5,
	"decimals_missing": 6,
}
View Source
var OrderbookKind_name = map[uint32]string{
	0: "unknown",
	1: "sequence_marketplace_v1",
	2: "sequence_marketplace_v2",
	3: "blur",
	4: "opensea",
	5: "looks_rare",
	6: "reservoir",
	7: "x2y2",
}
View Source
var OrderbookKind_value = map[string]uint32{
	"unknown":                 0,
	"sequence_marketplace_v1": 1,
	"sequence_marketplace_v2": 2,
	"blur":                    3,
	"opensea":                 4,
	"looks_rare":              5,
	"reservoir":               6,
	"x2y2":                    7,
}
View Source
var ProjectStatus_name = map[uint8]string{
	0: "unknown",
	1: "active",
	2: "inactive",
}
View Source
var ProjectStatus_value = map[string]uint8{
	"unknown":  0,
	"active":   1,
	"inactive": 2,
}
View Source
var PropertyType_name = map[uint32]string{
	0: "INT",
	1: "STRING",
	2: "ARRAY",
	3: "GENERIC",
}
View Source
var PropertyType_value = map[string]uint32{
	"INT":     0,
	"STRING":  1,
	"ARRAY":   2,
	"GENERIC": 3,
}
View Source
var SortOrder_name = map[uint32]string{
	0: "DESC",
	1: "ASC",
}
View Source
var SortOrder_value = map[string]uint32{
	"DESC": 0,
	"ASC":  1,
}
View Source
var SourceKind_name = map[uint32]string{
	0: "unknown",
	1: "external",
	2: "sequence_marketplace_v1",
	3: "sequence_marketplace_v2",
}
View Source
var SourceKind_value = map[string]uint32{
	"unknown":                 0,
	"external":                1,
	"sequence_marketplace_v1": 2,
	"sequence_marketplace_v2": 3,
}
View Source
var StepType_name = map[uint8]string{
	0: "unknown",
	1: "tokenApproval",
	2: "buy",
	3: "sell",
	4: "createListing",
	5: "createOffer",
	6: "signEIP712",
	7: "signEIP191",
	8: "cancel",
}
View Source
var StepType_value = map[string]uint8{
	"unknown":       0,
	"tokenApproval": 1,
	"buy":           2,
	"sell":          3,
	"createListing": 4,
	"createOffer":   5,
	"signEIP712":    6,
	"signEIP191":    7,
	"cancel":        8,
}
View Source
var TransactionCrypto_name = map[uint32]string{
	0: "none",
	1: "partially",
	2: "all",
}
View Source
var TransactionCrypto_value = map[string]uint32{
	"none":      0,
	"partially": 1,
	"all":       2,
}
View Source
var TransactionNFTCheckoutProvider_name = map[uint32]string{
	0: "unknown",
	1: "sardine",
	2: "transak",
}
View Source
var TransactionNFTCheckoutProvider_value = map[string]uint32{
	"unknown": 0,
	"sardine": 1,
	"transak": 2,
}
View Source
var TransactionOnRampProvider_name = map[uint32]string{
	0: "unknown",
	1: "sardine",
	2: "transak",
}
View Source
var TransactionOnRampProvider_value = map[string]uint32{
	"unknown": 0,
	"sardine": 1,
	"transak": 2,
}
View Source
var TransactionSwapProvider_name = map[uint32]string{
	0: "unknown",
	1: "zerox",
}
View Source
var TransactionSwapProvider_value = map[string]uint32{
	"unknown": 0,
	"zerox":   1,
}
View Source
var WalletKind_name = map[uint8]string{
	0: "unknown",
	1: "sequence",
}
View Source
var WalletKind_value = map[string]uint8{
	"unknown":  0,
	"sequence": 1,
}
View Source
var WebRPCServices = map[string][]string{
	"Admin": {
		"CreateCollection",
		"GetCollection",
		"UpdateCollection",
		"ListCollections",
		"DeleteCollection",
		"SyncCollection",
		"CreateCurrency",
		"CreateCurrencies",
		"UpdateCurrency",
		"ListCurrencies",
		"DeleteCurrency",
	},
	"Marketplace": {
		"ListCurrencies",
		"GetCollectionDetail",
		"GetCollectible",
		"GetLowestPriceOfferForCollectible",
		"GetHighestPriceOfferForCollectible",
		"GetLowestPriceListingForCollectible",
		"GetHighestPriceListingForCollectible",
		"ListListingsForCollectible",
		"ListOffersForCollectible",
		"GetCountOfListingsForCollectible",
		"GetCountOfOffersForCollectible",
		"GetCollectibleLowestOffer",
		"GetCollectibleHighestOffer",
		"GetCollectibleLowestListing",
		"GetCollectibleHighestListing",
		"ListCollectibleListings",
		"ListCollectibleOffers",
		"GenerateBuyTransaction",
		"GenerateSellTransaction",
		"GenerateListingTransaction",
		"GenerateOfferTransaction",
		"GenerateCancelTransaction",
		"Execute",
		"ListCollectibles",
		"GetCountOfAllCollectibles",
		"GetCountOfFilteredCollectibles",
		"GetFloorOrder",
		"ListCollectionActivities",
		"ListCollectibleActivities",
		"ListCollectiblesWithLowestListing",
		"ListCollectiblesWithHighestOffer",
		"SyncOrder",
		"SyncOrders",
		"GetOrders",
		"CheckoutOptionsMarketplace",
		"CheckoutOptionsSalesContract",
	},
}

Functions

func HTTPRequestHeaders

func HTTPRequestHeaders(ctx context.Context) (http.Header, bool)

func MethodCtx added in v0.49.0

func MethodCtx(ctx context.Context) (method, bool)

func MethodNameFromContext

func MethodNameFromContext(ctx context.Context) string

func RequestFromContext

func RequestFromContext(ctx context.Context) *http.Request

func ServiceNameFromContext

func ServiceNameFromContext(ctx context.Context) string

func WebRPCSchemaHash

func WebRPCSchemaHash() string

Schema hash generated from your RIDL schema

func WebRPCSchemaVersion

func WebRPCSchemaVersion() string

Schema version of your RIDL schema

func WebRPCVersion

func WebRPCVersion() string

WebRPC description and code-gen version

func WebrpcMethods added in v0.49.0

func WebrpcMethods() map[string]method

func WithHTTPRequestHeaders

func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error)

Types

type Activity

type Activity struct {
	ID                   uint64          `json:"-" db:"id,omitempty"`
	CollectionID         uint64          `json:"-" db:"collection_id,omitempty"`
	CollectibleID        uint64          `json:"-" db:"collectible_id,omitempty"`
	ChainID              uint64          `json:"chainId" db:"chain_id"`
	ContractAddress      prototyp.Hash   `json:"contractAddress" db:"contract_address"`
	TokenID              prototyp.BigInt `json:"tokenId" db:"token_id"`
	Action               ActivityAction  `json:"action" db:"action"`
	TxHash               prototyp.Hash   `json:"txHash" db:"tx_hash"`
	Source               SourceKind      `json:"-" db:"source"`
	From                 prototyp.Hash   `json:"from" db:"from_address"`
	To                   prototyp.Hash   `json:"to" db:"to_address"`
	Quantity             prototyp.BigInt `json:"quantity" db:"qty"`
	QuantityDecimals     uint64          `json:"quantityDecimals" db:"qty_decimals"`
	PriceAmount          prototyp.BigInt `json:"priceAmount" db:"price_amount"`
	PriceAmountFormatted *string         `json:"priceAmountFormatted"`
	PriceCurrencyAddress prototyp.Hash   `json:"priceCurrencyAddress" db:"price_currency_address"`
	PriceDecimals        *uint64         `json:"priceDecimals" db:"price_decimals"`
	ActivityCreatedAt    time.Time       `json:"activityCreatedAt" db:"activity_created_at"`
	LogIndex             uint64          `json:"-" db:"log_index"`
	UniqueHash           prototyp.Hash   `json:"uniqueHash" db:"unique_hash"`
	CreatedAt            time.Time       `json:"createdAt" db:"created_at"`
	UpdatedAt            time.Time       `json:"updatedAt" db:"updated_at"`
	DeletedAt            *time.Time      `json:"deletedAt,omitempty" db:"deleted_at"`
}

type ActivityAction added in v0.49.0

type ActivityAction uint8
const (
	ActivityAction_unknown       ActivityAction = 0
	ActivityAction_listing       ActivityAction = 1
	ActivityAction_offer         ActivityAction = 2
	ActivityAction_mint          ActivityAction = 3
	ActivityAction_sale          ActivityAction = 4
	ActivityAction_listingCancel ActivityAction = 5
	ActivityAction_offerCancel   ActivityAction = 6
	ActivityAction_transfer      ActivityAction = 7
)

func (*ActivityAction) Is added in v0.49.0

func (x *ActivityAction) Is(values ...ActivityAction) bool

func (ActivityAction) MarshalText added in v0.49.0

func (x ActivityAction) MarshalText() ([]byte, error)

func (ActivityAction) String added in v0.49.0

func (x ActivityAction) String() string

func (*ActivityAction) UnmarshalText added in v0.49.0

func (x *ActivityAction) UnmarshalText(b []byte) error

type AdditionalFee added in v0.49.0

type AdditionalFee struct {
	Amount   string `json:"amount"`
	Receiver string `json:"receiver"`
}

type Admin

type Admin interface {
	CreateCollection(ctx context.Context, projectId uint64, contractAddress string) (*Collection, error)
	GetCollection(ctx context.Context, projectId uint64, contractAddress string) (*Collection, error)
	UpdateCollection(ctx context.Context, collection *Collection) (*Collection, error)
	ListCollections(ctx context.Context, projectId uint64, page *Page) ([]*Collection, *Page, error)
	DeleteCollection(ctx context.Context, projectId uint64, contractAddress string) (*Collection, error)
	// determine what should happen here
	SyncCollection(ctx context.Context, projectId uint64, contractAddress string) (*Collection, error)
	CreateCurrency(ctx context.Context, currency *Currency) (*Currency, error)
	CreateCurrencies(ctx context.Context, currencies []*Currency) (map[string]*Currency, error)
	UpdateCurrency(ctx context.Context, currency *Currency) (*Currency, error)
	ListCurrencies(ctx context.Context) ([]*Currency, error)
	DeleteCurrency(ctx context.Context, chainId uint64, contractAddress string) (*Currency, error)
}

type AdminClient

type AdminClient interface {
	CreateCollection(ctx context.Context, projectId uint64, contractAddress string) (*Collection, error)
	GetCollection(ctx context.Context, projectId uint64, contractAddress string) (*Collection, error)
	UpdateCollection(ctx context.Context, collection *Collection) (*Collection, error)
	ListCollections(ctx context.Context, projectId uint64, page *Page) ([]*Collection, *Page, error)
	DeleteCollection(ctx context.Context, projectId uint64, contractAddress string) (*Collection, error)
	// determine what should happen here
	SyncCollection(ctx context.Context, projectId uint64, contractAddress string) (*Collection, error)
	CreateCurrency(ctx context.Context, currency *Currency) (*Currency, error)
	CreateCurrencies(ctx context.Context, currencies []*Currency) (map[string]*Currency, error)
	UpdateCurrency(ctx context.Context, currency *Currency) (*Currency, error)
	ListCurrencies(ctx context.Context) ([]*Currency, error)
	DeleteCurrency(ctx context.Context, chainId uint64, contractAddress string) (*Currency, error)
}

func NewAdminClient

func NewAdminClient(addr string, client HTTPClient) AdminClient

func NewMarketplaceAdmin

func NewMarketplaceAdmin(projectAccessKey string, chainHandle string, options ...Options) AdminClient

type Asset

type Asset struct {
	// asset id
	ID uint64 `json:"id" db:"id,omitempty"`
	// collection id associated to this asset
	CollectionID uint64 `json:"collectionId" db:"collection_id"`
	// token id associated to this collection
	TokenID prototyp.BigInt `json:"tokenId" db:"token_id"`
	// url where we can view the asset contents
	// ie. https://metadata.sequence.app/projects/1/collections/1/tokens/1/image
	URL string `json:"url" db:"-"`
	// metadata field related to TokenMetadata, some field names:
	// ['image', 'video', 'audio', 'animation_url', ...]
	MetadataField string `json:"metadataField,omitempty" db:"metadata_field"`
	// asset details
	Filename  string    `json:"filename,omitempty" db:"filename"`
	Filesize  uint32    `json:"filesize,omitempty" db:"filesize"`
	MimeType  string    `json:"mimeType,omitempty" db:"mime_type"`
	Width     *uint16   `json:"width,omitempty" db:"width"`
	Height    *uint16   `json:"height,omitempty" db:"height"`
	UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
}

Asset is a database type used by 'collections' to record static assets for a particular 'token' for the token metadata.

db table: assets

type CheckoutOptions added in v0.49.0

type CheckoutOptions struct {
	Crypto      TransactionCrypto                `json:"crypto"`
	Swap        []TransactionSwapProvider        `json:"swap"`
	NFTCheckout []TransactionNFTCheckoutProvider `json:"nftCheckout"`
	OnRamp      []TransactionOnRampProvider      `json:"onRamp"`
}

type CheckoutOptionsItem added in v0.49.0

type CheckoutOptionsItem struct {
	TokenID  string          `json:"tokenId"`
	Quantity prototyp.BigInt `json:"quantity"`
}

type CheckoutOptionsMarketplaceOrder added in v0.49.0

type CheckoutOptionsMarketplaceOrder struct {
	ContractAddress prototyp.Hash   `json:"contractAddress"`
	OrderID         string          `json:"orderId"`
	Marketplace     MarketplaceKind `json:"marketplace"`
}

type Collectible

type Collectible struct {
	ID              uint64            `json:"-" db:"id,omitempty"`
	CollectionID    uint64            `json:"-" db:"collection_id,omitempty"`
	ChainID         uint64            `json:"chainId" db:"chain_id"`
	ContractAddress prototyp.Hash     `json:"contractAddress" db:"contract_address"`
	Status          CollectibleStatus `json:"status" db:"status"`
	TokenID         prototyp.BigInt   `json:"tokenId" db:"token_id"`
	Decimals        uint64            `json:"decimals" db:"decimals"`
	CreatedAt       time.Time         `json:"createdAt" db:"created_at"`
	UpdatedAt       time.Time         `json:"updatedAt" db:"updated_at"`
	DeletedAt       *time.Time        `json:"deletedAt,omitempty" db:"deleted_at"`
}

type CollectibleOrder

type CollectibleOrder struct {
	Metadata *TokenMetadata `json:"metadata"`
	Order    *Order         `json:"order"`
	Listing  *Order         `json:"listing"`
	Offer    *Order         `json:"offer"`
}

type CollectibleStatus

type CollectibleStatus uint8
const (
	CollectibleStatus_unknown  CollectibleStatus = 0
	CollectibleStatus_active   CollectibleStatus = 1
	CollectibleStatus_inactive CollectibleStatus = 2
)

func (*CollectibleStatus) Is

func (x *CollectibleStatus) Is(values ...CollectibleStatus) bool

func (CollectibleStatus) MarshalText

func (x CollectibleStatus) MarshalText() ([]byte, error)

func (CollectibleStatus) String

func (x CollectibleStatus) String() string

func (*CollectibleStatus) UnmarshalText

func (x *CollectibleStatus) UnmarshalText(b []byte) error

type CollectiblesFilter

type CollectiblesFilter struct {
	// include collectibles without any orders at the end of the list
	IncludeEmpty bool `json:"includeEmpty"`
	// search collectibles by text
	SearchText *string `json:"searchText"`
	// filter by metadata properties
	Properties []*PropertyFilter `json:"properties"`
	// filter only orders in specific marketplace
	Marketplaces []MarketplaceKind `json:"marketplaces"`
	// filter collectibles owned by given account addresses
	InAccounts []string `json:"inAccounts"`
	// filter out collectibles owned by given account addresses
	NotInAccounts []string `json:"notInAccounts"`
	// filter orders created by given account addresses
	OrdersCreatedBy []string `json:"ordersCreatedBy"`
	// filter out orders created by given account addresses
	OrdersNotCreatedBy []string `json:"ordersNotCreatedBy"`
	// filter orders in given currency address
	// (use '0x0000000000000000000000000000000000000000' for native currency)
	InCurrencyAddresses []string `json:"inCurrencyAddresses"`
	// filter out orders in given currency address
	// (use '0x0000000000000000000000000000000000000000' for native currency)
	NotInCurrencyAddresses []string `json:"notInCurrencyAddresses"`
}

type Collection

type Collection struct {
	ID                       uint64             `json:"-" db:"id,omitempty"`
	Status                   CollectionStatus   `json:"status" db:"status"`
	ChainID                  uint64             `json:"chainId" db:"chain_id"`
	ContractAddress          prototyp.Hash      `json:"contractAddress" db:"contract_address"`
	ContractType             ContractType       `json:"contractType" db:"contract_type"`
	Priority                 CollectionPriority `json:"priority" db:"priority"`
	TokenQuantityDecimals    uint64             `json:"tokenQuantityDecimals" db:"token_qty_decimals"`
	Config                   *CollectionConfig  `json:"config" db:"config"`
	SyncContractMetadataJob  uint64             `json:"-" db:"sync_contract_metadata_job"`
	RefreshMetadataJob       uint64             `json:"-" db:"refresh_metadata_job"`
	RefreshMetadataTimestamp time.Time          `json:"-" db:"refresh_metadata_timestamp"`
	CreatedAt                time.Time          `json:"createdAt" db:"created_at"`
	UpdatedAt                time.Time          `json:"updatedAt" db:"updated_at"`
	DeletedAt                *time.Time         `json:"deletedAt,omitempty" db:"deleted_at"`
}

type CollectionConfig

type CollectionConfig struct {
	LastSynced                 map[string]*CollectionLastSynced `json:"lastSynced"`
	CollectiblesSynced         time.Time                        `json:"collectiblesSynced"`
	ActivitiesSynced           time.Time                        `json:"activitiesSynced"`
	ActivitiesSyncedContinuity string                           `json:"activitiesSyncedContinuity"`
}

type CollectionLastSynced

type CollectionLastSynced struct {
	AllOrders time.Time `json:"allOrders"`
	NewOrders time.Time `json:"newOrders"`
}

type CollectionPriority added in v0.49.0

type CollectionPriority uint8
const (
	CollectionPriority_unknown CollectionPriority = 0
	CollectionPriority_low     CollectionPriority = 1
	CollectionPriority_normal  CollectionPriority = 2
	CollectionPriority_high    CollectionPriority = 3
)

func (*CollectionPriority) Is added in v0.49.0

func (x *CollectionPriority) Is(values ...CollectionPriority) bool

func (CollectionPriority) MarshalText added in v0.49.0

func (x CollectionPriority) MarshalText() ([]byte, error)

func (CollectionPriority) String added in v0.49.0

func (x CollectionPriority) String() string

func (*CollectionPriority) UnmarshalText added in v0.49.0

func (x *CollectionPriority) UnmarshalText(b []byte) error

type CollectionStatus

type CollectionStatus uint8
const (
	CollectionStatus_unknown                   CollectionStatus = 0
	CollectionStatus_created                   CollectionStatus = 1
	CollectionStatus_syncing_contract_metadata CollectionStatus = 2
	CollectionStatus_synced_contract_metadata  CollectionStatus = 3
	CollectionStatus_syncing_metadata          CollectionStatus = 4
	CollectionStatus_synced_metadata           CollectionStatus = 5
	CollectionStatus_syncing_tokens            CollectionStatus = 6
	CollectionStatus_synced_tokens             CollectionStatus = 7
	CollectionStatus_syncing_orders            CollectionStatus = 8
	CollectionStatus_active                    CollectionStatus = 9
	CollectionStatus_failed                    CollectionStatus = 10
	CollectionStatus_inactive                  CollectionStatus = 11
	CollectionStatus_incompatible_type         CollectionStatus = 12
)

func (*CollectionStatus) Is

func (x *CollectionStatus) Is(values ...CollectionStatus) bool

func (CollectionStatus) MarshalText

func (x CollectionStatus) MarshalText() ([]byte, error)

func (CollectionStatus) String

func (x CollectionStatus) String() string

func (*CollectionStatus) UnmarshalText

func (x *CollectionStatus) UnmarshalText(b []byte) error

type ContractType added in v0.49.0

type ContractType uint16
const (
	ContractType_UNKNOWN ContractType = 0
	ContractType_ERC20   ContractType = 1
	ContractType_ERC721  ContractType = 2
	ContractType_ERC1155 ContractType = 3
)

func (*ContractType) Is added in v0.49.0

func (x *ContractType) Is(values ...ContractType) bool

func (ContractType) MarshalText added in v0.49.0

func (x ContractType) MarshalText() ([]byte, error)

func (ContractType) String added in v0.49.0

func (x ContractType) String() string

func (*ContractType) UnmarshalText added in v0.49.0

func (x *ContractType) UnmarshalText(b []byte) error

type CreateReq added in v0.49.0

type CreateReq struct {
	TokenID         string `json:"tokenId"`
	Quantity        string `json:"quantity"`
	Expiry          string `json:"expiry"`
	CurrencyAddress string `json:"currencyAddress"`
	PricePerToken   string `json:"pricePerToken"`
}

type Currency

type Currency struct {
	ID                   uint64         `json:"-" db:"id,omitempty"`
	ChainID              uint64         `json:"chainId" db:"chain_id"`
	ContractAddress      prototyp.Hash  `json:"contractAddress,omitempty" db:"contract_address"`
	Status               CurrencyStatus `json:"status" db:"status"`
	Name                 string         `json:"name" db:"name"`
	Symbol               string         `json:"symbol" db:"symbol"`
	Decimals             uint64         `json:"decimals" db:"decimals"`
	ImageURL             string         `json:"imageUrl" db:"image_url"`
	ExchangeRate         float64        `json:"exchangeRate" db:"exchange_rate"`
	DefaultChainCurrency bool           `json:"defaultChainCurrency" db:"default_chain_currency"`
	NativeCurrency       bool           `json:"nativeCurrency" db:"native_currency"`
	CreatedAt            time.Time      `json:"createdAt" db:"created_at"`
	UpdatedAt            time.Time      `json:"updatedAt" db:"updated_at"`
	DeletedAt            *time.Time     `json:"deletedAt,omitempty" db:"deleted_at"`
	RefreshMetadataJob   uint64         `json:"-" db:"refresh_metadata_job"`
}

type CurrencyStatus added in v0.49.0

type CurrencyStatus uint8
const (
	CurrencyStatus_unknown          CurrencyStatus = 0
	CurrencyStatus_created          CurrencyStatus = 1
	CurrencyStatus_syncing_metadata CurrencyStatus = 2
	CurrencyStatus_active           CurrencyStatus = 3
	CurrencyStatus_failed           CurrencyStatus = 4
)

func (*CurrencyStatus) Is added in v0.49.0

func (x *CurrencyStatus) Is(values ...CurrencyStatus) bool

func (CurrencyStatus) MarshalText added in v0.49.0

func (x CurrencyStatus) MarshalText() ([]byte, error)

func (CurrencyStatus) String added in v0.49.0

func (x CurrencyStatus) String() string

func (*CurrencyStatus) UnmarshalText added in v0.49.0

func (x *CurrencyStatus) UnmarshalText(b []byte) error

type Domain added in v0.49.0

type Domain struct {
	Name              string `json:"name"`
	Version           string `json:"version"`
	ChainID           uint64 `json:"chainId"`
	VerifyingContract string `json:"verifyingContract"`
}

type ExecuteType added in v0.49.0

type ExecuteType uint32
const (
	ExecuteType_unknown ExecuteType = 0
	ExecuteType_order   ExecuteType = 1
)

func (*ExecuteType) Is added in v0.49.0

func (x *ExecuteType) Is(values ...ExecuteType) bool

func (ExecuteType) MarshalText added in v0.49.0

func (x ExecuteType) MarshalText() ([]byte, error)

func (ExecuteType) String added in v0.49.0

func (x ExecuteType) String() string

func (*ExecuteType) UnmarshalText added in v0.49.0

func (x *ExecuteType) UnmarshalText(b []byte) error

type FeeBreakdown

type FeeBreakdown struct {
	Kind             string `json:"kind"`
	RecipientAddress string `json:"recipientAddress"`
	Bps              int64  `json:"bps"`
}

type Filter

type Filter struct {
	Text       *string           `json:"text"`
	Properties []*PropertyFilter `json:"properties"`
}

copied from metadata filter PropertyFilter name -> name of the property, eg: hero type -> type of the values of the property, eg: Int, string min?, max? used if type is int, gives range of values for filtering values? -> if string then array of values, eg: ['Ada', 'Ari', 'Axel', 'Banjo' ...] NOTE: When Filter has an array of PropertyFilter, the logic used is an 'and' condition whereas if the user selects multiple values inside the PropertyFilter, they logic used is the 'or' condition this is to achieve the desired effect opensea had on their filters

type GetOrdersInput added in v0.49.0

type GetOrdersInput struct {
	ContractAddress prototyp.Hash   `json:"contractAddress"`
	OrderID         string          `json:"orderId"`
	Marketplace     MarketplaceKind `json:"marketplace"`
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

type Marketplace

type Marketplace interface {
	ListCurrencies(ctx context.Context) ([]*Currency, error)
	GetCollectionDetail(ctx context.Context, contractAddress string) (*Collection, error)
	GetCollectible(ctx context.Context, contractAddress string, tokenId string) (*TokenMetadata, error)
	GetLowestPriceOfferForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	GetHighestPriceOfferForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	GetLowestPriceListingForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	GetHighestPriceListingForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	ListListingsForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, skipRealtimeSync bool, page *Page) ([]*Order, *Page, error)
	ListOffersForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, skipRealtimeSync bool, page *Page) ([]*Order, *Page, error)
	GetCountOfListingsForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (uint64, error)
	GetCountOfOffersForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (uint64, error)
	// Deprecated:
	GetCollectibleLowestOffer(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	// Deprecated:
	GetCollectibleHighestOffer(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	// Deprecated:
	GetCollectibleLowestListing(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	// Deprecated:
	GetCollectibleHighestListing(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	// Deprecated:
	ListCollectibleListings(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, page *Page) ([]*Order, *Page, error)
	// Deprecated:
	ListCollectibleOffers(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, page *Page) ([]*Order, *Page, error)
	// checkout process
	GenerateBuyTransaction(ctx context.Context, collectionAddress string, buyer string, marketplace MarketplaceKind, ordersData []*OrderData, additionalFees []*AdditionalFee, walletType *WalletKind) ([]*Step, error)
	GenerateSellTransaction(ctx context.Context, collectionAddress string, seller string, marketplace MarketplaceKind, ordersData []*OrderData, additionalFees []*AdditionalFee, walletType *WalletKind) ([]*Step, error)
	GenerateListingTransaction(ctx context.Context, collectionAddress string, owner string, contractType ContractType, orderbook OrderbookKind, listing *CreateReq, walletType *WalletKind) ([]*Step, error)
	GenerateOfferTransaction(ctx context.Context, collectionAddress string, maker string, contractType ContractType, orderbook OrderbookKind, offer *CreateReq, walletType *WalletKind) ([]*Step, error)
	GenerateCancelTransaction(ctx context.Context, collectionAddress string, maker string, marketplace MarketplaceKind, orderId string) ([]*Step, error)
	// only used in a case of external transactions ( when we create off-chain transactions ) for instance opensea market
	Execute(ctx context.Context, signature string, executeType ExecuteType, body interface{}) (string, error)
	// list of collectibles with best order for each collectible, by default this only returns collectibles with an order
	ListCollectibles(ctx context.Context, side OrderSide, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOrder, *Page, error)
	GetCountOfAllCollectibles(ctx context.Context, contractAddress string) (uint64, error)
	GetCountOfFilteredCollectibles(ctx context.Context, side OrderSide, contractAddress string, filter *CollectiblesFilter) (uint64, error)
	GetFloorOrder(ctx context.Context, contractAddress string, filter *CollectiblesFilter) (*CollectibleOrder, error)
	ListCollectionActivities(ctx context.Context, contractAddress string, page *Page) ([]*Activity, *Page, error)
	ListCollectibleActivities(ctx context.Context, contractAddress string, tokenId string, page *Page) ([]*Activity, *Page, error)
	ListCollectiblesWithLowestListing(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOrder, *Page, error)
	ListCollectiblesWithHighestOffer(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOrder, *Page, error)
	SyncOrder(ctx context.Context, order *Order) error
	SyncOrders(ctx context.Context, orders []*Order) error
	GetOrders(ctx context.Context, input []*GetOrdersInput, page *Page) ([]*Order, *Page, error)
	CheckoutOptionsMarketplace(ctx context.Context, wallet string, orders []*CheckoutOptionsMarketplaceOrder, additionalFee int) (*CheckoutOptions, error)
	CheckoutOptionsSalesContract(ctx context.Context, wallet string, contractAddress string, collectionAddress string, items []*CheckoutOptionsItem) (*CheckoutOptions, error)
}

type MarketplaceClient

type MarketplaceClient interface {
	ListCurrencies(ctx context.Context) ([]*Currency, error)
	GetCollectionDetail(ctx context.Context, contractAddress string) (*Collection, error)
	GetCollectible(ctx context.Context, contractAddress string, tokenId string) (*TokenMetadata, error)
	GetLowestPriceOfferForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	GetHighestPriceOfferForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	GetLowestPriceListingForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	GetHighestPriceListingForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	ListListingsForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, skipRealtimeSync bool, page *Page) ([]*Order, *Page, error)
	ListOffersForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, skipRealtimeSync bool, page *Page) ([]*Order, *Page, error)
	GetCountOfListingsForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (uint64, error)
	GetCountOfOffersForCollectible(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (uint64, error)
	// Deprecated:
	GetCollectibleLowestOffer(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	// Deprecated:
	GetCollectibleHighestOffer(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	// Deprecated:
	GetCollectibleLowestListing(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	// Deprecated:
	GetCollectibleHighestListing(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error)
	// Deprecated:
	ListCollectibleListings(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, page *Page) ([]*Order, *Page, error)
	// Deprecated:
	ListCollectibleOffers(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, page *Page) ([]*Order, *Page, error)
	// checkout process
	GenerateBuyTransaction(ctx context.Context, collectionAddress string, buyer string, marketplace MarketplaceKind, ordersData []*OrderData, additionalFees []*AdditionalFee, walletType *WalletKind) ([]*Step, error)
	GenerateSellTransaction(ctx context.Context, collectionAddress string, seller string, marketplace MarketplaceKind, ordersData []*OrderData, additionalFees []*AdditionalFee, walletType *WalletKind) ([]*Step, error)
	GenerateListingTransaction(ctx context.Context, collectionAddress string, owner string, contractType ContractType, orderbook OrderbookKind, listing *CreateReq, walletType *WalletKind) ([]*Step, error)
	GenerateOfferTransaction(ctx context.Context, collectionAddress string, maker string, contractType ContractType, orderbook OrderbookKind, offer *CreateReq, walletType *WalletKind) ([]*Step, error)
	GenerateCancelTransaction(ctx context.Context, collectionAddress string, maker string, marketplace MarketplaceKind, orderId string) ([]*Step, error)
	// only used in a case of external transactions ( when we create off-chain transactions ) for instance opensea market
	Execute(ctx context.Context, signature string, executeType ExecuteType, body interface{}) (string, error)
	// list of collectibles with best order for each collectible, by default this only returns collectibles with an order
	ListCollectibles(ctx context.Context, side OrderSide, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOrder, *Page, error)
	GetCountOfAllCollectibles(ctx context.Context, contractAddress string) (uint64, error)
	GetCountOfFilteredCollectibles(ctx context.Context, side OrderSide, contractAddress string, filter *CollectiblesFilter) (uint64, error)
	GetFloorOrder(ctx context.Context, contractAddress string, filter *CollectiblesFilter) (*CollectibleOrder, error)
	ListCollectionActivities(ctx context.Context, contractAddress string, page *Page) ([]*Activity, *Page, error)
	ListCollectibleActivities(ctx context.Context, contractAddress string, tokenId string, page *Page) ([]*Activity, *Page, error)
	ListCollectiblesWithLowestListing(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOrder, *Page, error)
	ListCollectiblesWithHighestOffer(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOrder, *Page, error)
	SyncOrder(ctx context.Context, order *Order) error
	SyncOrders(ctx context.Context, orders []*Order) error
	GetOrders(ctx context.Context, input []*GetOrdersInput, page *Page) ([]*Order, *Page, error)
	CheckoutOptionsMarketplace(ctx context.Context, wallet string, orders []*CheckoutOptionsMarketplaceOrder, additionalFee int) (*CheckoutOptions, error)
	CheckoutOptionsSalesContract(ctx context.Context, wallet string, contractAddress string, collectionAddress string, items []*CheckoutOptionsItem) (*CheckoutOptions, error)
}

func NewMarketplaceClient

func NewMarketplaceClient(addr string, client HTTPClient) MarketplaceClient

type MarketplaceKind

type MarketplaceKind uint32
const (
	MarketplaceKind_unknown                 MarketplaceKind = 0
	MarketplaceKind_sequence_marketplace_v1 MarketplaceKind = 1
	MarketplaceKind_sequence_marketplace_v2 MarketplaceKind = 2
	MarketplaceKind_blur                    MarketplaceKind = 3
	MarketplaceKind_zerox                   MarketplaceKind = 4
	MarketplaceKind_opensea                 MarketplaceKind = 5
	MarketplaceKind_looks_rare              MarketplaceKind = 6
	MarketplaceKind_x2y2                    MarketplaceKind = 7
	MarketplaceKind_alienswap               MarketplaceKind = 8
	MarketplaceKind_payment_processor       MarketplaceKind = 9
	MarketplaceKind_mintify                 MarketplaceKind = 10
)

func (*MarketplaceKind) Is

func (x *MarketplaceKind) Is(values ...MarketplaceKind) bool

func (MarketplaceKind) MarshalText

func (x MarketplaceKind) MarshalText() ([]byte, error)

func (MarketplaceKind) String

func (x MarketplaceKind) String() string

func (*MarketplaceKind) UnmarshalText

func (x *MarketplaceKind) UnmarshalText(b []byte) error

type Options

type Options struct {
	MarketplaceAPIURL string
	JWTAuthToken      string
	HTTPClient        HTTPClient
}

type Order

type Order struct {
	ID            uint64          `json:"-" db:"id,omitempty"`
	CollectionID  uint64          `json:"-" db:"collection_id,omitempty"`
	CollectibleID uint64          `json:"-" db:"collectible_id,omitempty"`
	OrderID       string          `json:"orderId" db:"order_id"`
	Marketplace   MarketplaceKind `json:"marketplace" db:"marketplace"`
	Source        SourceKind      `json:"-" db:"source"`
	Side          OrderSide       `json:"side" db:"side"`
	Status        OrderStatus     `json:"status" db:"status"`
	ChainID       uint64          `json:"chainId" db:"chain_id"`
	OriginName    string          `json:"originName,omitempty" db:"origin_name"`
	// contract
	CollectionContractAddress  prototyp.Hash   `json:"collectionContractAddress" db:"contract_address"`
	TokenID                    prototyp.BigInt `json:"tokenId" db:"token_id"`
	CreatedBy                  prototyp.Hash   `json:"createdBy" db:"created_by"`
	PriceAmount                prototyp.BigInt `json:"priceAmount" db:"price_amount"`
	PriceAmountFormatted       string          `json:"priceAmountFormatted"`
	PriceAmountNet             prototyp.BigInt `json:"priceAmountNet" db:"price_amount_net"`
	PriceAmountNetFormatted    string          `json:"priceAmountNetFormatted"`
	PriceCurrencyAddress       prototyp.Hash   `json:"priceCurrencyAddress" db:"price_currency_address"`
	PriceDecimals              uint64          `json:"priceDecimals" db:"price_decimals"`
	PriceUSD                   float64         `json:"priceUSD" db:"price_usd"`
	PriceUSDFormatted          string          `json:"priceUSDFormatted"`
	QuantityInitial            prototyp.BigInt `json:"quantityInitial" db:"qty_initial"`
	QuantityInitialFormatted   string          `json:"quantityInitialFormatted"`
	QuantityRemaining          prototyp.BigInt `json:"quantityRemaining" db:"qty_remaining"`
	QuantityRemainingFormatted string          `json:"quantityRemainingFormatted"`
	QuantityAvailable          prototyp.BigInt `json:"quantityAvailable" db:"qty_available"`
	QuantityAvailableFormatted string          `json:"quantityAvailableFormatted"`
	QuantityDecimals           uint64          `json:"quantityDecimals" db:"qty_decimals"`
	FeeBPS                     int64           `json:"feeBps" db:"fee_bps"`
	FeeBreakdown               []*FeeBreakdown `json:"feeBreakdown" db:"fee_breakdown"`
	ValidFrom                  time.Time       `json:"validFrom" db:"valid_from"`
	// expiration
	ValidUntil     time.Time  `json:"validUntil" db:"valid_until"`
	BlockNumber    uint64     `json:"blockNumber" db:"block_number"`
	OrderCreatedAt *time.Time `json:"orderCreatedAt" db:"order_created_at"`
	OrderUpdatedAt *time.Time `json:"orderUpdatedAt" db:"order_updated_at"`
	CreatedAt      time.Time  `json:"createdAt" db:"created_at"`
	UpdatedAt      time.Time  `json:"updatedAt" db:"updated_at"`
	DeletedAt      *time.Time `json:"deletedAt,omitempty" db:"deleted_at"`
}

type OrderData added in v0.49.0

type OrderData struct {
	OrderID  string `json:"orderId"`
	Quantity string `json:"quantity"`
}

type OrderFilter

type OrderFilter struct {
	CreatedBy   []string          `json:"createdBy"`
	Marketplace []MarketplaceKind `json:"marketplace"`
	Currencies  []string          `json:"currencies"`
}

type OrderSide

type OrderSide uint8
const (
	OrderSide_unknown OrderSide = 0
	// Ask
	OrderSide_listing OrderSide = 1
	// Bid
	OrderSide_offer OrderSide = 2
)

func (*OrderSide) Is

func (x *OrderSide) Is(values ...OrderSide) bool

func (OrderSide) MarshalText

func (x OrderSide) MarshalText() ([]byte, error)

func (OrderSide) String

func (x OrderSide) String() string

func (*OrderSide) UnmarshalText

func (x *OrderSide) UnmarshalText(b []byte) error

type OrderStatus

type OrderStatus uint8
const (
	OrderStatus_unknown OrderStatus = 0
	// Fillable
	OrderStatus_active OrderStatus = 1
	// Temporarily unfillable, due to balance / approval
	OrderStatus_inactive OrderStatus = 2
	// Permanently unfillable, due to expiry
	OrderStatus_expired OrderStatus = 3
	// Permanently unfillable, due to cancellation (by user or protocol)
	OrderStatus_cancelled OrderStatus = 4
	// Permanently unfillable, because it's been completely filled
	OrderStatus_filled OrderStatus = 5
	// Decimals are missing on collectible needs to be synced and order updated
	OrderStatus_decimals_missing OrderStatus = 6
)

func (*OrderStatus) Is

func (x *OrderStatus) Is(values ...OrderStatus) bool

func (OrderStatus) MarshalText

func (x OrderStatus) MarshalText() ([]byte, error)

func (OrderStatus) String

func (x OrderStatus) String() string

func (*OrderStatus) UnmarshalText

func (x *OrderStatus) UnmarshalText(b []byte) error

type OrderbookKind added in v0.49.0

type OrderbookKind uint32
const (
	OrderbookKind_unknown                 OrderbookKind = 0
	OrderbookKind_sequence_marketplace_v1 OrderbookKind = 1
	OrderbookKind_sequence_marketplace_v2 OrderbookKind = 2
	OrderbookKind_blur                    OrderbookKind = 3
	OrderbookKind_opensea                 OrderbookKind = 4
	OrderbookKind_looks_rare              OrderbookKind = 5
	OrderbookKind_reservoir               OrderbookKind = 6
	OrderbookKind_x2y2                    OrderbookKind = 7
)

func (*OrderbookKind) Is added in v0.49.0

func (x *OrderbookKind) Is(values ...OrderbookKind) bool

func (OrderbookKind) MarshalText added in v0.49.0

func (x OrderbookKind) MarshalText() ([]byte, error)

func (OrderbookKind) String added in v0.49.0

func (x OrderbookKind) String() string

func (*OrderbookKind) UnmarshalText added in v0.49.0

func (x *OrderbookKind) UnmarshalText(b []byte) error

type Page

type Page struct {
	// Numbered pages: Page number, this is multiplied by the value of the <pageSize> parameter.
	Page uint32 `json:"page,omitempty"`
	// Number of items per page
	PageSize uint32 `json:"pageSize,omitempty"`
	// Indicates if there are more results available
	More *bool `json:"more,omitempty"`
	// Sorting filter
	Sort []*SortBy `json:"sort,omitempty"`
}

Page represents a results page. This can be used both to request a page and to store the state of a page.

type PostRequest added in v0.49.0

type PostRequest struct {
	Endpoint string      `json:"endpoint"`
	Method   string      `json:"method"`
	Body     interface{} `json:"body"`
}

type Project

type Project struct {
	ID              uint64        `json:"-" db:"id,omitempty"`
	ProjectID       uint64        `json:"projectId" db:"project_id"`
	CollectionID    uint64        `json:"-" db:"collection_id,omitempty"`
	ChainID         uint64        `json:"chainId" db:"chain_id"`
	ContractAddress prototyp.Hash `json:"contractAddress" db:"contract_address"`
	Status          ProjectStatus `json:"status" db:"status"`
	CreatedAt       time.Time     `json:"createdAt" db:"created_at"`
	UpdatedAt       time.Time     `json:"updatedAt" db:"updated_at"`
	DeletedAt       *time.Time    `json:"deletedAt,omitempty" db:"deleted_at"`
}

type ProjectStatus

type ProjectStatus uint8
const (
	ProjectStatus_unknown  ProjectStatus = 0
	ProjectStatus_active   ProjectStatus = 1
	ProjectStatus_inactive ProjectStatus = 2
)

func (*ProjectStatus) Is

func (x *ProjectStatus) Is(values ...ProjectStatus) bool

func (ProjectStatus) MarshalText

func (x ProjectStatus) MarshalText() ([]byte, error)

func (ProjectStatus) String

func (x ProjectStatus) String() string

func (*ProjectStatus) UnmarshalText

func (x *ProjectStatus) UnmarshalText(b []byte) error

type PropertyFilter

type PropertyFilter struct {
	Name   string        `json:"name"`
	Type   PropertyType  `json:"type"`
	Min    *int64        `json:"min"`
	Max    *int64        `json:"max"`
	Values []interface{} `json:"values"`
}

type PropertyType

type PropertyType uint32
const (
	PropertyType_INT     PropertyType = 0
	PropertyType_STRING  PropertyType = 1
	PropertyType_ARRAY   PropertyType = 2
	PropertyType_GENERIC PropertyType = 3
)

func (*PropertyType) Is

func (x *PropertyType) Is(values ...PropertyType) bool

func (PropertyType) MarshalText

func (x PropertyType) MarshalText() ([]byte, error)

func (PropertyType) String

func (x PropertyType) String() string

func (*PropertyType) UnmarshalText

func (x *PropertyType) UnmarshalText(b []byte) error

type Signature added in v0.49.0

type Signature struct {
	Domain      *Domain     `json:"domain"`
	Types       interface{} `json:"types"`
	PrimaryType string      `json:"primaryType"`
	Value       interface{} `json:"value"`
}

type SortBy

type SortBy struct {
	Column string    `json:"column"`
	Order  SortOrder `json:"order"`
}

type SortOrder

type SortOrder uint32
const (
	SortOrder_DESC SortOrder = 0
	SortOrder_ASC  SortOrder = 1
)

func (*SortOrder) Is

func (x *SortOrder) Is(values ...SortOrder) bool

func (SortOrder) MarshalText

func (x SortOrder) MarshalText() ([]byte, error)

func (SortOrder) String

func (x SortOrder) String() string

func (*SortOrder) UnmarshalText

func (x *SortOrder) UnmarshalText(b []byte) error

type SourceKind

type SourceKind uint32
const (
	SourceKind_unknown                 SourceKind = 0
	SourceKind_external                SourceKind = 1
	SourceKind_sequence_marketplace_v1 SourceKind = 2
	SourceKind_sequence_marketplace_v2 SourceKind = 3
)

func (*SourceKind) Is

func (x *SourceKind) Is(values ...SourceKind) bool

func (SourceKind) MarshalText

func (x SourceKind) MarshalText() ([]byte, error)

func (SourceKind) String

func (x SourceKind) String() string

func (*SourceKind) UnmarshalText

func (x *SourceKind) UnmarshalText(b []byte) error

type Step added in v0.49.0

type Step struct {
	ID          StepType     `json:"id"`
	Data        string       `json:"data"`
	To          string       `json:"to"`
	Value       string       `json:"value"`
	Signature   *Signature   `json:"signature"`
	Post        *PostRequest `json:"post"`
	ExecuteType *ExecuteType `json:"executeType"`
}

type StepType added in v0.49.0

type StepType uint8
const (
	StepType_unknown       StepType = 0
	StepType_tokenApproval StepType = 1
	StepType_buy           StepType = 2
	StepType_sell          StepType = 3
	StepType_createListing StepType = 4
	StepType_createOffer   StepType = 5
	StepType_signEIP712    StepType = 6
	StepType_signEIP191    StepType = 7
	StepType_cancel        StepType = 8
)

func (*StepType) Is added in v0.49.0

func (x *StepType) Is(values ...StepType) bool

func (StepType) MarshalText added in v0.49.0

func (x StepType) MarshalText() ([]byte, error)

func (StepType) String added in v0.49.0

func (x StepType) String() string

func (*StepType) UnmarshalText added in v0.49.0

func (x *StepType) UnmarshalText(b []byte) error

type TokenMetadata

type TokenMetadata struct {
	TokenID     string `json:"tokenId" cbor:"-"`
	Name        string `json:"name" cbor:"-"`
	Description string `json:"description" cbor:"-"`
	// url
	Image string `json:"image" cbor:"-"`
	// non-standard fields we've added for Sequence. Others should adopt
	// these too and we should prompt, similar to how `image` field works.
	// url
	Video string `json:"video,omitempty" cbor:"-"`
	// url
	Audio      string                 `json:"audio,omitempty" cbor:"-"`
	Properties map[string]interface{} `json:"properties" cbor:"-"`
	// OpenSea fields
	// see https://docs.opensea.io/docs/metadata-standards
	//
	// NOTE: its a bit unfortunate OpenSea didn't use camelCase, and
	// also introduces 'attributes' when 'properties' is actually the correct property name.
	// TODO: we could smooth this out / normalize it, but we can leave it for now.
	Attributes      []map[string]interface{} `json:"attributes" cbor:"-"`
	ImageData       string                   `json:"image_data,omitempty" cbor:"-"`
	ExternalUrl     string                   `json:"external_url,omitempty" cbor:"-"`
	BackgroundColor string                   `json:"background_color,omitempty" cbor:"-"`
	AnimationUrl    string                   `json:"animation_url,omitempty" cbor:"-"`
	//
	// Misc
	//
	// decimals is deprecated, but still used by some
	Decimals  *uint64   `json:"decimals,omitempty" cbor:"-"`
	UpdatedAt time.Time `json:"updatedAt" cbor:"-"`
	// Assets associated to this token metadata
	Assets []*Asset `json:"assets,omitempty" cbor:"-"`
}

TokenMetadata based on 721/1155 standards, as well including some fields which are used by OpenSea.

TokenMetadata is RPC type for responding to clients that represents the token-level metadata.

type TransactionCrypto added in v0.49.0

type TransactionCrypto uint32
const (
	TransactionCrypto_none      TransactionCrypto = 0
	TransactionCrypto_partially TransactionCrypto = 1
	TransactionCrypto_all       TransactionCrypto = 2
)

func (*TransactionCrypto) Is added in v0.49.0

func (x *TransactionCrypto) Is(values ...TransactionCrypto) bool

func (TransactionCrypto) MarshalText added in v0.49.0

func (x TransactionCrypto) MarshalText() ([]byte, error)

func (TransactionCrypto) String added in v0.49.0

func (x TransactionCrypto) String() string

func (*TransactionCrypto) UnmarshalText added in v0.49.0

func (x *TransactionCrypto) UnmarshalText(b []byte) error

type TransactionNFTCheckoutProvider added in v0.49.0

type TransactionNFTCheckoutProvider uint32
const (
	TransactionNFTCheckoutProvider_unknown TransactionNFTCheckoutProvider = 0
	TransactionNFTCheckoutProvider_sardine TransactionNFTCheckoutProvider = 1
	TransactionNFTCheckoutProvider_transak TransactionNFTCheckoutProvider = 2
)

func (*TransactionNFTCheckoutProvider) Is added in v0.49.0

func (TransactionNFTCheckoutProvider) MarshalText added in v0.49.0

func (x TransactionNFTCheckoutProvider) MarshalText() ([]byte, error)

func (TransactionNFTCheckoutProvider) String added in v0.49.0

func (*TransactionNFTCheckoutProvider) UnmarshalText added in v0.49.0

func (x *TransactionNFTCheckoutProvider) UnmarshalText(b []byte) error

type TransactionOnRampProvider added in v0.49.0

type TransactionOnRampProvider uint32
const (
	TransactionOnRampProvider_unknown TransactionOnRampProvider = 0
	TransactionOnRampProvider_sardine TransactionOnRampProvider = 1
	TransactionOnRampProvider_transak TransactionOnRampProvider = 2
)

func (*TransactionOnRampProvider) Is added in v0.49.0

func (TransactionOnRampProvider) MarshalText added in v0.49.0

func (x TransactionOnRampProvider) MarshalText() ([]byte, error)

func (TransactionOnRampProvider) String added in v0.49.0

func (x TransactionOnRampProvider) String() string

func (*TransactionOnRampProvider) UnmarshalText added in v0.49.0

func (x *TransactionOnRampProvider) UnmarshalText(b []byte) error

type TransactionSwapProvider added in v0.49.0

type TransactionSwapProvider uint32
const (
	TransactionSwapProvider_unknown TransactionSwapProvider = 0
	TransactionSwapProvider_zerox   TransactionSwapProvider = 1
)

func (*TransactionSwapProvider) Is added in v0.49.0

func (TransactionSwapProvider) MarshalText added in v0.49.0

func (x TransactionSwapProvider) MarshalText() ([]byte, error)

func (TransactionSwapProvider) String added in v0.49.0

func (x TransactionSwapProvider) String() string

func (*TransactionSwapProvider) UnmarshalText added in v0.49.0

func (x *TransactionSwapProvider) UnmarshalText(b []byte) error

type WalletKind added in v0.49.0

type WalletKind uint8
const (
	WalletKind_unknown  WalletKind = 0
	WalletKind_sequence WalletKind = 1
)

func (*WalletKind) Is added in v0.49.0

func (x *WalletKind) Is(values ...WalletKind) bool

func (WalletKind) MarshalText added in v0.49.0

func (x WalletKind) MarshalText() ([]byte, error)

func (WalletKind) String added in v0.49.0

func (x WalletKind) String() string

func (*WalletKind) UnmarshalText added in v0.49.0

func (x *WalletKind) UnmarshalText(b []byte) error

type WebRPCError

type WebRPCError struct {
	Name       string `json:"error"`
	Code       int    `json:"code"`
	Message    string `json:"msg"`
	Cause      string `json:"cause,omitempty"`
	HTTPStatus int    `json:"status"`
	// contains filtered or unexported fields
}

func ErrorWithCause deprecated

func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError

Deprecated: Use .WithCause() method on WebRPCError.

func (WebRPCError) Error

func (e WebRPCError) Error() string

func (WebRPCError) Is

func (e WebRPCError) Is(target error) bool

func (WebRPCError) Unwrap

func (e WebRPCError) Unwrap() error

func (WebRPCError) WithCause

func (e WebRPCError) WithCause(cause error) WebRPCError

func (WebRPCError) WithCausef

func (e WebRPCError) WithCausef(format string, args ...interface{}) WebRPCError

type WebrpcGenVersions added in v0.49.0

type WebrpcGenVersions struct {
	WebrpcGenVersion string
	CodeGenName      string
	CodeGenVersion   string
	SchemaName       string
	SchemaVersion    string
}

func VersionFromHeader added in v0.49.0

func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error)

Jump to

Keyboard shortcuts

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