Function decode_bech32
Source pub fn decode_bech32(hrp_addr: &str) -> Result<Bytes, CoreError>
Expand description
Decodes a bech32-encoded address into raw bytes.
§Arguments
hrp_addr - A bech32-encoded address string (e.g., “erd1…”)
§Returns
The raw 32-byte public key, or an error if decoding fails
§Errors
Returns an error if:
- The address is not valid bech32
- The decoded data is not exactly 32 bytes