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

Fix types for stream calls #1040

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scottym5797
Copy link

I was attempting to listen to a transaction or operation stream on Horizon and I noticed that the types are sent back completely wrong.

Screenshot 2024-09-03 at 3 10 04 PM

i.e. I would try to call .records, .next() or .previous() operations and it would obviously fail as streams do not give collectionPages but rather single operationRecords. Same happens with transaction streams, etc.

here is after the fix with the correct types:
Screenshot 2024-09-03 at 3 03 12 PM

So I then went in and fixed the line so the types are correct since it's a very tiny fix.

TLDR: in typescript, streams were typed as Collections/pages when in reality they were single records.

Copy link
Contributor

@Shaptic Shaptic left a comment

Choose a reason for hiding this comment

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

Awesome, LGTM 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

2 participants