go icon indicating copy to clipboard operation
go copied to clipboard

Claimable balance id under operations on Horizon result

Open hklee93 opened this issue 2 years ago • 0 comments

This is more like a general question than the feature request. I noticed that "create_claimable_balance" type shows up on the /operations endpoint, but strangely it doesn't include the "claimable_balance_id". I was wondering why this isn't there. While I was going through the issue list, I saw something like we can compute the claimable balance id? If this is actually possible with only given information, I'd love to see how it can be retrieved.

What problem does your feature solve?

I'm trying to show both payment history and claimable balance history on the same page, and I noticed that /operations endpoint returns both, except it doesn't include the claimable balance id, which is needed to claim the asset back.

What would you like to see?

Something like this. The snippet is copied from the recent horizon.

{
        ...
        "id": "176738299368341604",
        "balance_id": "blahblah"  <<<<<<<<<<<<<<<<<<<<<< ADDED <<<<<<<<<<<<<<<<<<
        "paging_token": "176738299368341604",
        "transaction_successful": true,
        "source_account": "GBYREQTJKAOBPEXC3YGUE3IV3DVGNAO27QRB7BALTIUQBEWBBHYKYTNY",
        "type": "create_claimable_balance",
        "type_i": 14,
        "created_at": "2022-06-02T22:09:17Z",
        "transaction_hash": "4cd1e60054a2fa6f959e496191901024333676944928996a5470a374cafa2c08",
        "sponsor": "GBYREQTJKAOBPEXC3YGUE3IV3DVGNAO27QRB7BALTIUQBEWBBHYKYTNY",
        ...
}

What alternatives are there?

Otherwise I need to make two different API calls.

hklee93 avatar Jun 02 '22 22:06 hklee93