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

Commit

Permalink
feature: inject(onekey wallet) (#493)
Browse files Browse the repository at this point in the history
* feature: inject(onekey wallet)

* chore: perfect changesets
  • Loading branch information
ByteZhang1024 committed Aug 31, 2023
1 parent c86795f commit 46ce815
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-berries-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/connectors": patch
---

Added OneKey Wallet to injected connector flags.
1 change: 1 addition & 0 deletions packages/connectors/src/metaMask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class MetaMaskConnector extends InjectedConnector {
if (ethereum.isOkxWallet || ethereum.isOKExWallet) return
if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
return
if (ethereum.isOneKey) return
if (ethereum.isOpera) return
if (ethereum.isPortal) return
if (ethereum.isRabby) return
Expand Down
1 change: 1 addition & 0 deletions packages/connectors/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type InjectedProviderFlags = {
isOKExWallet?: true
isOneInchAndroidWallet?: true
isOneInchIOSWallet?: true
isOneKey?: true
isOpera?: true
isPhantom?: true
isPortal?: 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 @@ -51,6 +51,7 @@ describe.each([
{ ethereum: { isNovaWallet: true }, expected: 'Nova Wallet' },
{ ethereum: { isOneInchIOSWallet: true }, expected: '1inch Wallet' },
{ ethereum: { isOneInchAndroidWallet: true }, expected: '1inch Wallet' },
{ ethereum: { isOneKey: true }, expected: 'OneKey Wallet' },
{ ethereum: { isPhantom: true }, expected: 'Phantom' },
{ ethereum: { isPhantom: true, isMetaMask: true }, expected: 'Phantom' },
{ ethereum: { isPortal: true }, expected: 'Ripio Portal' },
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 @@ -33,6 +33,7 @@ export function getInjectedName(ethereum?: WindowProvider) {
if (provider.isOkxWallet || provider.isOKExWallet) return 'OKX Wallet'
if (provider.isOneInchIOSWallet || provider.isOneInchAndroidWallet)
return '1inch Wallet'
if (provider.isOneKey) return 'OneKey Wallet'
if (provider.isOpera) return 'Opera'
if (provider.isPhantom) return 'Phantom'
if (provider.isPortal) return 'Ripio Portal'
Expand Down

0 comments on commit 46ce815

Please sign in to comment.