diff --git a/docs/pages/api/embedded-wallet.mdx b/docs/pages/api/embedded-wallet.mdx deleted file mode 100644 index ba635ae6569..00000000000 --- a/docs/pages/api/embedded-wallet.mdx +++ /dev/null @@ -1,9 +0,0 @@ -import { Callout } from "vocs/components"; - -# Embedded Wallet API - -API Documentation Coming Soon - -Sequence Embedded Wallet (or Wallet-as-a-Service) enables the creation, management and usage of fully functional EVM compatible wallets. These wallets can be created on-demand for each user and allow you to integrate an application with an Ethereum compatible blockchain, while using familiar constructions like RPC APIs. - -Sequence Embedded Wallet offers real non-custodial wallets and the system guarantees that each created wallet can only be accessed with the consent of the owner of the wallet. diff --git a/docs/pages/api/marketplace/overview.mdx b/docs/pages/api/marketplace/overview.mdx new file mode 100644 index 00000000000..917a20d2b80 --- /dev/null +++ b/docs/pages/api/marketplace/overview.mdx @@ -0,0 +1,9 @@ +# Marketplace API + +:::note +[Marketplace API documentation and testing](https://0xsequence.redoc.ly/tag/marketplace) +::: + +The Sequence Marketplace API service offers a simple and fast way to interact with sequence marketplace protocols. The API is designed to be easy to use and to have all the features you need to build a fully functional marketplace. + + #TODO add example from solutions \ No newline at end of file diff --git a/docs/pages/solutions/marketplaces/orderbook/examples/03-get-top-orders.mdx b/docs/pages/solutions/marketplaces/orderbook/examples/03-get-top-orders.mdx index a7b4ee264cc..187d5b694f2 100644 --- a/docs/pages/solutions/marketplaces/orderbook/examples/03-get-top-orders.mdx +++ b/docs/pages/solutions/marketplaces/orderbook/examples/03-get-top-orders.mdx @@ -2,41 +2,7 @@ import { Callout } from "vocs/components"; ## GetTopOrders -Query the protocol for the top order based on various filters. - -Fetch the top orders from the protocol, optionally excluding those created by a specific user. - -- Request: POST /rpc/Marketplace/GetTopOrders -- Content-Type: application/json -- Body (in JSON): - - `orderbookContractAddress` (string) -- the address of the protocol contract - - `collectionAddress` (string) -- the address of the NFT collection - - `currencyAddresses` (string[]) -- an array of currency contract addresses - - `tokenIDs` (string[]) -- an array of token IDs to filter the orders by - - `isListing` (bool) -- whether to fetch listing orders (true) or offer orders (false) - - `priceSort` (SortOrder) -- the direction to sort the orders by price as an enum of `"DESC"` or `"ASC"` - - `excludeUser?` (string) -- the address of a user whose orders to exclude -- Response (in JSON): - - `page` - - `page` (i32) -- number of the page - - `pageSize` (i32) -- number of orders on the page - - `more` (bool) -- if there are more orders - - `orders` (OrderbookOrder[]) - [ - - `orderId` (string) -- order id - - `tokenContract` (string) -- the collection contract - - `tokenId` (string) -- the tokenId of the collection in the order - - `isListing` (bool) -- is true if it's a listing for sale, or false if it's an offer - - `quantity` (string) -- the number of tokens the order is for - - `quantityRemaining` (string) -- the number of tokens after the order - - `currencyAddress` (string) -- the currency the token is trading in - - `pricePerToken` (string) -- the price per token - - `expiry` (string) -- the expiry of when the order is no longer valid - - `orderStatus` (OrderStatus) -- the status of the order as an enum fom `"OPEN"`, `"CLOSED"`, `"CANCELLED"` - - `createdBy` (string) -- the address the order was created by - - `createdAt` (uint64) -- the time the order was created - - `orderbookContractAddress` (string) -- the orderbook contract address - ] +With the use of the `GetTopOrders` api developers can build bots to retrieve best orders to execute on, or, just simple notifiers to track the best orders to take action. :::code-group @@ -57,8 +23,8 @@ curl --request POST \ ``` ```ts twoslash [js] -// Works in both a Webapp (browser) or Node.js: -import fetch from "cross-fetch"; +// Works in both a Webapp (browser) or Node.js by importing cross-fetch: +// import fetch from "cross-fetch"; (async () => { const res = await fetch( @@ -81,12 +47,44 @@ import fetch from "cross-fetch"; console.log("res", await res.json()); })(); ``` - -```shell twoslash [other] - Please contact our team for assistance with integrations to another target. -``` ::: -### Example implementation +### Schema + +Query the protocol for the top order based on various filters. + +Fetch the top orders from the protocol, optionally excluding those created by a specific user. + +- Request: POST /rpc/Marketplace/GetTopOrders +- Content-Type: application/json +- Body (in JSON): + - `orderbookContractAddress` (string) -- the address of the protocol contract + - `collectionAddress` (string) -- the address of the NFT collection + - `currencyAddresses` (string[]) -- an array of currency contract addresses + - `tokenIDs` (string[]) -- an array of token IDs to filter the orders by + - `isListing` (bool) -- whether to fetch listing orders (true) or offer orders (false) + - `priceSort` (SortOrder) -- the direction to sort the orders by price as an enum of `"DESC"` or `"ASC"` + - `excludeUser?` (string) -- the address of a user whose orders to exclude +- Response (in JSON): + - `page` + - `page` (i32) -- number of the page + - `pageSize` (i32) -- number of orders on the page + - `more` (bool) -- if there are more orders + - `orders` (OrderbookOrder[]) + [ + - `orderId` (string) -- order id + - `tokenContract` (string) -- the collection contract + - `tokenId` (string) -- the tokenId of the collection in the order + - `isListing` (bool) -- is true if it's a listing for sale, or false if it's an offer + - `quantity` (string) -- the number of tokens the order is for + - `quantityRemaining` (string) -- the number of tokens after the order + - `currencyAddress` (string) -- the currency the token is trading in + - `pricePerToken` (string) -- the price per token + - `expiry` (string) -- the expiry of when the order is no longer valid + - `orderStatus` (OrderStatus) -- the status of the order as an enum fom `"OPEN"`, `"CLOSED"`, `"CANCELLED"` + - `createdBy` (string) -- the address the order was created by + - `createdAt` (uint64) -- the time the order was created + - `orderbookContractAddress` (string) -- the orderbook contract address + ] + -With the use of the `GetTopOrders` api developers can build bots to retrieve best orders to execute on, or, just simple notifiers to track the best orders to take action. diff --git a/docs/pages/solutions/marketplaces/orderbook/examples/04-get-orderbook.mdx b/docs/pages/solutions/marketplaces/orderbook/examples/04-get-orderbook.mdx index 5c22e7708e2..9fe498471bc 100644 --- a/docs/pages/solutions/marketplaces/orderbook/examples/04-get-orderbook.mdx +++ b/docs/pages/solutions/marketplaces/orderbook/examples/04-get-orderbook.mdx @@ -2,55 +2,14 @@ import { Callout } from "vocs/components"; ## GetOrderbookOrders -Query the protocol for orders based on various filters. +With the use of the `GetOrderbookOrders` api developers can build custom marketplaces around the api, as an example, one can implement a frontend to fulfill certain orders (not just the best price) for a collectible -_Sequence Orderbook `GetOrderbookOrders` Method:_ +![GetOrderbookOrders](/img/marketplace/custom-marketplace-listings.png) -- Request: POST /rpc/Marketplace/GetOrderbookOrders -- Content-Type: application/json -- Body (in JSON): - - `orderbookContractAddress` (string) -- the address of the protocol contract - - `collectionAddress` (string) -- the address of the NFT collection - - `currencyAddresses` (string[]) -- an array of currency contract addresses - - `filters` (OrderbookOrderFilter) -- filters to apply to the query - - `tokenIds` (string[]) -- the token ids of the assets you're looking at - - `isListing?` (bool) -- `true` if it is an order, `false` if it's an offer - - `userAddress?` (string) -- the address of the user - - `orderStatuses` (OrderStatus[]) (optional) -- filter orders by their statuses as `OPEN`, `CLOSED`, `CANCELLED` strings - - `metadataFilter` (Filter) (optional) -- filter orders by metadata - - `text?` (string) -- text to search - - `properties?` (PropertyFilter[]) -- - - `name` (string) -- name of the property, eg: hero - - `type`: (PropertyType) -- type of the values of the property as an enum from: `"INT"`,`"STRING"`,`"ARRAY"`, or `"GENERIC"` - - `min?`: (int64) -- used if type is int, gives range of values for filtering - - `max?`: (int64) -- used if type is int, gives range of values for filtering - - `values?`: []any -- if string then array of values, eg: ["Ada", "Ari", "Axel", "Banjo" ...] - - `beforeExpiryTimestamp` (int64) -- filter orders expiring before the given timestamp - - `page?` -- page object to sort by - - `sort` (Sort[]) -- with an object of keys `"column"` and `"order"` with example `"createdAt"` and `"ASC"`, respectively -- Response (in JSON): - - `page` - - `page` (i32) -- number of the page - - `pageSize` (i32) -- number of orders on the page - - `more` (bool) -- if there are more orders - - `orders` (OrderbookOrder[]) - [ - - `orderId` (string) -- order id - - `tokenContract` (string) -- the collection contract - - `tokenId` (string) -- the tokenId of the collection in the order - - `isListing` (bool) -- is true if it's a listing for sale, or false if it's an offer - - `quantity` (string) -- the number of tokens the order is for - - `quantityRemaining` (string) -- the number of tokens after the order - - `currencyAddress` (string) -- the currency the token is trading in - - `pricePerToken` (string) -- the price per token - - `expiry` (string) -- the expiry of when the order is no longer valid - - `orderStatus` (OrderStatus) -- the status of the order as an enum fom `"OPEN"`, `"CLOSED"`, `"CANCELLED"` - - `createdBy` (string) -- the address the order was created by - - `createdAt` (uint64) -- the time the order was created - - `orderbookContractAddress` (string) -- the orderbook contract address - ] -**Example: `GetOrderbookOrders` of token ids from a collection address on Polygon** +### Example + + `GetOrderbookOrders` of token ids from a collection address on Sepolia: Note: If using the metadata.properties key to filter, the use of `min` and @@ -129,14 +88,54 @@ import fetch from "cross-fetch"; console.log("res", await res.json()); })(); ``` - -```shell twoslash [other] - Please contact our team for assistance with integrations to another target. -``` ::: -### Example implementation +### Schema -With the use of the `GetOrderbookOrders` api developers can build custom marketplaces around the api, as an example, one can implement a frontend to fulfill certain orders (not just the best price) for a collectible +Query the protocol for orders based on various filters. -![GetOrderbookOrders](/img/marketplace/custom-marketplace-listings.png) +_Sequence Orderbook `GetOrderbookOrders` Method:_ + +- Request: POST /rpc/Marketplace/GetOrderbookOrders +- Content-Type: application/json +- Body (in JSON): + - `orderbookContractAddress` (string) -- the address of the protocol contract + - `collectionAddress` (string) -- the address of the NFT collection + - `currencyAddresses` (string[]) -- an array of currency contract addresses + - `filters` (OrderbookOrderFilter) -- filters to apply to the query + - `tokenIds` (string[]) -- the token ids of the assets you're looking at + - `isListing?` (bool) -- `true` if it is an order, `false` if it's an offer + - `userAddress?` (string) -- the address of the user + - `orderStatuses` (OrderStatus[]) (optional) -- filter orders by their statuses as `OPEN`, `CLOSED`, `CANCELLED` strings + - `metadataFilter` (Filter) (optional) -- filter orders by metadata + - `text?` (string) -- text to search + - `properties?` (PropertyFilter[]) -- + - `name` (string) -- name of the property, eg: hero + - `type`: (PropertyType) -- type of the values of the property as an enum from: `"INT"`,`"STRING"`,`"ARRAY"`, or `"GENERIC"` + - `min?`: (int64) -- used if type is int, gives range of values for filtering + - `max?`: (int64) -- used if type is int, gives range of values for filtering + - `values?`: []any -- if string then array of values, eg: ["Ada", "Ari", "Axel", "Banjo" ...] + - `beforeExpiryTimestamp` (int64) -- filter orders expiring before the given timestamp + - `page?` -- page object to sort by + - `sort` (Sort[]) -- with an object of keys `"column"` and `"order"` with example `"createdAt"` and `"ASC"`, respectively +- Response (in JSON): + - `page` + - `page` (i32) -- number of the page + - `pageSize` (i32) -- number of orders on the page + - `more` (bool) -- if there are more orders + - `orders` (OrderbookOrder[]) + [ + - `orderId` (string) -- order id + - `tokenContract` (string) -- the collection contract + - `tokenId` (string) -- the tokenId of the collection in the order + - `isListing` (bool) -- is true if it's a listing for sale, or false if it's an offer + - `quantity` (string) -- the number of tokens the order is for + - `quantityRemaining` (string) -- the number of tokens after the order + - `currencyAddress` (string) -- the currency the token is trading in + - `pricePerToken` (string) -- the price per token + - `expiry` (string) -- the expiry of when the order is no longer valid + - `orderStatus` (OrderStatus) -- the status of the order as an enum fom `"OPEN"`, `"CLOSED"`, `"CANCELLED"` + - `createdBy` (string) -- the address the order was created by + - `createdAt` (uint64) -- the time the order was created + - `orderbookContractAddress` (string) -- the orderbook contract address + ] \ No newline at end of file diff --git a/docs/pages/solutions/marketplaces/orderbook/examples/05-get-user-activities.mdx b/docs/pages/solutions/marketplaces/orderbook/examples/05-get-user-activities.mdx index 1f54accc834..2f0b58d65b9 100644 --- a/docs/pages/solutions/marketplaces/orderbook/examples/05-get-user-activities.mdx +++ b/docs/pages/solutions/marketplaces/orderbook/examples/05-get-user-activities.mdx @@ -1,42 +1,14 @@ ## GetUserActivities -Retrieve activity data for a specific user, including orders and trades. +Enables you to retrieve activity data for a specific user, including orders and trades. With the use of the `GetUserActivities` api developers can build custom and personalized social or tracking experiences to follow certain users in various interfaces. -- Request: POST /api/Marketplace/GetUserActivities -- Content-Type: application/json -- Body (in JSON): - - `orderbookContractAddress` (string) -- the address of the protocol contract. - - `collectionAddress` (string) -- the address of the NFT collection. - - `currencyAddresses` (string[]) -- an array of currency contract addresses. - - `userAddress` (string) -- the address of the user whose activities are being queried. - - `tokenIDs` (string[]) -- an array of token IDs to filter the activities by. -- Response (in JSON): - - `page` - - `page` (i32) -- number of the page - - `pageSize` (i32) -- number of orders on the page - - `more` (bool) -- if there are more orders - - `orders` (OrderbookOrder[]) - [ - - `orderId` (string) -- order id - - `tokenContract` (string) -- the collection contract - - `tokenId` (string) -- the tokenId of the collection in the order - - `isListing` (bool) -- is true if it's a listing for sale, or false if it's an offer - - `quantity` (string) -- the number of tokens the order is for - - `quantityRemaining` (string) -- the number of tokens after the order - - `currencyAddress` (string) -- the currency the token is trading in - - `pricePerToken` (string) -- the price per token - - `expiry` (string) -- the expiry of when the order is no longer valid - - `orderStatus` (OrderStatus) -- the status of the order as an enum fom `"OPEN"`, `"CLOSED"`, `"CANCELLED"` - - `createdBy` (string) -- the address the order was created by - - `createdAt` (uint64) -- the time the order was created - - `orderbookContractAddress` (string) -- the orderbook contract address - ] +![GetUserActivities](/img/marketplace/activities.png) -**Example: `GetUserActivities` for a user with specific token IDs** +### Example +`GetUserActivities` for a user with specific token IDs: :::code-group - ```shell twoslash [curl] filename="curl" curl -X POST -H "Content-Type: application/json" https://dev-marketplace-api.sequence.app/arbitrum-sepolia/rpc/Marketplace/GetUserActivities -d '{ "orderbookContractAddress": "0xB537a160472183f2150d42EB1c3DD6684A55f74c", @@ -75,14 +47,37 @@ import fetch from "cross-fetch"; console.log("res", await res.json()); })(); -``` +``` +::: -```shell twoslash [other] - Please contact our team for assistance with integrations to another target. -``` +### Schema -### Example implementation - -With the use of the `GetUserActivities` api developers can build custom and personalized social or tracking experiences to follow certain users in various interfaces. - -![GetUserActivities](/img/marketplace/activities.png) +- Request: POST /api/Marketplace/GetUserActivities +- Content-Type: application/json +- Body (in JSON): + - `orderbookContractAddress` (string) -- the address of the protocol contract. + - `collectionAddress` (string) -- the address of the NFT collection. + - `currencyAddresses` (string[]) -- an array of currency contract addresses. + - `userAddress` (string) -- the address of the user whose activities are being queried. + - `tokenIDs` (string[]) -- an array of token IDs to filter the activities by. +- Response (in JSON): + - `page` + - `page` (i32) -- number of the page + - `pageSize` (i32) -- number of orders on the page + - `more` (bool) -- if there are more orders + - `orders` (OrderbookOrder[]) + [ + - `orderId` (string) -- order id + - `tokenContract` (string) -- the collection contract + - `tokenId` (string) -- the tokenId of the collection in the order + - `isListing` (bool) -- is true if it's a listing for sale, or false if it's an offer + - `quantity` (string) -- the number of tokens the order is for + - `quantityRemaining` (string) -- the number of tokens after the order + - `currencyAddress` (string) -- the currency the token is trading in + - `pricePerToken` (string) -- the price per token + - `expiry` (string) -- the expiry of when the order is no longer valid + - `orderStatus` (OrderStatus) -- the status of the order as an enum fom `"OPEN"`, `"CLOSED"`, `"CANCELLED"` + - `createdBy` (string) -- the address the order was created by + - `createdAt` (uint64) -- the time the order was created + - `orderbookContractAddress` (string) -- the orderbook contract address + ] diff --git a/nav.ts b/nav.ts index a0ad0346011..8c9bcfe54ae 100644 --- a/nav.ts +++ b/nav.ts @@ -43,7 +43,7 @@ export const topNav = [ { text: 'Relayer API', link: '/api/relayer/overview' }, { text: 'Indexer API', link: '/api/indexer/overview' }, { text: 'Metadata API', link: '/api/metadata/overview' }, - { text: 'Marketplace API', link: '/api/marketplace' }, + { text: 'Marketplace API', link: '/api/marketplace/overview' }, { text: 'Node Gateway', link: '/api/node-gateway' }, ] }, @@ -119,7 +119,7 @@ export const sidebar = { {text: 'Get Top Orders', link: '/solutions/marketplaces/orderbook/examples/03-get-top-orders'}, {text: 'Get Orderbook', link: '/solutions/marketplaces/orderbook/examples/04-get-orderbook'}, {text: 'Get User Activities', link: '/solutions/marketplaces/orderbook/examples/05-get-user-activities'}, - {text: 'Orderbook Transactions', link: '/solutions/marketplaces/orderbook/examples/06-orderbook-transactions'}, + {text: 'Creating Market Transactions', link: '/solutions/marketplaces/orderbook/examples/06-orderbook-transactions'}, ] } ] @@ -408,10 +408,14 @@ export const sidebar = { text: 'Marketplace', collapsed: true, items: [ - { text: 'Overview', link: '/api/marketplace' }, - { text: 'Schema', link: '/api/marketplace/schema' }, - { text: 'Marketplace API', link: '/api/marketplace/api' }, + { text: 'Overview', link: '/api/marketplace/overview' }, + // { text: 'Schema', link: '/api/marketplace/schema' }, + // { text: 'Marketplace API', link: '/api/marketplace/api' }, {text: 'Examples', collapsed: true, items: [ + {text: 'Get Top Orders', link: '/solutions/marketplaces/orderbook/examples/03-get-top-orders'}, + {text: 'Get Orderbook', link: '/solutions/marketplaces/orderbook/examples/04-get-orderbook'}, + {text: 'Get User Activities', link: '/solutions/marketplaces/orderbook/examples/05-get-user-activities'}, + {text: 'Creating Market Transactions', link: '/solutions/marketplaces/orderbook/examples/06-orderbook-transactions'}, ] } ] @@ -435,6 +439,10 @@ export const sidebar = { { text: 'We\'re hiring!', link: 'https://horizon.io/careers' }, { text: 'Contact Us', link: 'https://support.sequence.xyz' }, ] - } + }, + + + + } as Sidebar