Skip to content

Commit

Permalink
feat: add Fordefi wallet (#1820)
Browse files Browse the repository at this point in the history
* feat: add Fordefi wallet

* fix: remove comma

* Update packages/injected/src/types.ts

---------

Co-authored-by: Adam Carpenter <[email protected]>
  • Loading branch information
rony-arnac and Adamj1232 authored Jul 14, 2023
1 parent 2f3fd79 commit ddfb620
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ const injected = injectedModule({
- Safeheron - _Desktop_
- Talisman - _Desktop_
- OneKey - _Desktop & Mobile_
- Fordefi - _Desktop_

## Build Environments

Expand Down
5 changes: 3 additions & 2 deletions 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.10.2",
"version": "2.10.3-alpha.1",
"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 Expand Up @@ -32,7 +32,8 @@
"Injected Wallet",
"GameStop",
"Phantom",
"DeFi Wallet"
"DeFi Wallet",
"Fordefi"
],
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion packages/injected/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
defiwallet: 'DeFi Wallet',
safeheron: 'Safeheron',
talismanEth: 'Talisman',
onekey: 'OneKey'
onekey: 'OneKey',
fordefi: 'Fordefi'
}
3 changes: 3 additions & 0 deletions packages/injected/src/icons/fordefi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default `
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 96 96" fill="none"><g clip-path="url(#a)"><path fill="#7994FF" d="M43.508 62.55H6v11.045c0 5.61 4.538 10.156 10.136 10.156H33l10.508-21.2Z"/><path fill="#486DFF" d="M6.001 39.102h70.206l-8.15 16.382H6V39.102Z"/><path fill="#5CD1FA" d="M30.64 12H6.098v20.028h83.747V12H65.302v14.958h-5.06V12H35.7v14.958h-5.06V12Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M6 12h84v72H6z"/></clipPath></defs></svg>
`
6 changes: 4 additions & 2 deletions packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export enum ProviderIdentityFlag {
DeFiWallet = 'isDeficonnectProvider',
Safeheron = 'isSafeheron',
Talisman = 'isTalisman',
OneKey = 'isOneKey'
OneKey = 'isOneKey',
Fordefi = 'isFordefi'
}


Expand Down Expand Up @@ -138,7 +139,8 @@ export enum ProviderLabel {
DeFiWallet = 'DeFi Wallet',
Safeheron = 'Safeheron',
Talisman = 'Talisman',
OneKey = 'OneKey'
OneKey = 'OneKey',
Fordefi = 'Fordefi',
}

export interface MeetOneProvider extends ExternalProvider {
Expand Down
15 changes: 14 additions & 1 deletion packages/injected/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,18 @@ const onekey: InjectedWalletModule = {
externalUrl: ProviderExternalUrl.OneKey
}

const fordefi: InjectedWalletModule = {
label: ProviderLabel.Fordefi,
injectedNamespace: InjectedNameSpace.Ethereum,
checkProviderIdentity: ({ provider }) =>
!!provider &&
!!provider[ProviderIdentityFlag.Fordefi] &&
!otherProviderFlagsExist(ProviderIdentityFlag.Fordefi, provider),
getIcon: async () => (await import('./icons/fordefi.js')).default,
getInterface: getInjectedInterface(ProviderIdentityFlag.Fordefi, true),
platforms: ['desktop']
}

const wallets = [
zeal,
exodus,
Expand Down Expand Up @@ -850,7 +862,8 @@ const wallets = [
infinitywallet,
safeheron,
talisman,
onekey
onekey,
fordefi
]

export default wallets

0 comments on commit ddfb620

Please sign in to comment.