From 84c132429074c76b9fc64e345360101e869aa6d5 Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Fri, 3 Jul 2020 16:52:25 +0200 Subject: [PATCH] python: Add authorize_coinjoin() to trezorlib. --- python/src/trezorlib/btc.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/python/src/trezorlib/btc.py b/python/src/trezorlib/btc.py index e137e6a6ea..149da9c43a 100644 --- a/python/src/trezorlib/btc.py +++ b/python/src/trezorlib/btc.py @@ -252,3 +252,25 @@ def sign_tx(client, coin_name, inputs, outputs, details=None, prev_txes=None): raise exceptions.TrezorException("Some signatures are missing!") return signatures, serialized_tx + + +@expect(messages.Success, field="message") +def authorize_coinjoin( + client, + coordinator, + max_total_fee, + n, + coin_name, + fee_per_anonymity=None, + script_type=messages.InputScriptType.SPENDADDRESS, +): + return client.call( + messages.AuthorizeCoinJoin( + coordinator=coordinator, + max_total_fee=max_total_fee, + address_n=n, + coin_name=coin_name, + fee_per_anonymity=fee_per_anonymity, + script_type=script_type, + ) + )