Skip to content
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

[FEATURE] Update evm tx history API #417

Open
Peppermint1020 opened this issue Oct 14, 2024 · 6 comments · May be fixed by #553
Open

[FEATURE] Update evm tx history API #417

Peppermint1020 opened this issue Oct 14, 2024 · 6 comments · May be fixed by #553
Assignees

Comments

@Peppermint1020
Copy link
Collaborator

Peppermint1020 commented Oct 14, 2024

Description:

Currently, the EVM transaction history API uses the Cadence transaction history URL (https://www.flowscan.io/tx/[tx id]) for retrieving transaction details. We would like to update this for EVM accounts to use the Flow EVM explorer transaction URLs (https://evm.flowscan.io/tx/[tx id]), while keeping the existing URL format for Flow accounts unchanged.

Proposed Changes:

Update the transaction history API specifically for EVM accounts to use the Flow EVM explorer URL: https://evm.flowscan.io/tx/[tx id].
Do not change the transaction history API for Flow accounts; the URL format for Flow accounts should remain as https://www.flowscan.io/tx/[tx id].

Expected Behavior:

For EVM accounts, the transaction history API should return URLs in the format: https://evm.flowscan.io/tx/[tx id].
For Flow accounts, the transaction history API should continue returning URLs in the format: https://www.flowscan.io/tx/[tx id].
Both APIs should work independently for EVM and Flow accounts.

Use Case:

This update will ensure that EVM accounts are using the correct URL for viewing transaction details on the Flow EVM explorer, while Flow accounts continue using the legacy Cadence explorer URL.

Ref: Outblock/FRW#58

@Peppermint1020 Peppermint1020 converted this from a draft issue Oct 14, 2024
@lmcmz lmcmz assigned jeden and unassigned zhouxl Nov 5, 2024
@jeden
Copy link
Collaborator

jeden commented Nov 5, 2024

@Peppermint1020 @zhouxl specs needed here too

@lmcmz lmcmz changed the title Update evm tx history API [FEATURE] Update evm tx history API Nov 5, 2024
@Peppermint1020
Copy link
Collaborator Author

@Peppermint1020 @zhouxl specs needed here too

@jeden

Hi Antonio,

I’ve added the specs for this feature. Please have a look when you get a chance.

Thanks!

@jeden jeden moved this from Todo to In Progress in Flow Wallet Nov 6, 2024
@jeden
Copy link
Collaborator

jeden commented Nov 6, 2024

Thanks @Peppermint1020.
In the code I see that there are three URLs for the transaction flow scan:

case .testnet:
    return URL(string: "https://testnet.flowscan.io/tx/\(hex)")
case .mainnet:
    return URL(string: "https://flowscan.io/tx/\(hex)")
case .previewnet:
    return URL(string: "https://previewnet.flowscan.io/tx/\(hex)")

Should I apply the same update to the other two (testnet and previewnet)?
If yes, should they look like:

https://evm.testnet.flowscan.io/tx/[tx]
https://evm.previewnet.flowscan.io/tx/[tx]

or

https://testnet.evm.flowscan.io/tx/[tx]
https://previewnet.evm.flowscan.io/tx/[tx]

@Peppermint1020
Copy link
Collaborator Author

@jeden
Don't worry about Previewnet. It was used for the Flow mainnet upgrade, and it has already been removed.

@caosbad cao
Could you provide API end point for testnet evm account there?

@jeden
Copy link
Collaborator

jeden commented Nov 20, 2024

@caosbad @zzggo I noticed there are some account detail URLs

string = "https://flowscan.org/account/\(self)"
string = "https://testnet.flowscan.org/account/\(self)"
string = "https://previewnet.flowscan.org/account/\(self)"

Should these be updated too? I see in this commit, wallet.ts file, line 3132, that base URLs are updated, so I presume the URL updates also applies to the /account paths.

Update: I've just noticed that their first-level domains are different (.io vs .org), so I presume they are handled differently, hence accounts should NOT be affected by this ticket.

jeden added a commit that referenced this issue Nov 21, 2024
@jeden jeden linked a pull request Nov 21, 2024 that will close this issue
@jeden jeden linked a pull request Nov 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Review
Development

Successfully merging a pull request may close this issue.

4 participants