substrate-stellar-sdk 0.3.0

A Substrate compatible SDK for Stellar
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::{lib::String, types::Error};
use scale_info::prelude::format;

impl<E: From<sp_std::str::Utf8Error>> crate::StellarTypeToString<Self, E> for Error {
    fn as_encoded_string(&self) -> Result<String, E> {
        let msg = self.msg.get_vec();
        let msg = sp_std::str::from_utf8(msg).map_err(E::from)?;
        Ok(format!("Error{{ code:{:?} message:{msg} }}", self.code))
    }
}