Skip to content

Commit daa27fb

Browse files
authored
Merge branch 'develop' into feature/move-ws-init
2 parents 4b05aaa + cc63c95 commit daa27fb

File tree

7 files changed

+57
-2
lines changed

7 files changed

+57
-2
lines changed

rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default {
6868
'trezor-connect',
6969
'ethereumjs-tx',
7070
'ethereumjs-util',
71+
'eth-lattice-keyring',
7172
'hdkey',
7273
'@ledgerhq/hw-transport-u2f',
7374
'@ledgerhq/hw-app-eth',

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/stores.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getBlocknative } from './services'
1+
import { getBlocknative, initializeBlocknative } from './services'
22
import { writable, derived, get } from 'svelte/store'
33
import { wait, makeCancelable, createInterval } from './utilities'
44
import { validateWalletInterface, validateType } from './validation'
@@ -309,6 +309,14 @@ function createBalanceStore(initialState: string | null): BalanceStore {
309309
currentBalance: get(balance)
310310
})
311311

312+
if (!getBlocknative()) {
313+
initializeBlocknative(
314+
get(app).dappId,
315+
get(app).networkId,
316+
get(app).apiUrl
317+
)
318+
}
319+
312320
if (emitterAddress !== $address) {
313321
const blocknative = getBlocknative()
314322

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)