Skip to content

Commit

Permalink
docs: Add JSDoc documentation to enviroment.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
madjin committed Dec 29, 2024
1 parent 85b019d commit 875be5b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/plugin-zksync-era/src/enviroment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof zksyncEnvSchema>;

/**
* 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<ZKsyncConfig>} - A Promise that resolves to the validated ZKsync configuration
* @throws {Error} - If the ZKsync configuration validation fails
*/
export async function validateZKsyncConfig(
runtime: IAgentRuntime
): Promise<ZKsyncConfig> {
Expand Down

0 comments on commit 875be5b

Please sign in to comment.