Skip to content

Commit

Permalink
Merge pull request #33 from MHaris-Ferrum/develop
Browse files Browse the repository at this point in the history
tx schema updated and health check api
  • Loading branch information
AbdulAhadArain authored Aug 27, 2024
2 parents 87ef145 + 1b4f5e1 commit 7ab2f9f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ app.use(cors());
app.options('*', cors());

app.use('/v1/api', router);
app.use(crons);

app.use('/health', (req: Request, res: Response) => {
res.status(httpStatus.OK).send('Welcome to Quantum Portal API');
});

// send back a 404 error for any unknown api request
app.use((req: Request, res: Response, next: NextFunction) => {
Expand All @@ -41,4 +44,6 @@ app.use(errorConverter);
// handle error
app.use(errorHandlers);

app.use(crons);

export default app;
2 changes: 2 additions & 0 deletions src/models/quantumPortalTransaction.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const quantumPortalTransactionSchema = new Schema({
nonce: Number,
status: String,
method: String,
position: Number,
blockNumber: Number,
confirmations: Number,
from: String,
Expand All @@ -24,6 +25,7 @@ const quantumPortalTransactionSchema = new Schema({
chainId: Number,
timestamp: String,
fee: String,
inputData: String,
decodedInput: Object,
logs: [Object],
});
Expand Down
2 changes: 2 additions & 0 deletions src/services/node.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ export const processBlockAndTransaction = async (
gasLimit: tx?.gas_limit,
gasUsed: tx?.gas_used,
gasPrice: tx?.gas_price,
inputData: tx?.raw_input,
decodedInput: tx?.decoded_input,
logs: logs?.data?.items,
nonce: tx?.nonce,
position: tx?.position,
confirmations: tx?.confirmations,
priorityFee: tx?.priority_fee,
maxPriorityFeePerGas: tx?.max_priority_fee_per_gas,
Expand Down

0 comments on commit 7ab2f9f

Please sign in to comment.