Skip to main content

Reference / Modules / client / OpenLoc

Class: OpenLoc

client.OpenLoc

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 OpenLoc(locSharedState, request, legalOfficerCase, locIssuers, invitedContributors): OpenLoc

Parameters

NameType
locSharedStateLocSharedState
requestLocRequest
legalOfficerCaseundefined | LegalOfficerCase
locIssuersLocVerifiedIssuers
invitedContributorsValidAccountId[]

Returns

OpenLoc

Inherited from

EditableRequest.constructor

Defined in

packages/client/src/Loc.ts:766

Properties

invitedContributors

Protected Readonly invitedContributors: ValidAccountId[]

Inherited from

EditableRequest.invitedContributors

Defined in

packages/client/src/Loc.ts:763


legalOfficerCase

Protected Optional Readonly legalOfficerCase: LegalOfficerCase

Inherited from

EditableRequest.legalOfficerCase

Defined in

packages/client/src/Loc.ts:761


locIssuers

Protected Readonly locIssuers: LocVerifiedIssuers

Inherited from

EditableRequest.locIssuers

Defined in

packages/client/src/Loc.ts:762


locSharedState

Protected Readonly locSharedState: LocSharedState

Inherited from

EditableRequest.locSharedState

Defined in

packages/client/src/Loc.ts:759


owner

Readonly owner: LegalOfficerClass

Inherited from

EditableRequest.owner

Defined in

packages/client/src/Loc.ts:764


request

Protected Readonly request: LocRequest

Inherited from

EditableRequest.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

EditableRequest.discarded

Defined in

packages/client/src/State.ts:24


legalOfficer

get legalOfficer(): LegalOfficerOpenRequestCommands

Returns

LegalOfficerOpenRequestCommands

Defined in

packages/client/src/Loc.ts:1821


locId

get locId(): UUID

Returns

UUID

Inherited from

EditableRequest.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

EditableRequest._withLocs

Defined in

packages/client/src/Loc.ts:1096


acknowledgeFile

acknowledgeFile(parameters): Promise<OpenLoc>

Parameters

NameType
parametersAckFileParams

Returns

Promise<OpenLoc>

Defined in

packages/client/src/Loc.ts:1677


acknowledgeLink(parameters): Promise<OpenLoc>

Parameters

NameType
parametersAckLinkParams

Returns

Promise<OpenLoc>

Defined in

packages/client/src/Loc.ts:1791


acknowledgeMetadata

acknowledgeMetadata(parameters): Promise<OpenLoc>

Parameters

NameType
parametersAckMetadataParams

Returns

Promise<OpenLoc>

Defined in

packages/client/src/Loc.ts:1737


addFile

addFile(params): Promise<EditableRequest>

Parameters

NameType
paramsAddFileParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.addFile

Defined in

packages/client/src/Loc.ts:1189


addLink(params): Promise<EditableRequest>

Parameters

NameType
paramsAddLinkParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.addLink

Defined in

packages/client/src/Loc.ts:1199


addMetadata

addMetadata(params): Promise<EditableRequest>

Parameters

NameType
paramsAddMetadataParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.addMetadata

Defined in

packages/client/src/Loc.ts:1180


checkHash

checkHash(hash): Promise<CheckHashResult>

Parameters

NameType
hashHash

Returns

Promise<CheckHashResult>

Inherited from

EditableRequest.checkHash

Defined in

packages/client/src/Loc.ts:869


data

data(): LocData

Returns

LocData

Inherited from

EditableRequest.data

Defined in

packages/client/src/Loc.ts:839


deleteFile

deleteFile(params): Promise<EditableRequest>

Parameters

NameType
paramsRefFileParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.deleteFile

Defined in

packages/client/src/Loc.ts:1217


deleteLink(params): Promise<EditableRequest>

Parameters

NameType
paramsRefLinkParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.deleteLink

Defined in

packages/client/src/Loc.ts:1226


deleteMetadata

deleteMetadata(params): Promise<EditableRequest>

Parameters

NameType
paramsRefMetadataParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.deleteMetadata

