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

feature: inject(onekey wallet) #493

Merged
merged 2 commits into from
Aug 31, 2023
Merged
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
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
Loading