2.0 KiB
Bitcoin: authorize CoinJoin
Allow device to do preauthorized operations in signTransaction and getOwnershipProof methods without further user interaction.
Permission persists until physical device disconnection or maxRounds limit is reached.
const result = await TrezorConnect.authorizeCoinJoin(params);
⚠️ This feature is experimental! Do not use it in production!
:note: Supported only by Trezor T with Firmware 2.4.4 or higher!
Params
Exporting single id
path— requiredstring | Array<number>prefix of the BIP-32 path leading to the account (m / purpose' / coin_type' / account')read more
coordinator— requiredstringcoordinator identifier to approve as a prefix in commitment data (max. 36 ASCII characters)
maxRounds— requirednumbermaximum number of rounds that Trezor is authorized to take part in
maxCoordinatorFeeRate— requirednumbermaximum coordination fee rate in units of 10**8 percent
maxFeePerKvbyte— requirednumbermaximum mining fee rate in units of satoshis per 1000 vbytes
coin- optionalstringDetermines network definition specified in coins.json file. Coin
shortcut,nameorlabelcan be used.scriptType— optionalPROTO.InputScriptTypeused to distinguish between various address formats (non-segwit, segwit, etc.)
amountUnit— optionalPROTO.AmountUnitshow amounts in
Example:
TrezorConnect.authorizeCoinJoin({
path: "m/10086'/0'/0'",
maxRounds: 3,
maxCoordinatorFeeRate: 5000000, // 5% => 0.05 * 10**8;
maxFeePerKvbyte: 3500,
scriptType: 'SPENDWITNESS',
});
Result
{
success: true,
payload: {
message: 'CoinJoin authorized'
}
}
Error
{
success: false,
payload: {
error: string // error message
}
}