Skip to content

Commit

Permalink
feat: PRO-2455 split functions in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
kanthgithub committed Jun 24, 2024
1 parent b7ce71d commit 1e47614
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions backend/src/routes/pimlico-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { Type } from "@sinclair/typebox";
import { FastifyPluginAsync } from "fastify";
import { GetSecretValueCommand, SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
import { Paymaster } from "../paymaster/index.js";
import SupportedNetworks from "../../config.json" assert { type: "json" };
import { PAYMASTER_ADDRESS } from "../constants/Pimlico.js";
import ErrorMessage from "../constants/ErrorMessage.js";
Expand All @@ -12,7 +11,6 @@ import { printRequest, getNetworkConfig } from "../utils/common.js";
import { APIKey } from "../models/api-key.js";

const pimlicoRoutes: FastifyPluginAsync = async (server) => {
const paymaster = new Paymaster(server.config.FEE_MARKUP, server.config.MULTI_TOKEN_MARKUP);

const prefixSecretId = 'arka_';

Expand Down Expand Up @@ -101,7 +99,7 @@ const pimlicoRoutes: FastifyPluginAsync = async (server) => {
if (!(PAYMASTER_ADDRESS[chainId] && PAYMASTER_ADDRESS[chainId][gasToken])) return reply.code(ReturnCode.FAILURE).send({ error: "Invalid network/token" })
result = { message: PAYMASTER_ADDRESS[chainId][gasToken] }
}
server.log.info(result, 'Response sent: ');
server.log.info(result, 'PimlicoAddress Response sent: ');
if (body.jsonrpc)
return reply.code(ReturnCode.SUCCESS).send({ jsonrpc: body.jsonrpc, id: body.id, message: result.message, error: null })
return reply.code(ReturnCode.SUCCESS).send(result);
Expand Down

0 comments on commit 1e47614

Please sign in to comment.