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 helpers to obtain Claimable Balance IDs #584

Open
2opremio opened this issue Oct 13, 2020 · 2 comments
Open

Add helpers to obtain Claimable Balance IDs #584

2opremio opened this issue Oct 13, 2020 · 2 comments
Assignees

Comments

@2opremio
Copy link

2opremio commented Oct 13, 2020

CAP 23 (as part of Stellar Protocol 14 and released with Horizon 1.9.0) allows creating and claiming Claimable Balances.

Those balances are queried and claimed using their ID which can be obtained:

  1. Before submitting the transaction creating the claim. The Claim ID is internally just a Hash which can be inferred even before Core accepts the transaction. A helper function would be useful in order to obtain this. ✔️ Adds helper to predict claimable balance IDs given a transaction. js-stellar-base#482
  2. After the transaction creating the claim is submitted (i.e. in the transaction result). However, the claimable ID is pretty buried withing the result XDR, making it hard to obtain through the raw API result. A helper would come in handy.

(2) still needs to be implemented

@ElliotFriend
Copy link

Hi @Shaptic!!

I recently made a dumb little side quest challenging folks to both create and claim a CB in a single transaction. I leaned heavily on the equivalent helper function from the python sdk, and just now thought to look if this was available in the js sdk.

Since it's already an issue, and is labeled good first issue, I think I'd like to take a stab at implementing it. What do you think?

@Shaptic
Copy link
Contributor

Shaptic commented May 6, 2022

Hi @ElliotFriend! Yeah, this is definitely a good first issue. Do note that the helper for (1) was added in stellar/js-stellar-base#482, but (2) would still be useful to anyone working with claimable balances. The PR will belong in the js-stellar-base repo, though, as that's where XDR-related goodies are handled 👍

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

No branches or pull requests

3 participants