Skip to content

Commit 361fa2a

Browse files
authored
[core-v2.8.1-alpha.2] : Fix - Enable customNotifications without connected wallets or API key (#1232)
* Enable customNotifications without connected wallets or API key * Formatting code * Fix type issue * refine notify display logic
1 parent 2e41c97 commit 361fa2a

File tree

8 files changed

+184
-21
lines changed

8 files changed

+184
-21
lines changed

packages/core/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/core",
3-
"version": "2.8.1-alpha.1",
3+
"version": "2.8.1-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",

packages/core/src/index.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ function init(options: InitOptions): OnboardAPI {
167167
}
168168
}
169169

170-
if (!apiKey || !notifyUpdate.enabled) {
171-
notifyUpdate.enabled = false
172-
}
173-
174170
updateNotify(notifyUpdate)
175171
} else {
176172
const error = validateNotify(notify as Notify)
@@ -184,19 +180,11 @@ function init(options: InitOptions): OnboardAPI {
184180
...notify
185181
}
186182

187-
if (!apiKey || !notifyUpdate.enabled) {
188-
notifyUpdate.enabled = false
189-
}
190-
191183
updateNotify(notifyUpdate)
192184
}
193185
} else {
194186
const notifyUpdate: Partial<Notify> = APP_INITIAL_STATE.notify
195187

196-
if (!apiKey) {
197-
notifyUpdate.enabled = false
198-
}
199-
200188
updateNotify(notifyUpdate)
201189
}
202190

packages/core/src/views/Index.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
(!$accountCenter$.enabled ||
7777
($notify$.position !== $accountCenter$.position &&
7878
device.type !== 'mobile') ||
79-
separateMobileContainerCheck) &&
80-
$wallets$.length
79+
separateMobileContainerCheck ||
80+
!$wallets$.length)
8181
8282
$: displayAccountCenterSeparate =
8383
$accountCenter$.enabled &&

packages/dcent/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ function dcent({
108108
currentChain =
109109
chains.find(({ id }: Chain) => id === chainId) || currentChain
110110

111-
const provider = new StaticJsonRpcProvider(currentChain.rpcUrl)
111+
const provider = new StaticJsonRpcProvider(
112+
currentChain.rpcUrl
113+
) as providers.StaticJsonRpcProvider
112114

113115
return generateAccounts(dcentKeyring, provider)
114116
}

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@web3-onboard/coinbase": "^2.1.0",
26-
"@web3-onboard/core": "^2.8.0",
26+
"@web3-onboard/core": "^2.8.1-alpha.2",
2727
"@web3-onboard/dcent": "^2.1.0",
2828
"@web3-onboard/fortmatic": "^2.0.11",
2929
"@web3-onboard/gas": "^2.1.0",

packages/react/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/react",
3-
"version": "2.3.1-alpha.1",
3+
"version": "2.3.1-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",
@@ -62,7 +62,7 @@
6262
"typescript": "^4.5.5"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/core": "^2.8.0",
65+
"@web3-onboard/core": "^2.8.1-alpha.2",
6666
"@web3-onboard/common": "^2.2.1-alpha.1",
6767
"use-sync-external-store": "1.0.0"
6868
},

packages/vue/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/vue",
3-
"version": "2.2.1-alpha.1",
3+
"version": "2.2.1-alpha.2",
44
"description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. 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",
@@ -63,7 +63,7 @@
6363
"@vueuse/core": "^8.4.2",
6464
"@vueuse/rxjs": "^8.2.0",
6565
"@web3-onboard/common": "^2.2.1-alpha.1",
66-
"@web3-onboard/core": "^2.8.0",
66+
"@web3-onboard/core": "^2.8.1-alpha.2",
6767
"vue-demi": "^0.12.4"
6868
},
6969
"peerDependencies": {

yarn.lock

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2974,6 +2974,179 @@
29742974
dependencies:
29752975
"@walletconnect/window-getters" "^1.0.0"
29762976

2977+
"@web3-onboard/coinbase@^2.1.0":
2978+
version "2.1.0"
2979+
resolved "https://registry.yarnpkg.com/@web3-onboard/coinbase/-/coinbase-2.1.0.tgz#de3223b82b838feb006f86cb10ae6196d915b36d"
2980+
integrity sha512-1aqgioMeu/2gz/PXryceCj5iwAkCoULURxTEiENqqsUg0r5jm96NbOnaL4js7DNV/yKR0IU1gd6IksdtBdqJPw==
2981+
dependencies:
2982+
"@coinbase/wallet-sdk" "^3.0.5"
2983+
"@web3-onboard/common" "^2.2.0"
2984+
2985+
"@web3-onboard/common@^2.1.7", "@web3-onboard/common@^2.2.0":
2986+
version "2.2.0"
2987+
resolved "https://registry.yarnpkg.com/@web3-onboard/common/-/common-2.2.0.tgz#a715115c8c8e05db03a7ce04c2c47c94206d02e9"
2988+
integrity sha512-J3V6pA5AUAbnBZGMhYGiAJjwMrFWwor69v6O7m0Srnfk7W8r0H963Vg9O6coam5ryGL9pBXXLLH41yaA+mZB0g==
2989+
dependencies:
2990+
bignumber.js "^9.1.0"
2991+
ethers "5.5.4"
2992+
joi "^17.4.2"
2993+
2994+
"@web3-onboard/dcent@^2.1.0":
2995+
version "2.1.0"
2996+
resolved "https://registry.yarnpkg.com/@web3-onboard/dcent/-/dcent-2.1.0.tgz#d32e4462d3cce78572a159bd7c4fd3b0cd6f4e0d"
2997+
integrity sha512-cP/eltBMuWfSfpqqnraHZEJODk9I5lSO4b3at7wRZqIEZeMYdOSOA6HaNPX/sOpkJCJTv99c6268RyWjjJ022Q==
2998+
dependencies:
2999+
"@ethereumjs/tx" "^3.4.0"
3000+
"@ethersproject/providers" "^5.5.0"
3001+
"@web3-onboard/common" "^2.2.0"
3002+
"@web3-onboard/hw-common" "^2.0.0"
3003+
eth-dcent-keyring "^0.2.2"
3004+
3005+
"@web3-onboard/fortmatic@^2.0.11":
3006+
version "2.0.11"
3007+
resolved "https://registry.yarnpkg.com/@web3-onboard/fortmatic/-/fortmatic-2.0.11.tgz#02bd8ef1f436242fdeff590e5694856d9befde1b"
3008+
integrity sha512-CXT+UGGdNoPK2j99zhOeGIn4+pylgaJyl7vN7iuoQo/TdVJm9FIscGawYUf3W41Pd/+f3LLHJ1mw0kbbosXTzw==
3009+
dependencies:
3010+
"@web3-onboard/common" "^2.2.0"
3011+
fortmatic "^2.2.1"
3012+
3013+
"@web3-onboard/gas@^2.0.0", "@web3-onboard/gas@^2.1.0":
3014+
version "2.1.0"
3015+
resolved "https://registry.yarnpkg.com/@web3-onboard/gas/-/gas-2.1.0.tgz#b771835523babfbcaf06af0684c241c0eac40224"
3016+
integrity sha512-dgARIqhiSGzL6Vi5fGWSCPVYonUO2VMqCg1riEjuwk5JW/u4Tyw+aAA/CBvQ7Wr2G32KDlvApPlch51LDHBEoA==
3017+
dependencies:
3018+
"@web3-onboard/common" "^2.2.0"
3019+
joi "^17.4.2"
3020+
rxjs "^7.5.2"
3021+
3022+
"@web3-onboard/gnosis@^2.1.0":
3023+
version "2.1.0"
3024+
resolved "https://registry.yarnpkg.com/@web3-onboard/gnosis/-/gnosis-2.1.0.tgz#0bd88d721775ec0adef212b09dc1ee1f41e63588"
3025+
integrity sha512-4Vin4icnoJSL0WbIUooyf+AAb6MWKw+PTiW+l+d8PuKtQiSrbLyUL5VSm/tbwZNClB+faGkohWulyAHR0lGzMQ==
3026+
dependencies:
3027+
"@gnosis.pm/safe-apps-provider" "^0.9.2"
3028+
"@gnosis.pm/safe-apps-sdk" "^6.1.1"
3029+
"@web3-onboard/common" "^2.2.0"
3030+
3031+
"@web3-onboard/hw-common@^2.0.0":
3032+
version "2.0.0"
3033+
resolved "https://registry.yarnpkg.com/@web3-onboard/hw-common/-/hw-common-2.0.0.tgz#aab020c8eeaa5fbfc756a955782ce7096b6318e1"
3034+
integrity sha512-86hRn019Zrs+usdlA/LsUDNnjsuxXa0ljI/4zpePh/kUqVryGmz5fhJMP+91vDRNKD5j4eea14TCGqW+lGj+9A==
3035+
dependencies:
3036+
"@ethereumjs/common" "2.6.2"
3037+
"@web3-onboard/common" "^2.2.0"
3038+
ethers "5.5.4"
3039+
joi "^17.4.2"
3040+
rxjs "^7.5.2"
3041+
3042+
"@web3-onboard/injected-wallets@^2.1.0":
3043+
version "2.1.0"
3044+
resolved "https://registry.yarnpkg.com/@web3-onboard/injected-wallets/-/injected-wallets-2.1.0.tgz#9621203b0008832abfa19a6755025a2a7227dfe9"
3045+
integrity sha512-jLUCeVgxYSJA4QtWM3Dt94nynFWPB204N+a1sFY7xxQUgKIJvmopRQ9uBffTqkqM0nSfSqa0H/ihHfRJoi/Q+A==
3046+
dependencies:
3047+
"@web3-onboard/common" "^2.2.0"
3048+
joi "^17.4.2"
3049+
lodash.uniqby "^4.7.0"
3050+
3051+
"@web3-onboard/keepkey@^2.2.0":
3052+
version "2.2.0"
3053+
resolved "https://registry.yarnpkg.com/@web3-onboard/keepkey/-/keepkey-2.2.0.tgz#02d7d70640860fe73b6e5c6acea993decc4dcb98"
3054+
integrity sha512-AzB4M+bGL22GyI0iK+tsUiNetTRQIAabxWZfG/HNgoQ0QfDUfLvZi31lVfi2xrd8Bmyysxf33JQ1eaGUGyueFA==
3055+
dependencies:
3056+
"@ethersproject/providers" "^5.5.0"
3057+
"@shapeshiftoss/hdwallet-core" "^1.15.2"
3058+
"@shapeshiftoss/hdwallet-keepkey-webusb" "^1.15.2"
3059+
"@web3-onboard/common" "^2.2.0"
3060+
"@web3-onboard/hw-common" "^2.0.0"
3061+
ethereumjs-util "^7.1.3"
3062+
3063+
"@web3-onboard/keystone@^2.2.0":
3064+
version "2.2.0"
3065+
resolved "https://registry.yarnpkg.com/@web3-onboard/keystone/-/keystone-2.2.0.tgz#cbbf36248cd2c752990a1366db0af9765ffdb00a"
3066+
integrity sha512-V8Kn90+zSNAqPp6zlDZyAv2kXohZMMPwGYBPBYPSuyM4UAMeStKkxtmGsrvNiGCgiyGB0bFACx9o4HeixRcOqg==
3067+
dependencies:
3068+
"@ethereumjs/tx" "^3.4.0"
3069+
"@ethersproject/providers" "^5.5.0"
3070+
"@keystonehq/eth-keyring" "^0.14.0-alpha.10.3"
3071+
"@web3-onboard/common" "^2.2.0"
3072+
"@web3-onboard/hw-common" "^2.0.0"
3073+
3074+
"@web3-onboard/ledger@^2.2.0":
3075+
version "2.2.0"
3076+
resolved "https://registry.yarnpkg.com/@web3-onboard/ledger/-/ledger-2.2.0.tgz#f50b6764fa77d892c8da61c04104197e928cd50e"
3077+
integrity sha512-VcGiB972lW+YoaRr9C/ClYcnZ0pSG4aWLiCry+Cye4Ykc21MeY/F+4hVGkWywzse246LKwCCVNql0zZi6zcMfg==
3078+
dependencies:
3079+
"@ethereumjs/tx" "^3.4.0"
3080+
"@ethersproject/providers" "^5.5.0"
3081+
"@ledgerhq/hw-app-eth" "^6.19.0"
3082+
"@ledgerhq/hw-transport-u2f" "^5.36.0-deprecated"
3083+
"@ledgerhq/hw-transport-webusb" "^6.19.0"
3084+
"@metamask/eth-sig-util" "^4.0.0"
3085+
"@web3-onboard/common" "^2.2.0"
3086+
"@web3-onboard/hw-common" "^2.0.0"
3087+
buffer "^6.0.3"
3088+
ethereumjs-util "^7.1.3"
3089+
3090+
"@web3-onboard/magic@^2.1.0":
3091+
version "2.1.0"
3092+
resolved "https://registry.yarnpkg.com/@web3-onboard/magic/-/magic-2.1.0.tgz#bb68d691e724567b9a64a66f30080ad5d1df6a42"
3093+
integrity sha512-E7rg5EeK3FqMHUL85ioIk26k+HWpBy272hLTz0vBO+8VovyB6NO7EycCT4Bg+t5saSYKkjRmNMVsB/4WGUvBHQ==
3094+
dependencies:
3095+
"@web3-onboard/common" "^2.2.0"
3096+
joi "^17.4.2"
3097+
magic-sdk "^8.1.0"
3098+
rxjs "^7.5.2"
3099+
3100+
"@web3-onboard/portis@^2.1.0":
3101+
version "2.1.0"
3102+
resolved "https://registry.yarnpkg.com/@web3-onboard/portis/-/portis-2.1.0.tgz#336fe7208b23b50ced08b2b2a85c64ddf5c93c1b"
3103+
integrity sha512-yZYacLDGTTVqOKI1mvohxg48W+gMZrcfkkbYUzgLp9mkCwV5HLjIL2FGT3EfzHKUupuH/PIdV8SjYESOqm9WCQ==
3104+
dependencies:
3105+
"@portis/web3" "^4.0.6"
3106+
"@web3-onboard/common" "^2.2.0"
3107+
3108+
"@web3-onboard/torus@^2.1.0":
3109+
version "2.1.0"
3110+
resolved "https://registry.yarnpkg.com/@web3-onboard/torus/-/torus-2.1.0.tgz#e69fd97305cf78747b76a5dc0190f8dab13c01bb"
3111+
integrity sha512-8xIsktxuGWl53KAwI2M7aZKij4I7fp9MAtCDHasaGAeVviB6khRYKUJb3cgjUd5hYRFM0jEmpmd4SLwX2nAUYA==
3112+
dependencies:
3113+
"@toruslabs/torus-embed" "^1.18.3"
3114+
"@web3-onboard/common" "^2.2.0"
3115+
3116+
"@web3-onboard/trezor@^2.2.0":
3117+
version "2.2.0"
3118+
resolved "https://registry.yarnpkg.com/@web3-onboard/trezor/-/trezor-2.2.0.tgz#24dd61fe26abd86aa6f2658b1b2d8d3cac5eb950"
3119+
integrity sha512-Asa9PV+ZECrAUScNfbSIHjO0Kdubu2/EOdCencu5wx5BAq/tnR8eJP6ji7BbXtvT10IOtTAXylifuKZpHvjlgg==
3120+
dependencies:
3121+
"@ethereumjs/tx" "^3.4.0"
3122+
"@ethersproject/providers" "^5.5.0"
3123+
"@web3-onboard/common" "^2.2.0"
3124+
"@web3-onboard/hw-common" "^2.0.0"
3125+
buffer "^6.0.3"
3126+
eth-crypto "^2.1.0"
3127+
ethereumjs-util "^7.1.3"
3128+
hdkey "^2.0.1"
3129+
trezor-connect "^8.2.6"
3130+
3131+
"@web3-onboard/walletconnect@^2.1.0":
3132+
version "2.1.0"
3133+
resolved "https://registry.yarnpkg.com/@web3-onboard/walletconnect/-/walletconnect-2.1.0.tgz#a2cc16c7e637ea500c8bbc93d63e021feb8a5262"
3134+
integrity sha512-/wdTrrtfdcB8KB3pjMVFc/hm2VHrsP5NfXjGIMcYxB+Yv6a1spWvZ+Z/vfJcYy+egEo/l2nhtbvqnP0Yt4PR8Q==
3135+
dependencies:
3136+
"@ethersproject/providers" "^5.5.0"
3137+
"@walletconnect/client" "^1.7.1"
3138+
"@walletconnect/qrcode-modal" "^1.7.1"
3139+
"@web3-onboard/common" "^2.2.0"
3140+
rxjs "^7.5.2"
3141+
3142+
"@web3-onboard/web3auth@^2.1.0":
3143+
version "2.1.0"
3144+
resolved "https://registry.yarnpkg.com/@web3-onboard/web3auth/-/web3auth-2.1.0.tgz#fb6a0c767e26edbf2bf98ab40c97ba49a52fcf70"
3145+
integrity sha512-2dnq6FsQTW+Pzk86N4nDq9FzsYDXsPuKa/+gOCK8ETbPs+vhzqF+Nr0lHJf6poEEdj4RJ/nfaIyzEhPPD1RMvA==
3146+
dependencies:
3147+
"@web3-onboard/common" "^2.2.0"
3148+
"@web3auth/web3auth" "^1.0.0"
3149+
29773150
"@web3auth/base-plugin@^1.0.1":
29783151
version "1.0.1"
29793152
resolved "https://registry.yarnpkg.com/@web3auth/base-plugin/-/base-plugin-1.0.1.tgz#1e2a87acf745299fdff6f92e6c46ee9bc38aa670"

0 commit comments

Comments
 (0)