JS API Reference

Class: DraftOfferProposalPool

market/draft-offer-proposal-pool.DraftOfferProposalPool

Pool of draft offer proposals that are ready to be promoted to agreements with Providers

Reaching this pool means that the related initial proposal which was delivered by Yagna in response to the subscription with the Demand has been fully negotiated between the Provider and Requestor.

This pool should contain only offer proposals that can be used to pursue the final Agreement between the parties.

Technically, the "market" part of you application should populate this pool with such offer proposals.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DraftOfferProposalPool(options?): DraftOfferProposalPool

Parameters

NameType
options?ProposalPoolOptions

Returns

DraftOfferProposalPool

Defined in

src/market/draft-offer-proposal-pool.ts:78

Properties

events

Readonly events: EventEmitter<ProposalPoolEvents, any>

Defined in

src/market/draft-offer-proposal-pool.ts:54

Methods

add

add(proposal): void

Pushes the provided proposal to the list of proposals available for lease

Parameters

NameType
proposalOfferProposal

Returns

void

Defined in

src/market/draft-offer-proposal-pool.ts:96


acquire

acquire(signalOrTimeout?): Promise<OfferProposal>

Attempts to obtain a single proposal from the pool

Parameters

NameTypeDescription
signalOrTimeout?number | AbortSignalthe timeout in milliseconds or an AbortSignal that will be used to cancel the acquiring

Returns

Promise<OfferProposal>

Defined in

src/market/draft-offer-proposal-pool.ts:111


release

release(proposal): Promise<void>

Releases the proposal back to the pool

Validates if the proposal is still usable before putting it back to the list of available ones

Parameters

NameType
proposalOfferProposal

Returns

Promise<void>

Defined in

src/market/draft-offer-proposal-pool.ts:155


remove

remove(proposal): Promise<void>

Parameters

NameType
proposalOfferProposal

Returns

Promise<void>

Defined in

src/market/draft-offer-proposal-pool.ts:168


count

count(): number

Returns the number of all items in the pool (available + leased out)

Returns

number

Defined in

src/market/draft-offer-proposal-pool.ts:185


availableCount

availableCount(): number

Returns the number of items that are possible to lease from the pool

Returns

number

Defined in

src/market/draft-offer-proposal-pool.ts:192


leasedCount

leasedCount(): number

Returns the number of items that were leased out of the pool

Returns

number

Defined in

src/market/draft-offer-proposal-pool.ts:199


isReady

isReady(): boolean

Tells if the pool is ready to take items from

Returns

boolean

Defined in

src/market/draft-offer-proposal-pool.ts:206


clear

clear(): Promise<void>

Clears the pool entirely

Returns

Promise<void>

Defined in

src/market/draft-offer-proposal-pool.ts:213


removeFromAvailable

removeFromAvailable(proposal): void

Parameters

NameType
proposalOfferProposal

Returns

void

Defined in

src/market/draft-offer-proposal-pool.ts:231


readFrom

readFrom(source): Subscription

Parameters

NameType
sourceObservable<OfferProposal>

Returns

Subscription

Defined in

src/market/draft-offer-proposal-pool.ts:236