Skip to content

Class: Agreement

agreement/agreement.Agreement

Agreement module - an object representing the contract between the requestor and the provider.

Table of contents

Methods

Properties

Methods

create

Static create(proposalId, agreementOptions?): Promise<Agreement>

Create agreement for given proposal ID

Parameters

Name Type Description
proposalId string proposal ID
agreementOptions? AgreementOptions AgreementOptions

Returns

Promise<Agreement>

Agreement

Defined in

yajsapi/agreement/agreement.ts:68


refreshDetails

refreshDetails(): Promise<void>

Refresh agreement details

Returns

Promise<void>

Defined in

yajsapi/agreement/agreement.ts:76


getState

getState(): Promise<AgreementStateEnum>

Return agreement state

Returns

Promise<AgreementStateEnum>

state

Defined in

yajsapi/agreement/agreement.ts:85


confirm

confirm(): Promise<void>

Confirm agreement and waits for provider approval

Description

Blocking function waits till agreement will be confirmed and approved by provider

Throws

Error if the agreement will be rejected by provider or failed to confirm

Returns

Promise<void>

Defined in

yajsapi/agreement/agreement.ts:95


isFinalState

isFinalState(): Promise<boolean>

Returns flag if the agreement is in the final state

Description

if the final state is true, agreement will not change state further anymore

Returns

Promise<boolean>

boolean

Defined in

yajsapi/agreement/agreement.ts:114


terminate

terminate(reason?): Promise<void>

Terminate agreement

Description

Blocking function waits till agreement will be terminated

Throws

Error if the agreement will be unable to terminate

Parameters

Name Type
reason Object

Returns

Promise<void>

Defined in

yajsapi/agreement/agreement.ts:124

Properties

id

Readonly id: any

agreement ID

Defined in

yajsapi/agreement/agreement.ts:58


provider

Readonly provider: ProviderInfo

ProviderInfo

Defined in

yajsapi/agreement/agreement.ts:58