Skip to content

fix: chainbase price chain id#8974

Merged
guanbinrui merged 3 commits intodevelopfrom
sentry-report-chainbase-price-chain-id-error
Mar 7, 2023
Merged

fix: chainbase price chain id#8974
guanbinrui merged 3 commits intodevelopfrom
sentry-report-chainbase-price-chain-id-error

Conversation

@hanszhoou
Copy link
Copy Markdown
Contributor

Description

https://mask.atlassian.net/browse/MF-3609

Closes # (NO_ISSUE)

Type of change

  • Documentation
  • Code refactoring (Restructuring existing code w/o changing its observable behavior)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (a fix or feature that would make something no longer possible to do/require old user must upgrade their Mask Network to this new version)

Previews

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
    • I have removed all in development console.logs
    • I have removed all commented code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have read Internationalization Guide and moved text fields to the i18n JSON file.

If this PR depends on external APIs:

  • I have configured those APIs with CORS headers to let extension requests get passed.
    • chrome extension: chrome-extension://[id]
    • firefox extension: moz-extension://[id]
  • I have delegated all web requests to the background service via the internal RPC bridge.

@hanszhoou hanszhoou added this to the 2.19.0 milestone Mar 7, 2023
if (isNativeTokenAddress(address) || !isValidAddress(address)) return undefined
const data = await fetchFromChainbase<FT_Price>(
urlcat('/v1/token/price', { chain_id: chainId, contract_address: address }),
urlcat('/v1/token/price', { chain_id: ChainId.Mainnet, contract_address: address }),
Copy link
Copy Markdown
Contributor Author

@hanszhoou hanszhoou Mar 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solana token price is from coingeko, chainbase is evm only.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's correct. The address could be from other EVM chains that don't exist on Mainnet and fail the API.

@github-actions github-actions bot temporarily deployed to pull request March 7, 2023 06:32 Inactive
@hanszhoou hanszhoou changed the title fix: sentry chainbase price chain id fix: chainbase price chain id Mar 7, 2023
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 7, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b6dc236
Status: ✅  Deploy successful!
Preview URL: https://c5da8c53.maskbook.pages.dev
Branch Preview URL: https://sentry-report-chainbase-pric.maskbook.pages.dev

View logs

@github-actions github-actions bot temporarily deployed to pull request March 7, 2023 07:22 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 7, 2023 07:27 Inactive
@guanbinrui guanbinrui merged commit ac515cb into develop Mar 7, 2023
@guanbinrui guanbinrui deleted the sentry-report-chainbase-price-chain-id-error branch March 7, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants