diff --git a/components/bank/components/historyBox.tsx b/components/bank/components/historyBox.tsx index 408378a..189816c 100644 --- a/components/bank/components/historyBox.tsx +++ b/components/bank/components/historyBox.tsx @@ -1,13 +1,11 @@ -import React, { useMemo, useState, useEffect } from 'react'; +import React, { useState } from 'react'; import { TruncatedAddressWithCopy } from '@/components/react/addressCopy'; import TxInfoModal from '../modals/txInfo'; -import { shiftDigits, truncateString } from '@/utils'; +import { shiftDigits } from '@/utils'; import { BurnIcon, DenomImage, formatDenom, MintIcon } from '@/components'; import { HistoryTxType, useTokenFactoryDenomsMetadata } from '@/hooks'; import { ReceiveIcon, SendIcon } from '@/components/icons'; -import useIsMobile from '@/hooks/useIsMobile'; - interface Transaction { tx_type: HistoryTxType; from_address: string; diff --git a/hooks/useQueries.ts b/hooks/useQueries.ts index 054fab9..14cfa89 100644 --- a/hooks/useQueries.ts +++ b/hooks/useQueries.ts @@ -784,6 +784,11 @@ const transformTransactions = (tx: any, address: string) => { let messages: TransactionGroup[] = []; let memo = tx.data.tx.body.memo ? { memo: tx.data.tx.body.memo } : {}; + // Skip the transaction if it's not successful + if (tx.data.txResponse.code && tx.data.txResponse.code !== 0) { + return messages; + } + for (const message of tx.data.tx.body.messages) { if (message['@type'] === '/cosmos.group.v1.MsgSubmitProposal') { for (const nestedMessage of message.messages) { @@ -863,7 +868,6 @@ export const useGetFilteredTxAndSuccessfulProposals = ( const transactions = dataResponse.data .flatMap((tx: any) => transformTransactions(tx, address)) .filter((tx: any) => tx !== null) - // Add secondary JS sort .sort((a: any, b: any) => { // Sort by timestamp descending (newest first) const dateComparison =