-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: PRO-2399 sponsorBalance property added to metadata API #106
Conversation
Deploying arka with Cloudflare Pages
|
…rontend and backend to 1.2.4
backend/src/routes/admin.ts
Outdated
@@ -86,8 +86,10 @@ const adminRoutes: FastifyPluginAsync = async (server) => { | |||
resolve(row); | |||
}) | |||
}) | |||
if (result && result.length > 0) | |||
if (result && result.length > 0){ | |||
console.log(`Duplicate record found: ${JSON.stringify(result)}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls use a logger instead of console.log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wil be adding logger and update existing console logging to use logger
backend/src/routes/admin.ts
Outdated
@@ -127,6 +129,7 @@ const adminRoutes: FastifyPluginAsync = async (server) => { | |||
server.post('/updateKey', async function (request, reply) { | |||
try { | |||
const body: any = JSON.parse(request.body as string); | |||
console.log(`Body: ${JSON.stringify(body)}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Pls remove or use a logger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wil be adding logger and update existing console logging to use logger
backend/src/routes/admin.ts
Outdated
@@ -101,7 +103,7 @@ const adminRoutes: FastifyPluginAsync = async (server) => { | |||
MULTI_TOKEN_ORACLES, \ | |||
TRANSACTION_LIMIT, \ | |||
NO_OF_TRANSACTIONS_IN_A_MONTH, \ | |||
INDEXER_ENDPOINT) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", [ | |||
INDEXER_ENDPOINT) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider using an orm instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ch4r10t33r yeap.
@vignesha22
for fastify the orm tool compatible would be objection.js which is built on top of Knex.js
the other ones can be sequelize, prisma
pls share your feedback for orm tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will include replacing the native sql to ORM based in a separate feature branch
incrementally with sponsorship policy enhancement (admin backend service to save/query sponsorship policies)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ch4r10t33r yeap.
@vignesha22 for fastify the orm tool compatible would be objection.js which is built on top of Knex.js the other ones can be sequelize, prisma
pls share your feedback for orm tool
Please pick the best one for the job. Whichever has a smaller build size.
console.log(body, server.config.ADMIN_WALLET_ADDRESS) | ||
if (ethers.utils.getAddress(body.WALLET_ADDRESS) === server.config.ADMIN_WALLET_ADDRESS) return reply.code(ReturnCode.SUCCESS).send({error: null, message: "Successfully Logged in"}); | ||
return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_USER }); | ||
if (ethers.utils.getAddress(body.WALLET_ADDRESS) === ethers.utils.getAddress(server.config.ADMIN_WALLET_ADDRESS)) return reply.code(ReturnCode.SUCCESS).send({error: null, message: "Successfully Logged in"}); return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_USER }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls do indentation on this part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one indentation part which was missing other than LGTM pls change that and then merge this PR
sponsorBalance property added to metadata API
Description
entryPoint
contract via function-calldepositFunds
onEtherspotPaymaster
sponsor-address
inEtherspotPaymaster
Types of changes
API Change
Metadata API will query sponsor balance of the sponsor via view function call
getSponsorBalance
onEtherspotPaymaster
Metadata API must include the
sponsorBalance
in the response[ X] Other : add new property in API response for metadata
Testing:
Deposit
on backend API testing with Polygon Amoy testnetTransactionHash: https://www.oklink.com/amoy/tx/0x40b84e8e01e9acd01bafa8d2ee3ef01c46dc8e9ec3abb783f4474eb8d23ceb43
metadata
API to get the Sponsor Details with new propertysponsorBalance