JS API 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(demand, parentId, setCounteringProposalReference, api, model, eventTarget?): Proposal

Create proposal for given subscription ID

Parameters

NameType
demandDemand
parentIdnull | string
setCounteringProposalReference(id: string, parentId: string) => null | void
apiRequestorApi
modelProposal
eventTarget?EventTarget

Returns

Proposal

Defined in

src/market/proposal.ts:84

Properties

id

id: string

Defined in

src/market/proposal.ts:64


issuerId

Readonly issuerId: string

Defined in

src/market/proposal.ts:65


provider

Readonly provider: ProviderInfo

Defined in

src/market/proposal.ts:66


properties

Readonly properties: ProposalProperties

Defined in

src/market/proposal.ts:67


constraints

Readonly constraints: string

Defined in

src/market/proposal.ts:68


timestamp

Readonly timestamp: string

Defined in

src/market/proposal.ts:69


counteringProposalId

counteringProposalId: null | string

Defined in

src/market/proposal.ts:70


demand

Readonly demand: Demand

Defined in

src/market/proposal.ts:85

Accessors

details

get details(): ProposalDetails

Returns

ProposalDetails

Defined in

src/market/proposal.ts:106


pricing

get pricing(): PricingInfo

Returns

PricingInfo

Defined in

src/market/proposal.ts:122

Methods

validate

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:145


isInitial

isInitial(): boolean

Returns

boolean

Defined in

src/market/proposal.ts:182


isDraft

isDraft(): boolean

Returns

boolean

Defined in

src/market/proposal.ts:186


isExpired

isExpired(): boolean

Returns

boolean

Defined in

src/market/proposal.ts:190


isRejected

isRejected(): boolean

Returns

boolean

Defined in

src/market/proposal.ts:194


reject

reject(reason?): Promise<void>

Parameters

NameTypeDefault value
reasonstring"no reason"

Returns

Promise<void>

Defined in

src/market/proposal.ts:198


respond

respond(chosenPlatform): Promise<string>

Parameters

NameType
chosenPlatformstring

Returns

Promise<string>

Defined in

src/market/proposal.ts:220


hasPaymentPlatform

hasPaymentPlatform(paymentPlatform): boolean

Parameters

NameType
paymentPlatformstring

Returns

boolean

Defined in

src/market/proposal.ts:260


getEstimatedCost

getEstimatedCost(): number

Proposal cost estimation based on CPU, Env and startup costs

Returns

number

Defined in

src/market/proposal.ts:267