Get orders
The GET /orders
endpoint data
field returns an array of Order objects matching the request filters or an empty array if no order is found.
Get orders successful response schema:
{
"success": true,
"message": null,
"data": Order[] | []
}
Order object schema, see also Maker Orders | LooksRare Docs:
Field Name | Field Type | Description |
---|---|---|
|
| The order hash is a unique hash which identifies the order. See the Order Hash section to find out how it's calculated. |
|
| The address of the collection. |
|
| The id of the asset. |
|
| If |
|
| The address of the MakerOrder signer. |
|
| The strategy address. See Addresses | LooksRare SDK for the possible values. |
|
| The currency address. See Addresses | LooksRare SDK for the possible values. The only whitelisted currency is |
|
| The amount of tokens to sell/purchase. It's 1 for ERC-721 and >= 1 for ERC-1155. |
|
| The price in WEI. |
|
| The order nonce. It's meant to be unique expect for conditional orders. Once executed, the order nonce becomes invalid rendering all the orders with the same nonce invalid. |
|
| Start time timestamp in seconds (when the order starts to be valid). |
|
| End time timestamp in seconds (when the order becomes invalid). |
|
| The minPercentageToAsk represents the minimum percentage required to be transferred to the ask or the trade is rejected (e.g., 9800 = 98% of the trade price). It protects the ask user from an unexpected increase in fees. |
|
| The order params are used for more advanced orders. For example to define the maximum price for a Dutch auction or recipient address for a private sale. Not used for standard orders. |
| See the Order Status section. | The order status. Only |
|
| The full EIP-712 signature. |
|
| The r parameter of the EIP-712 signature. |
|
| The s parameter of the EIP-712 signature. |
|
| The v parameter of the EIP-712 signature. |
Create an order
The POST /orders
endpoint is used to create a MakerOrder. If successful, it returns the newly created MakerOrder.
Create an order successful response schema:
{
"success": true,
"message": null,
"data": Order
}
See the Get orders - Order schema above for the response Order object schema. See below for the object the API expects to create an order.
MakerOrder object schema, see also MakerOrder | LooksRare SDK:
Field Name | Field Type | Description |
---|---|---|
|
| Set to |
|
| The address which will sign the MakerOrder object. If ask order, they must own the asset. |
|
| The collection address. |
|
| The price in WEI. |
|
| The asset id. Must be |
|
| The amount of tokens. Must be 1 for ERC-721, can be more for ERC-1155. |
|
| The strategy address. See Deployed Contract Addresses | LooksRare Docs for the possible values. For listings or standard offers use |
|
| The currency address. See Addresses | LooksRare SDK for the possible values. The only whitelisted currency is |
|
| The order nonce. You can retrieve it with the Get order nonce endpoint. It's meant to be unique expect for conditional orders. Once executed, the order nonce becomes invalid rendering all the orders with the same nonce invalid. You can't create more than 20 orders with the same nonce. |
|
| Start time timestamp in seconds.
|
|
| End time timestamp in seconds (when the order becomes invalid). |
|
| The minPercentageToAsk represents the minimum percentage required to be transferred to the ask or the trade is rejected (e.g., 9800 = 98% of the trade price). Can't be higher than It protects the ask user from an unexpected increase in fees. |
|
| The order params are used for more advanced orders. For example to define the maximum price for a Dutch auction or recipient address for a private sale. Not used for standard orders. Can be set to |
|
| The EIP-712 signature of the object with the previous params mentioned above. Must be added to the MakerOrder object before sending the POST request to the API endpoint. |
Get order nonce
The GET /orders/nonce
endpoint data
field returns the nonce to use when creating an order.
Get order nonce successful response schema:
{
"success": true,
"message": null,
"data": string
}
The data
field will contain the nonce to use to create a new MakerOrder.
Miscellaneous
Order Status
Status | Description |
---|---|
| The user cancelled the MakerOrder. |
| The user has not set, or has revoked, the approval ( |
| The user has not set, or has revoked, the approval ( |
| The user-approved WETH balance is lower than the MakerOrder |
| The MakerOrder has been executed, meaning the listed asset was bought or the offer accepted. |
| The current timestamp is greater than the |
| The MakerOrder |
| A valid MakerOrder that can be executed (can be matched with a TakerOrder). |
Order Hash
The order hash is the keccak256 hash of all the MakerOrder properties set when creating an order and a constant value.
NOTE: The order hash is automatically calculated at order creation. You don't need to worry about it.
Below is an example of how the order hash is obtained. In the following example, the order object is just a placeholder. The order object should contain a valid MakerOrder object.
import { encodeOrderParams } from "@looksrare/sdk";
import { defaultAbiCoder, keccak256 } from "ethers/lib/utils";
// NOTE: The order object is just a placeholder. The order object should contain a valid MakerOrder object.
const { encodedParams } = encodeOrderParams(order.params);
const types = [
"bytes32",
"bool",
"address",
"address",
"uint256",
"uint256",
"uint256",
"address",
"address",
"uint256",
"uint256",
"uint256",
"uint256",
"bytes32",
];
const values = [
// keccak256("MakerOrder(bool isOrderAsk,address signer,address collection,uint256 price,uint256 tokenId,uint256 amount,address strategy,address currency,uint256 nonce,uint256 startTime,uint256 endTime,uint256 minPercentageToAsk,bytes params)")
"0x40261ade532fa1d2c7293df30aaadb9b3c616fae525a0b56d3d411c841a85028",
order.isOrderAsk,
order.signer,
order.collection,
order.price,
order.tokenId,
order.amount,
order.strategy,
order.currency,
order.nonce,
order.startTime,
order.endTime,
order.minPercentageToAsk,
keccak256(encodedParams),
];
const hash = keccak256(defaultAbiCoder.encode(types, values));