input-output-hk / js-cardano-wasm

various cardano javascript using wasm bindings
MIT License
31 stars 21 forks source link

Add to_byte() method #86

Open aters opened 4 years ago

aters commented 4 years ago

Would be great to have a method similar to to_hex() or to_json() for the transaction, as it can be used to send the raw bytes right to the submit-api. Something like this: pub fn to_bytes(&self) -> Result<String, JsValue> { let bytes = cbor!(&self.0).map_err(|e| JsValue::from_str(&format! {"{:?}", e}))?; Ok(bytes) }