Skip to content

Commit a79281c

Browse files
authored
Merge pull request #317 from blocknative/update-with-w3o-2.25.6-release
Update with w3o 2.25.6 release
2 parents 1712efa + 792d3aa commit a79281c

File tree

7 files changed

+968
-1860
lines changed

7 files changed

+968
-1860
lines changed
+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: PR Status Checks
22

33
on:
4-
# Allows it to be manually triggered, used primarily for debugging
4+
# Allows it to be manually triggered, used primarily for debugging
55
workflow_dispatch:
66
pull_request:
77
branches:
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
checks:
13-
name: "Checks"
13+
name: 'Checks'
1414
runs-on: ubuntu-latest
1515

1616
steps:
@@ -20,15 +20,14 @@ jobs:
2020
- name: Setup Nodejs and yarn
2121
uses: actions/setup-node@v2
2222
with:
23-
node-version: "16"
23+
node-version: '18'
2424
cache: yarn
2525

2626
- name: Install dependencies
2727
run: yarn
28-
28+
2929
- name: Check that it builds
3030
run: yarn build
3131
env:
32-
NODE_OPTIONS: "--max_old_space_size=8192"
32+
NODE_OPTIONS: '--max_old_space_size=8192'
3333
CI: false
34-

package.json

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
{
22
"name": "onboard-notify-react",
3-
"version": "0.35.13-0.0.1",
3+
"version": "0.40.1",
44
"dependencies": {
55
"@safe-global/safe-apps-provider": "^0.18.0",
66
"@safe-global/safe-apps-sdk": "^8.1.0",
7-
"@web3-onboard/arcana-auth": "^2.0.0-alpha.1",
8-
"@web3-onboard/bitget": "^2.0.1-alpha.1",
9-
"@web3-onboard/blocto": "^2.0.1-alpha.1",
10-
"@web3-onboard/capsule": "^2.0.1-alpha.3",
11-
"@web3-onboard/cede-store": "^2.2.0-alpha.1",
12-
"@web3-onboard/coinbase": "^2.2.7-alpha.1",
13-
"@web3-onboard/dcent": "^2.2.8-alpha.1",
14-
"@web3-onboard/enkrypt": "^2.0.4-alpha.1",
15-
"@web3-onboard/fortmatic": "^2.0.19-alpha.1",
16-
"@web3-onboard/frame": "^2.0.2-alpha.1",
17-
"@web3-onboard/frontier": "^2.0.4-alpha.1",
18-
"@web3-onboard/gas": "^2.1.8-alpha.1",
19-
"@web3-onboard/gnosis": "^2.2.1-alpha.1",
20-
"@web3-onboard/infinity-wallet": "^2.0.4-alpha.1",
21-
"@web3-onboard/injected-wallets": "^2.10.14-alpha.1",
22-
"@web3-onboard/keepkey": "^2.3.8-alpha.1",
23-
"@web3-onboard/keystone": "^2.3.8-alpha.1",
24-
"@web3-onboard/ledger": "^2.6.0-alpha.1",
25-
"@web3-onboard/magic": "^2.1.7-alpha.1",
26-
"@web3-onboard/metamask": "^2.0.4-alpha.1",
27-
"@web3-onboard/mew-wallet": "^2.0.4-alpha.1",
28-
"@web3-onboard/phantom": "^2.0.3-alpha.1",
29-
"@web3-onboard/portis": "^2.1.7-alpha.1",
30-
"@web3-onboard/react": "^2.8.15-alpha.1",
31-
"@web3-onboard/sequence": "^2.0.8-alpha.1",
32-
"@web3-onboard/taho": "^2.0.5-alpha.1",
33-
"@web3-onboard/torus": "^2.2.6-alpha.1",
34-
"@web3-onboard/transaction-preview": "^2.0.8-alpha.1",
35-
"@web3-onboard/trezor": "^2.4.4-alpha.1",
36-
"@web3-onboard/trust": "^2.0.4-alpha.1",
37-
"@web3-onboard/uauth": "^2.1.2-alpha.1",
38-
"@web3-onboard/venly": "^2.0.0-alpha.1",
39-
"@web3-onboard/walletconnect": "^2.5.4-alpha.1",
40-
"@web3-onboard/web3auth": "^2.2.3-alpha.1",
41-
"@web3-onboard/xdefi": "^2.0.5-alpha.1",
42-
"@web3-onboard/zeal": "^2.0.4-alpha.1",
7+
"@web3-onboard/arcana-auth": "^2.0.0",
8+
"@web3-onboard/bitget": "^2.0.1",
9+
"@web3-onboard/blocto": "^2.0.0",
10+
"@web3-onboard/capsule": "^2.0.2",
11+
"@web3-onboard/cede-store": "^2.1.0",
12+
"@web3-onboard/coinbase": "^2.2.6",
13+
"@web3-onboard/dcent": "^2.2.7",
14+
"@web3-onboard/enkrypt": "^2.0.4",
15+
"@web3-onboard/fortmatic": "^2.0.19",
16+
"@web3-onboard/frame": "^2.0.2",
17+
"@web3-onboard/frontier": "^2.0.4",
18+
"@web3-onboard/gas": "^2.1.8",
19+
"@web3-onboard/gnosis": "^2.2.0",
20+
"@web3-onboard/infinity-wallet": "^2.0.4",
21+
"@web3-onboard/injected-wallets": "^2.10.16",
22+
"@web3-onboard/keepkey": "^2.3.7",
23+
"@web3-onboard/keystone": "^2.3.7",
24+
"@web3-onboard/ledger": "^2.5.2",
25+
"@web3-onboard/magic": "^2.1.7",
26+
"@web3-onboard/metamask": "^2.0.6",
27+
"@web3-onboard/mew-wallet": "^2.0.4",
28+
"@web3-onboard/phantom": "^2.0.3",
29+
"@web3-onboard/portis": "^2.1.7",
30+
"@web3-onboard/react": "^2.8.13",
31+
"@web3-onboard/sequence": "^2.0.8",
32+
"@web3-onboard/taho": "^2.0.5",
33+
"@web3-onboard/torus": "^2.2.6",
34+
"@web3-onboard/transaction-preview": "^2.0.8",
35+
"@web3-onboard/trezor": "^2.4.3",
36+
"@web3-onboard/trust": "^2.0.4",
37+
"@web3-onboard/uauth": "^2.1.2",
38+
"@web3-onboard/venly": "^2.0.0",
39+
"@web3-onboard/walletconnect": "^2.5.5",
40+
"@web3-onboard/web3auth": "^2.2.3",
41+
"@web3-onboard/xdefi": "^2.0.5",
42+
"@web3-onboard/zeal": "^2.0.4",
4343
"ethers": "^5.5.2",
4444
"path-browserify": "^1.0.1",
4545
"react": "^18.2.0",

src/App.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const App = () => {
3838
const [bnGasPrices, setBNGasPrices] = useState('')
3939
const [rpcInfuraGasPrices, setRPCInfuraGasPrices] = useState('')
4040
const [toAddress, setToAddress] = useState('')
41-
// default test transaction to Goerli
42-
const [toChain, setToChain] = useState('0x5')
41+
// default test transaction to Sepolia
42+
const [toChain, setToChain] = useState(11155111)
4343
const [accountCenterPosition, setAccountCenterPosition] = useState('topRight')
4444
const [notifyPosition, setNotifyPosition] = useState('topRight')
4545
const [locale, setLocale] = useState('en')
@@ -84,7 +84,6 @@ const App = () => {
8484
provider = null
8585
} else {
8686
provider = new ethers.providers.Web3Provider(wallet.provider, 'any')
87-
8887
}
8988
}, [wallet])
9089

@@ -573,7 +572,10 @@ const App = () => {
573572
value={toChain}
574573
>
575574
{chains.map(({ id, label }) => {
576-
if (label === 'Goerli' || label === 'Polygon - Mumbai') {
575+
if (
576+
label === 'Sepolia' ||
577+
label === 'Polygon - Mumbai'
578+
) {
577579
return (
578580
<option value={id} key={id}>
579581
{label}

src/networkEnum.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
const networkEnum = Object.freeze({
22
'0x1': 'Ethereum Main',
3+
'0xaa36a7': 'Sepolia',
34
'0x38': 'BSC',
45
'0x89': 'Polygon',
56
'0xfa': 'Fantom',
67
localhost: 'localhost'
7-
});
8-
export default networkEnum;
8+
})
9+
export default networkEnum

src/services.js

+43-16
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,16 @@ import bloctoModule from '@web3-onboard/blocto'
3535
import bitgetModule from '@web3-onboard/bitget'
3636
import metamaskModule from '@web3-onboard/metamask'
3737
import arcanaAuthModule from '@web3-onboard/arcana-auth'
38-
import capsuleModule from '@web3-onboard/capsule'
39-
import { Environment } from '@web3-onboard/capsule'
38+
import metamaskSDK from '@web3-onboard/metamask'
39+
import capsuleModule, {
40+
Environment,
41+
OAuthMethod,
42+
Theme
43+
} from '@web3-onboard/capsule'
4044

4145
// Replace with your DApp's Infura ID
42-
const INFURA_ID = 'cea9deb6467748b0b81b920b005c10c1'
43-
export const infuraRPC = `https://mainnet.infura.io/v3/${INFURA_ID}`
46+
const INFURA_ID = '80633e48116943128cbab25e402764ab'
47+
export const infuraRPC = `https://eth.llamarpc.com`
4448

4549
const dappId = '937627e1-3507-44b8-af10-72728aa5f74b'
4650

@@ -84,8 +88,9 @@ const injected = injectedModule({
8488
const coinbase = coinbaseModule()
8589

8690
const walletConnect = walletConnectModule({
91+
handleUri: uri => console.log(uri),
8792
projectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5',
88-
dappUrl: 'https://reactdemo.blocknative.com/'
93+
dappUrl: 'https://www.onboard.blocknative.com'
8994
})
9095
const portis = portisModule({
9196
apiKey: 'b2b7586f-2b1e-4c30-a7fb-c2d1533b153b'
@@ -144,7 +149,7 @@ const uauthOptions = {
144149
walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5',
145150
redirectUri: 'http://localhost:8080/',
146151
scope:
147-
'openid wallet email:optional humanity_check:optional profile:optional social:optional'
152+
'openid wallet email:optional humanity_check:optional profile:optional social:optional'
148153
}
149154
const uauth = uauthModule(uauthOptions)
150155

@@ -167,9 +172,30 @@ const arcanaAuth = arcanaAuthModule({
167172
clientID: 'xar_test_c9c3bc702eb13255c58dab0e74cfa859711c13cb'
168173
})
169174

175+
const metamaskSDKWallet = metamaskSDK({
176+
options: {
177+
extensionOnly: false,
178+
i18nOptions: {
179+
enabled: true
180+
},
181+
dappMetadata: {
182+
name: 'Demo Web3Onboard'
183+
}
184+
}
185+
})
186+
170187
const capsule = capsuleModule({
171188
environment: Environment.DEVELOPMENT,
172-
apiKey: '992bbd9146d5de8ad0419f141d9a7ca7'
189+
apiKey: '992bbd9146d5de8ad0419f141d9a7ca7',
190+
modalProps: {
191+
oAuthMethods: [OAuthMethod.GOOGLE, OAuthMethod.TWITTER],
192+
theme: Theme.dark
193+
},
194+
constructorOpts: {
195+
portalBackgroundColor: '#5e5656',
196+
portalPrimaryButtonColor: '#ff6700',
197+
portalTextColor: '#ffffff'
198+
}
173199
})
174200

175201
export const initWeb3Onboard = init({
@@ -209,6 +235,7 @@ export const initWeb3Onboard = init({
209235
venly,
210236
blocto,
211237
arcanaAuth,
238+
metamaskSDKWallet,
212239
capsule
213240
],
214241
chains: [
@@ -232,10 +259,10 @@ export const initWeb3Onboard = init({
232259
]
233260
},
234261
{
235-
id: '0x5',
262+
id: 11155111,
236263
token: 'ETH',
237-
label: 'Goerli',
238-
rpcUrl: `https://goerli.infura.io/v3/${INFURA_ID}`
264+
label: 'Sepolia',
265+
rpcUrl: 'https://rpc.sepolia.org/'
239266
},
240267
{
241268
id: '0x13881',
@@ -310,14 +337,14 @@ export const initWeb3Onboard = init({
310337
},
311338
accountCenter: {
312339
desktop: {
313-
enabled: true,
314-
position: 'topRight',
340+
enabled: true,
341+
position: 'topRight'
315342
},
316343
mobile: {
317-
enabled: true,
318-
position: 'topRight'
344+
enabled: true,
345+
position: 'topRight'
319346
}
320-
},
347+
},
321348
// example customizing copy
322349
i18n: {
323350
es: {
@@ -360,7 +387,7 @@ export const initWeb3Onboard = init({
360387
// message: `Your transaction is pending, click <a href="https://goerli.etherscan.io/tx/${transaction.hash}" rel="noopener noreferrer" target="_blank">here</a> for more info.`,
361388
// or you could use onClick for when someone clicks on the notification itself
362389
onClick: () =>
363-
window.open(`https://goerli.etherscan.io/tx/${transaction.hash}`)
390+
window.open(`https://sepolia.etherscan.io/tx/${transaction.hash}`)
364391
}
365392
}
366393
}

src/views/Header/Header.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ const Header = props => {
2424
<img
2525
className="user-avatar"
2626
// This will change when we switch to Viem
27-
src={(ens.avatar && ens.avatar.url) ? ens.avatar.url : avatarPlaceholder}
27+
src={
28+
ens.avatar && ens.avatar.url
29+
? ens.avatar.url
30+
: avatarPlaceholder
31+
}
2832
alt="avatar"
2933
></img>
3034
<div

0 commit comments

Comments
 (0)