@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
- backup
- deleteMessage
- getAllCredentials
- getAllDidPairs
- getAllMediators
- getAllMessages
- getAllPeerDIDs
- getAllPrismDIDs
- getCredentialMetadata
- getDIDPrivateKeysByDID
- getLinkSecret
- getMessage
- getPairByDID
- getPairByName
- getPrismDIDS
- mapDIDPairToDomain
- onlyOne
- restore
- revokeCredential
- start
- storeCredential
- storeCredentialMetadata
- storeDID
- storeDIDPair
- storeLinkSecret
- storeMediator
- storeMessage
- storeMessages
- storePeerDID
- storePrismDID
- storePrivateKey
Constructors
constructor
• new Pluto(store
, keyRestoration
): Pluto
Parameters
Name | Type |
---|---|
store | Store |
keyRestoration | KeyRestoration |
Returns
Defined in
Properties
BackupMgr
• BackupMgr: BackupManager
Defined in
Repositories
• Private
Repositories: Object
Type declaration
Name | Type |
---|---|
CredentialMetadata | CredentialMetadataRepository |
Credentials | CredentialRepository |
DIDKeyLinks | DIDKeyLinkRepository |
DIDLinks | DIDLinkRepository |
DIDs | DIDRepository |
Keys | KeyRepository |
LinkSecrets | LinkSecretRepository |
Messages | MessageRepository |
Defined in
keyRestoration
• Private
Readonly
keyRestoration: KeyRestoration
Defined in
store
• Private
Readonly
store: Store
Defined in
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
Defined in
deleteMessage
▸ deleteMessage(id
): Promise
<void
>
Delete a previously stored messages
Parameters
Name | Type |
---|---|
id | string |
Returns
Promise
<void
>
Implementation of
Defined in
getAllCredentials
▸ getAllCredentials(): Promise
<Credential
[]>
Retrieve all the stored credentials
Returns
Promise
<Credential
[]>
Implementation of
Defined in
getAllDidPairs
▸ getAllDidPairs(): Promise
<DIDPair
[]>
Retrieve all stored DID pairs (DIDComm connections).
Returns
Promise
<DIDPair
[]>
Implementation of
Defined in
getAllMediators
▸ getAllMediators(): Promise
<Mediator
[]>
Mediators *
Returns
Promise
<Mediator
[]>
Implementation of
Defined in
getAllMessages
▸ getAllMessages(): Promise
<Message
[]>
Retrieve all stored DIDComm messages.
Returns
Promise
<Message
[]>
Implementation of
Defined in
getAllPeerDIDs
▸ getAllPeerDIDs(): Promise
<PeerDID
[]>
Retrieve all stored Peer DIDs.
Returns
Promise
<PeerDID
[]>
Implementation of
Defined in
getAllPrismDIDs
▸ getAllPrismDIDs(): Promise
<PrismDID
[]>
Retrieve all stored PRISM DIDs.
Returns
Promise
<PrismDID
[]>
Implementation of
Defined in
getCredentialMetadata
▸ getCredentialMetadata(name
): Promise
<null
| CredentialMetadata
>
Fetch the Credential Metadata by its name
Parameters
Name | Type |
---|---|
name | string |
Returns
Promise
<null
| CredentialMetadata
>
Implementation of
Defined in
getDIDPrivateKeysByDID
▸ getDIDPrivateKeysByDID(did
): Promise
<PrivateKey
[]>
Retrieve available private keys for a given DID.
Parameters
Name | Type |
---|---|
did | DID |
Returns
Promise
<PrivateKey
[]>
Implementation of
Defined in
getLinkSecret
▸ getLinkSecret(name?
): Promise
<null
| LinkSecret
>
Retrieve the stored link secret by its name
Parameters
Name | Type | Default value |
---|---|---|
name | string | Domain.LinkSecret.defaultName |
Returns
Promise
<null
| LinkSecret
>
Implementation of
Defined in
getMessage
▸ getMessage(id
): Promise
<null
| Message
>
Retrieve a DIDComm message by ID.
Parameters
Name | Type |
---|---|
id | string |
Returns
Promise
<null
| Message
>
Implementation of
Defined in
getPairByDID
▸ getPairByDID(did
): Promise
<null
| DIDPair
>
Retrieve a DID pair containing a given DID as either host or receiver.
Parameters
Name | Type |
---|---|
did | DID |
Returns
Promise
<null
| DIDPair
>
Implementation of
Defined in
getPairByName
▸ getPairByName(alias
): Promise
<null
| DIDPair
>
Retrieve a DID pair by a given pair name.
Parameters
Name | Type |
---|---|
alias | string |
Returns
Promise
<null
| DIDPair
>
Implementation of
Defined in
getPrismDIDS
▸ getPrismDIDS(didId
): Promise
<PrismDID
[]>
Parameters
Name | Type |
---|---|
didId | string |
Returns
Promise
<PrismDID
[]>
Defined in
mapDIDPairToDomain
▸ mapDIDPairToDomain(link
): Promise
<null
| DIDPair
>
Parameters
Name | Type |
---|---|
link | DIDLink |
Returns
Promise
<null
| DIDPair
>
Defined in
onlyOne
▸ onlyOne<T
>(arr
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
arr | T [] |
Returns
T
Defined in
restore
▸ restore(backup
): Promise
<void
>
load the given data into the store
Parameters
Name | Type | Default value |
---|---|---|
backup | Object | undefined |
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? | string | linksecret |
backup.mediators | { holder_did : string ; mediator_did : string ; routing_did : string }[] | undefined |
backup.messages | string [] | undefined |
backup.version? | "0.0.1" | undefined |
Returns
Promise
<void
>
Implementation of
Defined in
revokeCredential
▸ revokeCredential(credential
): Promise
<void
>
Revoke a Credential
Parameters
Name | Type |
---|---|
credential | Credential |
Returns
Promise
<void
>
Implementation of
Defined in
start
▸ start(): Promise
<void
>
Pluto initialise function
Returns
Promise
<void
>
Implementation of
Defined in
storeCredential
▸ storeCredential(credential
): Promise
<void
>
Credentials *
Parameters
Name | Type |
---|---|
credential | Credential |
Returns
Promise
<void
>
Implementation of
Defined in
storeCredentialMetadata
▸ storeCredentialMetadata(metadata
): Promise
<void
>
Credential Metadata *
Parameters
Name | Type |
---|---|
metadata | CredentialMetadata |
Returns
Promise
<void
>
Implementation of
Defined in
storeDID
▸ storeDID(did
, keys?
, alias?
): Promise
<void
>
DIDs *
Parameters
Name | Type |
---|---|
did | DID |
keys? | Arrayable <PrivateKey > |
alias? | string |
Returns
Promise
<void
>
Implementation of
Defined in
storeDIDPair
▸ storeDIDPair(host
, receiver
, alias
): Promise
<void
>
DID Pairs *
Parameters
Name | Type |
---|---|
host | DID |
receiver | DID |
alias | string |
Returns
Promise
<void
>
Implementation of
Defined in
storeLinkSecret
▸ storeLinkSecret(linkSecret
): Promise
<void
>
LinkSecret *
Parameters
Name | Type |
---|---|
linkSecret | LinkSecret |
Returns
Promise
<void
>
Implementation of
Defined in
storeMediator
▸ storeMediator(mediator
): Promise
<void
>
Store a mediator information.
Parameters
Name | Type |
---|---|
mediator | Mediator |
Returns
Promise
<void
>
Implementation of
Defined in
storeMessage
▸ storeMessage(message
): Promise
<void
>
Messages *
Parameters
Name | Type |
---|---|
message | Message |
Returns
Promise
<void
>
Implementation of
Defined in
storeMessages
▸ storeMessages(messages
): Promise
<void
>
Store an array of DIDComm messages
Parameters
Name | Type |
---|---|
messages | Message [] |
Returns
Promise
<void
>
Implementation of
Defined in
storePeerDID
▸ storePeerDID(did
, privateKeys
): Promise
<void
>
Peer DIDs *
Parameters
Name | Type |
---|---|
did | DID |
privateKeys | PrivateKey [] |
Returns
Promise
<void
>
Implementation of
Defined in
storePrismDID
▸ storePrismDID(did
, privateKey
, alias?
): Promise
<void
>
Prism DIDs *
Parameters
Name | Type |
---|---|
did | DID |
privateKey | PrivateKey |
alias? | string |
Returns
Promise
<void
>
Implementation of
Defined in
storePrivateKey
▸ storePrivateKey(privateKey
): Promise
<void
>
PrivateKeys *
Parameters
Name | Type |
---|---|
privateKey | PrivateKey |
Returns
Promise
<void
>