From 572ce1e3fdb8095e2211d3fd93281afd8f4a20dc Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Wed, 25 Oct 2023 18:18:45 -0400 Subject: [PATCH] improve: use optional param --- api/suggested-fees.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/suggested-fees.ts b/api/suggested-fees.ts index 80321b079..6c7d7b13c 100644 --- a/api/suggested-fees.ts +++ b/api/suggested-fees.ts @@ -35,7 +35,7 @@ const SuggestedFeesQueryParamsSchema = type({ timestamp: optional(positiveIntStr()), skipAmountLimit: optional(boolStr()), message: optional(string()), - recipientAddress: validAddress(), + recipientAddress: optional(validAddress()), relayerAddress: optional(validAddress()), }); @@ -78,6 +78,7 @@ const handler = async ( } relayerAddress ??= sdk.constants.DEFAULT_SIMULATED_RELAYER_ADDRESS; + recipientAddress ??= sdk.constants.DEFAULT_SIMULATED_RELAYER_ADDRESS; token = ethers.utils.getAddress(token); const [latestBlock, tokenDetails] = await Promise.all([