You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| balance_id | The unique identifier of the claimable balance. The id is comprised of 8 character type code + SHA-256 hash of the history operation id that created the balance. The balance id can be joined back to the \`claimable_balances\` table to gather more details about the balance | string |||||| history_operations ||
Claimable balance IDs use a "history operation id that created the balance" to get the final CB_ID. You are supposed to be able to do this outside of the network:
@Shaptic I am not entirely sure what you mean, as each instance of method 1 in stellar-docs/docs/learn/encyclopedia/transactions-specialized/claimable-balances.mdx has no implementation in their respective SDKs. If this is incorrect, then please do correct me for #723, but I can't find the exact docs in any language for precomputing balance IDs.1 I also searched the entire doc repo, but please do let me know if I'm missing the reference you're referring to.
@JFWooten4 err yeah, you're right (I had the Go tab open by default). There are still the other methods of course, but it'd be good to document computation of the claimable balance 👍 and add a JS helper for it if that's a feature request.
The claimable balance ID is the sha256 hash of the claimable balance operation body encoded as a claimable balance ID. Namely,
hex(claimableBalanceIdTypeV0(sha256(
the operation/transaction source account's public key,
the transaction's source account sequence number
the operation index within the transaction
)))
Thank you for the help, George. I drafted an update in P1516 and will get the docs updated tomorrow. Mocking up the code examples now, all per your insights!
Activity
Shaptic commentedon Jul 31, 2024
There are examples in three languages? Ctrl-f "method 1"
JFWooten4 commentedon Aug 1, 2024
@Shaptic I am not entirely sure what you mean, as each instance of
method 1instellar-docs/docs/learn/encyclopedia/transactions-specialized/claimable-balances.mdxhas no implementation in their respective SDKs. If this is incorrect, then please do correct me for #723, but I can't find the exact docs in any language for precomputing balance IDs.1 I also searched the entire doc repo, but please do let me know if I'm missing the reference you're referring to.Footnotes
Except for the go implementation, but the docs there are extremely abstracted. ↩
Shaptic commentedon Aug 1, 2024
@JFWooten4 err yeah, you're right (I had the Go tab open by default). There are still the other methods of course, but it'd be good to document computation of the claimable balance 👍 and add a JS helper for it if that's a feature request.
Shaptic commentedon Aug 1, 2024
Oh lol there already is one in JS: https://stellar.github.io/js-stellar-sdk/Transaction.html#getClaimableBalanceId, it's just not updated in the docs.
Shaptic commentedon Aug 1, 2024
The claimable balance ID is the sha256 hash of the claimable balance operation body encoded as a claimable balance ID. Namely,
JFWooten4 commentedon Aug 2, 2024
Thank you for the help, George. I drafted an update in P1516 and will get the docs updated tomorrow. Mocking up the code examples now, all per your insights!