Defined in

packages/client/src/Loc.ts:1208


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

EditableRequest.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

EditableRequest.discardOnSuccess

Defined in

packages/client/src/State.ts:55


ensureCanAcknowledge

ensureCanAcknowledge(): void

Returns

void

Defined in

packages/client/src/Loc.ts:1690


ensureCanPublish

ensureCanPublish(): void

Returns

void

Defined in

packages/client/src/Loc.ts:1646


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

EditableRequest.ensureCurrent

Defined in

packages/client/src/State.ts:32


estimateFeesAcknowledgeFile

estimateFeesAcknowledgeFile(parameters): Promise<Fees>

Parameters

NameType
parametersRefFileParams

Returns

Promise<Fees>

Defined in

packages/client/src/Loc.ts:1696


estimateFeesAcknowledgeLink(parameters): Promise<Fees>

Parameters

NameType
parametersRefLinkParams

Returns

Promise<Fees>

Defined in

packages/client/src/Loc.ts:1804


estimateFeesAcknowledgeMetadata

estimateFeesAcknowledgeMetadata(parameters): Promise<Fees>

Parameters

NameType
parametersRefMetadataParams

Returns

Promise<Fees>

Defined in

packages/client/src/Loc.ts:1750


estimateFeesPublishFile

estimateFeesPublishFile(parameters): Promise<Fees>

Parameters

NameType
parametersObject
parameters.hashHash

Returns

Promise<Fees>

Defined in

packages/client/src/Loc.ts:1671


estimateFeesPublishLink(parameters): Promise<Fees>

Parameters

NameType
parametersObject
parameters.targetUUID

Returns

Promise<Fees>

Defined in

packages/client/src/Loc.ts:1785


estimateFeesPublishMetadata

estimateFeesPublishMetadata(parameters): Promise<Fees>

Parameters

NameType
parametersObject
parameters.nameHashHash

Returns

Promise<Fees>

Defined in

packages/client/src/Loc.ts:1731


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

EditableRequest.finalizeOnSuccess

Defined in

packages/client/src/State.ts:117


findFile

findFile(hash, status): EstimateFeesPublishFileParams

Parameters

NameType
hashHash
statusItemStatus

Returns

EstimateFeesPublishFileParams

Defined in

packages/client/src/Loc.ts:1655


findLink(target, status): EstimateFeesPublishLinkParams

Parameters

NameType
targetUUID
statusItemStatus

Returns

EstimateFeesPublishLinkParams

Defined in

packages/client/src/Loc.ts:1770


findMetadata

findMetadata(nameHash, status): EstimateFeesPublishMetadataParams

Parameters

NameType
nameHashHash
statusItemStatus

Returns

EstimateFeesPublishMetadataParams

Defined in

packages/client/src/Loc.ts:1716


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

EditableRequest.getCurrentState

Defined in

packages/client/src/State.ts:90


getCurrentStateOrThrow

getCurrentStateOrThrow(): State

Returns

State

Inherited from

EditableRequest.getCurrentStateOrThrow

Defined in

packages/client/src/State.ts:102


getFile

getFile(hash): Promise<TypedFile>

Parameters

NameType
hashHash

Returns

Promise<TypedFile>

Inherited from

EditableRequest.getFile

Defined in

packages/client/src/Loc.ts:1103


isLogionData

isLogionData(): boolean

Returns

boolean

Inherited from

EditableRequest.isLogionData

Defined in

packages/client/src/Loc.ts:864


isLogionIdentity

isLogionIdentity(): boolean

Returns

boolean

Inherited from

EditableRequest.isLogionIdentity

Defined in

packages/client/src/Loc.ts:859


isOwner

isOwner(account?): boolean

Parameters

NameType
account?ValidAccountId

Returns

boolean

Inherited from

EditableRequest.isOwner

Defined in

packages/client/src/Loc.ts:1112


isRequester

isRequester(account?): boolean

Parameters

NameType
account?ValidAccountId

Returns

boolean

Inherited from

EditableRequest.isRequester

Defined in

packages/client/src/Loc.ts:1107


