Skip to content

Commit

Permalink
implement contract hints
Browse files Browse the repository at this point in the history
  • Loading branch information
janmichek committed Jun 22, 2023
1 parent ed530f4 commit ffac685
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 4 deletions.
25 changes: 25 additions & 0 deletions src/components/TransactionGeneralPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<tr class="transaction-general-panel__row">
<th class="transaction-general-panel__table-header">
Keyblock Height
<hint-tooltip>
{{ transactionDetailsHints.blockHeight }}
</hint-tooltip>
</th>
<td class="transaction-general-panel__data">
{{ transactionDetails.blockHeight }}
Expand All @@ -30,6 +33,9 @@
<tr class="transaction-general-panel__row">
<th class="transaction-general-panel__table-header">
Keyblock Confirmations
<hint-tooltip>
{{ transactionDetailsHints.blockConfirmations }}
</hint-tooltip>
</th>
<td class="transaction-general-panel__data">
{{ transactionDetails.confirmations }}
Expand All @@ -38,6 +44,9 @@
<tr class="transaction-general-panel__row">
<th class="transaction-general-panel__table-header">
Status
<hint-tooltip>
{{ transactionDetailsHints.status }}
</hint-tooltip>
</th>
<td class="transaction-general-panel__data">
<app-chip
Expand All @@ -57,6 +66,9 @@
class="transaction-general-panel__row">
<th class="transaction-general-panel__table-header">
Microblock Hash
<hint-tooltip>
{{ transactionDetailsHints.microblockHash }}
</hint-tooltip>
</th>
<td class="transaction-general-panel__data">
<span class="transaction-general-panel__hash">
Expand All @@ -72,6 +84,9 @@
class="transaction-general-panel__row">
<th class="transaction-general-panel__table-header">
Time
<hint-tooltip>
{{ transactionDetailsHints.time }}
</hint-tooltip>
</th>
<td class="transaction-general-panel__data">
<datetime-label :datetime="transactionDetails.created"/>
Expand All @@ -80,6 +95,9 @@
<tr class="transaction-general-panel__row">
<th class="transaction-general-panel__table-header">
Fee
<hint-tooltip>
{{ transactionDetailsHints.fee }}
</hint-tooltip>
</th>
<td class="transaction-general-panel__data">
{{ formatAePrice(formatAettosToAe(transactionDetails.fee), null) }}
Expand All @@ -88,6 +106,9 @@
<tr class="transaction-general-panel__row">
<th class="transaction-general-panel__table-header">
Nonce
<hint-tooltip>
{{ transactionDetailsHints.nonce }}
</hint-tooltip>
</th>
<td class="transaction-general-panel__data">
{{ transactionDetails.nonce }}
Expand All @@ -96,6 +117,9 @@
<tr class="transaction-general-panel__row">
<th class="transaction-general-panel__table-header">
API links
<hint-tooltip>
{{ transactionDetailsHints.apiLinks }}
</hint-tooltip>
</th>
<td class="transaction-general-panel__data">
<div class="transaction-general-panel__container">
Expand Down Expand Up @@ -125,6 +149,7 @@
</template>

