chia-sdk-utils 0.33.0

General utilities for the chia-wallet-sdk.
Documentation
1
2
3
4
5
6
7
8
9
10
use chia_protocol::Bytes;
use hex::FromHexError;

pub fn parse_hex(mut hex: &str) -> Result<Bytes, FromHexError> {
    if let Some(stripped) = hex.strip_prefix("0x") {
        hex = stripped;
    }

    Ok(hex::decode(hex)?.into())
}