isVerifiedIssuer

isVerifiedIssuer(account?): boolean

Parameters

NameType
account?ValidAccountId

Returns

boolean

Inherited from

EditableRequest.isVerifiedIssuer

Defined in

packages/client/src/Loc.ts:1117


locsState

locsState(): LocsState

Returns

LocsState

Inherited from

EditableRequest.locsState

Defined in

packages/client/src/Loc.ts:835


publishFile

publishFile(parameters): Promise<OpenLoc>

Parameters

NameType
parameters{ hash: Hash } & BlockchainSubmissionParams

Returns

Promise<OpenLoc>

Defined in

packages/client/src/Loc.ts:1634


publishLink(parameters): Promise<OpenLoc>

Parameters

NameType
parameters{ target: UUID } & BlockchainSubmissionParams

Returns

Promise<OpenLoc>

Defined in

packages/client/src/Loc.ts:1758


publishMetadata

publishMetadata(parameters): Promise<OpenLoc>

Parameters

NameType
parameters{ nameHash: Hash } & BlockchainSubmissionParams

Returns

Promise<OpenLoc>

Defined in

packages/client/src/Loc.ts:1704


refresh

refresh(): Promise<OnchainLocState>

Returns

Promise<OnchainLocState>

Overrides

EditableRequest.refresh

Defined in

packages/client/src/Loc.ts:1626


requestFileReview

requestFileReview(params): Promise<EditableRequest>

Parameters

NameType
paramsRefFileParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.requestFileReview

Defined in

packages/client/src/Loc.ts:1235


requestLinkReview

requestLinkReview(params): Promise<EditableRequest>

Parameters

NameType
paramsRefLinkParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.requestLinkReview

Defined in

packages/client/src/Loc.ts:1253


requestMetadataReview

requestMetadataReview(params): Promise<EditableRequest>

Parameters

NameType
paramsRefMetadataParams

Returns

Promise<EditableRequest>

Inherited from

EditableRequest.requestMetadataReview

Defined in

packages/client/src/Loc.ts:1244


requestSof

requestSof(): Promise<PendingRequest>

Returns

Promise<PendingRequest>

Defined in

packages/client/src/Loc.ts:1622


setInvitedContributor

setInvitedContributor(parameters): Promise<OpenLoc>

Parameters

NameType
parametersBlockchainSubmission<SetInvitedContributorSelectionParams>

Returns

Promise<OpenLoc>

Defined in

packages/client/src/Loc.ts:1812


supersededLoc

supersededLoc(): Promise<undefined | VoidedLoc>

Returns

Promise<undefined | VoidedLoc>

Inherited from

EditableRequest.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

EditableRequest.syncDiscardOnSuccess

Defined in

packages/client/src/State.ts:73


veryNew

veryNew(): OpenLoc

Returns

OpenLoc

Defined in

packages/client/src/Loc.ts:1617


withLocs

withLocs(locsState): OpenLoc

Parameters

NameType
locsStateLocsState

Returns

OpenLoc

Overrides

EditableRequest.withLocs

Defined in

packages/client/src/Loc.ts:1630


buildLocData

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

Parameters

NameType
apiLogionNodeApiClass
legalOfficerCaseundefined | LegalOfficerCase
requestLocRequest
locIssuersLocVerifiedIssuers
invitedContributorsValidAccountId[]

Returns

LocData

Inherited from

EditableRequest.buildLocData

Defined in

packages/client/src/Loc.ts:843


checkHash

checkHash(loc, hash): CheckHashResult

Parameters

NameType
locLocData
hashHash

Returns

CheckHashResult

Inherited from

EditableRequest.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

EditableRequest.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

EditableRequest.createFromRequest

Defined in

packages/client/src/Loc.ts:785


toCollectionParams

toCollectionParams(collectionParams): undefined | CollectionParams

Parameters

NameType
collectionParamsundefined | BackendCollectionParams

Returns

undefined | CollectionParams

Inherited from

EditableRequest.toCollectionParams

Defined in

packages/client/src/Loc.ts:921