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

feat: add custom name mapping Infinity Wallet #490

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/connectors/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { ConnectorData } from './base'

type InjectedProviderFlags = {
isInfinityWallet?: true
Copy link
Member

Choose a reason for hiding this comment

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

alphabetize

isApexWallet?: true
isAvalanche?: true
isBackpack?: 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 @@ -5,6 +5,7 @@ import { getInjectedName } from './getInjectedName'

describe.each([
{ ethereum: undefined, expected: 'Injected' },
{ ethereum: { isInfinityWallet: true }, expected: 'Infinity Wallet' },
Copy link
Member

Choose a reason for hiding this comment

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

alphabetize

{ ethereum: { isApexWallet: true }, expected: 'Apex Wallet' },
{
ethereum: { isApexWallet: true, isMetaMask: true },
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 @@ -4,6 +4,7 @@ export function getInjectedName(ethereum?: WindowProvider) {
if (!ethereum) return 'Injected'

const getName = (provider: WindowProvider) => {
if (provider.isInfinityWallet) return 'Infinity Wallet'
Copy link
Member

Choose a reason for hiding this comment

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

alphabetize

if (provider.isApexWallet) return 'Apex Wallet'
if (provider.isAvalanche) return 'Core Wallet'
if (provider.isBackpack) return 'Backpack'
Expand Down
Loading