JS API Reference

Module: agreement/strategy

Table of contents

Functions

Functions

randomAgreementSelector

randomAgreementSelector(): (candidates: AgreementCandidate[]) => Promise<AgreementCandidate>

Default selector that selects a random provider from the pool

Returns

fn

▸ (candidates): Promise<AgreementCandidate>

Parameters
NameType
candidatesAgreementCandidate[]
Returns

Promise<AgreementCandidate>

Defined in

src/agreement/strategy.ts:4


randomAgreementSelectorWithPriorityForExistingOnes

randomAgreementSelectorWithPriorityForExistingOnes(): (candidates: AgreementCandidate[]) => Promise<AgreementCandidate>

Selector selecting a random provider from the pool, but giving priority to those who already have a confirmed agreement and deployed activity

Returns

fn

▸ (candidates): Promise<AgreementCandidate>

Parameters
NameType
candidatesAgreementCandidate[]
Returns

Promise<AgreementCandidate>

Defined in

src/agreement/strategy.ts:8


bestAgreementSelector

bestAgreementSelector(scores): (candidates: AgreementCandidate[]) => Promise<AgreementCandidate>

Selector selecting the provider according to the provided list of scores

Parameters

NameType
scoresObject

Returns

fn

▸ (candidates): Promise<AgreementCandidate>

Parameters
NameType
candidatesAgreementCandidate[]
Returns

Promise<AgreementCandidate>

Defined in

src/agreement/strategy.ts:17