js-stellar-sdk
js-stellar-sdk copied to clipboard
Add helpers to obtain Claimable Balance IDs
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:
- 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. :heavy_check_mark: stellar/js-stellar-base#482
- 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
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?
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 :+1: