Skip to main content

Orders

The orders module allows obtaining information on orders from the Orderbook of Alfa services.

Methods

Get all orders

The findAll method allows you to get all the orders in the Orderbook.

const orders = sdk.orders;

const result = await orders.findAll()

Get an order by your id

The findById method allows you to get an order from the Orderbook by its id.

const orders = sdk.orders;

const id = '33665b04-1da3-4c25-8f07-f04869439b50';

const order = await orders.findById(id);

Get orders from an owner

The findByOwner method allows you to get all the orders in the Orderbook of a specific owner.

const orders = sdk.orders;

const owner = new Owner('0xa73a3b8ACa335855EeaC2f9Fb505BB0360A1B703');

const result = await orders.findByOwner(owner);

Get the orders of a taker

The findByTaker method allows you to get all the orders in the Orderbook of a specific taker.

const orders = sdk.orders;

const taker = new EthereumAddress('0xa73a3b8ACa335855EeaC2f9Fb505BB0360A1B703');

const result = await orders.findByTaker(taker);