Skip to main content

@hyperledger/identus-edge-agent-sdk / Exports / Pluto

Class: Pluto

Pluto is a storage interface describing storage requirements of the edge agents which will be implemented using this SDK. Implement this interface using your preferred underlying storage technology, most appropriate for your use case.

Hierarchy

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Pluto(store, keyRestoration): Pluto

Parameters

NameType
storeStore
keyRestorationKeyRestoration

Returns

Pluto

Overrides

Controller.constructor

Defined in

src/pluto/Pluto.ts:116

Properties

BackupMgr

BackupMgr: BackupManager

Defined in

src/pluto/Pluto.ts:113


Repositories

Private Repositories: Object

Type declaration

NameType
CredentialMetadataCredentialMetadataRepository
CredentialsCredentialRepository
DIDKeyLinksDIDKeyLinkRepository
DIDLinksDIDLinkRepository
DIDsDIDRepository
KeysKeyRepository
LinkSecretsLinkSecretRepository
MessagesMessageRepository

Defined in

src/pluto/Pluto.ts:114


keyRestoration

Private Readonly keyRestoration: KeyRestoration

Defined in

src/pluto/Pluto.ts:118


state

state: State = State.STOPPED

current status of the entity

Inherited from

Controller.state

Defined in

src/domain/protocols/Startable.ts:42


store

Private Readonly store: Store

Defined in

src/pluto/Pluto.ts:117

Methods

_start

_start(): Promise<void>

internal method to define specific startup routine

used by start() internally

implement with protected to keep hidden from class interface

Returns

Promise<void>

Overrides

Controller._start

Defined in

src/pluto/Pluto.ts:133


_stop

_stop(): Promise<void>

internal method to define teardown routine

used by stop() internally

implement with protected to keep hidden from class interface

Returns

Promise<void>

Overrides

Controller._stop

Defined in

src/pluto/Pluto.ts:139


backup

backup(version?): Promise<{ credentials: { data: string ; recovery_id: string }[] ; did_pairs: { alias: string ; holder: string ; recipient: string }[] ; dids: { alias?: string ; did: string }[] ; keys: { did?: string ; index?: number ; key: string ; recovery_id: string }[] ; link_secret?: string = linksecret; mediators: { holder_did: string ; mediator_did: string ; routing_did: string }[] ; messages: string[] ; version?: "0.0.1" }>

Backups *

Parameters

NameType
version?"0.0.1"

Returns

Promise<{ credentials: { data: string ; recovery_id: string }[] ; did_pairs: { alias: string ; holder: string ; recipient: string }[] ; dids: { alias?: string ; did: string }[] ; keys: { did?: string ; index?: number ; key: string ; recovery_id: string }[] ; link_secret?: string = linksecret; mediators: { holder_did: string ; mediator_did: string ; routing_did: string }[] ; messages: string[] ; version?: "0.0.1" }>

Implementation of

Pluto.backup

Defined in

src/pluto/Pluto.ts:146


deleteMessage

deleteMessage(id): Promise<void>

Delete a previously stored messages

Parameters

NameType
idstring

Returns

Promise<void>

Implementation of

Pluto.deleteMessage

Defined in

src/pluto/Pluto.ts:154


getAllCredentials

getAllCredentials(): Promise<Credential[]>

Retrieve all the stored credentials

Returns

Promise<Credential[]>

Implementation of

Pluto.getAllCredentials

Defined in

src/pluto/Pluto.ts:168


getAllDidPairs

getAllDidPairs(): Promise<DIDPair[]>

Retrieve all stored DID pairs (DIDComm connections).

Returns

Promise<DIDPair[]>

Implementation of

Pluto.getAllDidPairs

Defined in

src/pluto/Pluto.ts:348


getAllMediators

getAllMediators(): Promise<Mediator[]>

Mediators *

Returns

Promise<Mediator[]>

Implementation of

Pluto.getAllMediators

Defined in