<script setup>
import { transactionDetailsHints } from '../utils/hints/transactionDetailHints'
import AppPanel from '@/components/AppPanel'
import AppChip from '@/components/AppChip'
import AppIcon from '@/components/AppIcon'
Expand Down
40 changes: 38 additions & 2 deletions src/components/TransactionTypeTableContractCallTx.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Status
<hint-tooltip>
{{ transactionDetailsHints.contractStatus }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
<transaction-type-status-label :status="transactionData.result"/>
Expand All @@ -12,6 +15,9 @@
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Smart Contract
<hint-tooltip>
{{ transactionDetailsHints.contractSmartContract }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
<app-link :to="`/contracts/${transactionData.contract_id}`">
Expand All @@ -22,6 +28,9 @@
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Caller
<hint-tooltip>
{{ transactionDetailsHints.contractCaller }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
<app-link :to="`/accounts/${transactionData.caller_id}`">
Expand All @@ -32,6 +41,9 @@
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Amount
<hint-tooltip>
{{ transactionDetailsHints.contractAmount }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
{{ formatAePrice(formatAettosToAe(transactionData.amount), null) }}
Expand All @@ -40,6 +52,9 @@
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Entry Point
<hint-tooltip>
{{ transactionDetailsHints.contractEntryPoint }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
<app-chip>
Expand All @@ -50,6 +65,9 @@
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Arguments
<hint-tooltip>
{{ transactionDetailsHints.contractArguments }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
{{ formatNullable(transactionData.arguments) }}
Expand All @@ -58,16 +76,26 @@
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Return
<hint-tooltip>
{{ transactionDetailsHints.contractReturn }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
{{ formatNullable(transactionData.return) }}
</td>
</tr>
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Gas Limit /
Gas Limit
<hint-tooltip>
{{ transactionDetailsHints.contractGasLimit }}
</hint-tooltip>
/
<wbr>
Gas Price
<hint-tooltip>
{{ transactionDetailsHints.contractGasPrice }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
{{ transactionData.gas }}
Expand All @@ -77,9 +105,16 @@
</tr>
<tr class="transaction-type-panel-contract-call-tx__row">
<th class="transaction-type-panel-contract-call-tx__table-header">
Gas Used /
Gas Used
<hint-tooltip>
{{ transactionDetailsHints.contractGasUsed }}
</hint-tooltip>
/
<wbr>
Gas Costs
<hint-tooltip>
{{ transactionDetailsHints.contractGasCost }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-call-tx__data">
{{ formatNullable(transactionData.gas_used) }}
Expand All @@ -96,6 +131,7 @@ import AppLink from '@/components/AppLink'
import TransactionTypeStatusLabel from '@/components/TransactionTypeStatusLabel'
import { formatAePrice, formatAettosToAe, formatNullable } from '@/utils/format'
import AppChip from '@/components/AppChip'
import { transactionDetailsHints } from '~/utils/hints/transactionDetailHints'
const props = defineProps({
transactionData: {
Expand Down
34 changes: 32 additions & 2 deletions src/components/TransactionTypeTableContractCreateTx.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<tr class="transaction-type-panel-contract-create-tx__row">
<th class="transaction-type-panel-contract-create-tx__table-header">
Status
<hint-tooltip>
{{ transactionDetailsHints.contractStatus }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-create-tx__data">
<transaction-type-status-label :status="transactionData.return_type"/>
Expand All @@ -12,6 +15,9 @@
<tr class="transaction-type-panel-contract-create-tx__row">
<th class="transaction-type-panel-contract-create-tx__table-header">
Smart Contract
<hint-tooltip>
{{ transactionDetailsHints.contractSmartContract }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-create-tx__data">
<app-link :to="`/contracts/${transactionData.contract_id}`">
Expand All @@ -22,6 +28,9 @@
<tr>
<th class="transaction-type-panel-contract-create-tx__table-header">
Creator
<hint-tooltip>
{{ transactionDetailsHints.contractCreator }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-create-tx__data">
<app-link :to="`/accounts/${transactionData.owner_id}`">
Expand All @@ -32,6 +41,9 @@
<tr class="transaction-type-panel-contract-create-tx__row">
<th class="transaction-type-panel-contract-create-tx__table-header">
Amount
<hint-tooltip>
{{ transactionDetailsHints.contractAmount }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-create-tx__data">
{{ formatAePrice(formatAettosToAe(transactionData.amount), null) }}
Expand All @@ -40,16 +52,26 @@
<tr class="transaction-type-panel-contract-create-tx__row">
<th class="transaction-type-panel-contract-create-tx__table-header">
Arguments
<hint-tooltip>
{{ transactionDetailsHints.contractArguments }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-create-tx__data">
{{ formatNullable(transactionData.args) }}
</td>
</tr>
<tr class="transaction-type-panel-contract-create-tx__row">
<th class="transaction-type-panel-contract-create-tx__table-header">
Gas Limit /
Gas Limit
<hint-tooltip>
{{ transactionDetailsHints.contractGasLimit }}
</hint-tooltip>
/
<wbr>
Gas Price
<hint-tooltip>
{{ transactionDetailsHints.contractGasPrice }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-create-tx__data">
{{ transactionData.gas }}
Expand All @@ -59,9 +81,16 @@
</tr>
<tr class="transaction-type-panel-contract-create-tx__row">
<th class="transaction-type-panel-contract-create-tx__table-header">
Gas Used /
Gas Used
<hint-tooltip>
{{ transactionDetailsHints.contractGasUsed }}
</hint-tooltip>
/
<wbr>
Gas Costs
<hint-tooltip>
{{ transactionDetailsHints.contractGasCost }}
</hint-tooltip>
</th>
<td class="transaction-type-panel-contract-create-tx__data">
{{ formatNullable(transactionData.gas_used) }}
Expand All @@ -77,6 +106,7 @@
import AppLink from '@/components/AppLink'
import TransactionTypeStatusLabel from '@/components/TransactionTypeStatusLabel'
import { formatAePrice, formatAettosToAe, formatNullable } from '@/utils/format'
import { transactionDetailsHints } from '@/utils/hints/transactionDetailHints'
const props = defineProps({
transactionData: {
Expand Down
1 change: 1 addition & 0 deletions src/utils/hints/transactionDetailHints.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const transactionDetailsHints = {
spendTxSenderPayload: 'Additional message attached to transaction.',
contractStatus: 'Status of the transaction',
contractSmartContract: 'Unique identifier for a smart contract instance that lives on the blockchain.',
contractCreator: 'Account that created the smart contract.',
contractCaller: 'Account that called the smart contract.',
contractAmount: 'Amount of AE coins that was transferred to smart contract address.',
contractEntryPoint: 'The entry point of the smart contract that has been called.',
Expand Down

0 comments on commit ffac685

Please sign in to comment.