feat: add calculate_fee and calculate_fee_rate on wallet

This commit is contained in:
Matthew committed 2024-01-08 12:18:36 -06:00
1 parent fc25cd709a
commit 3789c1dcd6
11 files changed
+180 -13

No files matched your search

+5
View File
@@ -64,6 +64,11 @@ class TestLiveWallet(unittest.TestCase):
walletDidSign = wallet.sign(psbt)
self.assertTrue(walletDidSign)
tx = psbt.extract_tx()
print(f"Transaction Id: {tx.txid}")
fee = wallet.calculate_fee(tx)
print(f"Transaction Fee: {fee}")
fee_rate = wallet.calculate_fee_rate(tx)
print(f"Transaction Fee Rate: {fee_rate.as_sat_per_vb()} sat/vB")
esploraClient.broadcast(tx)