From 981cb35240f2bd730ede18bd74cc71883153cca6 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 26 Jul 2025 01:40:15 +0000 Subject: [PATCH] improve op_return display --- .../transactions-list.component.html | 24 +++++++++++++++++-- .../transactions-list.component.ts | 7 ++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.html b/frontend/src/app/components/transactions-list/transactions-list.component.html index 70c559c33..5ec98d488 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.html +++ b/frontend/src/app/components/transactions-list/transactions-list.component.html @@ -341,7 +341,18 @@ @if (vout.isRunestone) { } @else { - {{ vout.scriptpubkey_asm | slice:0:200 | hex2ascii }} + + {{ vout.scriptpubkey_asm | hex2ascii | slice:0:200 }} + + @if ((vout.scriptpubkey_asm | hex2ascii).length > 200) { + @if (!showFullOpReturnPreview[vindex]) { + Show more + } @else { + Show less + } + } + + } {{ vout.scriptpubkey_type | scriptpubkeyType }} @@ -392,6 +403,15 @@ + + + {{ vout.scriptpubkey_asm | hex2ascii | slice:0:8000 }} + + @@ -428,7 +448,7 @@ -
OP_RETURN data + @if (!showFullOpReturnData[vindex]) { {{ (vout.scriptpubkey_asm | hex2ascii | slice:0:1000) }} } @else { diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.ts b/frontend/src/app/components/transactions-list/transactions-list.component.ts index 241c39101..80a144ca8 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.ts +++ b/frontend/src/app/components/transactions-list/transactions-list.component.ts @@ -66,6 +66,7 @@ export class TransactionsListComponent implements OnInit, OnChanges, OnDestroy { showFullScriptPubkeyAsm: { [voutIndex: number]: boolean } = {}; showFullScriptPubkeyHex: { [voutIndex: number]: boolean } = {}; showFullOpReturnData: { [voutIndex: number]: boolean } = {}; + showFullOpReturnPreview: { [voutIndex: number]: boolean } = {}; showOrdData: { [key: string]: { show: boolean; inscriptions?: Inscription[]; runestone?: Runestone, runeInfo?: { [id: string]: { etching: Etching; txid: string; } }; } } = {}; similarityMatches: Map> = new Map(); @@ -551,6 +552,12 @@ export class TransactionsListComponent implements OnInit, OnChanges, OnDestroy { this.showFullOpReturnData[voutIndex] = !this.showFullOpReturnData[voutIndex]; } + toggleShowFullOpReturnPreview(voutIndex: number): void { + console.log('toggleShowFullOpReturnPreview', voutIndex); + this.showFullOpReturnPreview[voutIndex] = !this.showFullOpReturnPreview[voutIndex]; + console.log(this.showFullOpReturnPreview[voutIndex]); + } + toggleOrdData(txid: string, type: 'vin' | 'vout', index: number) { const tx = this.transactions.find((tx) => tx.txid === txid); if (!tx) {