feat: add calculate_fee and calculate_fee_rate on wallet

This commit is contained in:
Matthew
2023-12-16 19:24:02 -06:00
parent fc25cd709a
commit 3789c1dcd6
11 changed files with 180 additions and 13 deletions

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)