Skip to content

Commit e5d8fa5

Browse files
authored
Release 1.7.8 (#332)
* Fix: TypeScript Definitions (#327) Closes #324 * Enhancement: Add Eslint and Format (#328) * Update node verision used in CI * Add Eslint and consistent format Closes #326 * Enhancement: Update bnc-sdk Dependency (#329) Closes #325 * Fix: Moment.js Resolution (#331) * Put resolutions to locked down version of momentjs * Update yarn.lock Closes #330 * Change to version 1.7.8
1 parent 75265e1 commit e5d8fa5

29 files changed

+1161
-826
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
test:
44
docker:
5-
- image: circleci/node:8.15-browsers
5+
- image: circleci/node:10.18.1-browsers
66
steps:
77
- checkout
88
- restore_cache:
@@ -18,7 +18,7 @@ jobs:
1818
key: v1-dependencies-{{ checksum "package.json" }}
1919
deploy_stage:
2020
docker:
21-
- image: circleci/node:8.15-browsers
21+
- image: circleci/node:10.18.1-browsers
2222
user: root
2323
steps:
2424
- checkout
@@ -30,7 +30,7 @@ jobs:
3030
- run: npm publish --dry-run
3131
deploy_prod:
3232
docker:
33-
- image: circleci/node:8.15-browsers
33+
- image: circleci/node:10.18.1-browsers
3434
user: root
3535
steps:
3636
- checkout
@@ -42,7 +42,7 @@ jobs:
4242
- run: npm publish
4343
deploy_demo:
4444
docker:
45-
- image: circleci/node:8.15-browsers
45+
- image: circleci/node:10.18.1-browsers
4646
user: root
4747
steps:
4848
- checkout

.eslintrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
ecmaVersion: 2020,
5+
sourceType: 'module'
6+
},
7+
extends: [
8+
'plugin:@typescript-eslint/recommended',
9+
'prettier/@typescript-eslint',
10+
'plugin:prettier/recommended'
11+
],
12+
13+
rules: {
14+
'@typescript-eslint/no-use-before-define': 'off',
15+
'@typescript-eslint/no-explicit-any': 'off',
16+
'@typescript-eslint/explicit-function-return-type': 'off',
17+
'@typescript-eslint/no-empty-function': 'off'
18+
}
19+
}

.prettierrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

.prettierrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
semi: false,
3+
trailingComma: 'none',
4+
singleQuote: true,
5+
printWidth: 80,
6+
tabWidth: 2,
7+
arrowParens: 'avoid'
8+
}

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.7.7",
3+
"version": "1.7.8",
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",
@@ -19,6 +19,9 @@
1919
"type": "git",
2020
"url": "https://github.com/blocknative/onboard"
2121
},
22+
"resolutions": {
23+
"moment": "2.24.0"
24+
},
2225
"license": "MIT",
2326
"devDependencies": {
2427
"@babel/cli": "^7.7.0",
@@ -29,7 +32,13 @@
2932
"@rollup/plugin-json": "^4.0.0",
3033
"@rollup/plugin-node-resolve": "^7.1.1",
3134
"@types/node": "^13.5.1",
35+
"@typescript-eslint/eslint-plugin": "^2.30.0",
36+
"@typescript-eslint/parser": "^2.30.0",
3237
"babel-plugin-external-helpers": "^6.18.0",
38+
"eslint": "^6.8.0",
39+
"eslint-config-prettier": "^6.11.0",
40+
"eslint-plugin-prettier": "^3.1.3",
41+
"prettier": "^2.0.5",
3342
"rimraf": "^3.0.0",
3443
"rollup": "^1.27.5",
3544
"rollup-plugin-svelte": "^5.0.3",
@@ -47,7 +56,7 @@
4756
"@walletconnect/web3-provider": "^1.0.0-beta.47",
4857
"authereum": "^0.0.4-beta.131",
4958
"bignumber.js": "^9.0.0",
50-
"bnc-sdk": "2.0.0",
59+
"bnc-sdk": "2.1.1",
5160
"bowser": "^2.5.2",
5261
"ethereumjs-tx": "^2.1.2",
5362
"ethereumjs-util": "^6.2.0",

src/@types/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ declare module 'trezor-connect'
1010
declare module 'ethereumjs-tx'
1111
declare module 'ethereumjs-util'
1212
declare module 'hdkey'
13-
// declare module 'ethereumjs-wallet/hdkey'
1413
declare module '@ledgerhq/hw-app-eth'
1514
declare module '@ledgerhq/hw-transport-u2f'
1615

src/components/Modal.svelte

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@
9797
on:mouseenter={() => (closeHovered = true)}
9898
on:mouseleave={() => (closeHovered = false)}>
9999
<svg
100-
version="1.1"
101-
id="Capa_1"
102100
xmlns="http://www.w3.org/2000/svg"
103101
xmlns:xlink="http://www.w3.org/1999/xlink"
104102
x="0px"

src/elements/Button.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
2-
import { app } from "../stores";
3-
export let onclick: () => void = () => {};
2+
import { app } from '../stores'
3+
export let onclick: () => void = () => {}
44
</script>
55

66
<style>

src/elements/walletIcon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const walletIcon: string = `
1+
const walletIcon = `
22
<svg
33
height="18"
44
viewBox="0 0 19 18"

src/interfaces.ts

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
export interface Initialization {
22
dappId: string
33
networkId: number
4-
subscriptions: Subscriptions
5-
walletSelect: WalletSelectModule
6-
walletCheck: Array<WalletCheckModule | WalletCheckInit>
4+
subscriptions?: Subscriptions
5+
walletSelect?: WalletSelectModuleOptions
6+
walletCheck?: Array<WalletCheckModule | WalletCheckInit>
77
darkMode?: boolean
88
apiUrl?: string
99
}
1010

1111
export interface Subscriptions {
12-
address: (address: string) => void
13-
network: (networkId: number) => void
14-
balance: (balance: string) => void
15-
wallet: (wallet: Wallet) => void
12+
address?: (address: string) => void
13+
network?: (networkId: number) => void
14+
balance?: (balance: string) => void
15+
wallet?: (wallet: Wallet) => void
16+
}
17+
18+
export interface WalletSelectModuleOptions {
19+
heading?: string
20+
description?: string
21+
wallets?: Array<WalletModule | WalletInitOptions>
22+
explanation?: string
1623
}
1724

1825
export interface WalletSelectModule {
@@ -27,7 +34,6 @@ export interface WalletCheckModule {
2734
| WalletCheckModal
2835
| undefined
2936
| Promise<WalletCheckModal | undefined>
30-
id?: string
3137
}
3238

3339
export interface WalletCheckModule {
@@ -155,37 +161,37 @@ export interface Wallet {
155161
}
156162

157163
export interface CommonWalletOptions {
158-
networkId: number
164+
walletName: string
159165
preferred?: boolean
160166
label?: string
161167
iconSrc?: string
162168
svg?: string
163169
}
164170

165-
export interface SdkWalletOptions {
171+
export interface SdkWalletOptions extends CommonWalletOptions {
166172
apiKey: string
167173
}
168174

169-
export interface WalletConnectOptions {
175+
export interface WalletConnectOptions extends CommonWalletOptions {
170176
infuraKey: string
171177
rpc: {
172178
[key: string]: string
173179
}
174180
bridge: string
175181
}
176182

177-
export interface TrezorOptions {
183+
export interface TrezorOptions extends CommonWalletOptions {
178184
appUrl: string
179185
email: string
180186
rpcUrl: string
181187
}
182188

183-
export interface LedgerOptions {
189+
export interface LedgerOptions extends CommonWalletOptions {
184190
rpcUrl: string
185191
LedgerTransport?: any
186192
}
187193

188-
export interface TorusOptions {
194+
export interface TorusOptions extends CommonWalletOptions {
189195
loginMethod?: 'google' | 'facebook' | 'twitch' | 'reddit' | 'discord'
190196
buildEnv?: 'production' | 'development' | 'staging' | 'testing'
191197
showTorusButton?: boolean
@@ -202,22 +208,38 @@ interface TorusVerifierStatus {
202208
discord?: boolean
203209
}
204210

205-
export interface AuthereumOptions {
211+
export interface AuthereumOptions extends CommonWalletOptions {
206212
disableNotifications?: boolean
207213
}
208214

209-
interface WalletName {
210-
walletName: string
215+
export interface ImTokenOptions extends CommonWalletOptions {
216+
rpcUrl?: string
217+
}
218+
219+
export interface TrustWalletOptions extends CommonWalletOptions {
220+
rpcUrl?: string
211221
}
212222

213-
export type WalletInitOptions = CommonWalletOptions &
223+
export type WalletInitOptions =
224+
| CommonWalletOptions
225+
| SdkWalletOptions
226+
| WalletConnectOptions
227+
| TorusOptions
228+
| TrezorOptions
229+
| AuthereumOptions
230+
| LedgerOptions
231+
| ImTokenOptions
232+
| TrustWalletOptions
233+
234+
export type AllWalletInitOptions = CommonWalletOptions &
214235
SdkWalletOptions &
215236
WalletConnectOptions &
216237
TorusOptions &
217238
TrezorOptions &
218239
AuthereumOptions &
219240
LedgerOptions &
220-
WalletName
241+
ImTokenOptions &
242+
TrustWalletOptions & { networkId: number }
221243

222244
export interface WalletCheckInit {
223245
checkName: string

0 commit comments

Comments
 (0)