Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions modules/sdk-coin-canton/src/canton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,18 @@ export class Canton extends BaseCoin {
}

/** @inheritDoc */
parseTransaction(params: ParseTransactionOptions): Promise<ParsedTransaction> {
throw new Error('Method not implemented.');
async parseTransaction(params: ParseTransactionOptions): Promise<ParsedTransaction> {
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 */
Expand Down
Loading