Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
feat: add fordefi name mapping (#417)
Browse files Browse the repository at this point in the history
* feat(connectors): add fordefi detection

* Update wise-pens-brake.md

* Fix alphabetical order

* cr fixes

* Update metaMask.ts

---------

Co-authored-by: jxom <[email protected]>
  • Loading branch information
rony-arnac and jxom authored Jul 24, 2023
1 parent baf3143 commit e089d7d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wise-pens-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/connectors": patch
---

Added Fordefi Wallet name mapping.
1 change: 1 addition & 0 deletions packages/connectors/src/metaMask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class MetaMaskConnector extends InjectedConnector {
if (ethereum.isAvalanche) return
if (ethereum.isBitKeep) return
if (ethereum.isBlockWallet) return
if (ethereum.isFordefi) return
if (ethereum.isMathWallet) return
if (ethereum.isOkxWallet || ethereum.isOKExWallet) return
if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
Expand Down
3 changes: 2 additions & 1 deletion packages/connectors/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ type InjectedProviderFlags = {
isDesig?: true
isEnkrypt?: true
isExodus?: true
isFordefi?: true
isFrame?: true
isFrontier?: true
isGamestop?: true
isHaloWallet?: true
isHaqqWallet?: true
isHyperPay?: true
isImToken?: true
Expand All @@ -52,7 +54,6 @@ type InjectedProviderFlags = {
isTTWallet?: true
isXDEFI?: true
isZerion?: true
isHaloWallet?: true
}

type InjectedProviders = InjectedProviderFlags & {
Expand Down
1 change: 1 addition & 0 deletions packages/connectors/src/utils/getInjectedName.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe.each([
{ ethereum: { isDesig: true }, expected: 'Desig Wallet' },
{ ethereum: { isEnkrypt: true }, expected: 'Enkrypt' },
{ ethereum: { isExodus: true }, expected: 'Exodus' },
{ ethereum: { isFordefi: true }, expected: 'Fordefi' },
{ ethereum: { isFrame: true }, expected: 'Frame' },
{ ethereum: { isFrontier: true }, expected: 'Frontier Wallet' },
{ ethereum: { isGamestop: true }, expected: 'GameStop Wallet' },
Expand Down
1 change: 1 addition & 0 deletions packages/connectors/src/utils/getInjectedName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function getInjectedName(ethereum?: WindowProvider) {
if (provider.isDesig) return 'Desig Wallet'
if (provider.isEnkrypt) return 'Enkrypt'
if (provider.isExodus) return 'Exodus'
if (provider.isFordefi) return 'Fordefi'
if (provider.isFrame) return 'Frame'
if (provider.isFrontier) return 'Frontier Wallet'
if (provider.isGamestop) return 'GameStop Wallet'
Expand Down

0 comments on commit e089d7d

Please sign in to comment.