Skip to content

Commit

Permalink
Fix conflicts after merging develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamj1232 committed Jan 30, 2023
2 parents 09d8989 + 76d89a5 commit 6df924e
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/src/routes/docs/[...4]wallets/injected.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ const injected = injectedModule({
- Exodus - _Desktop & Mobile_
- Frontier - _Desktop & Mobile_
- Rainbow - _Desktop & Mobile_
- DeFiWallet - _Desktop & Mobile_

## Build Environments

Expand Down
1 change: 1 addition & 0 deletions packages/injected/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ console.log(connectedWallets)
- Exodus - _Desktop & Mobile_
- Frontier - _Desktop & Mobile_
- Rainbow - _Desktop & Mobile_
- DeFiWallet - _Desktop & Mobile_

## Filtering Wallets

Expand Down
3 changes: 2 additions & 1 deletion packages/injected/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"confirmed",
"Injected Wallet",
"GameStop",
"Phantom"
"Phantom",
"DeFi Wallet"
],
"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 @@ -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'
}
7 changes: 7 additions & 0 deletions packages/injected/src/icons/defiwallet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default `<svg width="100%" height="100%" viewBox="0 0 222 256" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M111 0L0 64V192L111 256L222 192V64L111 0ZM111 0L0 64V192L111 256L222 192V64L111 0Z"
fill="white" />
<path
d="M154.822 206H139.028L120.12 188.667V179.778L139.695 161.111V131.556L165.277 114.889L194.417 136.889L154.822 206ZM89.4228 159.333L92.3146 131.556L82.7495 106.667H139.251L129.908 131.556L132.577 159.333H110.778H89.4228ZM102.325 188.667L83.4168 206.222H67.4008L27.5832 136.889L56.9459 115.111L82.7495 131.556V161.111L102.325 179.778V188.667ZM67.1784 55.3334H154.599L165.054 99.7778H56.9459L67.1784 55.3334ZM111 0L0 64V192L111 256L222 192V64L111 0Z"
fill="#03316C" />
</svg>`
10 changes: 7 additions & 3 deletions packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export enum ProviderIdentityFlag {
Zeal = 'isZeal',
Zerion = 'isZerion',
Rainbow = 'isRainbow',
SafePal = 'isSafePal'
SafePal = 'isSafePal',
DeFiWallet = 'isDeficonnectProvider'
}

export enum ProviderLabel {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -132,7 +134,8 @@ export enum InjectedNameSpace {
Phantom = 'phantom',
OKXWallet = 'okxwallet',
Trust = 'trustwallet',
Frontier = 'frontier'
Frontier = 'frontier',
DeFiConnectProvider = 'deficonnectProvider'
}

export interface CustomWindow extends Window {
Expand Down Expand Up @@ -166,6 +169,7 @@ export interface CustomWindow extends Window {
}
okxwallet: InjectedProvider
trustwallet: InjectedProvider
deficonnectProvider: InjectedProvider
}

export type InjectedProvider = 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 @@ -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,
Expand Down Expand Up @@ -745,7 +757,8 @@ const wallets = [
okxwallet,
zerion,
rainbow,
safepal
safepal,
defiwallet
]

export default wallets

0 comments on commit 6df924e

Please sign in to comment.