src/pluto/Pluto.ts:400


getAllMessages

getAllMessages(): Promise<Message[]>

Retrieve all stored DIDComm messages.

Returns

Promise<Message[]>

Implementation of

Pluto.getAllMessages

Defined in

src/pluto/Pluto.ts:329


getAllPeerDIDs

getAllPeerDIDs(): Promise<PeerDID[]>

Retrieve all stored Peer DIDs.

Returns

Promise<PeerDID[]>

Implementation of

Pluto.getAllPeerDIDs

Defined in

src/pluto/Pluto.ts:284


getAllPrismDIDs

getAllPrismDIDs(): Promise<PrismDID[]>

Retrieve all stored PRISM DIDs.

Returns

Promise<PrismDID[]>

Implementation of

Pluto.getAllPrismDIDs

Defined in

src/pluto/Pluto.ts:246


getCredentialMetadata

getCredentialMetadata(name): Promise<null | CredentialMetadata>

Fetch the Credential Metadata by its name

Parameters

NameType
namestring

Returns

Promise<null | CredentialMetadata>

Implementation of

Pluto.getCredentialMetadata

Defined in

src/pluto/Pluto.ts:189


getDIDPrivateKeysByDID

getDIDPrivateKeysByDID(did): Promise<PrivateKey[]>

Retrieve available private keys for a given DID.

Parameters

NameType
didDID

Returns

Promise<PrivateKey[]>

Implementation of

Pluto.getDIDPrivateKeysByDID

Defined in

src/pluto/Pluto.ts:211


getLinkSecret

getLinkSecret(name?): Promise<null | LinkSecret>

Retrieve the stored link secret by its name

Parameters

NameTypeDefault value
namestringDomain.LinkSecret.defaultName

Returns

Promise<null | LinkSecret>

Implementation of

Pluto.getLinkSecret

Defined in

src/pluto/Pluto.ts:200


getMessage

getMessage(id): Promise<null | Message>

Retrieve a DIDComm message by ID.

Parameters

NameType
idstring

Returns

Promise<null | Message>

Implementation of

Pluto.getMessage

Defined in

src/pluto/Pluto.ts:325


getPairByDID

getPairByDID(did): Promise<null | DIDPair>

Retrieve a DID pair containing a given DID as either host or receiver.

Parameters

NameType
didDID

Returns

Promise<null | DIDPair>

Implementation of

Pluto.getPairByDID

Defined in

src/pluto/Pluto.ts:356


getPairByName

getPairByName(alias): Promise<null | DIDPair>

Retrieve a DID pair by a given pair name.

Parameters

NameType
aliasstring

Returns

Promise<null | DIDPair>

Implementation of

Pluto.getPairByName

Defined in

src/pluto/Pluto.ts:373


getPrismDIDS

getPrismDIDS(didId): Promise<PrismDID[]>

Parameters

NameType
didIdstring

Returns

Promise<PrismDID[]>

Defined in

src/pluto/Pluto.ts:258


mapDIDPairToDomain

mapDIDPairToDomain(link): Promise<null | DIDPair>

Parameters

NameType
linkDIDLink

Returns

Promise<null | DIDPair>

Defined in

src/pluto/Pluto.ts:384


onlyOne

onlyOne<T>(arr): T

Type parameters

Name
T

Parameters

NameType
arrT[]

Returns

T

Defined in

src/pluto/Pluto.ts:454


restore

restore(backup): Promise<void>

load the given data into the store

Parameters

NameTypeDefault value
backupObjectundefined
backup.credentials{ data: string ; recovery_id: string }[]undefined
backup.did_pairs{ alias: string ; holder: string ; recipient: string }[]undefined
backup.dids{ alias?: string ; did: string }[]undefined
backup.keys{ did?: string ; index?: number ; key: string ; recovery_id: string }[]undefined
backup.link_secret?stringlinksecret
backup.mediators{ holder_did: string ; mediator_did: string ; routing_did: string }[]undefined
backup.messagesstring[]undefined
backup.version?"0.0.1"undefined

