diff --git a/modules/sdk-coin-canton/src/canton.ts b/modules/sdk-coin-canton/src/canton.ts index dc5e6ee20f..190d89cb4d 100644 --- a/modules/sdk-coin-canton/src/canton.ts +++ b/modules/sdk-coin-canton/src/canton.ts @@ -372,8 +372,18 @@ export class Canton extends BaseCoin { } /** @inheritDoc */ - parseTransaction(params: ParseTransactionOptions): Promise { - throw new Error('Method not implemented.'); + async parseTransaction(params: ParseTransactionOptions): Promise { + const txHex = params.txHex as string | undefined; + if (!txHex) { + // Message-only signing requests (e.g. CANTON_SIGN_TRANSACTION, CANTON_SIGN_TOPOLOGY) + // have no transaction hex to parse — return an empty result. + return {}; + } + const transactionExplanation = await this.explainTransaction({ txHex }); + if (!transactionExplanation) { + throw new Error('Invalid transaction'); + } + return transactionExplanation as unknown as ParsedTransaction; } /** @inheritDoc */