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

Use algorand indexer to retrieve past transactions #224

Merged
merged 3 commits into from
Jul 4, 2023

Conversation

stefanofa
Copy link
Contributor

@stefanofa stefanofa commented Jul 3, 2023

Given the current throughput of Algorand, users are unable to redeem transactions that were made more than approximately 55 minutes ago. This limitation arises from the use of the pendingTransactionInformation endpoint in the Algorand client, which only supports requests for transactions up to 1000 blocks in the past. To retrieve any transaction beyond this limit, we need to utilize the Algorand indexer.

To solve this problem, I made the necessary request via the indexer. However, the transaction encoding differs between the two endpoints, so I performed a transformation of the latter to make it compatible with the parameter required by parseSequenceFromLogAlgorand.

@stefanofa stefanofa changed the title WIP: Use algorand indexer to retrieve past transactions Use algorand indexer to retrieve past transactions Jul 3, 2023
src/utils/consts.ts Show resolved Hide resolved
@stefanofa stefanofa temporarily deployed to Cloudflare-Testnet July 4, 2023 12:42 — with GitHub Actions Inactive
@stefanofa stefanofa temporarily deployed to Cloudflare-Preview July 4, 2023 12:42 — with GitHub Actions Inactive
Copy link
Collaborator

@M-Picco M-Picco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it out locally and managed to start the recovery for an old tx, while the main branch version would fail with a 404.

I only have a small nitpick for parsing only the first inner tx's log instead of all, but the wh sdk only expects the first one. But we can take care of that later.

Thanks for the PR @stefanofa!

@sebastianscatularo sebastianscatularo merged commit c4f6e17 into XLabs:main Jul 4, 2023
8 of 10 checks 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.

3 participants