From 3c3df21169b78c56a35decaf5e60ac307733460c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viterbo=20Rodr=C3=ADguez?= Date: Mon, 29 Apr 2024 11:05:44 -0300 Subject: [PATCH 01/12] saving wip - tinternal trx flat --- .../InternalTransactionFlatTable.vue | 442 ++++++++++++++++++ src/components/InternalTransactionTable.vue | 2 +- src/pages/AccountPage.vue | 16 +- src/store/general/actions.js | 11 + src/store/general/getters.js | 1 + src/store/general/mutations.js | 4 + src/store/general/state.js | 1 + 7 files changed, 475 insertions(+), 2 deletions(-) create mode 100644 src/components/InternalTransactionFlatTable.vue diff --git a/src/components/InternalTransactionFlatTable.vue b/src/components/InternalTransactionFlatTable.vue new file mode 100644 index 00000000..9c765bf9 --- /dev/null +++ b/src/components/InternalTransactionFlatTable.vue @@ -0,0 +1,442 @@ + + + + diff --git a/src/components/InternalTransactionTable.vue b/src/components/InternalTransactionTable.vue index 8a992698..4e16c2ee 100644 --- a/src/components/InternalTransactionTable.vue +++ b/src/components/InternalTransactionTable.vue @@ -187,7 +187,7 @@ export default { '/transaction/' + transaction.hash + '/internal?limit=1000&sort=ASC&offset=0&includeAbi=1', ); for(const trace of [...traces.data.results]){ - trace.hash = trace.transaction_hash; + trace.hash = trace.transactionHash; } transaction.traces = traces.data?.results; transaction.contract = contract; diff --git a/src/pages/AccountPage.vue b/src/pages/AccountPage.vue index a0faba1b..ee6da841 100644 --- a/src/pages/AccountPage.vue +++ b/src/pages/AccountPage.vue @@ -14,6 +14,7 @@ import { Token } from 'src/types/Token'; import TransactionTable from 'components/TransactionTable.vue'; import InternalTransactionTable from 'components/InternalTransactionTable.vue'; +import InternalTransactionFlatTable from 'components/InternalTransactionFlatTable.vue'; import NftTransfersTable from 'components/NftTransfersTable.vue'; import TokenList from 'components/Token/TokenList.vue'; import ApprovalList from 'components/Token/ApprovalList.vue'; @@ -44,6 +45,7 @@ const nonce = ref(null); const contract = ref(null); const tab = ref(tabs[0]); const initialLoadComplete = ref(false); +const useInternalTransactionsFlat = ref(true); const accountAddress = computed(() => route.params.address as string ?? ''); const isLoggedIn = computed(() => store.getters['login/isLoggedIn']); @@ -312,7 +314,19 @@ async function loadAccount() { - + + + + + + + + + -import { ref, watch, onMounted } from 'vue'; +import { ref, watch, onMounted, computed } from 'vue'; import { contractManager } from 'src/boot/telosApi'; import { getIcon } from 'src/lib/token-utils'; import { toChecksumAddress } from 'src/lib/utils'; import CopyButton from 'components/CopyButton.vue'; +import { useStore } from 'vuex'; const props = defineProps({ - highlightAddress: { - type: String, - required: false, - default: '', - }, address: { type: String, required: true, @@ -38,9 +34,12 @@ const props = defineProps({ type: Boolean, default: false, }, + useHighlight: { + type: Boolean, + default: true, + }, }); -const emit = defineEmits(['highlight']); const displayName = ref(''); const fullName = ref(toChecksumAddress(props.address)); @@ -60,7 +59,9 @@ const restart = async () => { await getDisplay(); }; - +const $store = useStore(); +const setHighlightAddress = (method: string) => props.useHighlight ? $store.dispatch('general/setHighlightAddress', method) : null; +const highlightAddress = computed(() => props.useHighlight ? $store.state.general.highlightAddress : ''); watch(() => props.address, async () => { restart(); @@ -124,18 +125,14 @@ const loadContract = async () => { } }; -function emitHighlight(val: string) { - emit('highlight', val); -} -