Returns

Promise<void>

Implementation of

Pluto.restore

Defined in

src/pluto/Pluto.ts:150


revokeCredential

revokeCredential(credential): Promise<void>

Revoke a Credential

Parameters

NameType
credentialCredential

Returns

Promise<void>

Implementation of

Pluto.revokeCredential

Defined in

src/pluto/Pluto.ts:173


start

start(): Promise<any>

Pluto initialise function

Returns

Promise<any>

Implementation of

Pluto.start

Overrides

Controller.start

Defined in

src/pluto/Pluto.ts:126


stop

stop(): Promise<any>

handle the teardown of an entity

updates state according to lifecycle

Returns

Promise<any>

Implementation of

Pluto.stop

Overrides

Controller.stop

Defined in

src/pluto/Pluto.ts:129


storeCredential

storeCredential(credential): Promise<void>

Credentials *

Parameters

NameType
credentialCredential

Returns

Promise<void>

Implementation of

Pluto.storeCredential

Defined in

src/pluto/Pluto.ts:164


storeCredentialMetadata

storeCredentialMetadata(metadata): Promise<void>

Credential Metadata *

Parameters

NameType
metadataCredentialMetadata

Returns

Promise<void>

Implementation of

Pluto.storeCredentialMetadata

Defined in

src/pluto/Pluto.ts:185


storeDID

storeDID(did, keys?, alias?): Promise<void>

DIDs *

Parameters

NameType
didDID
keys?Arrayable<PrivateKey>
alias?string

Returns

Promise<void>

Implementation of

Pluto.storeDID

Defined in

src/pluto/Pluto.ts:221


storeDIDPair

storeDIDPair(host, receiver, alias): Promise<void>

DID Pairs *

Parameters

NameType
hostDID
receiverDID
aliasstring

Returns

Promise<void>

Implementation of

Pluto.storeDIDPair

Defined in

src/pluto/Pluto.ts:336


storeLinkSecret

storeLinkSecret(linkSecret): Promise<void>

LinkSecret *

Parameters

NameType
linkSecretLinkSecret

Returns

Promise<void>

Implementation of

Pluto.storeLinkSecret

Defined in

src/pluto/Pluto.ts:196


storeMediator

storeMediator(mediator): Promise<void>

Store a mediator information.

Parameters

NameType
mediatorMediator

Returns

Promise<void>

Implementation of

Pluto.storeMediator

Defined in

src/pluto/Pluto.ts:436


storeMessage

storeMessage(message): Promise<void>

Messages *

Parameters

NameType
messageMessage

Returns

Promise<void>

Implementation of

Pluto.storeMessage

Defined in

src/pluto/Pluto.ts:315


storeMessages

storeMessages(messages): Promise<void>

Store an array of DIDComm messages

Parameters

NameType
messagesMessage[]

Returns

Promise<void>

Implementation of

Pluto.storeMessages

Defined in

src/pluto/Pluto.ts:319


storePeerDID

storePeerDID(did, privateKeys): Promise<void>

Peer DIDs *

Parameters

NameType
didDID
privateKeysPrivateKey[]

Returns

Promise<void>

Implementation of

Pluto.storePeerDID

Defined in

src/pluto/Pluto.ts:276


storePrismDID

storePrismDID(did, privateKey, alias?): Promise<void>

Prism DIDs *

Parameters

NameType
didDID
privateKeyPrivateKey
alias?string

Returns

Promise<void>

Implementation of

Pluto.storePrismDID

Defined in

src/pluto/Pluto.ts:235


storePrivateKey

storePrivateKey(privateKey): Promise<void>

PrivateKeys *

Parameters

NameType
privateKeyPrivateKey

Returns

Promise<void>

Implementation of

Pluto.storePrivateKey

Defined in

src/pluto/Pluto.ts:207