reference

Class: Proposal

market/proposal.Proposal

Proposal module - an object representing an offer in the state of a proposal from the provider.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Proposal(subscriptionId, parentId, setCounteringProposalReference, api, model, demandRequest, eventTarget?)

Create proposal for given subscription ID

Parameters

NameTypeDescription
subscriptionIdstringsubscription ID
parentIdnull | stringPrevious proposal ID with Initial state
setCounteringProposalReference(id: string, parentId: string) => null | void
apiRequestorApiRequestorApi
modelProposalProposalModel
demandRequestDemandOfferBaseDemandOfferBase
eventTarget?EventTargetEventTarget

Defined in

src/market/proposal.ts:91

Properties

id

id: string

Defined in

src/market/proposal.ts:70


issuerId

Readonly issuerId: string

Defined in

src/market/proposal.ts:71


provider

Readonly provider: Object

Type declaration

NameType
idstring
namestring

Defined in

src/market/proposal.ts:72


properties

Readonly properties: ProposalProperties

Defined in

src/market/proposal.ts:73


constraints

Readonly constraints: string

Defined in

src/market/proposal.ts:74


timestamp

Readonly timestamp: string

Defined in

src/market/proposal.ts:75


counteringProposalId

counteringProposalId: null | string

Defined in

src/market/proposal.ts:76

Accessors

details

get details(): ProposalDetails

Returns

ProposalDetails

Defined in

src/market/proposal.ts:114


pricing

get pricing(): PricingInfo

Returns

PricingInfo

Defined in

src/market/proposal.ts:131

Methods

validate

Protected validate(): void

Validates if the proposal satisfies basic business rules, is complete and thus safe to interact with

Use this method before executing any important logic, to ensure that you're working with correct, complete data

Returns

void

Defined in

src/market/proposal.ts:154


isInitial

isInitial(): boolean

Returns

boolean

Defined in

src/market/proposal.ts:179


isDraft

isDraft(): boolean

Returns

boolean

Defined in

src/market/proposal.ts:183


isExpired

isExpired(): boolean

Returns

boolean

Defined in

src/market/proposal.ts:187


isRejected

isRejected(): boolean

Returns

boolean

Defined in

src/market/proposal.ts:191


reject

reject(reason?): Promise<void>

Parameters

NameTypeDefault value
reasonstring"no reason"

Returns

Promise<void>

Defined in

src/market/proposal.ts:195


respond

respond(chosenPlatform): Promise<string>

Parameters

NameType
chosenPlatformstring

Returns

Promise<string>

Defined in

src/market/proposal.ts:210


hasPaymentPlatform

hasPaymentPlatform(paymentPlatform): boolean

Parameters

NameType
paymentPlatformstring

Returns

boolean

Defined in

src/market/proposal.ts:240