-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fetch tx history sequentially #2141
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -241,101 +259,65 @@ function dedupeTransactions(txs: Transfer[]) { | |||
) | |||
} | |||
|
|||
async function getUpdatedPendingTransaction(tx: MergedTransaction) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved outside the hook because it's used by both sender and receiver fetchers
const { chain } = useNetwork() | ||
const [isTestnetMode] = useIsTestnetMode() | ||
const { isSmartContractWallet, isLoading: isLoadingAccountType } = | ||
useAccountType() | ||
|
||
// Check what type of CCTP (deposit, withdrawal or all) to fetch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CCTP moved to its own hook
useSWRImmutable<ChainPair[]>( | ||
address ? ['failed_chain_pairs', address] : null | ||
) | ||
const { data: erroredChains, mutate: addErroredChain } = useSWRImmutable< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erroredChains
are renamed from failedChainPairs
imo it's less of a mouthful
<div className="flex h-[28px] items-center space-x-2"> | ||
<FailedChainPairsTooltip failedChainPairs={failedChainPairs} /> | ||
<FailedChainPairsTooltip failedChainPairs={rawDataErroredChains} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the property is still called failedChainPairs
we should update it??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should split some hooks under a folder called /transactionHistoryHooks/
or split the hooks into several files
it's too chunky right now
closes FS-1054
The goal of these changes is to fetch sender transactions first, and once it's done and we display them we fetch receiver transactions.
Change log:
useTransactionHistory
updated to include individual data for sender and receiver, so we can track states (such as loading) for each of themuseTransactionHistoryWithoutStatuses
renamed touseRawTransactionHistory
useCctpTransactions
,useMappedSenderTransactionHistory
anduseMappedReceiverTransactionHistory
, all of which returnMergedTransaction[]
failedChainPairs
renamed torawDataErroredChains
getUpdatedPendingTransaction
moved outside the hook and is reused in different hooks