From 87bc9bea9fd642e87942d842364255aafec35749 Mon Sep 17 00:00:00 2001 From: daveusa <109542778+alteralt@users.noreply.github.com> Date: Sat, 7 Jan 2023 01:51:11 +0300 Subject: [PATCH] Add method send_tx to TrezorApi --- blockapi/api/trezor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blockapi/api/trezor.py b/blockapi/api/trezor.py index c2969d24..67ffbb7a 100644 --- a/blockapi/api/trezor.py +++ b/blockapi/api/trezor.py @@ -26,6 +26,7 @@ class TrezorAPI(BlockchainAPI): 'get_balance_xpub': '/api/v2/xpub/{address}', 'get_txs': '/api/v2/utxo/{address}?confirmed={confirmed}', 'get_tx': '/api/v2/tx/{tx_hash}', + 'send_tx': '/api/v1/sendtx/{tx_hex}', } def get_balance(self): @@ -71,6 +72,9 @@ def parse_tx(self, tx): 'raw': txdata, } + def send_tx(self, tx_hex): + return self.request('send_tx', tx_hex=tx_hex) + class Btc1TrezorAPI(TrezorAPI): base_url = 'https://btc1.trezor.io'