Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions backend/src/routes/whitelist-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const whitelistRoutes: FastifyPluginAsync = async (server) => {
policyId = body.params?.[1];
api_key = query['apiKey'] ?? body.params?.[2];
}
if (!address || !ethers.utils.isAddress(address)) return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_DATA })
if (!api_key || typeof(api_key) !== "string")
return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_API_KEY })
let privateKey = '';
Expand Down Expand Up @@ -154,7 +153,6 @@ const whitelistRoutes: FastifyPluginAsync = async (server) => {
chainId = query['chainId'] ?? body.params?.[2];
api_key = query['apiKey'] ?? body.params?.[3];
}
if (!address || !ethers.utils.isAddress(address)) return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_DATA });
if (!api_key || typeof(api_key) !== "string")
return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_API_KEY })
let privateKey = '';
Expand Down Expand Up @@ -346,9 +344,6 @@ const whitelistRoutes: FastifyPluginAsync = async (server) => {
if (!body) return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.MISSING_PARAMS });
const address = body.params?.[0];
const policyId = body.params?.[1];
if (!address || !ethers.utils.isAddress(address)) {
return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_DATA });
}
const api_key = query['apiKey'] ?? body.params?.[2];
if (!api_key || typeof(api_key) !== "string")
return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_API_KEY })
Expand Down Expand Up @@ -428,9 +423,6 @@ const whitelistRoutes: FastifyPluginAsync = async (server) => {
const policyId = body.params?.[1];
const chainId = query['chainId'] ?? body.params?.[2];
const api_key = query['apiKey'] ?? body.params?.[3];
if (!address || !ethers.utils.isAddress(address)) {
return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_DATA });
}
if (!api_key || typeof(api_key) !== "string")
return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_API_KEY })
let privateKey = '';
Expand Down
Loading