From e226a70fcff73471ea5ff7230594f45545712f5b Mon Sep 17 00:00:00 2001 From: roman goldstain Date: Fri, 19 Jun 2026 11:36:53 +0300 Subject: [PATCH] feat: add ETH_LINK_CLIENT_ID env var to configure x-client-id header Allows callers to pin a stable client ID instead of getting a random UUID generated per request. Consistent with the existing env-var-only config pattern. Co-Authored-By: Claude Sonnet 4.6 --- packages/api-validator/src/cli.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/api-validator/src/cli.ts b/packages/api-validator/src/cli.ts index d6d89db..8c802e3 100644 --- a/packages/api-validator/src/cli.ts +++ b/packages/api-validator/src/cli.ts @@ -26,6 +26,7 @@ interface Config { withdrawalAddress: string; amount: string; region?: "us" | "eu"; + clientId?: string; } function loadConfig(): Config { @@ -44,6 +45,7 @@ Optional: ETH_LINK_WITHDRAWAL_ADDRESS 0x-prefixed Ethereum address ETH_LINK_AMOUNT ETH amount (default: 32) ETH_LINK_REGION us | eu + ETH_LINK_CLIENT_ID x-client-id header value (random UUID if omitted) Usage: ETH_LINK_BASE_URL=https://provider.example.com ETH_LINK_API_KEY=secret eth-link-api-validator`); @@ -71,6 +73,7 @@ Usage: "0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1", // mock random address amount: process.env.ETH_LINK_AMOUNT || "32", region, + clientId: process.env.ETH_LINK_CLIENT_ID, }; } @@ -309,7 +312,7 @@ async function testCreateValidator(config: Config): Promise { await runTest("POST /eth-link/validators/create", async () => { const headers: Record = { ...commonHeaders(config.apiKey), - "x-client-id": crypto.randomUUID(), + "x-client-id": config.clientId ?? crypto.randomUUID(), }; // Validate our own request body @@ -505,6 +508,7 @@ async function main(): Promise { console.log(` ${dim("Amount:")} ${config.amount} ETH`); console.log(` ${dim("Withdrawal:")} ${config.withdrawalAddress}`); if (config.region) console.log(` ${dim("Region:")} ${config.region}`); + if (config.clientId) console.log(` ${dim("Client ID:")} ${config.clientId}`); console.log(bold("─".repeat(60))); console.log("");