Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[common:2.1.6-alpha.1] [keepkey:2.1.6-alpha.1] - Better Error Messages #1146

Merged
merged 6 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/coinbase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/coinbase",
"version": "2.0.8",
"version": "2.0.9-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -57,6 +57,6 @@
},
"dependencies": {
"@coinbase/wallet-sdk": "^3.0.5",
"@web3-onboard/common": "^2.1.5"
"@web3-onboard/common": "^2.1.6-alpha.1"
}
}
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/common",
"version": "2.1.5",
"version": "2.1.6-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down
8 changes: 4 additions & 4 deletions packages/common/src/elements/TableHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@
input[type='checkbox'] {
-webkit-appearance: none;
width: auto;
background: var(
--account-select-white,
var(--onboard-white, var(--white))
);
background: var(--account-select-white, var(--onboard-white, var(--white)));
border: 1px solid
var(--account-select-gray-300, var(--onboard-gray-300, var(--gray-300)));
padding: 0.5em;
Expand Down Expand Up @@ -144,6 +141,9 @@
--account-select-font-family-light,
var(--font-family-light)
);
font-size: var(--account-select-font-size-7, var(--font-size-7));
max-width: 15rem;
line-height: 1;
}

.table-controls {
Expand Down
17 changes: 12 additions & 5 deletions packages/common/src/views/AccountSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@
loadingAccounts = false
} catch (err) {
const { message } = err as { message: string }
errorFromScan = message || 'There was an error scanning for accounts'

if (
typeof message === 'string' &&
message.includes('could not detect network')
) {
errorFromScan =
'There was an error detecting connected network from RPC endpoint'
} else {
errorFromScan = message || 'There was an error scanning for accounts'
}

loadingAccounts = false
}
}
Expand Down Expand Up @@ -397,10 +407,7 @@
right: 0.2rem;
width: 2.5rem;
height: 2.5rem;
background: var(
--account-select-white,
var(--onboard-white, var(--white))
);
background: var(--account-select-white, var(--onboard-white, var(--white)));
border-radius: 1rem;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.5.0-alpha.1",
"version": "2.5.0-alpha.2",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -78,7 +78,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"bignumber.js": "^9.0.0",
"bnc-sdk": "^4.4.1",
"bowser": "^2.11.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/dcent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/dcent",
"version": "2.0.5",
"version": "2.0.6-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -54,7 +54,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"@ethereumjs/common": "^2.6.1",
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/fortmatic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/fortmatic",
"version": "2.0.7",
"version": "2.0.8-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -57,7 +57,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"fortmatic": "^2.2.1"
}
}
4 changes: 2 additions & 2 deletions packages/gnosis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/gnosis",
"version": "2.0.6",
"version": "2.0.7-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -59,6 +59,6 @@
"dependencies": {
"@gnosis.pm/safe-apps-provider": "^0.9.2",
"@gnosis.pm/safe-apps-sdk": "^6.1.1",
"@web3-onboard/common": "^2.1.5"
"@web3-onboard/common": "^2.1.6-alpha.1"
}
}
4 changes: 2 additions & 2 deletions packages/injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/injected-wallets",
"version": "2.0.14-alpha.1",
"version": "2.0.14-alpha.2",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -62,7 +62,7 @@
"window": "^4.2.7"
},
"dependencies": {
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"joi": "^17.4.2",
"lodash.uniqby": "^4.7.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/keepkey/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/keepkey",
"version": "2.1.5",
"version": "2.1.6-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -63,7 +63,7 @@
"@ethersproject/providers": "^5.5.0",
"@shapeshiftoss/hdwallet-core": "^1.15.2",
"@shapeshiftoss/hdwallet-keepkey-webusb": "^1.15.2",
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"ethereumjs-util": "^7.1.3"
}
}
60 changes: 33 additions & 27 deletions packages/keepkey/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,37 +167,43 @@ function keepkey(): WalletInit {
asset: Asset
provider: StaticJsonRpcProvider
}) => {
let index = getAccountIdx(derivationPath)
let zeroBalanceAccounts = 0
const accounts = []

// Iterates until a 0 balance account is found
// Then adds 4 more 0 balance accounts to the array
while (zeroBalanceAccounts < 5) {
const acc = await getAccount({
accountIdx: index,
provider,
asset
})
try {
let index = getAccountIdx(derivationPath)
let zeroBalanceAccounts = 0
const accounts = []

// Iterates until a 0 balance account is found
// Then adds 4 more 0 balance accounts to the array
while (zeroBalanceAccounts < 5) {
const acc = await getAccount({
accountIdx: index,
provider,
asset
})

if (
acc &&
acc.balance &&
acc.balance.value &&
acc.balance.value.isZero()
) {
zeroBalanceAccounts++
accounts.push(acc)
} else {
accounts.push(acc)
// Reset the number of 0 balance accounts
zeroBalanceAccounts = 0
}

if (
acc &&
acc.balance &&
acc.balance.value &&
acc.balance.value.isZero()
) {
zeroBalanceAccounts++
accounts.push(acc)
} else {
accounts.push(acc)
// Reset the number of 0 balance accounts
zeroBalanceAccounts = 0
index++
}

index++
return accounts
} catch (error) {
throw new Error(
(error as { message: { message: string } }).message.message
)
}

return accounts
}
let ethersProvider: StaticJsonRpcProvider
const scanAccounts = async ({
Expand Down
4 changes: 2 additions & 2 deletions packages/keystone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/keystone",
"version": "2.1.6",
"version": "2.1.7-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -57,6 +57,6 @@
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
"@keystonehq/eth-keyring": "^0.14.0-alpha.10.3",
"@web3-onboard/common": "^2.1.5"
"@web3-onboard/common": "^2.1.6-alpha.1"
}
}
4 changes: 2 additions & 2 deletions packages/ledger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/ledger",
"version": "2.1.5",
"version": "2.1.6-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -63,7 +63,7 @@
"@ledgerhq/hw-transport-u2f": "^5.36.0-deprecated",
"@ledgerhq/hw-transport-webusb": "^6.19.0",
"@metamask/eth-sig-util": "^4.0.0",
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"buffer": "^6.0.3",
"ethereumjs-util": "^7.1.3"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/magic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/magic",
"version": "2.0.8",
"version": "2.0.9-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -78,7 +78,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"joi": "^17.4.2",
"magic-sdk": "^8.1.0",
"rxjs": "^7.5.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/mew/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/mew",
"version": "2.0.5",
"version": "2.0.6-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -59,7 +59,7 @@
"@myetherwallet/mewconnect-web-client": "^2.2.0-beta.14"
},
"dependencies": {
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"rxjs": "^7.5.2"
}
}
4 changes: 2 additions & 2 deletions packages/portis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/portis",
"version": "2.0.5",
"version": "2.0.6-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -57,6 +57,6 @@
},
"dependencies": {
"@portis/web3": "^4.0.6",
"@web3-onboard/common": "^2.1.5"
"@web3-onboard/common": "^2.1.6-alpha.1"
}
}
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/react",
"version": "2.2.4-alpha.1",
"version": "2.2.4-alpha.2",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -59,8 +59,8 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/core": "^2.4.1-alpha.1",
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/core": "^2.4.1-alpha.2",
"@web3-onboard/common": "^2.1.6-alpha.1",
"use-sync-external-store": "1.0.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/torus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/torus",
"version": "2.0.6",
"version": "2.0.7-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -57,6 +57,6 @@
},
"dependencies": {
"@toruslabs/torus-embed": "^1.18.3",
"@web3-onboard/common": "^2.1.5"
"@web3-onboard/common": "^2.1.6-alpha.1"
}
}
4 changes: 2 additions & 2 deletions packages/trezor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/trezor",
"version": "2.1.5",
"version": "2.1.6-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -58,7 +58,7 @@
"dependencies": {
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
"@web3-onboard/common": "^2.1.5",
"@web3-onboard/common": "^2.1.6-alpha.1",
"buffer": "^6.0.3",
"eth-crypto": "^2.1.0",
"ethereumjs-util": "^7.1.3",
Expand Down
Loading