Skip to content

Commit

Permalink
Add new wagmi packages and setState (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamj1232 authored May 22, 2024
1 parent 67f8728 commit cfedf27
Show file tree
Hide file tree
Showing 4 changed files with 442 additions and 372 deletions.
65 changes: 33 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,43 @@
"dependencies": {
"@safe-global/safe-apps-provider": "^0.18.0",
"@safe-global/safe-apps-sdk": "^8.1.0",
"@web3-onboard/arcana-auth": "^2.1.0-viem.1",
"@web3-onboard/bitget": "^2.1.0-viem.1",
"@web3-onboard/blocto": "^2.1.0-viem.1",
"@web3-onboard/capsule": "^2.0.3-viem.1",
"@web3-onboard/cede-store": "^2.3.0-viem.1",
"@web3-onboard/coinbase": "^2.3.0-viem.1",
"@web3-onboard/arcana-auth": "^2.1.0-wagmi.1",
"@web3-onboard/bitget": "^2.1.0-wagmi.1",
"@web3-onboard/blocto": "^2.1.0-wagmi.1",
"@web3-onboard/capsule": "^2.1.0-wagmi.1",
"@web3-onboard/cede-store": "^2.3.0-wagmi.1",
"@web3-onboard/coinbase": "^2.3.0-wagmi.1",
"@web3-onboard/dcent": "^2.2.8-alpha.1",
"@web3-onboard/enkrypt": "^2.1.0-viem.1",
"@web3-onboard/fortmatic": "^2.1.0-viem.1",
"@web3-onboard/frame": "^2.1.0-viem.1",
"@web3-onboard/frontier": "^2.1.0-viem.1",
"@web3-onboard/gas": "^2.2.0-viem.1",
"@web3-onboard/gnosis": "^2.3.0-viem.1",
"@web3-onboard/infinity-wallet": "^2.1.0-viem.1",
"@web3-onboard/injected-wallets": "^2.11.0-viem.4",
"@web3-onboard/enkrypt": "^2.1.0-wagmi.1",
"@web3-onboard/fortmatic": "^2.1.0-wagmi.1",
"@web3-onboard/frame": "^2.1.0-wagmi.1",
"@web3-onboard/frontier": "^2.1.0-wagmi.1",
"@web3-onboard/gas": "^2.2.0-wagmi.1",
"@web3-onboard/gnosis": "^2.3.0-wagmi.1",
"@web3-onboard/infinity-wallet": "^2.1.0-wagmi.1",
"@web3-onboard/injected-wallets": "^2.11.0-wagmi.1",
"@web3-onboard/keepkey": "^2.3.8-alpha.1",
"@web3-onboard/keystone": "^2.3.8-alpha.1",
"@web3-onboard/ledger": "^2.7.0-viem.1",
"@web3-onboard/magic": "^2.2.0-viem.1",
"@web3-onboard/metamask": "^2.1.0-viem.1",
"@web3-onboard/mew-wallet": "^2.1.0-viem.1",
"@web3-onboard/phantom": "^2.1.0-viem.1",
"@web3-onboard/portis": "^2.2.0-viem.1",
"@web3-onboard/react": "^2.9.0-viem.2",
"@web3-onboard/sequence": "^2.1.0-viem.1",
"@web3-onboard/taho": "^2.1.0-viem.1",
"@web3-onboard/torus": "^2.3.0-viem.1",
"@web3-onboard/transaction-preview": "^2.1.0-viem.1",
"@web3-onboard/ledger": "^2.7.0-wagmi.1",
"@web3-onboard/magic": "^2.2.0-wagmi.1",
"@web3-onboard/metamask": "^2.1.0-wagmi.1",
"@web3-onboard/mew-wallet": "^2.1.0-wagmi.1",
"@web3-onboard/phantom": "^2.1.0-wagmi.1",
"@web3-onboard/portis": "^2.2.0-wagmi.1",
"@web3-onboard/react": "^2.9.0-wagmi.2",
"@web3-onboard/sequence": "^2.1.0-wagmi.1",
"@web3-onboard/taho": "^2.1.0-wagmi.1",
"@web3-onboard/torus": "^2.3.0-wagmi.1",
"@web3-onboard/transaction-preview": "^2.1.0-wagmi.1",
"@web3-onboard/trezor": "^2.4.4-alpha.1",
"@web3-onboard/trust": "^2.1.0-viem.1",
"@web3-onboard/uauth": "^2.2.0-viem.1",
"@web3-onboard/venly": "^2.1.0-viem.1",
"@web3-onboard/walletconnect": "^2.6.0-viem.1",
"@web3-onboard/web3auth": "^2.3.0-viem.1",
"@web3-onboard/xdefi": "^2.1.0-viem.1",
"@web3-onboard/zeal": "^2.1.0-viem.1",
"@web3-onboard/trust": "^2.1.0-wagmi.1",
"@web3-onboard/uauth": "^2.2.0-wagmi.1",
"@web3-onboard/venly": "^2.1.0-wagmi.1",
"@web3-onboard/wagmi": "^2.0.0-wagmi.1",
"@web3-onboard/walletconnect": "^2.5.6-alpha.1",
"@web3-onboard/web3auth": "^2.3.0-wagmi.1",
"@web3-onboard/xdefi": "^2.1.0-wagmi.1",
"@web3-onboard/zeal": "^2.1.0-wagmi.1",
"ethers": "^5.5.2",
"path-browserify": "^1.0.1",
"react": "^18.2.0",
Expand Down
7 changes: 6 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
useNotifications,
useSetChain,
useWallets,
useSetLocale
useSetLocale,
useWagmiConfig
} from '@web3-onboard/react'
import './App.css'
import Header from './views/Header/Header.js'
Expand All @@ -27,6 +28,7 @@ let provider
const App = () => {
const [{ wallet }, connect, disconnect, updateBalances, setWalletModules] =
useConnectWallet()
const wagmiConfig = useWagmiConfig()
const [{ chains, connectedChain, settingChain }, setChain] = useSetChain()
const [notifications, customNotification, updateNotify] = useNotifications()
const connectedWallets = useWallets()
Expand Down Expand Up @@ -92,6 +94,9 @@ const App = () => {
setBNGasPrices(estimates[0].blockPrices[0].estimatedPrices)
})
}, [])
useEffect(() => {
console.log('wagmiConfig', wagmiConfig)
}, [wagmiConfig])

