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

Add JS way to fetch claimable balance ID #1070

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Oct 30, 2024

No description provided.

The value of the `Latest-Ledger` HTTP header is the sequence number of the latest ledger known to Horizon at the time the request was processed.
Horizon will guarantee that all the data included in the response is consistent with that ledger. This mechanism prevents race conditions where
a request is processed at the boundary of two ledgers and ensures that the response is consistent with the ledger included in the `Latest-Ledger` HTTP header.
For endpoints which serve data which can change from ledger to ledger (for example an account balance), Horizon includes a `Latest-Ledger` HTTP header in its response. The value of the `Latest-Ledger` HTTP header is the sequence number of the latest ledger known to Horizon at the time the request was processed. Horizon will guarantee that all the data included in the response is consistent with that ledger. This mechanism prevents race conditions where a request is processed at the boundary of two ledgers and ensures that the response is consistent with the ledger included in the `Latest-Ledger` HTTP header.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

idk why this file changed but seems auto-markdown formatting related

@stellar-jenkins
Copy link

@Shaptic Shaptic merged commit 78008c9 into main Oct 30, 2024
2 checks passed
@Shaptic Shaptic deleted the claimable-balance-example branch October 30, 2024 17:00
@JFWooten4
Copy link
Contributor

JFWooten4 commented Nov 4, 2024

@Shaptic Thanks for implementing this! I have my own instance pending submission, and just wanted to circle around on this since I saw you used txResponse. As I understood the existing docs and community SDKs, method 1 is meant using only an analysis of the pre-submitted but built tx.

Clearly, you helped figure this one out and have gone the extra mile to implement it here! But I think it's intended to get fetched on the actual local object before touching Horizon. Just want to make sure we get this one right 🫱🏻‍🫲🏽

@Shaptic
Copy link
Contributor Author

Shaptic commented Nov 4, 2024

@JFWooten4 ah, very nice point!! I used txResponse out of laziness here as a way to get the transaction envelope, but you're absolutely correct that it's intended to enable calculation prior to submission entirely.

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.

4 participants