mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2026-01-01 06:06:41 +01:00
「🏗️」 wip: started doing the api for the contract
This commit is contained in:
13
src/api/scoreStore/default.js
Normal file
13
src/api/scoreStore/default.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { evm } from '@avalabs/avalanchejs';
|
||||
import scoreDB from '../../utils/scoreDB.js';
|
||||
import { getTx } from './getTx.js';
|
||||
|
||||
/**
|
||||
* @param {import('fastify').FastifyInstance} fastify
|
||||
* @param {import('fastify').FastifyPluginOptions} options
|
||||
*/
|
||||
export default async function(fastify, options) {
|
||||
fastify.get("/:id", async (request, reply) => {
|
||||
return getTx(request, reply, fastify);
|
||||
});
|
||||
}
|
||||
19
src/api/scoreStore/getTx.js
Normal file
19
src/api/scoreStore/getTx.js
Normal file
@ -0,0 +1,19 @@
|
||||
import scoreDB from "../../utils/scoreDB.js";
|
||||
|
||||
/**
|
||||
* @async
|
||||
* @param {import("fastify".FastifyRequest)} request
|
||||
* @param {import("fastify").FastifyReply} reply
|
||||
* @param {import("fastify").FastifyInstance} fastify
|
||||
*
|
||||
* @returns {import('fastify').FastifyReply}
|
||||
*/
|
||||
export async function getTx(request, reply, fastify) {
|
||||
try {
|
||||
|
||||
} catch (err) {
|
||||
fastify.log.error(err);
|
||||
return reply.code(500).send({ error: "Internal server error" });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user