Skip to content

Commit

Permalink
Added support for Data transactions (type 12)
Browse files Browse the repository at this point in the history
Show data entries of association and statement transactions.
  • Loading branch information
jasny committed Jul 11, 2023
1 parent 22fbc4a commit 05c4a58
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
5 changes: 5 additions & 0 deletions assets/lto-icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
color: #17054b;
}

.lto-data:before {
content: "\e910";
color: #17054b;
}

.lto-node:before {
content: "\e915";
color: #17054b;
Expand Down
3 changes: 2 additions & 1 deletion data/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ export const txTypes: {[key: number]: { name: string; description: string; icon:
8: { name: 'start_lease', description: 'Lease', icon: 'mdi-file-document-box-plus' },
9: { name: 'cancel_lease', description: 'Cancel Lease', icon: 'mdi-file-document-box-remove' },
11: { name: 'mass_transfer', description: 'Mass Transfer', icon: 'mdi-coins' },
12: { name: 'data', description: 'Data', icon: 'mdi-database' },
13: { name: 'script', description: 'Script', icon: 'mdi-script-text' },
15: { name: 'anchor', description: 'Anchor', icon: 'mdi-anchor' },
16: { name: 'invoke_association', description: 'Issue Association', icon: 'mdi-link-plus' },
16: { name: 'invoke_association', description: 'Association', icon: 'mdi-link-plus' },
17: { name: 'revoke_association', description: 'Revoke Association', icon: 'mdi-link-off' },
18: { name: 'sponsor', description: 'Sponsorship', icon: 'mdi-heart' },
19: { name: 'cancel_sponsor', description: 'Cancel Sponsorship', icon: 'mdi-heart-broken' },
Expand Down
3 changes: 2 additions & 1 deletion locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export default {
timestamp: 'Timestamp',
confirmed: 'Confirmed',
target: 'Target',
type: 'Type'
type: 'Type',
data: 'Data'
},
nodes: {
title: 'Nodes Monitor'
Expand Down
34 changes: 34 additions & 0 deletions pages/transaction/:transaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,40 @@
</v-card-text>
</v-card>
</v-col>

<v-col
v-if="transaction.data && transaction.data.length > 0"
:cols="12"
:sm="12"
:md="12"
:lg="12"
>
<v-card>
<v-card-title class="secondary--text">
<span class="mr-2 lto-data" />
{{ $t('explorer.data') }}
</v-card-title>
<v-card-text class="pa-0">
<v-simple-table>
<template v-slot:default>
<tbody>
<tr v-for="(entry, i) in transaction.data" :key="i">
<td>
{{ entry.key }}
</td>
<td>
{{ entry.value }}
</td>
<td class="d-none d-md-table-cell">
( {{ entry.type }} )
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-card-text>
</v-card>
</v-col>
</v-row>
</div>
</template>
Expand Down
1 change: 1 addition & 0 deletions pages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface Transaction {
fee: number | string;
type: number;
transfers: Transfer[];
data?: { key: string; type: string; value: string | number | boolean }[];
amount: number;
totalAmount: number;
height: number;
Expand Down

0 comments on commit 05c4a58

Please sign in to comment.