Skip to content

Commit

Permalink
Add Coinbase Wallet connector (DefiLlama#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
taycaldwell authored Aug 29, 2022
1 parent 9d8ca20 commit 283c6f2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ function Header(props) {

const renderProviderLogo = () => {
const providerLogoList = {
"Coinbase Wallet": "coinbase",
"Brave Wallet": "bravewallet",
Metamask: "metamask",
imToken: "imtoken",
Expand Down
4 changes: 4 additions & 0 deletions public/connectors/coinbaseWalletIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"add-to-metamask": "Add to Metamask",
"add-to-imToken": "Add to imToken",
"add-to-wallet": "Add to Wallet",
"add-to-brave": "Add to Brave"
"add-to-brave": "Add to Brave",
"add-to-coinbase": "Add to Coinbase Wallet"
}
}
4 changes: 3 additions & 1 deletion utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function bnDec(decimals) {

export function getProvider() {
if (typeof window !== "undefined" && typeof window.ethereum !== "undefined") {
if (window.ethereum.isCoinbaseWallet || window.ethereum.selectedProvider?.isCoinbaseWallet) return "Coinbase Wallet";
if (window.ethereum.isBraveWallet) return "Brave Wallet";
if (window.ethereum.isMetaMask) return "Metamask";
if (window.ethereum.isImToken) return "imToken";
Expand Down Expand Up @@ -86,7 +87,8 @@ export const renderProviderText = (account) => {
Metamask: "add-to-metamask",
imToken: "add-to-imToken",
Wallet: "add-to-wallet",
"Brave Wallet": "add-to-brave"
"Brave Wallet": "add-to-brave",
"Coinbase Wallet": "add-to-coinbase"
};
return providerTextList[getProvider()];
} else {
Expand Down

0 comments on commit 283c6f2

Please sign in to comment.