Skip to content

Commit 59729e1

Browse files
[common:2.1.6-alpha.1] [keepkey:2.1.6-alpha.1] - Better Error Messages (#1146)
* Format KeepKey Pin Entry error * Modify account select modal error styles * Format network detect error message * Increment common package version * Increment keepkey package version * Bump versions that use common to pull in changes to SelectAccount Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
1 parent d31ee6e commit 59729e1

File tree

23 files changed

+90
-77
lines changed

23 files changed

+90
-77
lines changed

packages/coinbase/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/coinbase",
3-
"version": "2.0.8",
3+
"version": "2.0.9-alpha.1",
44
"description": "Coinbase SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -57,6 +57,6 @@
5757
},
5858
"dependencies": {
5959
"@coinbase/wallet-sdk": "^3.0.5",
60-
"@web3-onboard/common": "^2.1.5"
60+
"@web3-onboard/common": "^2.1.6-alpha.1"
6161
}
6262
}

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/common",
3-
"version": "2.1.5",
3+
"version": "2.1.6-alpha.1",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",

packages/common/src/elements/TableHeader.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@
8080
input[type='checkbox'] {
8181
-webkit-appearance: none;
8282
width: auto;
83-
background: var(
84-
--account-select-white,
85-
var(--onboard-white, var(--white))
86-
);
83+
background: var(--account-select-white, var(--onboard-white, var(--white)));
8784
border: 1px solid
8885
var(--account-select-gray-300, var(--onboard-gray-300, var(--gray-300)));
8986
padding: 0.5em;
@@ -144,6 +141,9 @@
144141
--account-select-font-family-light,
145142
var(--font-family-light)
146143
);
144+
font-size: var(--account-select-font-size-7, var(--font-size-7));
145+
max-width: 15rem;
146+
line-height: 1;
147147
}
148148
149149
.table-controls {

packages/common/src/views/AccountSelect.svelte

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,17 @@
6767
loadingAccounts = false
6868
} catch (err) {
6969
const { message } = err as { message: string }
70-
errorFromScan = message || 'There was an error scanning for accounts'
70+
71+
if (
72+
typeof message === 'string' &&
73+
message.includes('could not detect network')
74+
) {
75+
errorFromScan =
76+
'There was an error detecting connected network from RPC endpoint'
77+
} else {
78+
errorFromScan = message || 'There was an error scanning for accounts'
79+
}
80+
7181
loadingAccounts = false
7282
}
7383
}
@@ -397,10 +407,7 @@
397407
right: 0.2rem;
398408
width: 2.5rem;
399409
height: 2.5rem;
400-
background: var(
401-
--account-select-white,
402-
var(--onboard-white, var(--white))
403-
);
410+
background: var(--account-select-white, var(--onboard-white, var(--white)));
404411
border-radius: 1rem;
405412
}
406413

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/core",
3-
"version": "2.5.0-alpha.1",
3+
"version": "2.5.0-alpha.2",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -78,7 +78,7 @@
7878
"typescript": "^4.5.5"
7979
},
8080
"dependencies": {
81-
"@web3-onboard/common": "^2.1.5",
81+
"@web3-onboard/common": "^2.1.6-alpha.1",
8282
"bignumber.js": "^9.0.0",
8383
"bnc-sdk": "^4.4.1",
8484
"bowser": "^2.11.0",

packages/dcent/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/dcent",
3-
"version": "2.0.5",
3+
"version": "2.0.6-alpha.1",
44
"description": "D'CENT wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -54,7 +54,7 @@
5454
"typescript": "^4.5.5"
5555
},
5656
"dependencies": {
57-
"@web3-onboard/common": "^2.1.5",
57+
"@web3-onboard/common": "^2.1.6-alpha.1",
5858
"@ethereumjs/common": "^2.6.1",
5959
"@ethereumjs/tx": "^3.4.0",
6060
"@ethersproject/providers": "^5.5.0",

packages/fortmatic/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/fortmatic",
3-
"version": "2.0.7",
3+
"version": "2.0.8-alpha.1",
44
"description": "Fortmatic wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -57,7 +57,7 @@
5757
"typescript": "^4.5.5"
5858
},
5959
"dependencies": {
60-
"@web3-onboard/common": "^2.1.5",
60+
"@web3-onboard/common": "^2.1.6-alpha.1",
6161
"fortmatic": "^2.2.1"
6262
}
6363
}

