diff --git a/src/rpc/adapter/rawtransactions.rs b/src/rpc/adapter/rawtransactions.rs index d0b92dc..a9b0d2e 100644 --- a/src/rpc/adapter/rawtransactions.rs +++ b/src/rpc/adapter/rawtransactions.rs @@ -42,6 +42,24 @@ pub fn sendrawtransaction( Ok(txid) } +pub fn fundrawtransaction( + _client: &Client, + _hexstring: String, + _options: Option, + _iswitness: Option, +) -> Result { + todo!() +} + +pub fn signrawtransactionwithwallet( + _client: &Client, + _hexstring: String, + _prevtxs: Option, + _sighashtype: Option, +) -> Result { + todo!() +} + #[cfg(test)] mod tests { use crate::{ diff --git a/src/rpc/traits.rs b/src/rpc/traits.rs index 50c4f60..6adfc35 100644 --- a/src/rpc/traits.rs +++ b/src/rpc/traits.rs @@ -94,6 +94,22 @@ pub trait Rpc { estimate_mode: Option<&str>, avoid_reuse: Option, ) -> Result; + + #[method(name = "fundrawtransaction")] + async fn fundrawtransaction( + &self, + hexstring: String, + options: Option, + iswitness: Option, + ) -> Result; + + #[method(name = "signrawtransactionwithwallet")] + async fn signrawtransactionwithwallet( + &self, + hexstring: String, + prevtxs: Option, + sighashtype: Option, + ) -> Result; } #[async_trait] @@ -208,6 +224,31 @@ impl RpcServer for Client { avoid_reuse, )) } + + async fn fundrawtransaction( + &self, + hexstring: String, + options: Option, + iswitness: Option, + ) -> Result { + to_jsonrpsee_error(adapter::fundrawtransaction( + self, hexstring, options, iswitness, + )) + } + + async fn signrawtransactionwithwallet( + &self, + hexstring: String, + prevtxs: Option, + sighashtype: Option, + ) -> Result { + to_jsonrpsee_error(adapter::signrawtransactionwithwallet( + self, + hexstring, + prevtxs, + sighashtype, + )) + } } /// Helper for converting ledger error to [`jsonrpsee`] error.