From bf8c831df204a993c2e02d4457ae4c63cee73d61 Mon Sep 17 00:00:00 2001 From: Aaron Cox Date: Wed, 22 Jan 2025 09:55:24 -0800 Subject: [PATCH] Quick addition of traces for a transaction --- .../transaction/[id]/[[seq]]/+layout.svelte | 13 ++-- .../[id]/[[seq]]/traces/+page.svelte | 59 +++++++++++++++++++ 2 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/traces/+page.svelte diff --git a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+layout.svelte b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+layout.svelte index 12ba76c6..0e9cb385 100644 --- a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+layout.svelte +++ b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+layout.svelte @@ -14,18 +14,19 @@ if (data.seq) { urlBase += `/${data.seq}`; } - return [ + const options = [ { href: urlBase, text: m.common_summary() }, - // { href: `${urlBase}/resources`, text: 'Resources' }, - { href: `${urlBase}/data`, text: m.common_data() } + { href: `${urlBase}/traces`, text: 'Traces' } ]; + if (settings.data.debugMode) { + options.push({ href: `${urlBase}/data`, text: m.common_data() }); + } + return options; }); - {#if settings.data.debugMode} - - {/if} + {@render children()} diff --git a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/traces/+page.svelte b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/traces/+page.svelte new file mode 100644 index 00000000..cb2a7f16 --- /dev/null +++ b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/traces/+page.svelte @@ -0,0 +1,59 @@ + + +{#if data.transaction?.traces} + {@const actions = data.transaction.traces as Trace[]} + + + + + + + + + + + {#each actions as action} + + + + + + + {/each} + +
ContractReceiverAuthorizationData
+

+ + {action.act.account} + +

+ + {action.act.name} + +
+ {action.receipt.receiver} + + {#each action.act.authorization as auth} + + {/each} + + {JSON.stringify(action.act.data, null, 2)} +
+{:else} +

No actions

+{/if}