Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Replace internal Ethers functionality with Viem - Add WAGMI support module #2203

Merged
merged 158 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 156 commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
e8b7fb5
Replaced isAddress check from ethers
Adamj1232 Apr 4, 2023
a279c87
Replace Ethers BigNumber usage with browser native BigInt
Adamj1232 Apr 4, 2023
c220378
Remove ethers from common
Adamj1232 Apr 4, 2023
6f2d769
Merge in latest dev and handle conflicts
Adamj1232 Apr 4, 2023
097eea6
Viem working for ens
Adamj1232 Apr 6, 2023
6841f91
Testing package size
Adamj1232 Apr 6, 2023
5a30b36
Working as expected!
Adamj1232 Apr 6, 2023
744ea48
Disable ums
Adamj1232 Apr 6, 2023
cd712b4
Cleanup chain usage
Adamj1232 Apr 6, 2023
01a6c14
More cleanup
Adamj1232 Apr 6, 2023
56775ba
Ens avatar testing
Adamj1232 Apr 7, 2023
55714f2
Some ethers swapped out for viem in Trezor and import map expanded
Adamj1232 Apr 7, 2023
0d25611
Alittle cleanup in Trezor
Adamj1232 Apr 7, 2023
fbf338b
revert Trezor changes
Adamj1232 Apr 10, 2023
c7c1a99
merge dev and handle conflicts
Adamj1232 Apr 10, 2023
a24a12a
All is working from old commit
Adamj1232 Apr 10, 2023
7857acd
Merge branch 'remove_ethers_test_branch' into enhancement/replace_ethers
Adamj1232 Apr 10, 2023
df7d22a
Fix conflict
Adamj1232 Apr 10, 2023
8f50c05
Remove logs
Adamj1232 Apr 10, 2023
8a6f44f
Return Address type to official check
Adamj1232 Apr 10, 2023
7907611
Update versions and handle type issues
Adamj1232 Apr 10, 2023
0f36179
Bump Viem to latest
Adamj1232 Apr 10, 2023
6594aa8
Add node version check and min set to 16.15.1
Adamj1232 Apr 11, 2023
6cb8b91
Add npmrc files with engine-strict set to true to core, react and vue…
Adamj1232 Apr 11, 2023
be24886
Added function for converting wei in both hex and string to eth, upda…
Adamj1232 Apr 12, 2023
54fc1c3
Handle conflicts from develop merge
Adamj1232 Apr 18, 2023
1a026a6
Return bignumber to core for now
Adamj1232 Apr 18, 2023
7454a99
cleanup and testing, removing unused code, refactor and rename to pro…
Adamj1232 Apr 18, 2023
43fac75
Remove bignumber from core again
Adamj1232 Apr 18, 2023
eb8d50e
Fix merge issue with unstoppable resolution
Adamj1232 Apr 18, 2023
4216c12
Return getText function for ens and update to viem
Adamj1232 Apr 18, 2023
af2986e
Refine ci changes scope to core and related packages
Adamj1232 Apr 19, 2023
003e2bf
Final pass of PR for cleanup and refactor
Adamj1232 Apr 19, 2023
749e2ec
Remove ethers from tp
Adamj1232 Apr 19, 2023
ad1741d
Update to latest viem
Adamj1232 Apr 21, 2023
1331af3
Update cede and WC docs
Adamj1232 May 4, 2023
6501187
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 May 4, 2023
8a4e611
Merged in develop and updated versions out of alpha flow
Adamj1232 May 4, 2023
9a71ef6
resolve conflict
Adamj1232 May 4, 2023
b0bafc3
Handle getting token symbol
Adamj1232 May 8, 2023
8d9400e
Update Viem usage and refactor for handling multiple promises
Adamj1232 May 16, 2023
1f7f565
Update config to publish viem test branches
Adamj1232 May 16, 2023
6c2f986
Update tsconfig and types
Adamj1232 May 17, 2023
131676d
Update node version in core
Adamj1232 May 17, 2023
9dd3a56
Bump versions for release and Remove console.log
Adamj1232 Mar 20, 2024
50c6dd5
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Mar 25, 2024
6407e04
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Mar 26, 2024
781e792
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 1, 2024
6f09e2c
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 4, 2024
5a34b64
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 5, 2024
cd21151
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 5, 2024
7bcedf0
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 9, 2024
1df7db3
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 12, 2024
14bc7bf
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 12, 2024
6923d85
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 12, 2024
6f303ca
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 12, 2024
6193944
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 12, 2024
e35c6d8
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 12, 2024
2b8d610
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 12, 2024
33b4dd9
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 12, 2024
b974a3d
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 15, 2024
b73822d
Merge branch 'develop' of github.com:blocknative/web3-onboard into de…
Adamj1232 Apr 15, 2024
6871663
Merge in develop and handle conflicts
Adamj1232 Apr 30, 2024
0a1018f
ENS working again
Adamj1232 Apr 30, 2024
52c7233
Progress within hw wallets
Adamj1232 May 1, 2024
fcf7281
Progress on chain imports
Adamj1232 May 1, 2024
385dc9a
Further refinement on viem usage of public client
Adamj1232 May 1, 2024
37b55f0
refine ledger, deprecate v1
Adamj1232 May 2, 2024
c061907
Update TS, revert viem changes to HW-wallets
Adamj1232 May 2, 2024
88b2af3
Handle ts errors
Adamj1232 May 2, 2024
6f8c4b1
Down to 7 ts errors
Adamj1232 May 3, 2024
1f8b9ce
Update packages for test release
Adamj1232 May 3, 2024
6244663
Handle all ts errors!
Adamj1232 May 6, 2024
48f5374
Cleanup
Adamj1232 May 6, 2024
38545de
Making progress
Adamj1232 May 8, 2024
56531cb
Wagmi core
Adamj1232 May 8, 2024
8cfd535
Refine imports and test a whole bunch
Adamj1232 May 8, 2024
1504254
Fix build errors
Adamj1232 May 8, 2024
c3ec2f7
Try later version of node in CI
Adamj1232 May 8, 2024
a1071e6
Add sass types to common
Adamj1232 May 8, 2024
d3a911e
Update tsconfig
Adamj1232 May 8, 2024
ddc2a0e
Update imports from common
Adamj1232 May 8, 2024
8246406
Refine types
Adamj1232 May 8, 2024
285ebd2
Update core imports
Adamj1232 May 8, 2024
65d5ea0
Update svelte preprocess
Adamj1232 May 8, 2024
9e107d2
Bump common version
Adamj1232 May 8, 2024
47f1f04
More refinements to core
Adamj1232 May 8, 2024
3560fd3
Remove log
Adamj1232 May 8, 2024
8f71df3
Update tsconfig for hw-common to resolve build error
Adamj1232 May 8, 2024
12bbaee
Ensure new utils file is part of commit
Adamj1232 May 8, 2024
51c60b5
Remove unnecessary commonjs as the issue was fixed by viem team
Adamj1232 May 9, 2024
eeafdd9
Use viem utils in common
Adamj1232 May 9, 2024
98c6c6d
Changes to versioning and ready for testing
Adamj1232 May 9, 2024
ffcb312
Bump version
Adamj1232 May 9, 2024
2a8695e
Merge in changes from viem branch
Adamj1232 May 9, 2024
a99ab63
More updates from viem branch
Adamj1232 May 9, 2024
c321a14
Merge branch 'develop' into feat/wagmi_support
Adamj1232 May 9, 2024
3edcb98
Refine package intialization and wagmi init
Adamj1232 May 10, 2024
09ecb23
testing signing
Adamj1232 May 10, 2024
e5ac02e
Update wagmi disconnect
Adamj1232 May 13, 2024
7b6a1d8
Update viem versions
Adamj1232 May 13, 2024
b4fa077
Yarn it
Adamj1232 May 13, 2024
4461904
Update publish workflow to publish all packages
Adamj1232 May 13, 2024
e87131e
Fix issue and redeploy
Adamj1232 May 13, 2024
1714b3d
Update solid node build version
Adamj1232 May 13, 2024
6b8f291
Handle build errors
Adamj1232 May 13, 2024
df37418
Update configs for build
Adamj1232 May 13, 2024
0ce505c
Update ci build config
Adamj1232 May 13, 2024
dda0f14
Bump arcana node version in CI
Adamj1232 May 13, 2024
5c6d017
Fix arcana
Adamj1232 May 13, 2024
dc91af0
Fix venly
Adamj1232 May 13, 2024
4f50dc3
Update gnosis pakcage.json
Adamj1232 May 13, 2024
9ff3c19
Merge in the latest viem support changes
Adamj1232 May 13, 2024
7d03fe8
Get all of the changes from viem merged and stablelized
Adamj1232 May 14, 2024
38bd88a
Use toHex function, switch chain now working
Adamj1232 May 14, 2024
89aaf1c
Handle multiple wallets correctly
Adamj1232 May 14, 2024
1897564
Still working thru MM sdk issues
Adamj1232 May 14, 2024
4140e36
Working through issues
Adamj1232 May 14, 2024
f177544
Still working through MM issues
Adamj1232 May 14, 2024
f354752
Connect working for sdks
Adamj1232 May 14, 2024
8bfe92d
wagmi support stabilized
Adamj1232 May 15, 2024
c57d89c
Cleanup logs
Adamj1232 May 15, 2024
aa0a140
More updates to wagmi on disconnect
Adamj1232 May 15, 2024
33743e2
Refine disconnect
Adamj1232 May 15, 2024
5204b93
Create and test wagmi module
Adamj1232 May 16, 2024
2a55f26
Create wagmi module
Adamj1232 May 16, 2024
aa94376
Add wagmi docs
Adamj1232 May 16, 2024
73b8468
Update examples
Adamj1232 May 16, 2024
2b81c95
Update disconnect to handle wagmi
Adamj1232 May 17, 2024
01d01e4
Handle ts errors in wagmi package
Adamj1232 May 17, 2024
6c78a24
Refine examples and more ts fixes
Adamj1232 May 17, 2024
793cca8
Handle more errors
Adamj1232 May 17, 2024
7794ac9
Update tags to be named as wagmi
Adamj1232 May 17, 2024
b4b32ed
Update CI for deployment
Adamj1232 May 17, 2024
e8b8ec4
Fix CI build for wagmi
Adamj1232 May 17, 2024
8a7fdf5
Update tsconfig
Adamj1232 May 17, 2024
319575a
Update tsconfig again
Adamj1232 May 17, 2024
de5b592
Update docs examples
Adamj1232 May 20, 2024
c1a8965
Merge in develop
Adamj1232 May 20, 2024
f83eb76
Fix build error
Adamj1232 May 20, 2024
3f4856b
cleanup exports and hook within react and document
Adamj1232 May 20, 2024
e307603
Refine docs
Adamj1232 May 20, 2024
2e04e2a
Merge in latest develop
Adamj1232 May 21, 2024
10dabba
Capsule is working!
Adamj1232 May 21, 2024
64ff9cb
merge in latest develop
Adamj1232 May 22, 2024
f992db1
Add note about init object to docs and readme
Adamj1232 May 22, 2024
5035898
Export all wagmi functions from wagmi package
Adamj1232 May 22, 2024
16156c5
Update docs
Adamj1232 May 22, 2024
175c18b
Fix examples
Adamj1232 May 22, 2024
99879af
Bump to latest versions of wagmi and viem
Adamj1232 May 23, 2024
325663e
bump common version
Adamj1232 May 23, 2024
e625722
Bump versions for latest deps
Adamj1232 May 23, 2024
bac782f
Bump versions for pub
Adamj1232 May 23, 2024
56d115c
Version from wagmi to alpha flag
Adamj1232 May 23, 2024
be5b37e
Revert testing ci changes
Adamj1232 May 28, 2024
b851646
update CI to remove testing flow
Adamj1232 May 28, 2024
82a46ae
Remove log
Adamj1232 May 28, 2024
6c725c6
Remove capsule for failing build from demo
Adamj1232 May 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 35 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ commands:
jobs:
build-core:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:16.15.1
working_directory: ~/web3-onboard-monorepo/packages/core
steps:
- node-build-steps
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
- node-build-steps
build-react:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:16.15.1
working_directory: ~/web3-onboard-monorepo/packages/react
steps:
- node-build-steps
Expand All @@ -293,7 +293,7 @@ jobs:
- node-build-steps
build-web3auth:
docker:
- image: cimg/node:16.18.1
- image: cimg/node:18.0.0
working_directory: ~/web3-onboard-monorepo/packages/web3auth
steps:
- node-build-steps
Expand All @@ -305,7 +305,7 @@ jobs:
- node-build-steps
build-vue:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:16.15.1
working_directory: ~/web3-onboard-monorepo/packages/vue
steps:
- node-build-steps
Expand Down Expand Up @@ -341,7 +341,7 @@ jobs:
- node-build-steps
build-uauth:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:18.0.0
working_directory: ~/web3-onboard-monorepo/packages/uauth
steps:
- node-build-steps
Expand Down Expand Up @@ -395,7 +395,7 @@ jobs:
- node-build-steps
build-arcana-auth:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:18.0.0
working_directory: ~/web3-onboard-monorepo/packages/arcana-auth
steps:
- node-build-steps
Expand All @@ -407,7 +407,7 @@ jobs:
- node-build-steps
build-venly:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:18.18.2
working_directory: ~/web3-onboard-monorepo/packages/venly
steps:
- node-build-steps
Expand All @@ -432,7 +432,7 @@ jobs:
resource_class: large
build-solid:
docker:
- image: cimg/node:16.14.2
- image: cimg/node:16.15.1
working_directory: ~/web3-onboard-monorepo/packages/solid
steps:
- node-build-steps
Expand All @@ -448,6 +448,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/particle-network
steps:
- node-build-steps
build-wagmi:
docker:
- image: cimg/node:18.0.0
working_directory: ~/web3-onboard-monorepo/packages/wagmi
steps:
- node-build-steps
build-passport:
docker:
- image: cimg/node:18.0.0
Expand All @@ -458,7 +464,7 @@ jobs:
# Build staging/Alpha releases
build-staging-core:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:16.15.1
working_directory: ~/web3-onboard-monorepo/packages/core
steps:
- node-staging-build-steps
Expand Down Expand Up @@ -566,7 +572,7 @@ jobs:
- node-staging-build-steps
build-staging-react:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:16.15.1
working_directory: ~/web3-onboard-monorepo/packages/react
steps:
- node-staging-build-steps
Expand All @@ -584,7 +590,7 @@ jobs:
- node-staging-build-steps
build-staging-web3auth:
docker:
- image: cimg/node:16.18.1
- image: cimg/node:18.0.0
working_directory: ~/web3-onboard-monorepo/packages/web3auth
steps:
- node-staging-build-steps
Expand All @@ -596,7 +602,7 @@ jobs:
- node-staging-build-steps
build-staging-vue:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:16.15.1
working_directory: ~/web3-onboard-monorepo/packages/vue
steps:
- node-staging-build-steps
Expand Down Expand Up @@ -632,7 +638,7 @@ jobs:
- node-staging-build-steps
build-staging-uauth:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:18.0.0
working_directory: ~/web3-onboard-monorepo/packages/uauth
steps:
- node-staging-build-steps
Expand Down Expand Up @@ -686,7 +692,7 @@ jobs:
- node-staging-build-steps
build-staging-arcana-auth:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:18.0.0
working_directory: ~/web3-onboard-monorepo/packages/arcana-auth
steps:
- node-staging-build-steps
Expand All @@ -698,7 +704,7 @@ jobs:
- node-staging-build-steps
build-staging-venly:
docker:
- image: cimg/node:16.13.1
- image: cimg/node:18.18.2
working_directory: ~/web3-onboard-monorepo/packages/venly
steps:
- node-staging-build-steps
Expand All @@ -722,7 +728,7 @@ jobs:
- node-staging-build-steps
build-staging-solid:
docker:
- image: cimg/node:16.14.2
- image: cimg/node:16.15.1
working_directory: ~/web3-onboard-monorepo/packages/solid
steps:
- node-staging-build-steps
Expand All @@ -738,6 +744,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/particle-network
steps:
- node-staging-build-steps
build-staging-wagmi:
docker:
- image: cimg/node:18.0.0
working_directory: ~/web3-onboard-monorepo/packages/wagmi
steps:
- node-staging-build-steps
build-staging-passport:
docker:
- image: cimg/node:18.0.0
Expand All @@ -753,6 +765,7 @@ workflows:
<<: *deploy_production_filters
- build-staging-common:
<<: *deploy_staging_filters

