Keystore
Interface: Keystore
A Keystore is responsible for holding the user's XMTP private keys and using them to encrypt/decrypt/sign messages.
Keystores are instantiated using a KeystoreProvider
Implemented by
Methods
createAuthToken
createAuthToken(req
): Promise
<Token
>
Create an XMTP auth token to be used as a header on XMTP API requests
Parameters
Name | Type |
---|---|
req | CreateAuthTokenRequest |
Returns
Promise
<Token
>
Defined in
createInvite
createInvite(req
): Promise
<CreateInviteResponse
>
Create a sealed/encrypted invite and store the Topic keys in the Keystore for later use. The returned invite payload must be sent to the network for the other party to be able to communicate.
Parameters
Name | Type |
---|---|
req | CreateInviteRequest |
Returns
Promise
<CreateInviteResponse
>
Defined in
decryptV1
decryptV1(req
): Promise
<DecryptResponse
>
Decrypt a batch of V1 messages
Parameters
Name | Type |
---|---|
req | DecryptV1Request |
Returns
Promise
<DecryptResponse
>
Defined in
decryptV2
decryptV2(req
): Promise
<DecryptResponse
>
Decrypt a batch of V2 messages
Parameters
Name | Type |
---|---|
req | DecryptV2Request |
Returns
Promise
<DecryptResponse
>
Defined in
encryptV1
encryptV1(req
): Promise
<EncryptResponse
>
Encrypt a batch of V1 messages
Parameters
Name | Type |
---|---|
req | EncryptV1Request |
Returns
Promise
<EncryptResponse
>
Defined in
encryptV2
encryptV2(req
): Promise
<EncryptResponse
>
Encrypt a batch of V2 messages
Parameters
Name | Type |
---|---|
req | EncryptV2Request |
Returns
Promise
<EncryptResponse
>
Defined in
getAccountAddress
getAccountAddress(): Promise
<string
>
Get the account address of the wallet used to create the Keystore
Returns
Promise
<string
>
Defined in
getPrivateKeyBundle
getPrivateKeyBundle(): Promise
<PrivateKeyBundleV1
>
Export the private keys. May throw an error if the keystore implementation does not allow this operation
Returns
Promise
<PrivateKeyBundleV1
>
Defined in
getPublicKeyBundle
getPublicKeyBundle(): Promise
<PublicKeyBundle
>
Get the PublicKeyBundle
associated with the Keystore's private keys
Returns
Promise
<PublicKeyBundle
>
Defined in
getV2Conversations
getV2Conversations(): Promise
<ConversationReference
[]>
Get a list of V2 conversations
Returns
Promise
<ConversationReference
[]>
Defined in
saveInvites
saveInvites(req
): Promise
<SaveInvitesResponse
>
Take a batch of invite messages and store the TopicKeys
for later use in decrypting messages
Parameters
Name | Type |
---|---|
req | SaveInvitesRequest |
Returns
Promise
<SaveInvitesResponse
>
Defined in
signDigest
signDigest(req
): Promise
<Signature
>
Sign the provided digest with either the IdentityKey
or a specified PreKey
Parameters
Name | Type |
---|---|
req | SignDigestRequest |
Returns
Promise
<Signature
>