diff --git a/packages/consumer/types.ts b/packages/consumer/types.ts index d0307a4..d94d3a3 100644 --- a/packages/consumer/types.ts +++ b/packages/consumer/types.ts @@ -1,23 +1,42 @@ import type { BaseClientOptions, ClientRequirements } from "@cistern/shared"; import type { ResourceUri, Tid } from "@atcute/lexicons"; +/** + * A locally-stored key pair suitable for storage + */ export interface InputLocalKeyPair { + /** An X-Wing private key, encoded in base64 */ privateKey: string; + + /** An AT URI to the `app.cistern.pubkey` record derived from this private key */ publicKey: ResourceUri; } +/** + * InputLocalKeyPair, with `privateKey` decoded to a Uint8Array + */ export interface LocalKeyPair { + /** An X-Wing private key in raw byte format */ privateKey: Uint8Array; + + /** An AT URI to the `app.cistern.pubkey` record derived from this private key */ publicKey: ResourceUri; } +/** Credentials and optional keypair for creating a Consumer client */ export interface ConsumerOptions extends BaseClientOptions { + /** Optional input keypair. If you do not provide this here, you will need to generate one after the client is instantiated */ keypair?: InputLocalKeyPair; } +/** Asynchronously-acquired parameters required to construct a Client. `createConsumer` will translate from `ConsumerOptions` to `ConsumerParams` for you */ export type ConsumerParams = ClientRequirements; +/** A simplified, encrypted memo */ export interface DecryptedMemo { + /** TID for when the memo was created */ tid: Tid; + + /** The original, decrypted contents of the memo */ text: string; }