core:
jobs:
- build-core:
Expand Down Expand Up @@ -1030,6 +1043,12 @@ workflows:
<<: *deploy_production_filters
- build-staging-particle:
<<: *deploy_staging_filters
wagmi:
jobs:
- build-wagmi:
<<: *deploy_production_filters
- build-staging-wagmi:
<<: *deploy_staging_filters
passport:
jobs:
- build-passport:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/<INFURA_KEY>'
const injected = injectedModule()

const onboard = Onboard({
// This javascript object is unordered meaning props do not require a certain order
wallets: [injected],
chains: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const appMetadata = {

```ts
const onboard = Onboard({
// This javascript object is unordered meaning props do not require a certain order
wallets,
chains,
appMetadata
Expand Down
1 change: 1 addition & 0 deletions docs/src/routes/docs/[...3]modules/[...1]core/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ import injectedModule from '@web3-onboard/injected-wallets'
const injected = injectedModule()

const onboard = Onboard({
// This javascript object is unordered meaning props do not require a certain order
// head to https://explorer.blocknative.com/account to sign up for free
apiKey: 'xxx387fb-bxx1-4xxc-a0x3-9d37e426xxxx'
wallets: [injected],
Expand Down
29 changes: 29 additions & 0 deletions docs/src/routes/docs/[...3]modules/[...3]react/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const rpcUrl = `https://mainnet.infura.io/v3/${infuraKey}`

// initialize Onboard
init({
// This javascript object is unordered meaning props do not require a certain order
apiKey,
wallets: [injected],
chains: [
Expand Down Expand Up @@ -724,3 +725,31 @@ export default {
}
}
```

## `useWagmiConfig`

This hook allows you to get the WagmiConfig (Config from the Wagmi project) from @web3-onboard/core if W3O has been initialized with the [WAGMI property imported and passing into the web3-onboard/core config](../../modules/wagmi.md#usage).

```typescript
import { sendTransaction as wagmiSendTransaction } from '@web3-onboard/wagmi'
import { parseEther } from 'viem'
import { useWagmiConfig, wallets } from '@web3-onboard/react'
import type { WagmiConfig } from '@web3-onboard/core'

type useWagmiConfig = (): WagmiConfig

const wagmiConfig = useWagmiConfig()
const w3OWallets = useWallets()

const sendTransaction = async () => {
// current primary wallet - as multiple wallets can connect this value is the currently active
const [currentPrimaryWallet] = w3OWallets
const result = await wagmiSendTransaction(wagmiConfig, {
to: toAddress,
// desired connector to send txn from
account: currentPrimaryWallet.accounts[0],
value: parseEther('0.001')
})
console.log(result)
}
```
97 changes: 97 additions & 0 deletions docs/src/routes/docs/[...3]modules/[...8]wagmi/+page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
title: wagmi
---

# {$frontmatter.title}

A module for connecting wallets using WAGMI which returns a WAGMI config object to be used with [@wagmi/core](https://wagmi.sh/core/getting-started) functions.

### Install

<Tabs values={['yarn', 'npm']}>
<TabPanel value="yarn">

```sh copy
yarn add @web3-onboard/wagmi
```

</TabPanel>
<TabPanel value="npm">

```sh copy
npm install @web3-onboard/wagmi
```

</TabPanel>
</Tabs>

## Usage

This example assumes you have already setup web3-onboard to connect wallets to your dapp.
For more information see [web3-onboard docs](https://onboard.blocknative.com/docs/modules/core#install).

```ts
import Onboard from '@web3-onboard/core'
import injectedModule from '@web3-onboard/injected-wallets'
import wagmi from '@web3-onboard/wagmi'
import { parseEther } from 'viem'
import {
sendTransaction as wagmiSendTransaction,
switchChain,
disconnect,
getConnectors
} from '@web3-onboard/wagmi'
import { parseEther, isHex, fromHex } from 'viem'

const injected = injectedModule()

const onboard = Onboard({
// This javascript object is unordered meaning props do not require a certain order
// ... other Onboard options
wagmi,
wallets: [injected],
chains: [
{
id: '0x1',
token: 'ETH',
label: 'Ethereum',
rpcUrl: 'https://mainnet.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e'
}
]
// ... other Onboard options
})

const sendTransaction = async () => {
// current primary wallet - as multiple wallets can connect this value is the currently active
const [currentPrimaryWallet] = onboard.state.get().wallets
const wagmiConfig = onboard.state.get().wagmiConfig
const result = await wagmiSendTransaction(wagmiConfig, {
to: toAddress,
// desired connector to send txn from
account: currentPrimaryWallet.accounts[0],
value: parseEther('0.001')
})
console.log(result)
}

async function switchWagmiChain(chainId) {
let chainAsNumber
if (isHex(chainId)) {
chainAsNumber = fromHex(chainId, 'number')
} else if (!isHex(chainId) && typeof chainId === 'number') {
chainAsNumber = chainId
} else {
throw new Error('Invalid chainId')
}
const wagmiConfig = onboard.state.get().wagmiConfig
await switchChain(wagmiConfig, { chainId: chainAsNumber })
}

async function disconnectWallet() {
const wagmiConfig = onboard.state.get().wagmiConfig
const disconnectThisWallet = getConnectors(wagmiConfig).find(
(connector) => connector.name === label
)
disconnect(wagmiConfig, { connector: disconnectThisWallet })
}
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"devDependencies": {
"prettier": "^2.4.1",
"prettier-plugin-svelte": "^2.4.0",
"typescript": "^4.5.5"
"typescript": "^4.9.4"
},
"peerDependencies": {
"react": "*",
Expand Down
8 changes: 4 additions & 4 deletions packages/arcana-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/arcana-auth",
"version": "2.0.0",
"version": "2.1.0-alpha.2",
"license": "MIT",
"description": "Arcana wallet is a built-in, secure Web3 wallet that users can access instantly when logging into an app integrated with the Arcana Auth SDK. It offers a customizable interface that can be branded to match the app's style. Users don't need to generate or manage cryptographic keys or remember passphrases. The wallet uses advanced distributed key generation, giving users full control over their wallets while onboarding Web3 apps using familiar Web2 authentication methods. It is user-friendly, secure, and puts users in control of their Web3 experience.",
"private": false,
Expand All @@ -13,10 +13,10 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@arcana/auth": "^1.0.7",
"@web3-onboard/common": "2.3.3"
"@arcana/auth": "^1.0.10",
"@web3-onboard/common": "2.4.0-alpha.2"
},
"devDependencies": {
"typescript": "^5.1.6"
"typescript": "^5.4.5"
}
}
Loading
Loading