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

Commit 46ce815

Browse files
feature: inject(onekey wallet) (#493)
* feature: inject(onekey wallet) * chore: perfect changesets
1 parent c86795f commit 46ce815

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

.changeset/green-berries-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@wagmi/connectors": patch
3+
---
4+
5+
Added OneKey Wallet to injected connector flags.

packages/connectors/src/metaMask.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class MetaMaskConnector extends InjectedConnector {
5757
if (ethereum.isOkxWallet || ethereum.isOKExWallet) return
5858
if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
5959
return
60+
if (ethereum.isOneKey) return
6061
if (ethereum.isOpera) return
6162
if (ethereum.isPortal) return
6263
if (ethereum.isRabby) return

packages/connectors/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type InjectedProviderFlags = {
4040
isOKExWallet?: true
4141
isOneInchAndroidWallet?: true
4242
isOneInchIOSWallet?: true
43+
isOneKey?: true
4344
isOpera?: true
4445
isPhantom?: true
4546
isPortal?: true

packages/connectors/src/utils/getInjectedName.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ describe.each([
5151
{ ethereum: { isNovaWallet: true }, expected: 'Nova Wallet' },
5252
{ ethereum: { isOneInchIOSWallet: true }, expected: '1inch Wallet' },
5353
{ ethereum: { isOneInchAndroidWallet: true }, expected: '1inch Wallet' },
54+
{ ethereum: { isOneKey: true }, expected: 'OneKey Wallet' },
5455
{ ethereum: { isPhantom: true }, expected: 'Phantom' },
5556
{ ethereum: { isPhantom: true, isMetaMask: true }, expected: 'Phantom' },
5657
{ ethereum: { isPortal: true }, expected: 'Ripio Portal' },

packages/connectors/src/utils/getInjectedName.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export function getInjectedName(ethereum?: WindowProvider) {
3333
if (provider.isOkxWallet || provider.isOKExWallet) return 'OKX Wallet'
3434
if (provider.isOneInchIOSWallet || provider.isOneInchAndroidWallet)
3535
return '1inch Wallet'
36+
if (provider.isOneKey) return 'OneKey Wallet'
3637
if (provider.isOpera) return 'Opera'
3738
if (provider.isPhantom) return 'Phantom'
3839
if (provider.isPortal) return 'Ripio Portal'

0 commit comments

Comments
 (0)