Skip to content

Commit 26610a0

Browse files
lnbc1QWFyb24taylorjdawsonsoralitdependabot[bot]
authored
Release 1.21.0 (#517)
* 1.20.0-0.0.1: [enhancement] - Install Wallet Copy (#514) * Start implementing * Fix svelte formatting * Remove mobileDevice flag * Add ismobile to common wallet interface * Change button copy * Update mobile copy * Add isMobile to all wallet modules * Conditionally render message * Increment version * 1.20.0-0.1.0: [feature]: Add Cobo Vault hardware wallet support (#508) * add cobovault support * Update src/modules/check/derivation-path.ts Co-authored-by: Aaron Barnard <abarnard@protonmail.com> * Update src/modules/check/derivation-path.ts Co-authored-by: Aaron Barnard <abarnard@protonmail.com> * fix code issue * resolve code issue * update dependency * bump version code Co-authored-by: Aaron Barnard <abarnard@protonmail.com> * Bump y18n from 4.0.0 to 4.0.1 (#516) Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Version 1.21.0 Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com> Co-authored-by: soralit <18829236489@163.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 8f2b913 commit 26610a0

File tree

14 files changed

+561
-67
lines changed

14 files changed

+561
-67
lines changed

.prettierrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ module.exports = {
44
singleQuote: true,
55
printWidth: 80,
66
tabWidth: 2,
7-
arrowParens: 'avoid'
7+
arrowParens: 'avoid',
8+
svelteSortOrder: 'scripts-styles-markup'
89
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.20.0",
3+
"version": "1.21.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",
@@ -45,6 +45,7 @@
4545
"typescript": "^3.6.4"
4646
},
4747
"dependencies": {
48+
"@cvbb/eth-keyring": "^1.1.0",
4849
"@ledgerhq/hw-app-eth": "^5.21.0",
4950
"@ledgerhq/hw-transport-u2f": "^5.21.0",
5051
"@portis/web3": "^2.0.0-beta.57",

rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export default {
6969
'ethereumjs-tx',
7070
'ethereumjs-util',
7171
'eth-lattice-keyring',
72+
'@cvbb/eth-keyring',
7273
'hdkey',
7374
'@ledgerhq/hw-transport-u2f',
7475
'@ledgerhq/hw-app-eth',

src/components/SelectedWallet.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
iconSrc={selectedWalletModule.iconSrc}
3030
iconSrcSet={selectedWalletModule.iconSrcSet}
3131
svg={selectedWalletModule.svg}
32-
text={selectedWalletModule.name} />
32+
text={selectedWalletModule.name}
33+
/>
3334

3435
{#if installMessage}
3536
{@html installMessage}
@@ -39,8 +40,9 @@
3940
<a
4041
href={selectedWalletModule.link}
4142
rel="noreferrer noopener"
42-
target="_blank">
43-
<Button>Install {selectedWalletModule.name}</Button>
43+
target="_blank"
44+
>
45+
<Button>Open {selectedWalletModule.name}</Button>
4446
</a>
4547
<Button onclick={onBack}>Back</Button>
4648
</footer>

src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export interface CommonWalletOptions {
171171
label?: string
172172
iconSrc?: string
173173
svg?: string
174+
isMobile: boolean
174175
}
175176

176177
export interface SdkWalletOptions extends CommonWalletOptions {

src/modules/check/derivation-path.ts

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -182,57 +182,60 @@ function derivationPath(
182182
}
183183
;(window as any).handleCustomInput = handleCustomInput
184184
;(window as any).handleDerivationClick = handleDerivationClick
185-
return {
186-
heading: heading || 'Hardware Wallet Connect',
187-
description:
188-
description ||
189-
`Make sure your ${wallet.name} is plugged in, ${
190-
wallet.name === 'Ledger' ? 'and the Ethereum app is open, ' : ''
191-
}then select a derivation path to connect your accounts:`,
192-
eventCode: 'derivationPath',
193-
html: derivationSelectHtmlString(wallet.name as string),
194-
button: {
195-
text: 'Connect',
196-
onclick: async () => {
197-
state.loading = true
198-
const path =
199-
state.dPath || derivationPaths[wallet.name as string][0].path
200-
try {
201-
const validPath = await wallet.provider.setPath(
202-
path,
203-
state.showCustomInput
204-
)
205-
206-
if (!validPath) {
207-
state.error = `${path} is not a valid derivation path`
185+
186+
return (
187+
derivationPaths[wallet.name as string] && {
188+
heading: heading || 'Hardware Wallet Connect',
189+
description:
190+
description ||
191+
`Make sure your ${wallet.name} is plugged in, ${
192+
wallet.name === 'Ledger' ? 'and the Ethereum app is open, ' : ''
193+
}then select a derivation path to connect your accounts:`,
194+
eventCode: 'derivationPath',
195+
html: derivationSelectHtmlString(wallet.name as string),
196+
button: {
197+
text: 'Connect',
198+
onclick: async () => {
199+
state.loading = true
200+
const path =
201+
state.dPath || derivationPaths[wallet.name as string][0].path
202+
try {
203+
const validPath = await wallet.provider.setPath(
204+
path,
205+
state.showCustomInput
206+
)
207+
208+
if (!validPath) {
209+
state.error = `${path} is not a valid derivation path`
210+
state.loading = false
211+
return
212+
}
213+
} catch (error) {
214+
state.error = error
208215
state.loading = false
209216
return
210217
}
211-
} catch (error) {
212-
state.error = error
213-
state.loading = false
214-
return
215-
}
216218

217-
state.error = ''
218-
219-
if (wallet.connect) {
220-
;(wallet.connect as Connect)()
221-
.then(() => {
222-
deleteWindowProperties()
223-
state.loading = false
224-
state.completed = true
225-
})
226-
.catch(error => {
227-
state.error = error.message
228-
state.loading = false
229-
})
219+
state.error = ''
220+
221+
if (wallet.connect) {
222+
;(wallet.connect as Connect)()
223+
.then(() => {
224+
deleteWindowProperties()
225+
state.loading = false
226+
state.completed = true
227+
})
228+
.catch(error => {
229+
state.error = error.message
230+
state.loading = false
231+
})
232+
}
230233
}
231-
}
232-
},
234+
},
233235

234-
icon: icon || usbIcon
235-
}
236+
icon: icon || usbIcon
237+
}
238+
)
236239
}
237240
}
238241

src/modules/select/content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const mobileWalletInstallMessage = (helpers: {
5353

5454
return `
5555
<p style="font-size: 0.889rem;">
56-
You'll need to install <b>${selectedWallet}</b> to continue. Click below to install and then load this Dapp with <b>${selectedWallet}</b>.
56+
Tap the button below to <b>Open ${selectedWallet}</b>. Please access this site on ${selectedWallet}'s in-app browser for a seamless experience.
5757
</p>
5858
`
5959
}

src/modules/select/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function select(
3838

3939
try {
4040
return getModule(walletName).then((m: any) =>
41-
m.default({ ...initParams, networkId })
41+
m.default({ ...initParams, networkId, isMobile })
4242
)
4343
} catch (error) {
4444
if (error.name === 'DeprecatedWalletError') {
@@ -103,6 +103,8 @@ function getModule(
103103
return import('./wallets/trezor')
104104
case 'lattice':
105105
return import('./wallets/lattice')
106+
case 'cobovault':
107+
return import('./wallets/cobovault')
106108
case 'ledger':
107109
return import('./wallets/ledger')
108110
case 'walletLink':
Loading
Loading

0 commit comments

Comments
 (0)