packages/gnosis/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/gnosis",
3-
"version": "2.0.6",
3+
"version": "2.0.7-alpha.1",
44
"description": "Gnosis Safe module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -59,6 +59,6 @@
5959
"dependencies": {
6060
"@gnosis.pm/safe-apps-provider": "^0.9.2",
6161
"@gnosis.pm/safe-apps-sdk": "^6.1.1",
62-
"@web3-onboard/common": "^2.1.5"
62+
"@web3-onboard/common": "^2.1.6-alpha.1"
6363
}
6464
}

packages/injected/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/injected-wallets",
3-
"version": "2.0.14-alpha.1",
3+
"version": "2.0.14-alpha.2",
44
"description": "Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -62,7 +62,7 @@
6262
"window": "^4.2.7"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/common": "^2.1.5",
65+
"@web3-onboard/common": "^2.1.6-alpha.1",
6666
"joi": "^17.4.2",
6767
"lodash.uniqby": "^4.7.0"
6868
}

packages/keepkey/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/keepkey",
3-
"version": "2.1.5",
3+
"version": "2.1.6-alpha.1",
44
"description": "KeepKey hardware wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -63,7 +63,7 @@
6363
"@ethersproject/providers": "^5.5.0",
6464
"@shapeshiftoss/hdwallet-core": "^1.15.2",
6565
"@shapeshiftoss/hdwallet-keepkey-webusb": "^1.15.2",
66-
"@web3-onboard/common": "^2.1.5",
66+
"@web3-onboard/common": "^2.1.6-alpha.1",
6767
"ethereumjs-util": "^7.1.3"
6868
}
6969
}

packages/keepkey/src/index.ts

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -167,37 +167,43 @@ function keepkey(): WalletInit {
167167
asset: Asset
168168
provider: StaticJsonRpcProvider
169169
}) => {
170-
let index = getAccountIdx(derivationPath)
171-
let zeroBalanceAccounts = 0
172-
const accounts = []
173-
174-
// Iterates until a 0 balance account is found
175-
// Then adds 4 more 0 balance accounts to the array
176-
while (zeroBalanceAccounts < 5) {
177-
const acc = await getAccount({
178-
accountIdx: index,
179-
provider,
180-
asset
181-
})
170+
try {
171+
let index = getAccountIdx(derivationPath)
172+
let zeroBalanceAccounts = 0
173+
const accounts = []
174+
175+
// Iterates until a 0 balance account is found
176+
// Then adds 4 more 0 balance accounts to the array
177+
while (zeroBalanceAccounts < 5) {
178+
const acc = await getAccount({
179+
accountIdx: index,
180+
provider,
181+
asset
182+
})
183+
184+
if (
185+
acc &&
186+
acc.balance &&
187+
acc.balance.value &&
188+
acc.balance.value.isZero()
189+
) {
190+
zeroBalanceAccounts++
191+
accounts.push(acc)
192+
} else {
193+
accounts.push(acc)
194+
// Reset the number of 0 balance accounts
195+
zeroBalanceAccounts = 0
196+
}
182197

183-
if (
184-
acc &&
185-
acc.balance &&
186-
acc.balance.value &&
187-
acc.balance.value.isZero()
188-
) {
189-
zeroBalanceAccounts++
190-
accounts.push(acc)
191-
} else {
192-
accounts.push(acc)
193-
// Reset the number of 0 balance accounts
194-
zeroBalanceAccounts = 0
198+
index++
195199
}
196200

197-
index++
201+
return accounts
202+
} catch (error) {
203+
throw new Error(
204+
(error as { message: { message: string } }).message.message
205+
)
198206
}
199-
200-
return accounts
201207
}
202208
let ethersProvider: StaticJsonRpcProvider
203209
const scanAccounts = async ({

packages/keystone/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/keystone",
3-
"version": "2.1.6",
3+
"version": "2.1.7-alpha.1",
44
"description": "Keystone hardware wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -57,6 +57,6 @@
5757
"@ethereumjs/tx": "^3.4.0",
5858
"@ethersproject/providers": "^5.5.0",
5959
"@keystonehq/eth-keyring": "^0.14.0-alpha.10.3",
60-
"@web3-onboard/common": "^2.1.5"
60+
"@web3-onboard/common": "^2.1.6-alpha.1"
6161
}
6262
}

packages/ledger/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/ledger",
3-
"version": "2.1.5",
3+
"version": "2.1.6-alpha.1",
44
"description": "Ledger hardare wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -63,7 +63,7 @@
6363
"@ledgerhq/hw-transport-u2f": "^5.36.0-deprecated",
6464
"@ledgerhq/hw-transport-webusb": "^6.19.0",
6565
"@metamask/eth-sig-util": "^4.0.0",
66-
"@web3-onboard/common": "^2.1.5",
66+
"@web3-onboard/common": "^2.1.6-alpha.1",
6767
"buffer": "^6.0.3",
6868
"ethereumjs-util": "^7.1.3"
6969
}

packages/magic/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/magic",
3-
"version": "2.0.8",
3+
"version": "2.0.9-alpha.1",
44
"description": "Magic SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -78,7 +78,7 @@
7878
"typescript": "^4.5.5"
7979
},
8080
"dependencies": {
81-
"@web3-onboard/common": "^2.1.5",
81+
"@web3-onboard/common": "^2.1.6-alpha.1",
8282
"joi": "^17.4.2",
8383
"magic-sdk": "^8.1.0",
8484
"rxjs": "^7.5.2"

packages/mew/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/mew",
3-
"version": "2.0.5",
3+
"version": "2.0.6-alpha.1",
44
"description": "MEW (My Ether Wallet) SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -59,7 +59,7 @@
5959
"@myetherwallet/mewconnect-web-client": "^2.2.0-beta.14"
6060
},
6161
"dependencies": {
62-
"@web3-onboard/common": "^2.1.5",
62+
"@web3-onboard/common": "^2.1.6-alpha.1",
6363
"rxjs": "^7.5.2"
6464
}
6565
}

