Skip to content

Latest commit

 

History

History
763 lines (402 loc) · 14 KB

File metadata and controls

763 lines (402 loc) · 14 KB

iexec


iexec / IExecOrderbookModule

Class: IExecOrderbookModule

module exposing orderbook methods

Extends

Constructors

Constructor

new IExecOrderbookModule(configOrArgs, options?): IExecOrderbookModule

Create an IExecModule instance

Parameters

configOrArgs

IExecConfigArgs | IExecConfig

options?

IExecConfigOptions

Returns

IExecOrderbookModule

Inherited from

IExecModule.constructor

Properties

config

config: IExecConfig

current IExecConfig

Inherited from

IExecModule.config

Methods

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

orderHash

string

Returns

Promise<PublishedApporder>


fetchAppOrderbook()

fetchAppOrderbook(appAddressOrOptions, 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

appAddressOrOptions

string |

{ app?: string; appOwner?: string; dataset?: string; isDatasetStrict?: boolean; isRequesterStrict?: boolean; isWorkerpoolStrict?: boolean; maxTag?: Tag | string[]; minTag?: Tag | string[]; minVolume?: BNish; page?: number; pageSize?: number; requester?: string; workerpool?: string; }

app?

string

filter by app

appOwner?

string

filter by app owner

dataset?

string

include orders restricted to specified dataset (use 'any' to include any dataset)

isDatasetStrict?

boolean

filters out orders allowing “any” dataset (default: false)

isRequesterStrict?

boolean

filters out orders allowing “any” requester (default: false)

isWorkerpoolStrict?

boolean

filters out orders allowing “any” workerpool (default: false)

maxTag?

Tag | string[]

filter by maximum tag accepted

minTag?

Tag | string[]

filter by minimum tag required

minVolume?

BNish

filter by minimum volume remaining

page?

number

index of the page to fetch

pageSize?

number

size of the page to fetch

requester?

string

include orders restricted to specified requester (use 'any' to include any requester)

workerpool?

string

include orders restricted to specified workerpool (use 'any' to include any workerpool)

options?

Deprecated

use first parameter instead

migration:

replace fetchAppOrderbook(appAddress, options) by fetchAppOrderbook({ app: appAddress, ...options })

dataset?

string

include orders restricted to specified dataset (use 'any' to include any dataset)

isDatasetStrict?

boolean

filters out orders allowing “any” dataset (default: false)

isRequesterStrict?

boolean

filters out orders allowing “any” requester (default: false)

isWorkerpoolStrict?

boolean

filters out orders allowing “any” workerpool (default: false)

maxTag?

Tag | string[]

filter by maximum tag accepted

minTag?

Tag | string[]

filter by minimum tag required

minVolume?

BNish

filter by minimum volume remaining

page?

number

index of the page to fetch

pageSize?

number

size of the page to fetch

requester?

string

include orders restricted to specified requester (use 'any' to include any requester)

workerpool?

string

include orders restricted to specified workerpool (use 'any' to include any workerpool)

Returns

Promise<PaginableOrders<PublishedApporder>>


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

orderHash

string

Returns

Promise<PublishedDatasetorder>


fetchDatasetOrderbook()

fetchDatasetOrderbook(datasetAddressOrOptions, 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

datasetAddressOrOptions

string |

{ app?: string; bulkOnly?: boolean; dataset?: string; datasetOwner?: string; isAppStrict?: boolean; isRequesterStrict?: boolean; isWorkerpoolStrict?: boolean; maxTag?: Tag | string[]; minTag?: Tag | string[]; minVolume?: BNish; page?: number; pageSize?: number; requester?: string; workerpool?: string; }

app?

string

include orders restricted to specified app (use 'any' to include any app)

bulkOnly?

boolean

filters out orders that don't allow bulk processing (default: false)

dataset?

string

filter by dataset

datasetOwner?

string

filter by dataset owner

isAppStrict?

boolean

filters out orders allowing “any” app (default: false)

isRequesterStrict?

boolean

filters out orders allowing “any” requester (default: false)

isWorkerpoolStrict?

boolean

filters out orders allowing “any” workerpool (default: false)

maxTag?

Tag | string[]

filter by maximum tag accepted

minTag?

Tag | string[]

filter by minimum tag required

minVolume?

BNish

filter by minimum volume remaining

page?

number

index of the page to fetch

pageSize?

number

size of the page to fetch

requester?

string

include orders restricted to specified requester (use 'any' to include any requester)

workerpool?

string

include orders restricted to specified workerpool (use 'any' to include any workerpool)

options?

Deprecated

use first parameter instead

migration:

replace fetchDatasetOrderbook(datasetAddress, options) by fetchDatasetOrderbook({ dataset: datasetAddress, ...options })

app?

string

include orders restricted to specified app (use 'any' to include any app)

bulkOnly?

boolean

filters out orders that don't allow bulk processing (default: false)

isAppStrict?

boolean

filters out orders allowing “any” app (default: false)

isRequesterStrict?

boolean

filters out orders allowing “any” requester (default: false)

isWorkerpoolStrict?

boolean

filters out orders allowing “any” workerpool (default: false)

maxTag?

Tag | string[]

filter by maximum tag accepted

minTag?

Tag | string[]

filter by minimum tag required

minVolume?

BNish

filter by minimum volume remaining

page?

number

index of the page to fetch

pageSize?

number

size of the page to fetch

requester?

string

include orders restricted to specified requester (use 'any' to include any requester)

workerpool?

string

include orders restricted to specified workerpool (use 'any' to include any workerpool)

Returns

Promise<PaginableOrders<PublishedDatasetorder>>


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

orderHash

string

Returns

Promise<PublishedRequestorder>


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

options?
app?

string

filter by specified app

category?

BNish

filter by category

dataset?

string

filter by specified dataset

isWorkerpoolStrict?

boolean

filters out orders allowing “any” workerpool (default: false)

maxTag?

Tag | string[]

filter by maximum tag accepted

maxTrust?

BNish

filter by maximum trust required

minTag?

Tag | string[]

filter by minimum tag required

minVolume?

BNish

filter by minimum volume remaining

page?

number

index of the page to fetch

pageSize?

number

size of the page to fetch

requester?

string

filter by requester

workerpool?

string

include orders restricted to specified workerpool (use 'any' to include any 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

orderHash

string

Returns

Promise<PublishedWorkerpoolorder>


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

options?
app?

string

include orders restricted to specified app (use 'any' to include any app)

category?

BNish

filter by category

dataset?

string

include orders restricted to specified dataset (use 'any' to include any dataset)

isAppStrict?

boolean

filters out orders allowing “any” app (default: false)

isDatasetStrict?

boolean

filters out orders allowing “any” dataset (default: false)

isRequesterStrict?

boolean

filters out orders allowing “any” requester (default: false)

maxTag?

Tag | string[]

filter by maximum tag offered

minTag?

Tag | string[]

filter by minimum tag required

minTrust?

BNish

filter by minimum trust required

minVolume?

BNish

filter by minimum volume remaining

page?

number

index of the page to fetch

pageSize?

number

size of the page to fetch

requester?

string

include orders restricted to specified requester (use 'any' to include any requester)

workerpool?

string

filter by workerpool

workerpoolOwner?

string

filter by workerpool owner

Returns

Promise<PaginableOrders<PublishedWorkerpoolorder>>


fromConfig()

static fromConfig(config): IExecOrderbookModule

Create an IExecOrderbookModule instance using an IExecConfig instance

Parameters

config

IExecConfig

Returns

IExecOrderbookModule

Overrides

IExecModule.fromConfig