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
{{ message }}
Repository navigation
Inconsistent claimable balance ID format handling across commands #2451
Tried to use claim-claimable-balance with the 72-char hex format (returned by Horizon API) and the strkey format (returned by getTransaction) using a real testnet claimable balance (00000000fa8e1bed9deeb6ae75441056b18bcfbde917eca581f70cb93cca637ee10bfa85):
# 72-char hex with type prefix (Horizon API format) - FAILS
stellar tx new claim-claimable-balance \
--balance-id 00000000fa8e1bed9deeb6ae75441056b18bcfbde917eca581f70cb93cca637ee10bfa85
# Strkey format (returned by getTransaction) - FAILS
stellar tx new claim-claimable-balance \
--balance-id BAAAAAAA7KHBX3M5523K45KECBLLDC6PXXURP3FFQH3QZOJ4ZJRX5YIL7KCZJ4I
The same formats work with clawback-claimable-balance:
# 72-char hex - WORKS
stellar tx new clawback-claimable-balance \
--balance-id 00000000fa8e1bed9deeb6ae75441056b18bcfbde917eca581f70cb93cca637ee10bfa85
# Strkey - WORKS
stellar tx new clawback-claimable-balance \
--balance-id BAAAAAAA7KHBX3M5523K45KECBLLDC6PXXURP3FFQH3QZOJ4ZJRX5YIL7KCZJ4I
ledger entry fetch claimable-balance --id also only accepts hex, not strkey.
What did you expect to see?
All commands that accept a --balance-id should accept all three common formats consistently:
clawback-claimable-balance already does this correctly via its parse_balance_id function.
What did you see instead?
claim-claimable-balance rejects both the 72-char hex and strkey formats with an invalid hex error, because it only does a raw hex::decode and validates the result is exactly 32 bytes (claim_claimable_balance.rs:30-41).
ledger entry fetch claimable-balance also rejects strkey format because it uses padded_hex_from_str which only handles hex (claimable_balance.rs:39).
The fix is to reuse the existing parse_balance_id from clawback_claimable_balance.rs:49-88 (or move it to a shared utility) in claim-claimable-balance and ledger entry fetch claimable-balance.
Activity
Accept 72-char hex and strkey balance IDs in claim-claimable-balance …