packages/portis/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/portis",
3-
"version": "2.0.5",
3+
"version": "2.0.6-alpha.1",
44
"description": "Portis SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -57,6 +57,6 @@
5757
},
5858
"dependencies": {
5959
"@portis/web3": "^4.0.6",
60-
"@web3-onboard/common": "^2.1.5"
60+
"@web3-onboard/common": "^2.1.6-alpha.1"
6161
}
6262
}

packages/react/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/react",
3-
"version": "2.2.4-alpha.1",
3+
"version": "2.2.4-alpha.2",
44
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -59,8 +59,8 @@
5959
"typescript": "^4.5.5"
6060
},
6161
"dependencies": {
62-
"@web3-onboard/core": "^2.4.1-alpha.1",
63-
"@web3-onboard/common": "^2.1.5",
62+
"@web3-onboard/core": "^2.4.1-alpha.2",
63+
"@web3-onboard/common": "^2.1.6-alpha.1",
6464
"use-sync-external-store": "1.0.0"
6565
},
6666
"peerDependencies": {

packages/torus/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/torus",
3-
"version": "2.0.6",
3+
"version": "2.0.7-alpha.1",
44
"description": "Torus SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -57,6 +57,6 @@
5757
},
5858
"dependencies": {
5959
"@toruslabs/torus-embed": "^1.18.3",
60-
"@web3-onboard/common": "^2.1.5"
60+
"@web3-onboard/common": "^2.1.6-alpha.1"
6161
}
6262
}

packages/trezor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/trezor",
3-
"version": "2.1.5",
3+
"version": "2.1.6-alpha.1",
44
"description": "Trezor hardware wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -58,7 +58,7 @@
5858
"dependencies": {
5959
"@ethereumjs/tx": "^3.4.0",
6060
"@ethersproject/providers": "^5.5.0",
61-
"@web3-onboard/common": "^2.1.5",
61+
"@web3-onboard/common": "^2.1.6-alpha.1",
6262
"buffer": "^6.0.3",
6363
"eth-crypto": "^2.1.0",
6464
"ethereumjs-util": "^7.1.3",

0 commit comments

Comments
 (0)