Skip to content

Commit

Permalink
ft: adding default bundler key for /saveKey endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilkumar1612 committed Oct 17, 2024
1 parent 2d8bde9 commit 87eac33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arka",
"version": "1.6.5",
"version": "1.6.6",
"description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software",
"type": "module",
"directories": {
Expand Down
7 changes: 5 additions & 2 deletions backend/src/plugins/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const ConfigSchema = Type.Strict(
EPV_07: Type.Array(Type.String()) || ['0x0000000071727De22E5E9d8BAf0edAc6f37da032'],
DELETE_KEY_RECOVER_WINDOW: Type.Number(),
KMS_KEY_ID: Type.String() || undefined,
USE_KMS: Type.Boolean() || false
USE_KMS: Type.Boolean() || false,
DEFAULT_BUNDLER_API_KEY: Type.String()
})
);

Expand Down Expand Up @@ -68,6 +69,7 @@ const configPlugin: FastifyPluginAsync = async (server) => {
DELETE_KEY_RECOVER_WINDOW: process.env.DELETE_KEY_RECOVER_WINDOW,
KMS_KEY_ID: process.env.KMS_KEY_ID,
USE_KMS: process.env.USE_KMS,
DEFAULT_BUNDLER_API_KEY: process.env.DEFAULT_BUNDLER_API_KEY
}

const valid = validate(envVar);
Expand Down Expand Up @@ -99,7 +101,8 @@ const configPlugin: FastifyPluginAsync = async (server) => {
EPV_07: process.env.EPV_07?.split(',') ?? ['0x0000000071727De22E5E9d8BAf0edAc6f37da032'],
DELETE_KEY_RECOVER_WINDOW: parseInt(process.env.DELETE_KEY_RECOVER_WINDOW || '7'),
KMS_KEY_ID: process.env.KMS_KEY_ID ?? '',
USE_KMS: process.env.USE_KMS === 'true'
USE_KMS: process.env.USE_KMS === 'true',
DEFAULT_BUNDLER_API_KEY: process.env.DEFAULT_BUNDLER_API_KEY ?? ''
}

server.log.info(config, "config:");
Expand Down
3 changes: 2 additions & 1 deletion backend/src/routes/admin-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ const adminRoutes: FastifyPluginAsync = async (server) => {
SecretString: JSON.stringify({
PRIVATE_KEY: privateKey,
PUBLIC_ADDRESS: publicAddress,
MNEMONIC: mnemonic
MNEMONIC: mnemonic,
BUNDLER_API_KEY: server.config.DEFAULT_BUNDLER_API_KEY
}),
});

Expand Down

0 comments on commit 87eac33

Please sign in to comment.