0

I want to convert bytes into string address. I have only two options because of Junction limitation: bytes32 or bytes20.

pub enum Junction {
   ...
   AccountId32 { network: Option<NetworkId>, id: [u8; 32] },
   ...
   AccountKey20 { network: Option<NetworkId>, key: [u8; 20] },
   ...
}

I want to convert bytes32 into bech32 string address:

xxxxxx1amkywxzsvshqrtw4vcsplp9v83k8w6r8auedp7

But there is no no_std library. Is the anyway to do it?

1 Answer 1

1

dependency for pallet or any code that compiled to wasm [dependencies] bech32 = { package = "bech32", version = "0.9.1", default-features = false, features = [ "strict", ] }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.