Skip to main content

Reference / Modules / client / PendingRequest

Class: PendingRequest

client.PendingRequest

A State instance is a state in the "state machine" sense. It comes with some behavior and state transition methods. A state transition method returns an instance of the next state given the executed operation, which discards current object.

This class should be extended by client class. It provides method enabling the client class to query if it was already discarded or not as well as methods actually discarding the state.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new PendingRequest(locSharedState, request, legalOfficerCase, locIssuers, invitedContributors): PendingRequest

Parameters

NameType
locSharedStateLocSharedState
requestLocRequest
legalOfficerCaseundefined | LegalOfficerCase
locIssuersLocVerifiedIssuers
invitedContributorsValidAccountId[]

Returns

PendingRequest

Inherited from

LocRequestState.constructor

Defined in

packages/client/src/Loc.ts:766

Properties

invitedContributors

Protected Readonly invitedContributors: ValidAccountId[]

Inherited from

LocRequestState.invitedContributors

Defined in

packages/client/src/Loc.ts:763


legalOfficerCase

Protected Optional Readonly legalOfficerCase: LegalOfficerCase

Inherited from

LocRequestState.legalOfficerCase

Defined in

packages/client/src/Loc.ts:761


locIssuers

Protected Readonly locIssuers: LocVerifiedIssuers

Inherited from

LocRequestState.locIssuers

Defined in

packages/client/src/Loc.ts:762


locSharedState

Protected Readonly locSharedState: LocSharedState

Inherited from

LocRequestState.locSharedState

Defined in

packages/client/src/Loc.ts:759


owner

Readonly owner: LegalOfficerClass

Inherited from

LocRequestState.owner

Defined in

packages/client/src/Loc.ts:764


request

Protected Readonly request: LocRequest

Inherited from

LocRequestState.request

Defined in

packages/client/src/Loc.ts:760

Accessors

discarded

get discarded(): boolean

Returns

boolean

Description

True if this state was discarded

Inherited from

LocRequestState.discarded

Defined in

packages/client/src/State.ts:24


legalOfficer

get legalOfficer(): LegalOfficerPendingRequestCommands

Returns

LegalOfficerPendingRequestCommands

Defined in

packages/client/src/Loc.ts:1369


locId

get locId(): UUID

Returns

UUID

Inherited from

LocRequestState.locId

Defined in

packages/client/src/Loc.ts:781

Methods

_withLocs

_withLocs<T>(locsState, constructor): T

Type parameters

NameType
Textends LocRequestState

Parameters

NameType
locsStateLocsState
constructor(locSharedState: LocSharedState, request: LocRequest, legalOfficerCase: undefined | LegalOfficerCase, locIssuers: LocVerifiedIssuers, invitedContributors: ValidAccountId[]) => T

Returns

T

Inherited from

LocRequestState._withLocs

Defined in

packages/client/src/Loc.ts:1096


checkHash

checkHash(hash): Promise<CheckHashResult>

Parameters

NameType
hashHash

Returns

Promise<CheckHashResult>

Inherited from

LocRequestState.checkHash

Defined in

packages/client/src/Loc.ts:869


data

data(): LocData

Returns

LocData

Inherited from

LocRequestState.data

Defined in

packages/client/src/Loc.ts:839


discard

discard(next): void

Parameters

NameType
nextundefined | State

Returns

void

Description

Discards current state. One must discard the state only if the state transition was successfully executed. It may be safer to use discardOnSuccess.

Inherited from

LocRequestState.discard

Defined in

packages/client/src/State.ts:43


discardOnSuccess

discardOnSuccess<T, U>(action): Promise<U>

Type parameters

NameType
Textends State
Uextends State = T

Parameters

NameTypeDescription
action(current: T) => Promise<U>The state transition logic producing next state

Returns

Promise<U>

Next state if state transition logic execution did not throw

Descripiton

Discards current state only if given state transition logic executed successfully (i.e. without throwing an error).

Inherited from

LocRequestState.discardOnSuccess

Defined in

packages/client/src/State.ts:55


ensureCurrent

ensureCurrent(): void

Returns

void

Description

Throws an error if this state was discarded. This should be called by all public methods of client class.

Inherited from

LocRequestState.ensureCurrent

Defined in

packages/client/src/State.ts:32


finalizeOnSuccess

finalizeOnSuccess<T>(action): Promise<void>

Type parameters

NameType
Textends State

Parameters

NameTypeDescription
action(current: T) => Promise<void>The state transition logic producing next state

Returns

Promise<void>

Next state if state transition logic execution did not throw

Descripiton

Finalizes (i.e. replaces with no new state) current state only if given state transition logic executed successfully (i.e. without throwing an error).

Inherited from

LocRequestState.finalizeOnSuccess

Defined in

packages/client/src/State.ts:117


getCurrentState

getCurrentState(): undefined | State

Returns

undefined | State

This state if not discareded or the current state or undefined when there is no current state.

Description

