forId

fun forId(claimableBalanceId: String): ClaimableBalanceId

Reads claimableBalanceId in whichever spelling it holds and returns the balance it names.

A string as long as a strkey is read as one: the base32 and the hexadecimal alphabets overlap, but no hexadecimal spelling has that length, so the strkey reading is the only one that can succeed. A hexadecimal spelling is read in either case, and every byte of a discriminant it carries is judged.

Return

the balance the given spelling names

Parameters

claimableBalanceId

the balance id as a B... strkey, as the bare hash in hexadecimal, or as the hash behind a type discriminant of either width in hexadecimal

Throws

if claimableBalanceId is as long as a strkey but does not begin with B, if it is not a strkey this codec accepts, if its length matches none of the accepted shapes, if it is not hexadecimal, or if it carries a discriminant naming no claimable balance id type