···1717 LocalKeyPair,
1818} from "./types.ts";
19192020+/**
2121+ * Creates a `Consumer` instance with all necessary requirements. This is the recommended way to construct a `Consumer`.
2222+ *
2323+ * @description Resolves the user's DID using Slingshot, instantiates an `@atcute/client` instance, creates an initial session, and then returns a new Consumer.
2424+ * @param {ConsumerOptions} options - Information for constructing the underlying XRPC client
2525+ * @returns {Promise<Consumer>} A Cistern consumer client with an authorized session
2626+ */
2027export async function createConsumer(
2128 options: ConsumerOptions,
2229): Promise<Consumer> {
···2936 * Client for generating keys and decoding Cistern memos.
3037 */
3138export class Consumer {
3939+ /** DID of the user this consumer acts on behalf of */
3240 did: Did;
4141+4242+ /** `@atcute/client` instance with credential manager */
4343+ rpc: Client<XRPCQueries, XRPCProcedures>;
4444+4545+ /** Private key used for decrypting and the AT URI of its associated public key */
3346 keypair?: LocalKeyPair;
3434- rpc: Client<XRPCQueries, XRPCProcedures>;
3535- manager: CredentialManager;
36473748 constructor(params: ConsumerParams) {
3849 this.did = params.miniDoc.did;
···4354 }
4455 : undefined;
4556 this.rpc = params.rpc;
4646- this.manager = params.manager;
4757 }
48584959 /**