@atala/prism-wallet-sdk / Exports / Domain / Pluto
Interface: Pluto
Domain.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.
Implemented by
Table of contents
Methods
- backup
- deleteMessage
- getAllCredentials
- getAllDidPairs
- getAllMediators
- getAllMessages
- getAllPeerDIDs
- getAllPrismDIDs
- getCredentialMetadata
- getDIDPrivateKeysByDID
- getLinkSecret
- getMessage
- getPairByDID
- getPairByName
- restore
- revokeCredential
- start
- storeCredential
- storeCredentialMetadata
- storeDID
- storeDIDPair
- storeLinkSecret
- storeMediator
- storeMessage
- storeMessages
- storePeerDID
- storePrismDID
- storePrivateKey
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"
}>
create a Backup object from the stored data
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"
}>
Defined in
src/domain/buildingBlocks/Pluto.ts:44
deleteMessage
▸ deleteMessage(uuid
): Promise
<void
>
Delete a previously stored messages
Parameters
Name | Type |
---|---|
uuid | string |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:179
getAllCredentials
▸ getAllCredentials(): Promise
<Credential
[]>
Retrieve all the stored credentials
Returns
Promise
<Credential
[]>
Defined in
src/domain/buildingBlocks/Pluto.ts:159
getAllDidPairs
▸ getAllDidPairs(): Promise
<DIDPair
[]>
Retrieve all stored DID pairs (DIDComm connections).
Returns
Promise
<DIDPair
[]>
Defined in
src/domain/buildingBlocks/Pluto.ts:129
getAllMediators
▸ getAllMediators(): Promise
<Mediator
[]>
Retrieve all stored mediators.
Returns
Promise
<Mediator
[]>
Defined in
src/domain/buildingBlocks/Pluto.ts:154
getAllMessages
▸ getAllMessages(): Promise
<Message
[]>
Retrieve all stored DIDComm messages.
Returns
Promise
<Message
[]>
Defined in
src/domain/buildingBlocks/Pluto.ts:144
getAllPeerDIDs
▸ getAllPeerDIDs(): Promise
<PeerDID
[]>
Retrieve all stored Peer DIDs.
Returns
Promise
<PeerDID
[]>
Defined in
src/domain/buildingBlocks/Pluto.ts:119
getAllPrismDIDs
▸ getAllPrismDIDs(): Promise
<PrismDID
[]>
Retrieve all stored PRISM DIDs.
Returns
Promise
<PrismDID
[]>
Defined in
src/domain/buildingBlocks/Pluto.ts:114
getCredentialMetadata
▸ getCredentialMetadata(name
): Promise
<null
| CredentialMetadata
>
Fetch the Credential Metadata by its name
Parameters
Name | Type |
---|---|
name | string |
Returns
Promise
<null
| CredentialMetadata
>
Defined in
src/domain/buildingBlocks/Pluto.ts:61
getDIDPrivateKeysByDID
▸ getDIDPrivateKeysByDID(did
): Promise
<PrivateKey
[]>
Retrieve available private keys for a given DID.
Parameters
Name | Type |
---|---|
did | DID |
Returns
Promise
<PrivateKey
[]>
Defined in
src/domain/buildingBlocks/Pluto.ts:124
getLinkSecret
▸ getLinkSecret(name?
): Promise
<null
| LinkSecret
>
Retrieve the stored link secret by its name
Parameters
Name | Type |
---|---|
name? | string |
Returns
Promise
<null
| LinkSecret
>
Defined in
src/domain/buildingBlocks/Pluto.ts:164
getMessage
▸ getMessage(id
): Promise
<null
| Message
>
Retrieve a DIDComm message by ID.
Parameters
Name | Type |
---|---|
id | string |
Returns
Promise
<null
| Message
>
Defined in
src/domain/buildingBlocks/Pluto.ts:149
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
>
Defined in
src/domain/buildingBlocks/Pluto.ts:134
getPairByName
▸ getPairByName(name
): Promise
<null
| DIDPair
>
Retrieve a DID pair by a given pair name.
Parameters
Name | Type |
---|---|
name | string |
Returns
Promise
<null
| DIDPair
>
Defined in
src/domain/buildingBlocks/Pluto.ts:139
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
>
Defined in
src/domain/buildingBlocks/Pluto.ts:50
revokeCredential
▸ revokeCredential(credential
): Promise
<void
>
Revoke a Credential
Parameters
Name | Type |
---|---|
credential | Credential |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:174
start
▸ start(): Promise
<void
>
Pluto initialise function
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:39
storeCredential
▸ storeCredential(credential
): Promise
<void
>
Store a Credential into the Database
Parameters
Name | Type |
---|---|
credential | Credential |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:109
storeCredentialMetadata
▸ storeCredentialMetadata(metadata
): Promise
<void
>
Store the Credential Metadata
Parameters
Name | Type |
---|---|
metadata | CredentialMetadata |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:55
storeDID
▸ storeDID(did
, keys?
, alias?
): Promise
<void
>
Store a DID with optional private key(s) and alias
Parameters
Name | Type |
---|---|
did | DID |
keys? | Arrayable <PrivateKey > |
alias? | string |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:67
storeDIDPair
▸ storeDIDPair(host
, receiver
, name
): Promise
<void
>
Store a named pair of DIDs representing a DIDComm connection.
Parameters
Name | Type |
---|---|
host | DID |
receiver | DID |
name | string |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:84
storeLinkSecret
▸ storeLinkSecret(linkSecret
): Promise
<void
>
Store a new linkSecret
Parameters
Name | Type |
---|---|
linkSecret | LinkSecret |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:169
storeMediator
▸ storeMediator(mediator
): Promise
<void
>
Store a mediator information.
Parameters
Name | Type |
---|---|
mediator | Mediator |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:104
storeMessage
▸ storeMessage(message
): Promise
<void
>
Store a DIDComm message.
Parameters
Name | Type |
---|---|
message | Message |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:89
storeMessages
▸ storeMessages(messages
): Promise
<void
>
Store an array of DIDComm messages
Parameters
Name | Type |
---|---|
messages | Message [] |
Returns
Promise
<void
>
Defined in
src/domain/buildingBlocks/Pluto.ts:94
storePeerDID
▸ storePeerDID(did
, privateKeys
): Promise
<void
>
Store a Peer DID and an array of its privateKeys.
Parameters
Name | Type |
---|---|
did | DID |
privateKeys | PrivateKey [] |
Returns
Promise
<void
>
Deprecated
use storeDID instead
Defined in
src/domain/buildingBlocks/Pluto.ts:79
storePrismDID
▸ storePrismDID(did
, privateKey
, alias?
): Promise
<void
>
Store a PRISM DID and its private key with given metadata.
Parameters
Name | Type |
---|---|
did | DID |
privateKey | PrivateKey |
alias? | string |
Returns
Promise
<void
>
Deprecated
use storeDID instead
Defined in
src/domain/buildingBlocks/Pluto.ts:73
storePrivateKey
▸ storePrivateKey(privateKey
): Promise
<void
>
Store a list of private keys with its metadata and a reference to the DID it belongs to.
Parameters
Name | Type |
---|---|
privateKey | PrivateKey |
Returns
Promise
<void
>