Skip to content

GetOrderbookOrders

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

GetOrderbookOrders

Example

GetOrderbookOrders of token ids from a collection address on Sepolia:

cURL
 
curl --request POST \
  --url https://marketplace-api.sequence.app/arbitrum-sepolia/rpc/Marketplace/GetOrderbookOrders \
  --header 'Content-Type: application/json' \
  --data '{
    "collectionAddress": "0x1693ffc74edbb50d6138517fe5cd64fd1c917709",
    "currencyAddresses": [
        "0xa9c88358862211870db6f18bc9b3f6e4f8b3eae7"
    ],
    "filters": {
        "isListing": true,
        "tokenIds": [
            "0",
            "1",
            "4",
            "5"
        ]
    },
    "orderStatuses": [
        "OPEN","CANCELLED"
    ],
    "page": {
        "sort": [
            {
                "column": "createdAt",
                "order": "ASC"
            }
        ]
    },
    "orderbookContractAddress": "0xB537a160472183f2150d42EB1c3DD6684A55f74c"
}'

Schema

Query the protocol for orders based on various filters.

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 ]