diff --git a/docs/src/routes/docs/[...4]wallets/injected.md b/docs/src/routes/docs/[...4]wallets/injected.md index 26010db4b..29c8ca909 100644 --- a/docs/src/routes/docs/[...4]wallets/injected.md +++ b/docs/src/routes/docs/[...4]wallets/injected.md @@ -310,6 +310,7 @@ const injected = injectedModule({ - Exodus - _Desktop & Mobile_ - Frontier - _Desktop & Mobile_ - Rainbow - _Desktop & Mobile_ +- DeFiWallet - _Desktop & Mobile_ ## Build Environments diff --git a/packages/demo/package.json b/packages/demo/package.json index 0bdf0c6b5..28f68f9d1 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -34,7 +34,7 @@ "@web3-onboard/keepkey": "^2.3.3", "@web3-onboard/keystone": "^2.3.3", "@web3-onboard/ledger": "^2.4.2", - "@web3-onboard/injected-wallets": "^2.6.2-alpha.3", + "@web3-onboard/injected-wallets": "^2.6.2-alpha.4", "@web3-onboard/magic": "^2.1.3", "@web3-onboard/phantom": "^2.0.0-alpha.1", "@web3-onboard/portis": "^2.1.3", diff --git a/packages/injected/README.md b/packages/injected/README.md index 8027f7cc1..d78e77b57 100644 --- a/packages/injected/README.md +++ b/packages/injected/README.md @@ -78,6 +78,7 @@ console.log(connectedWallets) - Exodus - _Desktop & Mobile_ - Frontier - _Desktop & Mobile_ - Rainbow - _Desktop & Mobile_ +- DeFiWallet - _Desktop & Mobile_ ## Filtering Wallets diff --git a/packages/injected/package.json b/packages/injected/package.json index 548a94efb..82f556f1c 100644 --- a/packages/injected/package.json +++ b/packages/injected/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/injected-wallets", - "version": "2.6.2-alpha.3", + "version": "2.6.2-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", @@ -31,7 +31,8 @@ "confirmed", "Injected Wallet", "GameStop", - "Phantom" + "Phantom", + "DeFi Wallet" ], "repository": { "type": "git", diff --git a/packages/injected/src/constants.ts b/packages/injected/src/constants.ts index f88a28b6d..b78ada7ca 100644 --- a/packages/injected/src/constants.ts +++ b/packages/injected/src/constants.ts @@ -20,5 +20,6 @@ export const WALLET_NAMES: { [key: string]: string } = { trust: 'Trust Wallet', frontier: 'Frontier', zerion: 'Zerion', - rainbow: 'Rainbow' + rainbow: 'Rainbow', + defiwallet: 'DeFi Wallet' } diff --git a/packages/injected/src/icons/defiwallet.ts b/packages/injected/src/icons/defiwallet.ts new file mode 100644 index 000000000..196c1f2f4 --- /dev/null +++ b/packages/injected/src/icons/defiwallet.ts @@ -0,0 +1,7 @@ +export default ` + + +` diff --git a/packages/injected/src/types.ts b/packages/injected/src/types.ts index b9ff9df64..368d40b74 100644 --- a/packages/injected/src/types.ts +++ b/packages/injected/src/types.ts @@ -56,7 +56,8 @@ export enum ProviderIdentityFlag { Zeal = 'isZeal', Zerion = 'isZerion', Rainbow = 'isRainbow', - SafePal = 'isSafePal' + SafePal = 'isSafePal', + DeFiWallet = 'isDeficonnectProvider' } export enum ProviderLabel { @@ -103,7 +104,8 @@ export enum ProviderLabel { OKXWallet = 'OKX Wallet', Zerion = 'Zerion', Rainbow = 'Rainbow', - SafePal = 'SafePal' + SafePal = 'SafePal', + DeFiWallet = 'DeFi Wallet' } export interface MeetOneProvider extends ExternalProvider { @@ -132,7 +134,8 @@ export enum InjectedNameSpace { Phantom = 'phantom', OKXWallet = 'okxwallet', Trust = 'trustwallet', - Frontier = 'frontier' + Frontier = 'frontier', + DeFiConnectProvider = 'deficonnectProvider' } export interface CustomWindow extends Window { @@ -166,6 +169,7 @@ export interface CustomWindow extends Window { } okxwallet: InjectedProvider trustwallet: InjectedProvider + deficonnectProvider: InjectedProvider } export type InjectedProvider = ExternalProvider & diff --git a/packages/injected/src/wallets.ts b/packages/injected/src/wallets.ts index 465e534d4..4201ad1be 100644 --- a/packages/injected/src/wallets.ts +++ b/packages/injected/src/wallets.ts @@ -703,6 +703,18 @@ const okxwallet: InjectedWalletModule = { platforms: ['desktop'] } +const defiwallet: InjectedWalletModule = { + label: ProviderLabel.DeFiWallet, + injectedNamespace: InjectedNameSpace.DeFiConnectProvider, + checkProviderIdentity: ({ provider }) => + !!provider && !!provider[ProviderIdentityFlag.DeFiWallet], + getIcon: async () => (await import('./icons/defiwallet.js')).default, + getInterface: async () => ({ + provider: createEIP1193Provider(window.deficonnectProvider) + }), + platforms: ['all'], +} + const wallets = [ zeal, exodus, @@ -745,7 +757,8 @@ const wallets = [ okxwallet, zerion, rainbow, - safepal + safepal, + defiwallet ] export default wallets