From 88ac9a57ffee831d32418b63d93b468921dcda4a Mon Sep 17 00:00:00 2001 From: Dmytro Tolok Date: Wed, 4 Oct 2023 08:30:29 +0200 Subject: [PATCH] feat(address check): add address check to /api/scores (#903) Co-authored-by: Chaitanya --- src/rpc.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rpc.ts b/src/rpc.ts index 79372041..425f6e7d 100644 --- a/src/rpc.ts +++ b/src/rpc.ts @@ -132,6 +132,12 @@ router.post('/api/scores', async (req, res) => { ) return rpcError(res, 500, 'something wrong with the strategies', null); + try { + addresses.forEach(getAddress); + } catch (e: any) { + return rpcError(res, 400, 'invalid address', null); + } + let result; try { result = await scores(