diff --git a/packages/connectors/src/metaMask.ts b/packages/connectors/src/metaMask.ts index a494b47a..206efc19 100644 --- a/packages/connectors/src/metaMask.ts +++ b/packages/connectors/src/metaMask.ts @@ -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 diff --git a/packages/connectors/src/types.ts b/packages/connectors/src/types.ts index e8e16973..6d52f3bd 100644 --- a/packages/connectors/src/types.ts +++ b/packages/connectors/src/types.ts @@ -40,6 +40,7 @@ type InjectedProviderFlags = { isOKExWallet?: true isOneInchAndroidWallet?: true isOneInchIOSWallet?: true + isOneKey?: true isOpera?: true isPhantom?: true isPortal?: true diff --git a/packages/connectors/src/utils/getInjectedName.test.ts b/packages/connectors/src/utils/getInjectedName.test.ts index a2588b4d..25206e17 100644 --- a/packages/connectors/src/utils/getInjectedName.test.ts +++ b/packages/connectors/src/utils/getInjectedName.test.ts @@ -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' }, diff --git a/packages/connectors/src/utils/getInjectedName.ts b/packages/connectors/src/utils/getInjectedName.ts index eea7a4d8..1c7ccf52 100644 --- a/packages/connectors/src/utils/getInjectedName.ts +++ b/packages/connectors/src/utils/getInjectedName.ts @@ -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'