From 875be5bd19c7573c5d53e7d0eee70f89ba62597b Mon Sep 17 00:00:00 2001 From: jin <32600939+madjin@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:17:53 -0500 Subject: [PATCH] docs: Add JSDoc documentation to enviroment.ts --- packages/plugin-zksync-era/src/enviroment.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/plugin-zksync-era/src/enviroment.ts b/packages/plugin-zksync-era/src/enviroment.ts index cde6311672..dc3044f7ee 100644 --- a/packages/plugin-zksync-era/src/enviroment.ts +++ b/packages/plugin-zksync-era/src/enviroment.ts @@ -6,8 +6,19 @@ export const zksyncEnvSchema = z.object({ ZKSYNC_PRIVATE_KEY: z.string().min(1, "ZKsync private key is required"), }); +/** + * Type definition for ZKsyncConfig inferred from zksyncEnvSchema. + */ export type ZKsyncConfig = z.infer; +/** + * Validates the ZKsync configuration by retrieving the ZKSYNC_ADDRESS and ZKSYNC_PRIVATE_KEY settings from the runtime + * or environment variables, and then parsing it using zksyncEnvSchema. + * + * @param {IAgentRuntime} runtime - The Agent Runtime instance + * @returns {Promise} - A Promise that resolves to the validated ZKsync configuration + * @throws {Error} - If the ZKsync configuration validation fails + */ export async function validateZKsyncConfig( runtime: IAgentRuntime ): Promise {