Skip to content

Commit

Permalink
Update packages to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamj1232 committed May 31, 2024
1 parent 0d2c59c commit 600cb69
Show file tree
Hide file tree
Showing 4 changed files with 450 additions and 258 deletions.
77 changes: 40 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,46 @@
"dependencies": {
"@safe-global/safe-apps-provider": "^0.18.0",
"@safe-global/safe-apps-sdk": "^8.1.0",
"@web3-onboard/arcana-auth": "^2.1.0-alpha.2",
"@web3-onboard/bitget": "^2.1.0-alpha.2",
"@web3-onboard/blocto": "^2.1.0-alpha.2",
"@web3-onboard/capsule": "^2.1.0-alpha.2",
"@web3-onboard/cede-store": "^2.3.0-alpha.2",
"@web3-onboard/coinbase": "^2.3.0-alpha.2",
"@web3-onboard/dcent": "^2.2.8-alpha.1",
"@web3-onboard/enkrypt": "^2.1.0-alpha.2",
"@web3-onboard/fortmatic": "^2.1.0-alpha.2",
"@web3-onboard/frame": "^2.1.0-alpha.2",
"@web3-onboard/frontier": "^2.1.0-alpha.2",
"@web3-onboard/gas": "^2.2.0-alpha.2",
"@web3-onboard/gnosis": "^2.3.0-alpha.2",
"@web3-onboard/infinity-wallet": "^2.1.0-alpha.2",
"@web3-onboard/injected-wallets": "^2.11.0-alpha.2",
"@web3-onboard/keepkey": "^2.3.8-alpha.1",
"@web3-onboard/keystone": "^2.3.8-alpha.1",
"@web3-onboard/ledger": "^2.7.0-alpha.2",
"@web3-onboard/magic": "^2.2.0-alpha.2",
"@web3-onboard/metamask": "^2.1.0-alpha.2",
"@web3-onboard/mew-wallet": "^2.1.0-alpha.2",
"@web3-onboard/phantom": "^2.1.0-alpha.2",
"@web3-onboard/portis": "^2.2.0-alpha.2",
"@web3-onboard/react": "^2.9.0-alpha.4",
"@web3-onboard/sequence": "^2.1.0-alpha.2",
"@web3-onboard/taho": "^2.1.0-alpha.2",
"@web3-onboard/torus": "^2.3.0-alpha.2",
"@web3-onboard/transaction-preview": "^2.1.0-alpha.2",
"@web3-onboard/trezor": "^2.4.4-alpha.1",
"@web3-onboard/trust": "^2.1.0-alpha.2",
"@web3-onboard/uauth": "^2.2.0-alpha.2",
"@web3-onboard/venly": "^2.1.0-alpha.2",
"@web3-onboard/wagmi": "2.0.0-alpha.5",
"@web3-onboard/walletconnect": "^2.6.0-alpha.2",
"@web3-onboard/web3auth": "^2.3.0-alpha.2",
"@web3-onboard/xdefi": "^2.1.0-alpha.2",
"@web3-onboard/zeal": "^2.1.0-alpha.2",
"@web3-onboard/arcana-auth": "^2.1.0",
"@web3-onboard/bitget": "^2.1.0",
"@web3-onboard/blocto": "^2.1.0",
"@web3-onboard/capsule": "^2.1.0",
"@web3-onboard/cede-store": "^2.3.0",
"@web3-onboard/coinbase": "^2.3.0",
"@web3-onboard/core": "2.22.0-alpha.7",
"@web3-onboard/dcent": "^2.2.9",
"@web3-onboard/enkrypt": "^2.1.0",
"@web3-onboard/fortmatic": "^2.1.0",
"@web3-onboard/frame": "^2.1.0",
"@web3-onboard/frontier": "^2.1.0",
"@web3-onboard/gas": "^2.2.0",
"@web3-onboard/gnosis": "^2.3.0",
"@web3-onboard/infinity-wallet": "^2.1.0",
"@web3-onboard/injected-wallets": "^2.11.0",
"@web3-onboard/keepkey": "^2.3.9",
"@web3-onboard/keystone": "^2.3.9",
"@web3-onboard/ledger": "^2.7.0",
"@web3-onboard/magic": "^2.2.0",
"@web3-onboard/metamask": "^2.1.0",
"@web3-onboard/mew-wallet": "^2.1.0",
"@web3-onboard/particle-network": "2.1.0-alpha.2",
"@web3-onboard/passport": "2.1.0-alpha.2",
"@web3-onboard/phantom": "^2.1.0",
"@web3-onboard/portis": "^2.2.0",
"@web3-onboard/react": "^2.9.0",
"@web3-onboard/sequence": "^2.1.0",
"@web3-onboard/taho": "^2.1.0",
"@web3-onboard/torus": "^2.3.0",
"@web3-onboard/transaction-preview": "^2.1.0",
"@web3-onboard/trezor": "^2.4.5",
"@web3-onboard/trust": "^2.1.0",
"@web3-onboard/uauth": "^2.2.0",
"@web3-onboard/venly": "^2.1.0",
"@web3-onboard/wagmi": "2.0.0-alpha.6",
"@web3-onboard/walletconnect": "^2.6.0",
"@web3-onboard/web3auth": "^2.3.0",
"@web3-onboard/xdefi": "^2.1.0",
"@web3-onboard/zeal": "^2.1.0",
"ethers": "^5.5.2",
"path-browserify": "^1.0.1",
"react": "^18.2.0",
Expand Down
22 changes: 13 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,28 +240,32 @@ const App = () => {
// WAGMI functions
async function switchChainWagmi(chainId) {
let chainAsNumber
const { wagmiConnector } = wallet

console.log('wagmiConnector', wagmiConnector)
if (isHex(chainId)) {
chainAsNumber = fromHex(chainId, 'number')
} else if (!isHex(chainId) && typeof chainId === 'number') {
chainAsNumber = chainId
} else {
throw new Error('Invalid chainId')
}
await switchChain(wagmiConfig, { chainId: chainAsNumber })
await switchChain(wagmiConfig, {
chainId: chainAsNumber,
connector: wagmiConnector
})
}

const sendTransactionWagmi = async () => {
const {label} = wallet
const transactWithThisWallet = getConnectors(wagmiConfig).find(
connector => connector.name === label
)
console.log('transactWithThisWallet', transactWithThisWallet)
const { wagmiConnector } = wallet

console.log('transactWithThisWallet', wagmiConnector)
// current primary wallet - as multiple wallets can connect this value is the currently active
const result = await wagmiSendTransaction(wagmiConfig, {
to: toAddress,
// desired connector to send txn from
value: parseEther('0.001'),
connector: transactWithThisWallet
// desired connector to send txn from
connector: wagmiConnector
})
console.log(result)
}
Expand Down Expand Up @@ -490,7 +494,7 @@ const App = () => {
className="chain-select"
onChange={({ target: { value } }) =>
// setChain({ chainId: value })
switchChainWagmi(value)
switchChainWagmi(value)
}
value={connectedChain?.id}
>
Expand Down
2 changes: 1 addition & 1 deletion src/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ export const initWeb3Onboard = init({
},
wallets: [
metamask,
coinbase,
injected,
walletConnect,
ledger,
trezor,
coinbase,
phantom,
gnosis,
trust,
Expand Down
Loading

0 comments on commit 600cb69

Please sign in to comment.