Skip to content

Commit

Permalink
Quick addition of traces for a transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Jan 22, 2025
1 parent f62e774 commit bf8c831
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
</script>

<Stack class="@container">
{#if settings.data.debugMode}
<PillGroup {options} />
{/if}
<PillGroup {options} />

{@render children()}
</Stack>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<script lang="ts">
import Code from '$lib/components/code.svelte';
import type { Action, NameType } from '@wharfkit/antelope';
let { data } = $props();
// Define the Action interface
interface Trace {
act: Action;
receipt: { receiver: NameType };
}
</script>

{#if data.transaction?.traces}
{@const actions = data.transaction.traces as Trace[]}
<table class="table-styles">
<thead>
<tr>
<th>Contract</th>
<th>Receiver</th>
<th>Authorization</th>
<th>Data</th>
</tr>
</thead>
<tbody>
{#each actions as action}
<tr>
<td>
<p>
<a href={`/${data.network}/contract/${action.act.account}`}>
{action.act.account}
</a>
</p>
<a href={`/${data.network}/contract/${action.act.account}/actions/${action.act.name}`}>
{action.act.name}
</a>
</td>
<td>
{action.receipt.receiver}
</td>
<td>
{#each action.act.authorization as auth}
<div>
<a href={`/${data.network}/account/${auth.actor}`}>
{auth.actor}@{auth.permission}
</a>
</div>
{/each}
</td>
<td>
<Code>{JSON.stringify(action.act.data, null, 2)}</Code>
</td>
</tr>
{/each}
</tbody>
</table>
{:else}
<p>No actions</p>
{/if}

0 comments on commit bf8c831

Please sign in to comment.