Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request primarily focuses on the creation of a new
MainnetCheckService
class in themainnetCheckService.ts
file and the subsequent integration of this service into the existing codebase. TheMainnetCheckService
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
class was created. This class includes methods to interact with a DynamoDB database, such asgetAddressStatus
andupdateAddressStatus
, and acheckAddressValidity
method to manage the balance check count for a specific address.Integration of
MainnetCheckService
into the existing codebase:MainnetCheckService
and instantiated it. ThecheckAddressValidity
method of theMainnetCheckService
was then used in therouter.post('/sendToken',...)
method to replace the previous balance checking mechanism. 1 2 3getNonce
function to fetch the current nonce for a given address from the network.checkMainnetBalancePipeline
function to use theMainnetCheckService
for balance checking and to handle potential internal errors. 1 2