useEffect(() => {
async function getEtherGasFromRPC() {
Expand Down
7 changes: 4 additions & 3 deletions src/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import venlyModule from '@web3-onboard/venly'
import bloctoModule from '@web3-onboard/blocto'
import bitgetModule from '@web3-onboard/bitget'
import metamaskModule from '@web3-onboard/metamask'
import wagmi from '@web3-onboard/wagmi'
import arcanaAuthModule from '@web3-onboard/arcana-auth'
import capsuleModule, {
Environment,
Expand Down Expand Up @@ -84,8 +85,6 @@ const injected = injectedModule({
// walletUnavailableMessage: wallet => `Oops ${wallet.label} is unavailable!`
})

const coinbase = coinbaseModule()

const walletConnect = walletConnectModule({
handleUri: uri => console.log(uri),
projectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5',
Expand All @@ -104,6 +103,7 @@ const web3auth = web3authModule({
'DJuUOKvmNnlzy6ruVgeWYWIMKLRyYtjYa9Y10VCeJzWZcygDlrYLyXsBQjpJ2hxlBO9dnl8t9GmAC2qOP5vnIGo'
})

const coinbase = coinbaseModule()
const torus = torusModule()
const infinityWallet = infinityWalletModule()
const ledger = ledgerModule({ projectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5' })
Expand Down Expand Up @@ -186,6 +186,7 @@ const capsule = capsuleModule({
})

export const initWeb3Onboard = init({
wagmi,
connect: {
autoConnectAllPreviousWallet: true
},
Expand Down Expand Up @@ -221,7 +222,7 @@ export const initWeb3Onboard = init({
cedeStore,
venly,
blocto,
arcanaAuth,
arcanaAuth
// capsule
],
chains: [
Expand Down
Loading

0 comments on commit cfedf27

Please sign in to comment.