If the state has been discarded, provides the replacing current state if any.

Inherited from

LocRequestState.getCurrentState

Defined in

packages/client/src/State.ts:90


getCurrentStateOrThrow

getCurrentStateOrThrow(): State

Returns

State

Inherited from

LocRequestState.getCurrentStateOrThrow

Defined in

packages/client/src/State.ts:102


getFile

getFile(hash): Promise<TypedFile>

Parameters

NameType
hashHash

Returns

Promise<TypedFile>

Inherited from

LocRequestState.getFile

Defined in

packages/client/src/Loc.ts:1103


isLogionData

isLogionData(): boolean

Returns

boolean

Inherited from

LocRequestState.isLogionData

Defined in

packages/client/src/Loc.ts:864


isLogionIdentity

isLogionIdentity(): boolean

Returns

boolean

Inherited from

LocRequestState.isLogionIdentity

Defined in

packages/client/src/Loc.ts:859


isOwner

isOwner(account?): boolean

Parameters

NameType
account?ValidAccountId

Returns

boolean

Inherited from

LocRequestState.isOwner

Defined in

packages/client/src/Loc.ts:1112


isRequester

isRequester(account?): boolean

Parameters

NameType
account?ValidAccountId

Returns

boolean

Inherited from

LocRequestState.isRequester

Defined in

packages/client/src/Loc.ts:1107


isVerifiedIssuer

isVerifiedIssuer(account?): boolean

Parameters

NameType
account?ValidAccountId

Returns

boolean

Inherited from

LocRequestState.isVerifiedIssuer

Defined in

packages/client/src/Loc.ts:1117


locsState

locsState(): LocsState

Returns

LocsState

Inherited from

LocRequestState.locsState

Defined in

packages/client/src/Loc.ts:835


refresh

refresh(): Promise<LocRequestState>

Returns

Promise<LocRequestState>

Inherited from

LocRequestState.refresh

Defined in

packages/client/src/Loc.ts:823


supersededLoc

supersededLoc(): Promise<undefined | VoidedLoc>

Returns

Promise<undefined | VoidedLoc>

Inherited from

LocRequestState.supersededLoc

Defined in

packages/client/src/Loc.ts:851


syncDiscardOnSuccess

syncDiscardOnSuccess<T, U>(action): U

Type parameters

NameType
Textends State
Uextends State = T

Parameters

NameTypeDescription
action(current: T) => UThe state transition logic producing next state

Returns

U

Next state if state transition logic execution did not throw

Descripiton

Same as discardOnSuccess but with a synchronous action.

Inherited from

LocRequestState.syncDiscardOnSuccess

Defined in

packages/client/src/State.ts:73


veryNew

veryNew(): PendingRequest

Returns

PendingRequest

Defined in

packages/client/src/Loc.ts:1360


withLocs

withLocs(locsState): PendingRequest

Parameters

NameType
locsStateLocsState

Returns

PendingRequest

Overrides

LocRequestState.withLocs

Defined in

packages/client/src/Loc.ts:1365


buildLocData

buildLocData(api, legalOfficerCase, request, locIssuers, invitedContributors): LocData

Parameters

NameType
apiLogionNodeApiClass
legalOfficerCaseundefined | LegalOfficerCase
requestLocRequest
locIssuersLocVerifiedIssuers
invitedContributorsValidAccountId[]

Returns

LocData

Inherited from

LocRequestState.buildLocData

Defined in

packages/client/src/Loc.ts:843


checkHash

checkHash(loc, hash): CheckHashResult

Parameters

NameType
locLocData
hashHash

Returns

CheckHashResult

Inherited from

LocRequestState.checkHash

Defined in

packages/client/src/Loc.ts:873


createFromLoc

createFromLoc(locSharedState, request, legalOfficerCase, locIssuers, invitedContributors): Promise<OnchainLocState>

Parameters

NameType
locSharedStateLocSharedState
requestLocRequest
legalOfficerCaseLegalOfficerCase
locIssuersLocVerifiedIssuers
invitedContributorsValidAccountId[]

Returns

Promise<OnchainLocState>

Inherited from

LocRequestState.createFromLoc

Defined in

packages/client/src/Loc.ts:800


createFromRequest

createFromRequest(locSharedState, request, locIssuers, invitedContributors, legalOfficerCase?): Promise<AnyLocState>

Parameters

NameType
locSharedStateLocSharedState
requestLocRequest
locIssuersLocVerifiedIssuers
invitedContributorsValidAccountId[]
legalOfficerCase?LegalOfficerCase

Returns

Promise<AnyLocState>

Inherited from

LocRequestState.createFromRequest

Defined in

packages/client/src/Loc.ts:785


toCollectionParams

toCollectionParams(collectionParams): undefined | CollectionParams

Parameters

NameType
collectionParamsundefined | BackendCollectionParams

Returns

undefined | CollectionParams

Inherited from

LocRequestState.toCollectionParams

Defined in

packages/client/src/Loc.ts:921