From 015d81e75ec3f423836fe3acc92c082b490d9f84 Mon Sep 17 00:00:00 2001 From: Lukas Jenicek Date: Mon, 1 Jul 2024 11:58:30 +0200 Subject: [PATCH] update marketplace client to latest version (#141) --- marketplace/marketplace.gen.go | 191 +++++++++++++++++---------------- 1 file changed, 99 insertions(+), 92 deletions(-) diff --git a/marketplace/marketplace.gen.go b/marketplace/marketplace.gen.go index 422b3a1d..c963a1ad 100644 --- a/marketplace/marketplace.gen.go +++ b/marketplace/marketplace.gen.go @@ -1,4 +1,4 @@ -// marketplace-api 117ea88649b259b29ebc7b06502884700874b604 +// marketplace-api 291f736eb0f4eddfb67c8ce8469984c26ff927d1 // -- // Code generated by webrpc-gen@v0.18.3 with golang generator. DO NOT EDIT. // @@ -31,7 +31,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "117ea88649b259b29ebc7b06502884700874b604" + return "291f736eb0f4eddfb67c8ce8469984c26ff927d1" } // @@ -196,33 +196,33 @@ func (x *PropertyType) Is(values ...PropertyType) bool { type MarketplaceKind uint32 const ( - MarketplaceKind_unknown MarketplaceKind = 0 - MarketplaceKind_orderbook_v1 MarketplaceKind = 1 - MarketplaceKind_orderbook_v2 MarketplaceKind = 2 - MarketplaceKind_opensea MarketplaceKind = 3 - MarketplaceKind_magic_eden MarketplaceKind = 4 - MarketplaceKind_mintify MarketplaceKind = 5 - MarketplaceKind_looks_rare MarketplaceKind = 6 - MarketplaceKind_x2y2 MarketplaceKind = 7 - MarketplaceKind_sudo_swap MarketplaceKind = 8 - MarketplaceKind_coinbase MarketplaceKind = 9 - MarketplaceKind_rarible MarketplaceKind = 10 - MarketplaceKind_nftx MarketplaceKind = 11 - MarketplaceKind_foundation MarketplaceKind = 12 - MarketplaceKind_manifold MarketplaceKind = 13 - MarketplaceKind_zora MarketplaceKind = 14 - MarketplaceKind_blur MarketplaceKind = 15 - MarketplaceKind_super_rare MarketplaceKind = 16 - MarketplaceKind_okx MarketplaceKind = 17 - MarketplaceKind_element MarketplaceKind = 18 - MarketplaceKind_aqua_xyz MarketplaceKind = 19 - MarketplaceKind_auranft_co MarketplaceKind = 20 + MarketplaceKind_unknown MarketplaceKind = 0 + MarketplaceKind_sequence_marketplace_v1 MarketplaceKind = 1 + MarketplaceKind_sequence_marketplace_v2 MarketplaceKind = 2 + MarketplaceKind_opensea MarketplaceKind = 3 + MarketplaceKind_magic_eden MarketplaceKind = 4 + MarketplaceKind_mintify MarketplaceKind = 5 + MarketplaceKind_looks_rare MarketplaceKind = 6 + MarketplaceKind_x2y2 MarketplaceKind = 7 + MarketplaceKind_sudo_swap MarketplaceKind = 8 + MarketplaceKind_coinbase MarketplaceKind = 9 + MarketplaceKind_rarible MarketplaceKind = 10 + MarketplaceKind_nftx MarketplaceKind = 11 + MarketplaceKind_foundation MarketplaceKind = 12 + MarketplaceKind_manifold MarketplaceKind = 13 + MarketplaceKind_zora MarketplaceKind = 14 + MarketplaceKind_blur MarketplaceKind = 15 + MarketplaceKind_super_rare MarketplaceKind = 16 + MarketplaceKind_okx MarketplaceKind = 17 + MarketplaceKind_element MarketplaceKind = 18 + MarketplaceKind_aqua_xyz MarketplaceKind = 19 + MarketplaceKind_auranft_co MarketplaceKind = 20 ) var MarketplaceKind_name = map[uint32]string{ 0: "unknown", - 1: "orderbook_v1", - 2: "orderbook_v2", + 1: "sequence_marketplace_v1", + 2: "sequence_marketplace_v2", 3: "opensea", 4: "magic_eden", 5: "mintify", @@ -244,27 +244,27 @@ var MarketplaceKind_name = map[uint32]string{ } var MarketplaceKind_value = map[string]uint32{ - "unknown": 0, - "orderbook_v1": 1, - "orderbook_v2": 2, - "opensea": 3, - "magic_eden": 4, - "mintify": 5, - "looks_rare": 6, - "x2y2": 7, - "sudo_swap": 8, - "coinbase": 9, - "rarible": 10, - "nftx": 11, - "foundation": 12, - "manifold": 13, - "zora": 14, - "blur": 15, - "super_rare": 16, - "okx": 17, - "element": 18, - "aqua_xyz": 19, - "auranft_co": 20, + "unknown": 0, + "sequence_marketplace_v1": 1, + "sequence_marketplace_v2": 2, + "opensea": 3, + "magic_eden": 4, + "mintify": 5, + "looks_rare": 6, + "x2y2": 7, + "sudo_swap": 8, + "coinbase": 9, + "rarible": 10, + "nftx": 11, + "foundation": 12, + "manifold": 13, + "zora": 14, + "blur": 15, + "super_rare": 16, + "okx": 17, + "element": 18, + "aqua_xyz": 19, + "auranft_co": 20, } func (x MarketplaceKind) String() string { @@ -295,21 +295,24 @@ func (x *MarketplaceKind) Is(values ...MarketplaceKind) bool { type SourceKind uint32 const ( - SourceKind_unknown SourceKind = 0 - SourceKind_external SourceKind = 1 - SourceKind_orderbook_v1 SourceKind = 2 + SourceKind_unknown SourceKind = 0 + SourceKind_external SourceKind = 1 + SourceKind_sequence_marketplace_v1 SourceKind = 2 + SourceKind_sequence_marketplace_v2 SourceKind = 3 ) var SourceKind_name = map[uint32]string{ 0: "unknown", 1: "external", - 2: "orderbook_v1", + 2: "sequence_marketplace_v1", + 3: "sequence_marketplace_v2", } var SourceKind_value = map[string]uint32{ - "unknown": 0, - "external": 1, - "orderbook_v1": 2, + "unknown": 0, + "external": 1, + "sequence_marketplace_v1": 2, + "sequence_marketplace_v2": 3, } func (x SourceKind) String() string { @@ -446,27 +449,36 @@ func (x *OrderStatus) Is(values ...OrderStatus) bool { type CollectionStatus uint8 const ( - CollectionStatus_unknown CollectionStatus = 0 - CollectionStatus_created CollectionStatus = 1 - CollectionStatus_initializing CollectionStatus = 2 - CollectionStatus_active CollectionStatus = 3 - CollectionStatus_inactive CollectionStatus = 4 + CollectionStatus_unknown CollectionStatus = 0 + CollectionStatus_created CollectionStatus = 1 + CollectionStatus_syncing_tokens CollectionStatus = 2 + CollectionStatus_synced_tokens CollectionStatus = 3 + CollectionStatus_syncing_orders CollectionStatus = 4 + CollectionStatus_active CollectionStatus = 5 + CollectionStatus_failed CollectionStatus = 6 + CollectionStatus_inactive CollectionStatus = 7 ) var CollectionStatus_name = map[uint8]string{ 0: "unknown", 1: "created", - 2: "initializing", - 3: "active", - 4: "inactive", + 2: "syncing_tokens", + 3: "synced_tokens", + 4: "syncing_orders", + 5: "active", + 6: "failed", + 7: "inactive", } var CollectionStatus_value = map[string]uint8{ - "unknown": 0, - "created": 1, - "initializing": 2, - "active": 3, - "inactive": 4, + "unknown": 0, + "created": 1, + "syncing_tokens": 2, + "synced_tokens": 3, + "syncing_orders": 4, + "active": 5, + "failed": 6, + "inactive": 7, } func (x CollectionStatus) String() string { @@ -640,17 +652,17 @@ type CollectiblesFilter struct { } type Order struct { - ID uint64 `json:"id" db:"id,omitempty"` - CollectionID uint64 `json:"collectionId" db:"collection_id,omitempty"` + ID uint64 `json:"-" db:"id,omitempty"` + CollectionID uint64 `json:"-" db:"collection_id,omitempty"` CollectibleID uint64 `json:"collectibleId" db:"collectible_id,omitempty"` OrderID string `json:"orderId" db:"order_id"` Marketplace MarketplaceKind `json:"marketplace" db:"marketplace"` - Source SourceKind `json:"source" db:"source"` + Source SourceKind `json:"-" db:"source"` Side OrderSide `json:"side" db:"side"` Status OrderStatus `json:"status" db:"status"` ChainID uint64 `json:"chainId" db:"chain_id"` // contract - ContractAddress prototyp.Hash `json:"contractAddress" db:"contract_address"` + 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"` @@ -685,14 +697,9 @@ type FeeBreakdown struct { Bps int64 `json:"bps"` } -type CollectibleListing struct { - Metadata *TokenMetadata `json:"metadata"` - LowestListing *Order `json:"lowestListing"` -} - -type CollectibleOffer struct { - Metadata *TokenMetadata `json:"metadata"` - HighestOffer *Order `json:"highestOffer"` +type CollectibleOrder struct { + Metadata *TokenMetadata `json:"metadata"` + Order *Order `json:"order"` } type OrderFilter struct { @@ -713,7 +720,7 @@ type Activity struct { } type Collection struct { - ID uint64 `json:"id" db:"id,omitempty"` + 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"` @@ -734,9 +741,9 @@ type CollectionLastSynced struct { } type Project struct { - ID uint64 `json:"id" db:"id,omitempty"` + ID uint64 `json:"-" db:"id,omitempty"` ProjectID uint64 `json:"projectId" db:"project_id"` - CollectionID uint64 `json:"collectionId" db:"collection_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 ProjectStatus `json:"status" db:"status"` @@ -746,8 +753,8 @@ type Project struct { } type Collectible struct { - ID uint64 `json:"id" db:"id,omitempty"` - CollectionID uint64 `json:"collectionId" db:"collection_id,omitempty"` + 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"` @@ -830,8 +837,8 @@ type Marketplace interface { GetCollectibleHighestListing(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error) ListCollectibleListings(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, page *Page) ([]*Order, *Page, error) ListCollectibleOffers(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, page *Page) ([]*Order, *Page, error) - ListCollectiblesWithLowestListing(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleListing, *Page, error) - ListCollectiblesWithHighestOffer(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOffer, *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) } // @@ -860,8 +867,8 @@ type MarketplaceClient interface { GetCollectibleHighestListing(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter) (*Order, error) ListCollectibleListings(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, page *Page) ([]*Order, *Page, error) ListCollectibleOffers(ctx context.Context, contractAddress string, tokenId string, filter *OrderFilter, page *Page) ([]*Order, *Page, error) - ListCollectiblesWithLowestListing(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleListing, *Page, error) - ListCollectiblesWithHighestOffer(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOffer, *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) } // @@ -1275,15 +1282,15 @@ func (c *marketplaceClient) ListCollectibleOffers(ctx context.Context, contractA return out.Ret0, out.Ret1, err } -func (c *marketplaceClient) ListCollectiblesWithLowestListing(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleListing, *Page, error) { +func (c *marketplaceClient) ListCollectiblesWithLowestListing(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOrder, *Page, error) { in := struct { Arg0 string `json:"contractAddress"` Arg1 *CollectiblesFilter `json:"filter"` Arg2 *Page `json:"page"` }{contractAddress, filter, page} out := struct { - Ret0 []*CollectibleListing `json:"collectibles"` - Ret1 *Page `json:"page"` + Ret0 []*CollectibleOrder `json:"collectibles"` + Ret1 *Page `json:"page"` }{} resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) @@ -1297,14 +1304,14 @@ func (c *marketplaceClient) ListCollectiblesWithLowestListing(ctx context.Contex return out.Ret0, out.Ret1, err } -func (c *marketplaceClient) ListCollectiblesWithHighestOffer(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOffer, *Page, error) { +func (c *marketplaceClient) ListCollectiblesWithHighestOffer(ctx context.Context, contractAddress string, filter *CollectiblesFilter, page *Page) ([]*CollectibleOrder, *Page, error) { in := struct { Arg0 string `json:"contractAddress"` Arg1 *CollectiblesFilter `json:"filter"` Arg2 *Page `json:"page"` }{contractAddress, filter, page} out := struct { - Ret0 []*CollectibleOffer `json:"collectibles"` + Ret0 []*CollectibleOrder `json:"collectibles"` Ret1 *Page `json:"page"` }{}