Skip to content

Commit

Permalink
Add Frontier Wallet Package
Browse files Browse the repository at this point in the history
  • Loading branch information
punithbm committed Jan 10, 2023
1 parent 98a0820 commit b2feef8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/injected/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/injected/src/icons/frontier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default `<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 153.42 152.94">
<path d="M145.15,75.59v-58a9.29,9.29,0,0,0-9.3-9.28H77.65a2.24,2.24,0,0,1-1.56-.64l-7-7A2.24,2.24,0,0,0,67.48,0H9.31A9.29,9.29,0,0,0,0,9.27H0v58a2.16,2.16,0,0,0,.65,1.55l7,7a2.16,2.16,0,0,1,.65,1.55v58a9.29,9.29,0,0,0,9.3,9.28H75.8a2.24,2.24,0,0,1,1.56.64l7,7a2.24,2.24,0,0,0,1.56.64h58.19a9.29,9.29,0,0,0,9.31-9.27h0v-58a2.16,2.16,0,0,0-.65-1.55l-7-7A2.17,2.17,0,0,1,145.15,75.59Zm-32.3,38.55H40.65A1.68,1.68,0,0,1,39,112.47V40.53a1.68,1.68,0,0,1,1.67-1.67h72.18a1.68,1.68,0,0,1,1.67,1.67v71.94a1.68,1.68,0,0,1-1.67,1.67Z" transform="translate(0 0)"></path>
</svg>
`
6 changes: 6 additions & 0 deletions packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export enum ProviderIdentityFlag {
Detected = 'request',
Dcent = 'isDcentWallet',
Exodus = 'isExodus',
Frontier = 'isFrontier',
Frame = 'isFrame',
HuobiWallet = 'isHbWallet',
HyperPay = 'isHyperPay',
Expand Down Expand Up @@ -67,6 +68,7 @@ export enum ProviderLabel {
Detected = 'Detected Wallet',
Exodus = 'Exodus',
Frame = 'Frame',
Frontier = 'Frontier',
HuobiWallet = 'Huobi Wallet',
HyperPay = 'HyperPay',
ImToken = 'imToken',
Expand Down Expand Up @@ -119,6 +121,7 @@ export enum InjectedNameSpace {
Bitski = 'Bitski',
Enkrypt = 'enkrypt',
Zeal = 'zeal',
Frontier = 'frontier',
Phantom = 'phantom'
}

Expand All @@ -145,6 +148,9 @@ export interface CustomWindow extends Window {
ethereum: InjectedProvider
}
}
frontier: {
ethereum: InjectedProvider
}
phantom: {
ethereum: InjectedProvider
}
Expand Down
13 changes: 13 additions & 0 deletions packages/injected/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -656,6 +668,7 @@ const phantom: InjectedWalletModule = {
const wallets = [
zeal,
exodus,
frontier,
metamask,
binance,
coinbase,
Expand Down

0 comments on commit b2feef8

Please sign in to comment.