Skip to main content

@atala/prism-wallet-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.

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Pluto(store, keyRestoration): Pluto

Parameters

NameType
storeStore
keyRestorationKeyRestoration

Returns

Pluto

Defined in

src/pluto/Pluto.ts:109

Properties

BackupMgr

BackupMgr: BackupManager

Defined in

src/pluto/Pluto.ts:106


Repositories

Private Repositories: Object

Type declaration

NameType
CredentialMetadataCredentialMetadataRepository
CredentialsCredentialRepository
DIDKeyLinksDIDKeyLinkRepository
DIDLinksDIDLinkRepository
DIDsDIDRepository
KeysKeyRepository
LinkSecretsLinkSecretRepository
MessagesMessageRepository

Defined in

src/pluto/Pluto.ts:107


keyRestoration

Private Readonly keyRestoration: KeyRestoration

Defined in

src/pluto/Pluto.ts:111


store

Private Readonly store: Store

Defined in

src/pluto/Pluto.ts:110

Methods

backup

backup(): 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 *

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


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


getAllCredentials

getAllCredentials(): Promise<Credential[]>

Retrieve all the stored credentials

Returns

Promise<Credential[]>

Implementation of

Pluto.getAllCredentials

Defined in

src/pluto/Pluto.ts:146


getAllDidPairs

getAllDidPairs(): Promise<DIDPair[]>

Retrieve all stored DID pairs (DIDComm connections).

Returns

Promise<DIDPair[]>

Implementation of

Pluto.getAllDidPairs

Defined in

src/pluto/Pluto.ts:330


getAllMediators

getAllMediators(): Promise<Mediator[]>

Mediators *

Returns

Promise<Mediator[]>

Implementation of

Pluto.getAllMediators

Defined in

src/pluto/Pluto.ts:382


getAllMessages

getAllMessages(): Promise<Message[]>

Retrieve all stored DIDComm messages.

Returns

Promise<Message[]>

Implementation of

Pluto.getAllMessages

Defined in

src/pluto/Pluto.ts:311


getAllPeerDIDs

getAllPeerDIDs(): Promise<PeerDID[]>

Retrieve all stored Peer DIDs.

Returns

Promise<PeerDID[]>

Implementation of

Pluto.getAllPeerDIDs

Defined in

src/pluto/Pluto.ts:268


getAllPrismDIDs

getAllPrismDIDs(): Promise<PrismDID[]>

Retrieve all stored PRISM DIDs.

Returns

Promise<PrismDID[]>

Implementation of

Pluto.getAllPrismDIDs

Defined in

src/pluto/Pluto.ts:229


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


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


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


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


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


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


getPrismDIDS

getPrismDIDS(didId): Promise<PrismDID[]>

Parameters

NameType
didIdstring

Returns

Promise<PrismDID[]>

Defined in

src/pluto/Pluto.ts:241


mapDIDPairToDomain

mapDIDPairToDomain(link): Promise<null | DIDPair>

Parameters

NameType
linkDIDLink

Returns

Promise<null | DIDPair>

Defined in

src/pluto/Pluto.ts:366


onlyOne

onlyOne<T>(arr): T

Type parameters

Name
T

Parameters

NameType
arrT[]

Returns

T

Defined in

src/pluto/Pluto.ts:436


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


revokeCredential

revokeCredential(credential): Promise<void>

Revoke a Credential

Parameters

NameType
credentialCredential

Returns

Promise<void>

Implementation of

Pluto.revokeCredential

Defined in

src/pluto/Pluto.ts:151


start

start(): Promise<void>

Pluto initialise function

Returns

Promise<void>

Implementation of

Pluto.start

Defined in

src/pluto/Pluto.ts:117


storeCredential

storeCredential(credential): Promise<void>

Credentials *

Parameters

NameType
credentialCredential

Returns

Promise<void>

Implementation of

Pluto.storeCredential

Defined in

src/pluto/Pluto.ts:142


storeCredentialMetadata

storeCredentialMetadata(metadata): Promise<void>

Credential Metadata *

Parameters

NameType
metadataCredentialMetadata

Returns

Promise<void>

Implementation of

Pluto.storeCredentialMetadata

Defined in

src/pluto/Pluto.ts:163


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


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


storeLinkSecret

storeLinkSecret(linkSecret): Promise<void>

LinkSecret *

Parameters

NameType
linkSecretLinkSecret

Returns

Promise<void>

Implementation of

Pluto.storeLinkSecret

Defined in

src/pluto/Pluto.ts:174


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


storeMessage

storeMessage(message): Promise<void>

Messages *

Parameters

NameType
messageMessage

Returns

Promise<void>

Implementation of

Pluto.storeMessage

Defined in

src/pluto/Pluto.ts:299


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


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


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


storePrivateKey

storePrivateKey(privateKey): Promise<void>

PrivateKeys *

Parameters

NameType
privateKeyPrivateKey

Returns

Promise<void>

Implementation of

Pluto.storePrivateKey

Defined in

src/pluto/Pluto.ts:185