Skip to content

Commit cc63c95

Browse files
authored
Merge pull request #483 from monokh/liquality
Add Liquality
2 parents ca545b3 + baa5e75 commit cc63c95

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

src/modules/select/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const mobileDefaultWalletNames = [
1717
'hyperpay',
1818
'tokenpocket',
1919
'dcent',
20-
'atoken'
20+
'atoken',
21+
'liquality'
2122
]
2223

2324
function select(
@@ -122,6 +123,8 @@ function getModule(
122123
return import('./wallets/dcent')
123124
case 'atoken':
124125
return import('./wallets/atoken')
126+
case 'liquality':
127+
return import('./wallets/liquality')
125128
default:
126129
throw new Error(`${name} is not a valid walletName.`)
127130
}
Loading
Loading
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { extensionInstallMessage } from '../content'
2+
import { WalletModule, Helpers, CommonWalletOptions } from '../../../interfaces'
3+
4+
import liqualityIcon from '../wallet-icons/icon-liquality.png'
5+
import liqualityIcon2x from '../wallet-icons/icon-liquality@2x.png'
6+
7+
function liquality(options: CommonWalletOptions): WalletModule {
8+
const { preferred, label, iconSrc, svg } = options
9+
10+
return {
11+
name: label || 'Liquality',
12+
iconSrc: iconSrc || liqualityIcon,
13+
iconSrcSet: iconSrc || liqualityIcon2x,
14+
svg,
15+
wallet: async (helpers: Helpers) => {
16+
const { getProviderName, createModernProviderInterface } = helpers
17+
18+
const provider =
19+
(window as any).ethereum ||
20+
((window as any).web3 && (window as any).web3.currentProvider)
21+
22+
return {
23+
provider,
24+
interface:
25+
(getProviderName(provider) === 'Liquality' &&
26+
createModernProviderInterface(provider)) ||
27+
null
28+
}
29+
},
30+
type: 'injected',
31+
link: 'https://liquality.io',
32+
installMessage: extensionInstallMessage,
33+
desktop: true,
34+
mobile: false,
35+
preferred
36+
}
37+
}
38+
39+
export default liquality

src/utilities.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ export function getProviderName(provider: any): string | undefined {
262262
return 'AToken'
263263
}
264264

265+
if (provider.isLiquality) {
266+
return 'Liquality'
267+
}
268+
265269
if (provider.host && provider.host.indexOf('localhost') !== -1) {
266270
return 'localhost'
267271
}

0 commit comments

Comments
 (0)