encodeClaimableBalance

Encodes raw bytes to strkey claimable balance ID (B...)

The type discriminant data carries is checked here as well as on decode, so every string this function returns is one decodeClaimableBalance accepts.

Return

The encoded strkey, 58 characters long

Parameters

data

The 33-byte strkey body (the type discriminant followed by the 32-byte hash), the 32-byte hash alone, or the 36-byte XDR wire form (the four-byte big-endian union discriminant followed by the hash)

Throws

if data has none of those widths, or if the discriminant in the 33- or 36-byte form is not the one the XDR union declares