-
Notifications
You must be signed in to change notification settings - Fork 395
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
Binance Smart Chain support #2659
Merged
Merged
Changes from 9 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
5754ab6
Add feature flag for Binance Smart Chain
05f96a0
Add Binance Smart Chain constants
2aa6920
Add Binance Smart Chain to the list of protocols in the top menu
57a4b74
Rename icons for Binance Smart Chain
8ac10df
Add icon for BNB coin
797869e
Add Binance Smart Chain to supported networks
599a9b2
Merge branch 'main' into add-binance-smart-chain
2f9191d
Rename title for Binance Smart Chain scan website
fdfb95f
Fix the issue for getting gas prices for Binance Smart Chain
7a7c9f2
Add a token token list for BSC
cc25336
Merge branch 'main' into add-binance-smart-chain
379717c
Update coin type for BNB
a7cb97b
Merge branch 'main' into add-binance-smart-chain
16da743
Add network chart color for Binance Smart Chain
07fe5ba
Fix the issue with displaying the asset amount for BSC
fe6c8c5
Fix the issue with displaying the asset amount for BSC for overview page
9265b9c
Merge branch 'main' into add-binance-smart-chain
1476c03
Merge branch 'main' into add-binance-smart-chain
3bf8cb0
Merge branch 'main' into add-binance-smart-chain
a508ad8
Delete unnecessary comment
65db03a
Merge branch 'main' into add-binance-smart-chain
1304ccb
Merge branch 'main' into add-binance-smart-chain
5f1bb26
Refactor for updating combined data function
8ed47c9
Merge branch 'main' into add-binance-smart-chain
695715a
Rename title for BSC scan website
f3673b0
Merge branch 'main' into add-binance-smart-chain
7cb4384
Merge branch 'main' of github.com:tallycash/extension into add-binanc…
d40bd51
Merge branch 'main' of github.com:tallycash/extension into add-binanc…
017c09e
Refactor for update combined data function
45a2a1f
Add a new RPC url for BSC
6cd98f5
Rename BNB Smart Chain to BNB Chain
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { EVMNetwork, Network } from "../networks" | ||
import { AVAX, BTC, ETH, MATIC, OPTIMISTIC_ETH, RBTC } from "./currencies" | ||
import { AVAX, BNB, BTC, ETH, MATIC, OPTIMISTIC_ETH, RBTC } from "./currencies" | ||
|
||
export const ETHEREUM: EVMNetwork = { | ||
name: "Ethereum", | ||
|
@@ -41,6 +41,14 @@ export const AVALANCHE: EVMNetwork = { | |
coingeckoPlatformID: "avalanche", | ||
} | ||
|
||
export const BINANCE_SMART_CHAIN: EVMNetwork = { | ||
name: "BNB Smart Chain", | ||
baseAsset: BNB, | ||
chainID: "56", | ||
family: "EVM", | ||
coingeckoPlatformID: "binance-smart-chain", | ||
} | ||
|
||
export const OPTIMISM: EVMNetwork = { | ||
name: "Optimism", | ||
baseAsset: OPTIMISTIC_ETH, | ||
|
@@ -77,7 +85,9 @@ export const EIP_1559_COMPLIANT_CHAIN_IDS = new Set( | |
) | ||
|
||
export const CHAINS_WITH_MEMPOOL = new Set( | ||
[ETHEREUM, POLYGON, AVALANCHE, GOERLI].map((network) => network.chainID) | ||
[ETHEREUM, POLYGON, AVALANCHE, GOERLI, BINANCE_SMART_CHAIN].map( | ||
(network) => network.chainID | ||
) | ||
) | ||
|
||
export const NETWORK_BY_CHAIN_ID = { | ||
|
@@ -87,6 +97,7 @@ export const NETWORK_BY_CHAIN_ID = { | |
[ARBITRUM_ONE.chainID]: ARBITRUM_ONE, | ||
[AVALANCHE.chainID]: AVALANCHE, | ||
[OPTIMISM.chainID]: OPTIMISM, | ||
[BINANCE_SMART_CHAIN.chainID]: BINANCE_SMART_CHAIN, | ||
[GOERLI.chainID]: GOERLI, | ||
[FORK.chainID]: FORK, | ||
} | ||
|
@@ -106,6 +117,7 @@ export const CHAIN_ID_TO_NFT_METADATA_PROVIDER: { | |
[OPTIMISM.chainID]: ["simplehash"], | ||
[ARBITRUM_ONE.chainID]: ["simplehash"], | ||
[AVALANCHE.chainID]: ["simplehash"], | ||
[BINANCE_SMART_CHAIN.chainID]: ["simplehash"], | ||
} | ||
|
||
export const NETWORKS_SUPPORTING_NFTS = new Set( | ||
|
@@ -123,6 +135,7 @@ export const CHAIN_ID_TO_0X_API_BASE: { | |
[GOERLI.chainID]: "goerli.api.0x.org", | ||
[ARBITRUM_ONE.chainID]: "arbitrum.api.0x.org", | ||
[AVALANCHE.chainID]: "avalanche.api.0x.org", | ||
[BINANCE_SMART_CHAIN.chainID]: "bsc.api.0x.org", | ||
} | ||
|
||
export const NETWORKS_SUPPORTING_SWAPS = new Set( | ||
|
@@ -151,4 +164,5 @@ export const CHAIN_ID_TO_RPC_URLS: { | |
], | ||
[GOERLI.chainID]: ["https://ethereum-goerli-rpc.allthatnode.com"], | ||
[AVALANCHE.chainID]: ["https://api.avax.network/ext/bc/C/rpc"], | ||
[BINANCE_SMART_CHAIN.chainID]: ["https://rpc.ankr.com/bsc"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add the official one as well |
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,7 @@ | ||||||
import { | ||||||
ARBITRUM_ONE, | ||||||
AVALANCHE, | ||||||
BINANCE_SMART_CHAIN, | ||||||
ETHEREUM, | ||||||
GOERLI, | ||||||
OPTIMISM, | ||||||
|
@@ -23,6 +24,10 @@ export const scanWebsite = { | |||||
[GOERLI.chainID]: { title: "Etherscan", url: "https://goerli.etherscan.io/" }, | ||||||
[ARBITRUM_ONE.chainID]: { title: "Arbiscan", url: "https://arbiscan.io/" }, | ||||||
[AVALANCHE.chainID]: { title: "Snowtrace", url: "https://snowtrace.io/" }, | ||||||
[BINANCE_SMART_CHAIN.chainID]: { | ||||||
title: "Bscscan", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
url: "https://bscscan.com", | ||||||
}, | ||||||
} | ||||||
|
||||||
export const ESTIMATED_SPEED_IN_READABLE_FORMAT_RELATIVE_TO_CONFIDENCE_LEVEL: { | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Love to see this list expand :)