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
Name | Type |
---|---|
options? | ProposalPoolOptions |
Returns
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
Name | Type |
---|---|
proposal | OfferProposal |
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
Name | Type | Description |
---|---|---|
signalOrTimeout? | number | AbortSignal | the 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
Name | Type |
---|---|
proposal | OfferProposal |
Returns
Promise
<void
>
Defined in
src/market/draft-offer-proposal-pool.ts:155
remove
▸ remove(proposal
): Promise
<void
>
Parameters
Name | Type |
---|---|
proposal | OfferProposal |
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
Name | Type |
---|---|
proposal | OfferProposal |
Returns
void
Defined in
src/market/draft-offer-proposal-pool.ts:231
readFrom
▸ readFrom(source
): Subscription
Parameters
Name | Type |
---|---|
source | Observable <OfferProposal > |
Returns
Subscription
Defined in
Was this helpful?