Skip to content

Commit 148363b

Browse files
authored
Merge pull request #490 from blocknative/release/1.19.0
Release 1.19.0
2 parents 6f1f18e + b0ec59e commit 148363b

File tree

11 files changed

+72
-13
lines changed

11 files changed

+72
-13
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.18.0",
3+
"version": "1.19.0",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",
@@ -52,7 +52,7 @@
5252
"@walletconnect/web3-provider": "^1.3.1",
5353
"authereum": "^0.1.12",
5454
"bignumber.js": "^9.0.0",
55-
"bnc-sdk": "^2.1.4",
55+
"bnc-sdk": "^3.1.0",
5656
"bowser": "^2.10.0",
5757
"eth-lattice-keyring": "^0.2.7",
5858
"ethereumjs-tx": "^2.1.2",

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from './stores'
1818

1919
import { getDeviceInfo } from './utilities'
20-
import { initializeBlocknative } from './services'
2120
import { validateInit, validateConfig } from './validation'
2221

2322
import { version } from '../package.json'
@@ -81,6 +80,7 @@ function init(initialization: Initialization): API {
8180
app.update((store: AppState) => ({
8281
...store,
8382
dappId,
83+
apiUrl,
8484
networkId,
8585
version,
8686
mobileDevice: isMobile,
@@ -94,10 +94,6 @@ function init(initialization: Initialization): API {
9494

9595
initializeStores()
9696

97-
if (dappId) {
98-
initializeBlocknative(dappId, networkId, apiUrl)
99-
}
100-
10197
onboard = new Onboard({
10298
target: document.body,
10399
props: {

src/services.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import BlocknativeApi from 'bnc-sdk'
2+
import { get } from 'svelte/store'
3+
import { app } from './stores'
4+
import { version } from '../package.json'
25

36
let blocknative: any
47

@@ -11,12 +14,16 @@ export function initializeBlocknative(
1114
dappId,
1215
networkId,
1316
name: 'Onboard',
17+
appVersion: version,
1418
apiUrl
1519
})
16-
1720
return blocknative
1821
}
1922

2023
export function getBlocknative(): any {
24+
if (!blocknative) {
25+
const { dappId, networkId, apiUrl } = get(app)
26+
initializeBlocknative(dappId, networkId, apiUrl)
27+
}
2128
return blocknative
2229
}

src/stores.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616

1717
export const app: WritableStore = writable({
1818
dappId: '',
19+
apiUrl: '',
1920
networkId: 1,
2021
version: '',
2122
mobileDevice: false,

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
}

yarn.lock

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,12 +2452,13 @@ bn.js@^5.1.3:
24522452
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b"
24532453
integrity sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==
24542454

2455-
bnc-sdk@^2.1.4:
2456-
version "2.1.4"
2457-
resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-2.1.4.tgz#23267198f5a48e800d9c2406f6d04a767cab5643"
2458-
integrity sha512-aU7DYweE+6tfTvZE7NOOfQsieU2Zyrav6o/xwuLt+uKGvrkblIeg1aqBW1yAQBEg4LCHEygX6TwZk8VznDAh3g==
2455+
bnc-sdk@^3.1.0:
2456+
version "3.1.0"
2457+
resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-3.1.0.tgz#b568d357a3fe95b627701470c051b72d6c9199a8"
2458+
integrity sha512-qr299cdBiAxFjTharZNlF+qpxjtB49oexSVwDnsW5fczJjBLG1ibJHoUD/GtJbCiVPS+hqq+qH6HJnpsQknRZA==
24592459
dependencies:
24602460
crypto-es "^1.2.2"
2461+
rxjs "^6.6.3"
24612462
sturdy-websocket "^0.1.12"
24622463

24632464
bowser@^2.10.0:
@@ -6344,6 +6345,13 @@ rxjs@^6.5.4, rxjs@^6.6.0:
63446345
dependencies:
63456346
tslib "^1.9.0"
63466347

6348+
rxjs@^6.6.3:
6349+
version "6.6.3"
6350+
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552"
6351+
integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==
6352+
dependencies:
6353+
tslib "^1.9.0"
6354+
63476355
safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0:
63486356
version "5.2.1"
63496357
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"

0 commit comments

Comments
 (0)