We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08032d2 commit 112f87bCopy full SHA for 112f87b
src/transactions.rs
@@ -141,6 +141,17 @@ impl NodeInterface {
141
142
Ok(res_json)
143
}
144
+
145
+ /// Gets the recommended fee for a transaction.
146
+ /// bytes - size of the transaction in bytes
147
+ /// wait_time - minutes to wait for the transaction to be included in the blockchain
148
+ pub fn get_recommended_fee(&self, bytes: u64, wait_time: u64) -> Result<u64> {
149
+ let endpoint = format!("/transactions/getFee?bytes={}&waitTime={}", bytes, wait_time);
150
+ let res = self.send_get_req(&endpoint);
151
+ let res_json = self.parse_response_to_json(res);
152
+ let fee = res_json?.as_u64().unwrap();
153
+ Ok(fee)
154
+ }
155
156
157
fn parse_tx_id_unsafe(mut res_json: JsonValue) -> TxId {
0 commit comments