diff --git a/packages/injected/package.json b/packages/injected/package.json index 2a1907a47..266a20c35 100644 --- a/packages/injected/package.json +++ b/packages/injected/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/injected-wallets", - "version": "2.5.0-alpha.3", + "version": "2.5.0-alpha.4", "description": "Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", diff --git a/packages/injected/src/icons/frontier.ts b/packages/injected/src/icons/frontier.ts new file mode 100644 index 000000000..d4856d122 --- /dev/null +++ b/packages/injected/src/icons/frontier.ts @@ -0,0 +1,4 @@ +export default ` + + +` diff --git a/packages/injected/src/types.ts b/packages/injected/src/types.ts index 81dde19ec..41e1a216e 100644 --- a/packages/injected/src/types.ts +++ b/packages/injected/src/types.ts @@ -22,6 +22,7 @@ export enum ProviderIdentityFlag { Detected = 'request', Dcent = 'isDcentWallet', Exodus = 'isExodus', + Frontier = 'isFrontier', Frame = 'isFrame', HuobiWallet = 'isHbWallet', HyperPay = 'isHyperPay', @@ -67,6 +68,7 @@ export enum ProviderLabel { Detected = 'Detected Wallet', Exodus = 'Exodus', Frame = 'Frame', + Frontier = 'Frontier', HuobiWallet = 'Huobi Wallet', HyperPay = 'HyperPay', ImToken = 'imToken', @@ -119,6 +121,7 @@ export enum InjectedNameSpace { Bitski = 'Bitski', Enkrypt = 'enkrypt', Zeal = 'zeal', + Frontier = 'frontier', Phantom = 'phantom' } @@ -145,6 +148,9 @@ export interface CustomWindow extends Window { ethereum: InjectedProvider } } + frontier: { + ethereum: InjectedProvider + } phantom: { ethereum: InjectedProvider } diff --git a/packages/injected/src/wallets.ts b/packages/injected/src/wallets.ts index 8c7a0f147..0f8ea2c6d 100644 --- a/packages/injected/src/wallets.ts +++ b/packages/injected/src/wallets.ts @@ -74,6 +74,18 @@ const exodus: InjectedWalletModule = { platforms: ['all'] } +const frontier: InjectedWalletModule = { + label: ProviderLabel.Frontier, + injectedNamespace: InjectedNameSpace.Frontier, + checkProviderIdentity: ({ provider }) => + !!provider && !!provider[ProviderIdentityFlag.Frontier], + getIcon: async () => (await import('./icons/frontier.js')).default, + getInterface: async () => ({ + provider: createEIP1193Provider(window.frontier.ethereum) + }), + platforms: ['all'] +} + const brave: InjectedWalletModule = { label: ProviderLabel.Brave, injectedNamespace: InjectedNameSpace.Ethereum, @@ -656,6 +668,7 @@ const phantom: InjectedWalletModule = { const wallets = [ zeal, exodus, + frontier, metamask, binance, coinbase,