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
Activity details loading #1519
Activity details loading #1519
Conversation
Here's the packed extension for this build: |
@@ -52,6 +51,14 @@ export const fetchTransaction = async ({ | |||
currency: SupportedCurrencyKey; | |||
chainId: ChainId; | |||
}) => { | |||
if (!SUPPORTED_CHAIN_IDS.includes(chainId)) { |
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.
did you find any case where we pass unsopperted chainids?
all of the instances are using chains coming from useBackendSupportedChains hook like this https://github.com/rainbow-me/browser-extension/blob/master/src/entries/popup/hooks/useTransactionListForPendingTxs.ts#L32 or from that constant https://github.com/rainbow-me/browser-extension/blob/master/src/entries/popup/pages/home/Approvals/Approvals.tsx#L342
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 consolidated the other hooks into useTransaction
(from outside this file everything works the same) to handle the transaction metadata no matter where that data is coming from
so I check if it's supported by the backend in the this fetch to decide if it's gonna fetch from our api ou the provider
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.
okok it makes sense
}; | ||
} | ||
|
||
const type = await guessTransactionType(provider, transaction); |
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.
why await?
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.
Im fetching data from the provider to guess the type
like transaction.to
has code (provider.getCode
) means it's probably a transaction interacting with a contract
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.
hmm idk whats the expected behavior on smart wallets
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.
oh wow i missed the getCode
part, nvmm
return getCustomNetworkTransactions({ address }).find( | ||
(tx) => tx.hash === hash && tx.chainId === chainId, | ||
); | ||
}, |
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 don't follow why this is mixing txs supported by backend and the ones from customNetworkTransactionsStore
, there are separate stores and we're using them separately
Here's the packed extension for this build: |
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.
lgtm 🚀
Here's the packed extension for this build: |
Fixes BX-####
Figma link (if any):
What changed (plus any additional context for devs)
testnetMode
from the consolidatedTransactionsQueryKey as it was not used in the query itself and I didn't find a reason to have it in the query key lmk if Im mistakenuseTransaction
hook, aggregated into a single useQuery for either supported or unsupported BE networks and added some more info we could find when fetching the tx data from the providerScreen recordings / screenshots
What to test