Orders
Last updated
Last updated
Typescript Core SDK
V3 ORDERS ENDPOINTS MIGRATION
Please refer to this guide when you plan your migration to the upgraded v3 endpoints, and to learn more about maker taker fees please see here.
📚SDK REFERENCE
listOrders
Get a list of active orders from a particular collection that are listed in ETH
and sorted by name
:
const getListOrders = async (
status: 'active' | 'filled' | 'cancelled' | 'expired' | 'inactive',
orderBy:
| 'created_at'
| 'expired_at'
| 'sell_quantity'
| 'buy_quantity'
| 'buy_quantity_with_fees'
| 'updated_at',
sellTokenAddress: string,
buyTokenType: string
) => {
const response = await client.listOrders({
status,
orderBy,
sellTokenAddress,
buyTokenType,
});
return response;
};
getListOrders(
'active',
'buy_quantity_with_fees',
'0x61e506cec264d5b2705f10e5a934dc5313a56a6e',
'ETH'
)
.then((result) => {
console.log(result);
})
.catch((e) => {
console.log(e);
});
{
result: [
{
order_id: 1506, // ID of the order
status: 'active', // Status of the order
user: '0x192f36ee2bd12cf90571e464a3d28e76b8462c87', // Ethereum address of the user who submitted the order
sell: { // Details about the asset in sale
type: 'ERC721', // Type of this asset (ETH/ERC20/ERC721), it used to buy the asset
data: {
token_id: '271', // ERC721 Token ID
token_address: '0x61e506cec264d5b2705f10e5a934dc5313a56a6e', // Address of ERC721/ERC20 contract
quantity: '1', // Quantity of this asset - inclusive of fees for buy order in v1 API and exclusive of fees in v3 API
quantity_with_fees: '', // Quantity of this asset with the sum of all fees applied to the asset
properties: { // Properties of the asset in sale
name: 'CityEscape #1',
image_url: 'https://ipfs.thearknft.io/ipfs/bafkreibq3wnukid4fdfdugjjefjsom553mjloealius5cidqvtktvxf4va',
collection: [Object]
}
}
},
buy: { // Details about the asset used to buy
type: 'ETH', // Type of this asset (ETH/ERC20/ERC721), it used to buy the asset
data: {
token_address: '', // Address of ERC721/ERC20 contract. If the type is ETH, no address is required
decimals: 18, // Number of decimals supported by this asset
quantity: '530000000000000000', // Quantity of this asset - inclusive of fees for buy order in v1 API and exclusive of fees in v3 API
quantity_with_fees: '530000000000000000' // Quantity of this asset with the sum of all fees applied to the asset
}
},
amount_sold: null, // Amount of the asset already sold by this order
expiration_timestamp: '2121-09-28T13:00:00Z', // Expiration timestamp of this order
timestamp: '2022-09-28T13:26:26.327782Z', // Timestamp this order was created
updated_timestamp: '2022-09-28T13:26:26.327782Z' // Updated timestamp of this order
},
// Other orders returned
...
],
cursor: 'eyJvcmRlcl9pZCI6MTU0Niwic2VsbF9xdWFudGl0eSI6IjEiLCJidXlfcXVhbnRpdHkiOiI4MDAwMDAwMDAwMDAwMDAwMCIsImJ1eV9xdWFudGl0eV9pbmNsdXNpdmVfZmVlcyI6IjgzMjAwMDAwMDAwMDAwMDAwIiwiZXhwaXJlZF9hdCI6IjIxMjEtMDktMjlUMDA6MDA6MDBaIiwiY3JlYXRlZF9hdCI6IjIwMjItMDktMjlUMDA6NDc6MTMuODA2NjU2WiIsInVwZGF0ZWRfYXQiOiIyMDIyLTA5LTI5VDAwOjQ3OjEzLjgwNjY1NloiLCJ0c19zb3J0X3JhbmsiOm51bGx9',
// Remaining results
remaining: 0
}
Kotlin (JVM) Core SDK
SDK REFERENCE
listOrders
Swift Core SDK
SDK REFERENCE
listOrders
Golang Core SDK
📚SDK REFERENCE
ListOrders
C# Core SDK
📚SDK REFERENCE
ListOrders
Typescript Core SDK
📚SDK REFERENCE
getOrder
Get details about an order with ID 1506
, including fees:
const getOrder = async (id: string, includeFees: boolean) => {
const response = await client.getOrder({
id,
includeFees,
});
return response;
};
getOrder('1506', true)
.then((result) => {
console.log(result);
})
.catch((e) => {
console.log(e);
});
{
order_id: 1506, // ID of the order
status: 'active', // Status of the order
user: '0x192f36ee2bd12cf90571e464a3d28e76b8462c87', // Ethereum address of the user who submitted the order
sell: { // Details about the asset in sale
type: 'ERC721', // Type of this asset (ETH/ERC20/ERC721), it used to buy the asset
data: {
token_id: '271', // ERC721 Token ID
token_address: '0x61e506cec264d5b2705f10e5a934dc5313a56a6e', // Address of ERC721/ERC20 contract
quantity: '1', // Quantity of this asset - inclusive of fees for buy order in v1 API and exclusive of fees in v3 API
quantity_with_fees: '', // Quantity of this asset with the sum of all fees applied to the asset
properties: { // Properties of the asset in sale
name: 'CityEscape #1',
image_url: 'https://ipfs.thearknft.io/ipfs/bafkreibq3wnukid4fdfdugjjefjsom553mjloealius5cidqvtktvxf4va',
collection: [Object]
}
}
},
buy: { // Details about the asset used to buy
type: 'ETH', // Type of this asset (ETH/ERC20/ERC721), it used to buy the asset
data: {
token_address: '', // Address of ERC721/ERC20 contract. If the type is ETH, no address is required
decimals: 18, // Number of decimals supported by this asset
quantity: '530000000000000000', // Quantity of this asset - inclusive of fees for buy order in v1 API and exclusive of fees in v3 API
quantity_with_fees: '530000000000000000' // Quantity of this asset with the sum of all fees applied to the asset
}
},
amount_sold: null, // Amount of the asset already sold by this order
expiration_timestamp: '2121-09-28T13:00:00Z', // Expiration timestamp of this order
timestamp: '2022-09-28T13:26:26.327782Z', // Timestamp this order was created
updated_timestamp: '2022-09-28T13:26:26.327782Z' // Updated timestamp of this order
fees: [ // Fees info
{
type: 'protocol',
address: '0xa6c368164eb270c31592c1830ed25c2bf5d34bae',
token: [Object],
amount: '10000000000000000'
},
{
type: 'royalty',
address: '0x192f36ee2bd12cf90571e464a3d28e76b8462c87',
token: [Object],
amount: '10000000000000000'
},
{
type: 'royalty',
address: '0x59bb6d1b896a9a139380bf2b8d828819f0cf1409',
token: [Object],
amount: '10000000000000000'
}
]
}
Kotlin (JVM) Core SDK
📚SDK REFERENCE
getOrder
Swift Core SDK
📚SDK REFERENCE
getOrder
Golang Core SDK
📚SDK REFERENCE
GetOrder
C# Core SDK
📚SDK REFERENCE
GetOrder