Skip to content
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

Mainnet address tracker service #137

Merged
merged 2 commits into from
Feb 9, 2024
Merged

Conversation

rajranjan0608
Copy link
Collaborator

@rajranjan0608 rajranjan0608 commented Feb 7, 2024

This pull request primarily focuses on the creation of a new MainnetCheckService class in the mainnetCheckService.ts file and the subsequent integration of this service into the existing codebase. The MainnetCheckService class is designed to interact with a DynamoDB database to track and manage the number of balance checks performed on a specific address. This is done to limit the number of balance checks to a maximum of three times, after which the user is required to perform a transaction on the mainnet to reset the check count.

The main changes can be grouped into two categories:

Creation of the MainnetCheckService:

  • mainnetCheckService.ts: A new MainnetCheckService class was created. This class includes methods to interact with a DynamoDB database, such as getAddressStatus and updateAddressStatus, and a checkAddressValidity method to manage the balance check count for a specific address.

Integration of MainnetCheckService into the existing codebase:

  • server.ts: Imported the MainnetCheckService and instantiated it. The checkAddressValidity method of the MainnetCheckService was then used in the router.post('/sendToken',...) method to replace the previous balance checking mechanism. 1 2 3
  • utils/mainnetBalanceCheck.ts: Added a new getNonce function to fetch the current nonce for a given address from the network.
  • utils/pipelineChecks.ts: Modified the checkMainnetBalancePipeline function to use the MainnetCheckService for balance checking and to handle potential internal errors. 1 2

@rajranjan0608 rajranjan0608 merged commit 59bdfb7 into main Feb 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant