From 122711e4d67436670502f0b95a96a21750e05934 Mon Sep 17 00:00:00 2001 From: demogorgod Date: Tue, 24 Oct 2023 20:45:24 -0400 Subject: [PATCH 1/2] Push branch --- .../overview/components/BreakdownTable.vue | 806 ++++++++---------- .../ethereum/scripts/resources/ssv-network | 1 + .../oracle/scripts/resources/rockx-dkg-cli | 1 + 3 files changed, 348 insertions(+), 460 deletions(-) create mode 160000 contracts/ethereum/scripts/resources/ssv-network create mode 160000 services/oracle/scripts/resources/rockx-dkg-cli diff --git a/apps/web/src/pages/overview/components/BreakdownTable.vue b/apps/web/src/pages/overview/components/BreakdownTable.vue index e1a18d1df..500d91736 100644 --- a/apps/web/src/pages/overview/components/BreakdownTable.vue +++ b/apps/web/src/pages/overview/components/BreakdownTable.vue @@ -57,25 +57,33 @@ const tableHeaderOptions = ref( value: 'blank_column' }, { - title: 'Date', - value: 'date' + title: 'Hash', + value: 'tx_hash' }, { title: 'Type', value: 'tx_type' }, + { + title: 'Date', + value: 'date' + }, { title: 'Amount', value: 'stk_amt' }, { - title: 'Status', - value: 'status' + title: 'Price', + value: 'price' }, { - title: 'Hash', - value: 'tx_hash' - } + title: 'From', + value: 'from' + }, + { + title: 'To', + value: 'to' + }, ] }, Staking: { @@ -89,8 +97,8 @@ const tableHeaderOptions = ref( value: 'date' }, { - title: 'Account', - value: 'act' + title: 'Wallet Address', + value: 'wallet_address' }, { title: 'Type', @@ -101,8 +109,8 @@ const tableHeaderOptions = ref( value: 'amount' }, { - title: 'Staking Fees', - value: 'staking_fees' + title: 'Fees', + value: 'fees' }, { title: 'Status', @@ -117,12 +125,12 @@ const tableHeaderOptions = ref( } ) -const { user } = useUser() +const { user } = useUser() const tableData = ref({ - Wallets: [] as {tx_hash: string, wallet_provider: string, status: string, staking_fees: string, type: string, amount: string, bal: string, act: string, date: string, blank_column: any, stk_amt: string, tx_type: string, stk_rwd: string }[], - Transactions: [] as {tx_hash: string, wallet_provider: string, status: string, staking_fees: string, type: string, amount: string, bal: string, act: string, date: string, blank_column: any, stk_amt: string, tx_type: string, stk_rwd: string }[], - Staking: [] as {tx_hash: string, wallet_provider: string, status: string, staking_fees: string, type: string, amount: string, bal: string, act: string, date: string, blank_column: any, stk_amt: string, tx_type: string, stk_rwd: string }[], + Wallets: [] as { tx_hash: string, wallet_provider: string, status: string, staking_fees: string, type: string, amount: string, bal: string, act: string, date: string, blank_column: any, stk_amt: string, tx_type: string, stk_rwd: string }[], + Transactions: [] as { tx_hash: string, wallet_provider: string, status: string, staking_fees: string, type: string, amount: string, bal: string, act: string, date: string, blank_column: any, stk_amt: string, tx_type: string, stk_rwd: string }[], + Staking: [] as { tx_hash: string, wallet_provider: string, status: string, staking_fees: string, type: string, amount: string, bal: string, act: string, date: string, blank_column: any, stk_amt: string, tx_type: string, stk_rwd: string }[], }) const filteredData = ref(tableData.value[tableView.value as keyof typeof tableData.value]) @@ -130,33 +138,35 @@ const filteredData = ref(tableData.value[tableView.value as keyof typeof tableDa const filterData = () => { let filteredDataArray + filteredDataArray = tableData.value[tableView.value as keyof typeof tableData.value] if (searchInput.value === '') { filteredDataArray = tableData.value[tableView.value as keyof typeof tableData.value] } else { const searchTerm = searchInput.value.toLocaleLowerCase() filteredDataArray = (tableData.value[tableView.value as keyof typeof tableData.value] as Array).filter(item => { - return ( - // Might need to modify to match types each variable - // {tx_hash: string, wallet_provider: string, status: string, - // staking_fees: string, type: string, amount: string, bal: string, - // act: string, date: string, blank_column: any, stk_amt: string, - // tx_type: string, stk_rwd: string } - item.wallet_provider?.toString().toLocaleLowerCase().includes(searchTerm) || - item.act?.toString().toLocaleLowerCase().includes(searchTerm) || - item.bal?.toString().toLocaleLowerCase().includes(searchTerm) || - item.stk_amt?.toString().toLocaleLowerCase().includes(searchTerm) || - item.stk_rwd?.toString().toLocaleLowerCase().includes(searchTerm) || - item.tx_hash?.toString().toLocaleLowerCase().includes(searchTerm) || - item.date?.toString().toLocaleLowerCase().includes(searchTerm) || - item.apy?.toString().toLocaleLowerCase().includes(searchTerm) || - item.status?.toString().toLocaleLowerCase().includes(searchTerm) || - item.type?.toString().toLocaleLowerCase().includes(searchTerm) || - item.staking_fees?.toString().toLocaleLowerCase().includes(searchTerm) - ) + return true + // return ( + // Might need to modify to match types each variable + // {tx_hash: string, wallet_provider: string, status: string, + // staking_fees: string, type: string, amount: string, bal: string, + // act: string, date: string, blank_column: any, stk_amt: string, + // tx_type: string, stk_rwd: string } + // item.wallet_provider?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.act?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.bal?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.stk_amt?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.stk_rwd?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.tx_hash?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.date?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.apy?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.status?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.type?.toString().toLocaleLowerCase().includes(searchTerm) || + // item.staking_fees?.toString().toLocaleLowerCase().includes(searchTerm) + // ) }) } - if(selectedHeader.value !== '' && selectedOrientation.value !== '') { + if (selectedHeader.value !== '' && selectedOrientation.value !== '') { filteredDataArray = filteredDataArray.sort((a, b) => { const valA = a[selectedHeader.value] const valB = b[selectedHeader.value] @@ -175,7 +185,7 @@ const filterData = () => { filteredData.value = filteredDataArray.slice(start, end) as any } -watch([searchInput, tableView, selectedHeader, selectedOrientation, currentPage], ()=>{ +watch([searchInput, tableView, selectedHeader, selectedOrientation, currentPage], () => { filterData() }) @@ -228,7 +238,7 @@ const downloadFile = (content: any, filename: string, mimeType: any) => { const exportFile = () => { - const jsonData = checkedItems.value.length > 0? checkedItems.value : filteredData.value + const jsonData = checkedItems.value.length > 0 ? checkedItems.value : filteredData.value const isMac = navigator.userAgent.indexOf('Mac') !== -1 const fileExtension = isMac ? 'csv' : 'xlsx' @@ -242,19 +252,19 @@ const exportFile = () => { } } -const removeItemFromCheckedList = (item:any) => { +const removeItemFromCheckedList = (item: any) => { const index = checkedItems.value.indexOf(item) if (index > -1) { checkedItems.value.splice(index, 1) } } -const {rawUserAnalytics } = useAnalytics() +const { rawUserAnalytics } = useAnalytics() -const setTableData = () =>{ +const setTableData = () => { - if(!rawUserAnalytics.value) return + if (!rawUserAnalytics.value) return const sortedTransactions = rawUserAnalytics.value.sort((a: any, b: any) => { new Date(a.receivedAt).getTime() - new Date(b.receivedAt).getTime() @@ -262,30 +272,30 @@ const setTableData = () =>{ const newTable = tableData.value - newTable.Transactions = sortedTransactions.map((item: any) =>{ + newTable.Transactions = sortedTransactions.map((item: any) => { return { - tx_hash: item.txId, - stk_amt: item.amount, - tx_type: item.txDirection, - date: item.receivedAt, - status: item.status, + tx_hash: item.txId, + stk_amt: item.amount, + tx_type: item.txDirection, + date: item.receivedAt, + status: item.status, } }) let filteredWallets = [] as any let filteredStakingTransactions = [] as any sortedTransactions.forEach((item: any) => { - const index = filteredWallets.findIndex((i: any)=> i.act === item.walletAddress) + const index = filteredWallets.findIndex((i: any) => i.act === item.walletAddress) - if(index > -1) { - if(new Date(filteredWallets[index].date).getTime() < new Date(item.receivedAt).getTime()){ + if (index > -1) { + if (new Date(filteredWallets[index].date).getTime() < new Date(item.receivedAt).getTime()) { filteredWallets[index].bal === item.walletBalance } } else { let provider = user.value?.accounts.find(i => i.address.toLocaleLowerCase() === item.walletAddress.toLocaleLowerCase())?.walletProvider filteredWallets.push( { - wallet_provider: provider? provider : 'Unknown', + wallet_provider: provider ? provider : 'Unknown', act: item.walletAddress, bal: item.walletBalance, stk_amt: item.amount, @@ -294,7 +304,7 @@ const setTableData = () =>{ ) } - if(item.type){ + if (item.type) { filteredStakingTransactions.push({ date: item.receivedAt, act: item.walletAddress, @@ -314,22 +324,22 @@ const setTableData = () =>{ } const checkAll = ref(false) -watch(checkAll, () =>{ - filteredData.value.map(item =>{ - if(checkAll.value && !checkedItems.value.includes(item)){ +watch(checkAll, () => { + filteredData.value.map(item => { + if (checkAll.value && !checkedItems.value.includes(item)) { checkedItems.value.push(item) - }else if(!checkAll && checkedItems.value.includes(item)){ + } else if (!checkAll && checkedItems.value.includes(item)) { removeItemFromCheckedList(item) } }) }) -watch(rawUserAnalytics, () =>{ +watch(rawUserAnalytics, () => { setTableData() filterData() }) -onMounted(() =>{ +onMounted(() => { setTableData() filterData() }) @@ -339,8 +349,8 @@ onMounted(() =>{ @/composables/user \ No newline at end of file diff --git a/contracts/ethereum/scripts/resources/ssv-network b/contracts/ethereum/scripts/resources/ssv-network new file mode 160000 index 000000000..b8e03e7d2 --- /dev/null +++ b/contracts/ethereum/scripts/resources/ssv-network @@ -0,0 +1 @@ +Subproject commit b8e03e7d2edf28a4631e16489f00052ed42a7e74 diff --git a/services/oracle/scripts/resources/rockx-dkg-cli b/services/oracle/scripts/resources/rockx-dkg-cli new file mode 160000 index 000000000..171973247 --- /dev/null +++ b/services/oracle/scripts/resources/rockx-dkg-cli @@ -0,0 +1 @@ +Subproject commit 171973247f89caae74003c484c3913ecfd33e62e From 373cf5bdf68c2fdab78f23e8a22e37d2c65d4aa2 Mon Sep 17 00:00:00 2001 From: Christopher Cali Date: Thu, 26 Oct 2023 16:11:51 -0400 Subject: [PATCH 2/2] Delete old submodules --- contracts/ethereum/scripts/resources/ssv-network | 1 - services/oracle/scripts/resources/rockx-dkg-cli | 1 - 2 files changed, 2 deletions(-) delete mode 160000 contracts/ethereum/scripts/resources/ssv-network delete mode 160000 services/oracle/scripts/resources/rockx-dkg-cli diff --git a/contracts/ethereum/scripts/resources/ssv-network b/contracts/ethereum/scripts/resources/ssv-network deleted file mode 160000 index b8e03e7d2..000000000 --- a/contracts/ethereum/scripts/resources/ssv-network +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b8e03e7d2edf28a4631e16489f00052ed42a7e74 diff --git a/services/oracle/scripts/resources/rockx-dkg-cli b/services/oracle/scripts/resources/rockx-dkg-cli deleted file mode 160000 index 171973247..000000000 --- a/services/oracle/scripts/resources/rockx-dkg-cli +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 171973247f89caae74003c484c3913ecfd33e62e