-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quick addition of traces for a transaction
- Loading branch information
Showing
2 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/traces/+page.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |