+
+
Onboarding Users with Onboard
+
+ {!wallet.provider && (
+
+ )}
+
+ {wallet.provider && (
+
+ )}
+
+ {wallet.provider && (
+
+ )}
+
+ {wallet.provider && (
+
+ )}
+ {wallet.provider && wallet.dashboard && (
+
+ )}
+ {wallet.provider && wallet.type === 'hardware' && address && (
+
+ )}
+
-
-
- with pre-flight and in-flight notifications
-
-
-
-
+
+
UI Settings
{
- if (!address) {
- await readyToTransact()
- }
-
- address && notify.account(address)
+ className={`bn-demo-button ${
+ darkMode ? 'selected-toggle-btn' : 'unselected-toggle-btn'
+ }`}
+ onClick={() => {
+ setDarkMode(true)
+ notify.config({ darkMode: true })
+ onboard.config({ darkMode: true })
}}
>
- Watch Current Account
+ Dark Mode
{
- if (!address) {
- await readyToTransact()
- }
-
- address && notify.unsubscribe(address)
+ className={`bn-demo-button ${
+ !darkMode ? 'selected-toggle-btn' : 'unselected-toggle-btn'
+ }`}
+ onClick={() => {
+ setDarkMode(false)
+ notify.config({ darkMode: false })
+ onboard.config({ darkMode: false })
+ }}
+ >
+ Light Mode
+
+ Desktop Positioning
+ {
+ setDesktopPosition('topLeft')
+ notify.config({ desktopPosition: 'topLeft' })
+ }}
+ >
+ Top Left
+
+ {
+ setDesktopPosition('topRight')
+ notify.config({ desktopPosition: 'topRight' })
+ }}
+ >
+ Top Right
+
+ {
+ setDesktopPosition('bottomRight')
+ notify.config({ desktopPosition: 'bottomRight' })
}}
>
- Un-watch Current Account
+ Bottom Right
{
- const { update } = notify.notification({
- eventCode: 'dbUpdate',
- type: 'pending',
- message: 'This is a custom notification triggered by the dapp'
- })
- setTimeout(
- () =>
- update({
- eventCode: 'dbUpdateSuccess',
- message: 'Updated status for custom notification',
- type: 'success'
- }),
- 4000
- )
+ setDesktopPosition('bottomLeft')
+ notify.config({ desktopPosition: 'bottomLeft' })
}}
>
- Custom Notification
+ Bottom Left
+
+ Mobile Positioning
+ {
+ setMobilePosition('top')
+ notify.config({ mobilePosition: 'top' })
+ }}
+ >
+ Top
+
+ {
+ setMobilePosition('bottom')
+ notify.config({ mobilePosition: 'bottom' })
+ }}
+ >
+ Bottom
-
-
UI Settings
- {
- setDarkMode(true)
- notify.config({ darkMode: true })
- onboard.config({ darkMode: true })
- }}
- >
- Dark Mode
-
- {
- setDarkMode(false)
- notify.config({ darkMode: false })
- onboard.config({ darkMode: false })
- }}
- >
- Light Mode
-
- Desktop Positioning
- {
- setDesktopPosition('topLeft')
- notify.config({ desktopPosition: 'topLeft' })
- }}
- >
- Top Left
-
- {
- setDesktopPosition('topRight')
- notify.config({ desktopPosition: 'topRight' })
- }}
- >
- Top Right
-
- {
- setDesktopPosition('bottomRight')
- notify.config({ desktopPosition: 'bottomRight' })
- }}
- >
- Bottom Right
-
- {
- setDesktopPosition('bottomLeft')
- notify.config({ desktopPosition: 'bottomLeft' })
- }}
- >
- Bottom Left
-
- Mobile Positioning
- {
- setMobilePosition('top')
- notify.config({ mobilePosition: 'top' })
- }}
- >
- Top
-
- {
- setMobilePosition('bottom')
- notify.config({ mobilePosition: 'bottom' })
- }}
- >
- Bottom
-
-
{
flexDirection: 'column',
position: 'fixed',
bottom: '1rem',
- left: '1rem'
+ left: '1rem',
+ color: '#716c6c'
}}
>
diff --git a/src/signer.js b/src/signer.js
deleted file mode 100644
index 621c8c98..00000000
--- a/src/signer.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import { ethers } from 'ethers'
-
-class UncheckedJsonRpcSigner extends ethers.Signer {
- constructor(signer) {
- super()
- ethers.utils.defineReadOnly(this, 'signer', signer)
- ethers.utils.defineReadOnly(this, 'provider', signer.provider)
- }
-
- getAddress() {
- return this.signer.getAddress()
- }
-
- sendTransaction(transaction) {
- return this.signer.sendUncheckedTransaction(transaction).then(hash => ({
- hash,
- nonce: null,
- gasLimit: null,
- gasPrice: null,
- data: null,
- value: null,
- chainId: null,
- confirmations: 0,
- from: null,
- wait: confirmations =>
- this.provider.waitForTransaction(hash, confirmations)
- }))
- }
-}
-
-function getSigner(provider) {
- return new UncheckedJsonRpcSigner(provider.getSigner())
-}
-
-export default getSigner
diff --git a/yarn.lock b/yarn.lock
index d738b89b..e7bbc352 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1784,6 +1784,13 @@
dependencies:
"@ethersproject/logger" "^5.5.0"
+"@ethersproject/networks@5.5.1":
+ version "5.5.1"
+ resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.5.1.tgz#b7f7b9fb88dec1ea48f739b7fb9621311aa8ce6c"
+ integrity sha512-tYRDM4zZtSUcKnD4UMuAlj7SeXH/k5WC4SP2u1Pn57++JdXHkRu2zwNkgNogZoxHzhm9Q6qqurDBVptHOsW49Q==
+ dependencies:
+ "@ethersproject/logger" "^5.5.0"
+
"@ethersproject/pbkdf2@5.4.0", "@ethersproject/pbkdf2@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c"
@@ -1896,6 +1903,31 @@
bech32 "1.1.4"
ws "7.4.6"
+"@ethersproject/providers@5.5.1":
+ version "5.5.1"
+ resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.5.1.tgz#ba87e3c93219bbd2e2edf8b369873aee774abf04"
+ integrity sha512-2zdD5sltACDWhjUE12Kucg2PcgM6V2q9JMyVvObtVGnzJu+QSmibbP+BHQyLWZUBfLApx2942+7DC5D+n4wBQQ==
+ dependencies:
+ "@ethersproject/abstract-provider" "^5.5.0"
+ "@ethersproject/abstract-signer" "^5.5.0"
+ "@ethersproject/address" "^5.5.0"
+ "@ethersproject/basex" "^5.5.0"
+ "@ethersproject/bignumber" "^5.5.0"
+ "@ethersproject/bytes" "^5.5.0"
+ "@ethersproject/constants" "^5.5.0"
+ "@ethersproject/hash" "^5.5.0"
+ "@ethersproject/logger" "^5.5.0"
+ "@ethersproject/networks" "^5.5.0"
+ "@ethersproject/properties" "^5.5.0"
+ "@ethersproject/random" "^5.5.0"
+ "@ethersproject/rlp" "^5.5.0"
+ "@ethersproject/sha2" "^5.5.0"
+ "@ethersproject/strings" "^5.5.0"
+ "@ethersproject/transactions" "^5.5.0"
+ "@ethersproject/web" "^5.5.0"
+ bech32 "1.1.4"
+ ws "7.4.6"
+
"@ethersproject/random@5.4.0", "@ethersproject/random@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16"
@@ -2123,6 +2155,17 @@
"@ethersproject/properties" "^5.5.0"
"@ethersproject/strings" "^5.5.0"
+"@ethersproject/web@5.5.1":
+ version "5.5.1"
+ resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.5.1.tgz#cfcc4a074a6936c657878ac58917a61341681316"
+ integrity sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==
+ dependencies:
+ "@ethersproject/base64" "^5.5.0"
+ "@ethersproject/bytes" "^5.5.0"
+ "@ethersproject/logger" "^5.5.0"
+ "@ethersproject/properties" "^5.5.0"
+ "@ethersproject/strings" "^5.5.0"
+
"@ethersproject/wordlists@5.4.0", "@ethersproject/wordlists@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7"
@@ -4389,10 +4432,10 @@ bnb-javascript-sdk-nobroadcast@^2.16.14:
regenerator-runtime "^0.13.3"
uuid "^3.3.3"
-bnc-notify@^1.9.1:
- version "1.9.1"
- resolved "https://registry.yarnpkg.com/bnc-notify/-/bnc-notify-1.9.1.tgz#cd8ec8e5f5482cf78b6caea7de35288ee73d6b32"
- integrity sha512-OWXI6KIOU/0CWhlFBiIStfbio3X5uUTeBjG6h4R7Ng6MABqZHMFRCNOgVQ50HdwwZiaFMuA3l23cZLxJjyaY0Q==
+bnc-notify@^1.9.2:
+ version "1.9.2"
+ resolved "https://registry.yarnpkg.com/bnc-notify/-/bnc-notify-1.9.2.tgz#f077559643ae0eed69759524dff904b7a9f2f07f"
+ integrity sha512-Eeo7NiPuZqhod2dEuL1M67SHUDVm4jExv70yubv5arexN2BhW/ruzCzklPExv/oqo8q6H4fQicQiT4jCN6zPPQ==
dependencies:
bignumber.js "^9.0.0"
bnc-sdk "^3.5.0"
@@ -7352,6 +7395,42 @@ ethers@^5.4.7:
"@ethersproject/web" "5.5.0"
"@ethersproject/wordlists" "5.5.0"
+ethers@^5.5.2:
+ version "5.5.2"
+ resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.5.2.tgz#cd2e508c7342c44fa70392f722e8de8f2416489f"
+ integrity sha512-EF5W+6Wwcu6BqVwpgmyR5U2+L4c1FQzlM/02dkZOugN3KF0cG9bzHZP+TDJglmPm2/IzCEJDT7KBxzayk7SAHw==
+ dependencies:
+ "@ethersproject/abi" "5.5.0"
+ "@ethersproject/abstract-provider" "5.5.1"
+ "@ethersproject/abstract-signer" "5.5.0"
+ "@ethersproject/address" "5.5.0"
+ "@ethersproject/base64" "5.5.0"
+ "@ethersproject/basex" "5.5.0"
+ "@ethersproject/bignumber" "5.5.0"
+ "@ethersproject/bytes" "5.5.0"
+ "@ethersproject/constants" "5.5.0"
+ "@ethersproject/contracts" "5.5.0"
+ "@ethersproject/hash" "5.5.0"
+ "@ethersproject/hdnode" "5.5.0"
+ "@ethersproject/json-wallets" "5.5.0"
+ "@ethersproject/keccak256" "5.5.0"
+ "@ethersproject/logger" "5.5.0"
+ "@ethersproject/networks" "5.5.1"
+ "@ethersproject/pbkdf2" "5.5.0"
+ "@ethersproject/properties" "5.5.0"
+ "@ethersproject/providers" "5.5.1"
+ "@ethersproject/random" "5.5.0"
+ "@ethersproject/rlp" "5.5.0"
+ "@ethersproject/sha2" "5.5.0"
+ "@ethersproject/signing-key" "5.5.0"
+ "@ethersproject/solidity" "5.5.0"
+ "@ethersproject/strings" "5.5.0"
+ "@ethersproject/transactions" "5.5.0"
+ "@ethersproject/units" "5.5.0"
+ "@ethersproject/wallet" "5.5.0"
+ "@ethersproject/web" "5.5.1"
+ "@ethersproject/wordlists" "5.5.0"
+
ethjs-unit@0.1.6:
version "0.1.6"
resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699"