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

Commit

Permalink
Add Backpack wallet name resolution to injected connector (#168)
Browse files Browse the repository at this point in the history
* Add injected Backpack wallet name resolution

* Create gorgeous-jeans-hope.md

* Update gorgeous-jeans-hope.md

---------

Co-authored-by: jxom <jakemoxey@gmail.com>
  • Loading branch information
ph101pp and jxom authored Mar 16, 2023
1 parent 1f452e7 commit a4d9083
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-jeans-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@wagmi/connectors': patch
---

Added Backpack wallet to injected connector flags.
1 change: 1 addition & 0 deletions packages/connectors/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type WatchAssetParams = {
type InjectedProviderFlags = {
isApexWallet?: true
isAvalanche?: true
isBackpack?: true
isBifrost?: true
isBitKeep?: true
isBitski?: true
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 @@ -15,6 +15,7 @@ describe.each([
ethereum: { isAvalanche: true, isMetaMask: true },
expected: 'Core Wallet',
},
{ ethereum: { isBackpack: true }, expected: 'Backpack' },
{ ethereum: { isBifrost: true }, expected: 'Bifrost Wallet' },
{ ethereum: { isBitKeep: true }, expected: 'BitKeep' },
{ ethereum: { isBitski: true }, expected: 'Bitski' },
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 @@ -6,6 +6,7 @@ export function getInjectedName(ethereum?: Ethereum) {
const getName = (provider: Ethereum) => {
if (provider.isApexWallet) return 'Apex Wallet'
if (provider.isAvalanche) return 'Core Wallet'
if (provider.isBackpack) return 'Backpack'
if (provider.isBifrost) return 'Bifrost Wallet'
if (provider.isBitKeep) return 'BitKeep'
if (provider.isBitski) return 'Bitski'
Expand Down

0 comments on commit a4d9083

Please sign in to comment.