Skip to content

Latest commit

 

History

History
348 lines (234 loc) · 12 KB

IExecOrderbookModule.md

File metadata and controls

348 lines (234 loc) · 12 KB

iexec / Exports / IExecOrderbookModule

Class: IExecOrderbookModule

module exposing orderbook methods

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new IExecOrderbookModule(configOrArgs, options?): IExecOrderbookModule

Create an IExecModule instance

Parameters

Name Type
configOrArgs IExecConfig | IExecConfigArgs
options? IExecConfigOptions

Returns

IExecOrderbookModule

Inherited from

IExecModule.constructor

Properties

config

config: IExecConfig

current IExecConfig

Inherited from

IExecModule.config

Methods

fetchAppOrderbook

fetchAppOrderbook(appAddress, options?): Promise<PaginableOrders<PublishedApporder>>

find the cheapest orders for the specified app.

NB: use options to include restricted orders or filter results.

example:

const { count, orders } = await fetchAppOrderbook(appAddress);
console.log('best order:', orders[0]?.order);
console.log('total orders:', count);

Parameters

Name Type Description
appAddress string -
options? Object -
options.dataset? string include orders restricted to specified dataset (use 'any' to include any dataset)
options.isDatasetStrict? boolean filters out orders allowing “any” dataset (default: false)
options.isRequesterStrict? boolean filters out orders allowing “any” requester (default: false)
options.isWorkerpoolStrict? boolean filters out orders allowing “any” workerpool (default: false)
options.maxTag? Tag | string[] filter by maximum tag accepted
options.minTag? Tag | string[] filter by minimum tag required
options.minVolume? BNish filter by minimum volume remaining
options.page? number index of the page to fetch
options.pageSize? number size of the page to fetch
options.requester? string include orders restricted to specified requester (use 'any' to include any requester)
options.workerpool? string include orders restricted to specified workerpool (use 'any' to include any workerpool)

Returns

Promise<PaginableOrders<PublishedApporder>>


fetchApporder

fetchApporder(orderHash): Promise<PublishedApporder>

find a published apporder by orderHash.

example:

const { order, remaining } = await fetchApporder(orderHash);
console.log('order:' order);
console.log('remaining volume:', remaining);

Parameters

Name Type
orderHash string

Returns

Promise<PublishedApporder>


fetchDatasetOrderbook

fetchDatasetOrderbook(datasetAddress, options?): Promise<PaginableOrders<PublishedDatasetorder>>

find the cheapest orders for the specified dataset.

NB: use options to include restricted orders or filter results.

example:

const { count, orders } = await fetchDatasetOrderbook(datasetAddress);
console.log('best order:', orders[0]?.order);
console.log('total orders:', count);

Parameters

Name Type Description
datasetAddress string -
options? Object -
options.app? string include orders restricted to specified app (use 'any' to include any app)
options.isAppStrict? boolean filters out orders allowing “any” app (default: false)
options.isRequesterStrict? boolean filters out orders allowing “any” requester (default: false)
options.isWorkerpoolStrict? boolean filters out orders allowing “any” workerpool (default: false)
options.maxTag? Tag | string[] filter by maximum tag accepted
options.minTag? Tag | string[] filter by minimum tag required
options.minVolume? BNish filter by minimum volume remaining
options.page? number index of the page to fetch
options.pageSize? number size of the page to fetch
options.requester? string include orders restricted to specified requester (use 'any' to include any requester)
options.workerpool? string include orders restricted to specified workerpool (use 'any' to include any workerpool)

Returns

Promise<PaginableOrders<PublishedDatasetorder>>


fetchDatasetorder

fetchDatasetorder(orderHash): Promise<PublishedDatasetorder>

find a published datasetorder by orderHash.

example:

const { order, remaining } = await fetchDatasetorder(orderHash);
console.log('order:' order);
console.log('remaining volume:', remaining);

Parameters

Name Type
orderHash string

Returns

Promise<PublishedDatasetorder>


fetchRequestOrderbook

fetchRequestOrderbook(options?): Promise<PaginableOrders<PublishedWorkerpoolorder>>

find the best paying request orders for computing resource.

NB: use options to include restricted orders or filter results.

example:

const { count, orders } = await fetchRequestOrderbook();
console.log('best order:', orders[0]?.order);
console.log('total orders:', count);

Parameters

Name Type Description
options? Object -
options.app? string filter by specified app
options.category? BNish filter by category
options.dataset? string filter by specified dataset
options.isWorkerpoolStrict? boolean filters out orders allowing “any” workerpool (default: false)
options.maxTag? Tag | string[] filter by maximum tag accepted
options.maxTrust? BNish filter by maximum trust required
options.minTag? Tag | string[] filter by minimum tag required
options.minVolume? BNish filter by minimum volume remaining
options.page? number index of the page to fetch
options.pageSize? number size of the page to fetch
options.requester? string filter by requester
options.workerpool? string include orders restricted to specified workerpool (use 'any' to include any workerpool)

Returns

Promise<PaginableOrders<PublishedWorkerpoolorder>>


fetchRequestorder

fetchRequestorder(orderHash): Promise<PublishedRequestorder>

find a published requestorder by orderHash.

example:

const { order, remaining } = await fetchRequestorder(orderHash);
console.log('order:' order);
console.log('remaining volume:', remaining);

Parameters

Name Type
orderHash string

Returns

Promise<PublishedRequestorder>


fetchWorkerpoolOrderbook

fetchWorkerpoolOrderbook(options?): Promise<PaginableOrders<PublishedWorkerpoolorder>>

find the cheapest orders for the specified computing resource.

NB: use options to include restricted orders or filter results.

example:

const { count, orders } = await fetchWorkerpoolOrderbook();
console.log('best order:', orders[0]?.order);
console.log('total orders:', count);

Parameters

Name Type Description
options? Object -
options.app? string include orders restricted to specified app (use 'any' to include any app)
options.category? BNish filter by category
options.dataset? string include orders restricted to specified dataset (use 'any' to include any dataset)
options.isAppStrict? boolean filters out orders allowing “any” app (default: false)
options.isDatasetStrict? boolean filters out orders allowing “any” dataset (default: false)
options.isRequesterStrict? boolean filters out orders allowing “any” requester (default: false)
options.maxTag? Tag | string[] filter by maximum tag offered
options.minTag? Tag | string[] filter by minimum tag required
options.minTrust? BNish filter by minimum trust required
options.minVolume? BNish filter by minimum volume remaining
options.page? number index of the page to fetch
options.pageSize? number size of the page to fetch
options.requester? string include orders restricted to specified requester (use 'any' to include any requester)
options.workerpool? string filter by workerpool

Returns

Promise<PaginableOrders<PublishedWorkerpoolorder>>


fetchWorkerpoolorder

fetchWorkerpoolorder(orderHash): Promise<PublishedWorkerpoolorder>

find a published workerpoolorder by orderHash.

example:

const { order, remaining } = await fetchWorkerpoolorder(orderHash);
console.log('order:' order);
console.log('remaining volume:', remaining);

Parameters

Name Type
orderHash string

Returns

Promise<PublishedWorkerpoolorder>


fromConfig

fromConfig(config): IExecOrderbookModule

Create an IExecOrderbookModule instance using an IExecConfig instance

Parameters

Name Type
config IExecConfig

Returns

IExecOrderbookModule

Overrides

IExecModule.fromConfig