diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30-ledger.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30-ledger.ts index b375a2f489..e15827c8b8 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30-ledger.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/cip30/cip30-ledger.ts @@ -1,4 +1,5 @@ import {Transaction, WasmModuleProxy} from '@emurgo/cross-csl-core' +import {has_transaction_set_tag, TransactionSetsState} from '@emurgo/csl-mobile-bridge' import {createSignedLedgerTxFromCbor} from '@emurgo/yoroi-lib' import {normalizeToAddress} from '@emurgo/yoroi-lib/dist/internals/utils/addresses' import {HW, Wallet} from '@yoroi/types' @@ -21,10 +22,16 @@ class CIP30LedgerExtension { async signTx(cbor: string, partial: boolean, hwDeviceInfo: HW.DeviceInfo, useUSB: boolean): Promise { const {csl, release} = wrappedCsl() try { - const tx = await csl.Transaction.fromHex(cbor) + const tx = await csl.FixedTransaction.fromHex(cbor) if (!partial) await assertHasAllSigners(cbor, this.wallet, this.meta) const txBody = await tx.body() + const transactionSetTag = await has_transaction_set_tag(await txBody.toBytes()) + + if (transactionSetTag === TransactionSetsState.MixedSets) { + throw new Error('Mixed transaction sets are not supported when using a HW wallet') + } + const payload = await toLedgerSignRequest( csl, txBody,