- #4042
b4d9ef79deb554ee20fed6666a474be5e7cdd522
Thanks @tmm! - Removedinjected
connectorisAuthorized
timeout.
9c862d8d63e3d692a22cef2a90782b74a9103f17
Thanks @tmm! - Reverted internal module loading utility.
- #3816
06bb598a7f04c7b167f5b7ff6d46bd15886a6a14
Thanks @marthendalnunes! - AddeddeployContract
action.
24a45b269bd0214a29d6f82a84ac66ef8c3f3822
Thanks @tmm! - AddedSameSite
default tocookieStorage
-
#4009
f2a7cefab96691ebed8b8e45ffde071c47b58dbe
Thanks @roninjin10! - Markedto
as optional forsendTransaction
. -
#4023
f0ea0b2a7fe193dadfeb49a4c8031ee451c638b5
Thanks @jxom! - Added chain check togetConnectorClient
since it's possible for connection state chain ID to get out of sync with the connector (e.g. wallet bug).
- #3970
030c7c2cb380dfd67a2182f62e2aa7a6e1601898
Thanks @nanxiaobei! - FixedcookieStorage
not working across paths.
- #3984
51fde8a0433b4fff357c1a8d7e08b41b4c86c968
Thanks @tmm! - FixedwriteContract
query types forvalue
property.
- #3962
2804a8a583b1874271154898b4bae38756ef581c
Thanks @tmm! - Added catch toreconnect
.
- #3940
a5071f581dfdfb961718873643a2fc629101c72a
Thanks @jxom! - Fixed usage ofmetaMask
connector in Vite environments.
- Bumped versions.
- #3928
3117e71825f9c58a0d718f3d1686f1a191fa9cb1
Thanks @tmm! - Updated the default Coinbase SDK incoinbaseWallet
Connector to v4.x.
- #3906
32fcb4a31dde6b0206961d8ffe9c651f8a459c67
Thanks @tmm! - Added support for Vue.
- #3924
1f58734f88458e0f6adb05c99f0c90f36ab286b8
Thanks @jxom! - RefactoredisChainsStale
logic inwalletConnect
connector.
- #3917
05948fdad5bb4a56b08916d45b3dec2cb1e5f55b
Thanks @jxom! - Updated@metamask/sdk
.
4fecbbb66d0aacd03b8c62a6455d11a33cde8f85
Thanks @jxom! - Fixed address comparison ingetConnectorClient
.
- #3910
e6139a97c4b8804d734b1547b5e3921ce01fbe24
Thanks @tmm! - Added experimentalwallet_revokePermissions
support toinjected
.
- #3904
addca28ebc20f1a4367c35fe9ef786decff9c87e
Thanks @jxom! - Updated@walletconnect/ethereum-provider
.
- #3902
204b7b624612405500ec098fb9e35facd3f74ca4
Thanks @jxom! - Made third-party SDK imports type-only.
- #3869
d4a78eb0
Thanks @jxom! - Fixed issue whereprepareTransactionRequest
would internally call unsupported wallet RPC methods.
- #3868
c2af20b8
Thanks @jxom! - AddedsupportsSimulation
property to connectors that indicates if the connector's wallet supports contract simulation.
- #3858
0d141f17
Thanks @yulafezmesi! - Fixed accessing reverted reason property insidewaitForTransactionReceipt
.
-
#3849
4781a405
Thanks @tmm! - FixedshimDisconnect: false
behavior. -
#3859
400c960b
Thanks @holic! - Added workaround to injected connector for MetaMask bug, where chain switching does not work if target chain RPC'net_version'
request fails.
- #3822
a97bfbae
Thanks @jxom! - Fixed an issue where Wagmi would not correctly rehydrate the active chain when a persisted store was being used.
-
#3777
b3b54ef1
Thanks @desfero! - FixedwriteContract
to forwardchainIn
when simulating contract call -
#3779
3da20bb8
Thanks @jxom! - Fixed an issue whereeth_requestAccounts
would be called upon reconnect instead ofeth_accounts
. -
a3d1858f
Thanks @jxom! - Fixed hydration conditional increateConfig
.
-
#3763
a59069e9
Thanks @tmm! - FixedgetConnectorClient
internal address comparison. -
#3608
0acd3132
Thanks @mqklin! - Disabledwallet_requestPermissions
prompt whenshimDisconnect
isfalse
.
dbdca8fd
Thanks @jxom! - Fixed issue where duplicate connectors could be instantiated if injected after page mount.
-
#3642
b479b5e8
Thanks @johanneskares! - Fixed a bug where minification caused the wrong functions to be called on the client. -
f5648dd2
Thanks @jxom! - UpdatedprepareTransactionRequest
types forviem@2.8.0
. -
1c1fee6a
Thanks @jxom! - Updated@walletconnect/ethereum-provider
. -
#3653
88a2d744
Thanks @tash-2s! - Fixed error occurring when adding chains without explorers to MetaMask.
- #3644
a91c0b64
Thanks @nishuzumi! - Exported types
-
#3533
9c3b85dd
Thanks @tmm! - Fixedaccount
property passthrough for actions. -
2a72214a
Thanks @tmm! - Shimmed EIP-1193removeListener
for injected since some wallets do not follow spec.
-
#3519
414eb048
Thanks @tmm! - Fixed multicall passing through all properties to Viem method. -
#3518
338e857d
Thanks @tmm! - Fixed internal store migration between versions.
-
#3510
660ff80d
Thanks @tmm! - Fixed issue where connectors returning multiple addresses didn't checksum correctly. -
#3433
101a7dd1
Thanks @tmm! - FixedgetClient
andgetPublicClient
throwing when used with unconfiguredchainId
.
- #3461
ca98041d
Thanks @marthendalnunes! - AddedgetTransactionConfirmations
action.
- #3427
370f1b4a
Thanks @marthendalnunes! - AddedprepareTransactionRequest
action.
- #3476
3be5bb7b
Thanks @jxom! - Modified persist strategy to only store "critical" properties that are needed before hydration.
- #3459
d950b666
Thanks @marthendalnunes! - AddedgetEnsText
action.
-
#3467
90ef39bb
Thanks @jxom! - Fixed an issue where connectors that share the same provider instance could reconnect when they have never been connected before. -
1cfb6e5a
Thanks @jxom! - Bumped listener limit on WalletConnect connector.
-
#3434
00bf10a4
Thanks @marthendalnunes! - AddedgetBytecode
andgetStorageAt
actions. -
#3416
64c073f6
Thanks @marthendalnunes! - AddedgetTransactionReceipt
action. -
#3408
fb6c4148
Thanks @marthendalnunes! - AddedgetProof
action.
- #3407
e00b8205
Thanks @jxom! - Added a prelude gas estimate check tosendTransaction
/useSendTransaction
.
-
#3402
64b82282
Thanks @Songkeys! - Fixed SSR cookie support for cookies that have special characters, e.g.=
.
- #3387
c9cd302e
Thanks @marthendalnunes! - Addedcall
action.
- #3384
ee868c33
Thanks @tmm! - Fixed connectors not bubbling error when connecting withchainId
and subsequent user rejection.
-
#3333
b3a0baaa
Thanks @tmm! - Wagmi Core 2.0 featuring:- Full TanStack Query support + queryKeys
- Connect multiple connectors
- Switch chains while disconnected
- EIP-6963 enabled
- Strongly typed chainId and chain properties
- Smaller bundle size
- Miscellaneous improvements and bug fixes
- Updated dependencies [
bbbbf587
]:- @wagmi/connectors@3.1.11
-
53ca1f7e
Thanks @tmm! - Removed LedgerConnector due to security vulnerability -
Updated dependencies [
53ca1f7e
]:- @wagmi/connectors@3.1.10
-
#3299
b02020b3
Thanks @dasanra! - Fixed issue with Safe SDK by bumping@safe-global/safe-apps-provider@0.18.1
-
Updated dependencies [
51eca0fb
,b02020b3
]:- @wagmi/connectors@3.1.9
- Updated dependencies [
e8f7bcbc
]:- @wagmi/connectors@3.1.8
-
#3276
83223a06
Thanks @glitch-txs! - Removed required namespaces from WalletConnect connector -
Updated dependencies [
83223a06
]:- @wagmi/connectors@3.1.7
- Updated dependencies [
a1950449
]:- @wagmi/connectors@3.1.5
- Updated dependencies [
4e6ec415
]:- @wagmi/connectors@3.1.4
- Updated dependencies [
e78aa337
]:- @wagmi/connectors@3.1.3
- #3125
725e73fe
Thanks @lukasrosario! - Fixed an issue wheredataSuffix
was not being passed down into viem'ssimulateContract
, causing the data to be omitted from requests.
-
#3076
4c36831b
Thanks @jxom! - Passchain
to viemsendTransaction
/writeContract
. -
#3006
f2ddce23
Thanks @jxom! - Changednormalize
to a dynamic import.
- Updated dependencies [
3aaba328
]:- @wagmi/connectors@3.1.2
- Updated dependencies [
bf831bb3
]:- @wagmi/connectors@3.1.1
- Updated dependencies [
2abeb285
]:- @wagmi/connectors@3.1.0
- #2619
0d79748c
Thanks @jxom! - Updated references:- Updated
@safe-global/safe-apps-sdk
to^8.0.0
(the one withviem
support)
- Updated
-
#2589
9680c347
Thanks @jxom! - FixedwriteContract
parameters to be compatible withprepareWriteContract
.
- #2433
54fcff5f
Thanks @jxom! - Added ability to pass anaccount
towriteContract
/prepareWriteContract
.
- #2338
92bfdc2c
Thanks @jxom! - Fixed an issue where synchronous switch chain behavior (WalletConnect v2) would encounter chain id race conditions inwatchWalletClient
.
-
Updated dependencies [
ea651cd7
]:- @wagmi/connectors@1.0.1
- #2235
5be0655c
Thanks @jxom! - Released v1. Read Migration Guide.
-
#2235
708b2ce2
Thanks @jxom! - Addedconfig.setPublicClient
&config.setWebSocketPublicClient
-
Updated references.
- Updated dependencies []:
- @wagmi/connectors@1.0.0-next.5
-
#2235
708b2ce2
Thanks @jxom! - Addedconfig.setPublicClient
&config.setWebSocketPublicClient
-
Added
config.setConnectors
- Updated dependencies []:
- @wagmi/connectors@1.0.0-next.6
- Updated viem.
Removed
goerli
export from main entrypoint.
- Updated dependencies []:
- @wagmi/connectors@1.0.0-next.5
- Updated references.
- Updated dependencies []:
- @wagmi/connectors@1.0.0-next.4
- Breaking: Renamed
createClient
tocreateConfig
- Breaking: Renamed
getClient
togetConfig
- Breaking: Removed
request
as an argument toprepareSendTransaction
&sendTransation
. Arguments now belong on the root level of the Action.
- Updated dependencies []:
- @wagmi/chains@1.0.0-next.0
- @wagmi/connectors@1.0.0-next.3
- updated viem
- Updated dependencies []:
- @wagmi/connectors@1.0.0-next.2
- Updated dependencies [
a7dda00c
]:- @wagmi/connectors@1.0.0-next.1
-
Updated dependencies []:
- @wagmi/connectors@0.3.19
-
#2208
cfc696d8
Thanks @bangtoven! - Bumped references to apply coinbase wallet sdk updates -
Updated dependencies []:
- @wagmi/connectors@0.3.16
-
Updated dependencies []:
- @wagmi/connectors@0.3.12
-
#2099
f1fee5b3
Thanks @jxom! - Added chains:nexi
polygonZkEvm
xdc
xdcTestnet
-
#2085
7d64e3f5
Thanks @jxom! - Fixed an issue where multicall would not throw if the target chain was not configured on the wagmi client. -
Updated dependencies []:
- @wagmi/connectors@0.3.10
-
Updated dependencies []:
- @wagmi/connectors@0.3.10
-
#2053
665df1bf
Thanks @tmm! - Fixed issue where you add a new chain to MetaMask, but the switch after is rejected. -
Updated dependencies []:
- @wagmi/connectors@0.3.7
-
Updated dependencies []:
- @wagmi/connectors@0.3.6
-
#2043
49a58320
Thanks @tmm! - RemovedInjectedConnector
shimChainChangedDisconnect
shim (no longer necessary). -
Updated dependencies []:
- @wagmi/connectors@0.3.6
-
#2016
06bf61de
Thanks @jxom! - Added chains:boba
chronos
crossbell
dfk
dogechain
flare
flareTestnet
klaytn
scrollTestnet
shardeumSphinx
skaleCalypso
skaleCalypsoTestnet
skaleChaosTestnet
skaleCryptoBlades
skaleCryptoColosseum
skaleEuropa
skaleEuropaTestnet
skaleExorde
skaleHumanProtocol
skaleNebula
skaleNebulaTestnet
skaleRazor
skaleTitan
skaleTitanTestnet
songbird
songbirdTestnet
titan
titanTestnet
wanchain
wanchainTestnet
-
#2016
06bf61de
Thanks @jxom! - Updated references/ submodule. -
Updated dependencies []:
- @wagmi/connectors@0.3.4
-
#1902
0994e896
Thanks @jxom! - Breaking: Removed theversion
config option forWalletConnectConnector
.WalletConnectConnector
now uses WalletConnect v2 by default. WalletConnect v1 is nowWalletConnectLegacyConnector
.import { WalletConnectConnector } from 'wagmi/connectors/walletConnect' const connector = new WalletConnectConnector({ options: { - version: '2', projectId: 'abc', }, })
-import { WalletConnectConnector } from 'wagmi/connectors/walletConnect' +import { WalletConnectConnector } from 'wagmi/connectors/walletConnectLegacy' -const connector = new WalletConnectConnector({ +const connector = new WalletConnectLegacyConnector({ options: { qrcode: true, }, })
- Updated dependencies []:
- @wagmi/connectors@0.3.2
-
#1907
cc4e74ee
Thanks @jxom! - Added the following chains to thewagmi/chains
entrypoint:baseGoerli
harmonyOne
polygonZkEvmTestnet
-
Updated dependencies []:
- @wagmi/connectors@0.2.7
-
#1812
c7fd7fbd
Thanks @jxom! - Added the following chains to thewagmi/chains
entrypoint:filecoinCalibration
moonbaseAlpha
moonbeam
moonriver
-
Updated dependencies []:
- @wagmi/connectors@0.2.5
-
#1786
b173a431
Thanks @tmm! - Locked ethers peer dependency version to >=5.5.1 <6 -
Updated dependencies []:
- @wagmi/connectors@0.2.4
-
#1773
9aaf1955
Thanks @jxom! - Updated@walletconnect/universal-provider
onWalletConnectConnector
v2. Added more signable methods toWalletConnectConnector
v2. -
#1773
9aaf1955
Thanks @jxom! - Added Telos to thewagmi/chains
entrypoint. Thanks @donnyquixotic! -
Updated dependencies []:
- @wagmi/connectors@0.2.3
-
#1756
31d06b8c
Thanks @jxom! - Added OKC Chain. Thanks @clark-cui! -
#1756
31d06b8c
Thanks @jxom! - Fixed race condition betweenswitchNetwork
and mutation Actions that usechainId
(e.g.sendTransaction
). Thanks @DanInTheD4rk! -
Updated dependencies []:
- @wagmi/connectors@0.2.2
-
#1752
144a0e76
Thanks @jxom! - ImprovedWalletConnectConnector
(v2) initialization & updated dependencies. -
#1752
144a0e76
Thanks @jxom! - Added the following chains to thewagmi/chains
entrypoint:- Aurora – thanks @salil-naik
- Bronos – thanks @chedetinaveen
- Canto – thanks @tster
- Celo – thanks @aaronmgdr
-
Updated dependencies []:
- @wagmi/connectors@0.2.1
- #1732
01e21897
Thanks @tmm! - Bumped minimum TypeScript version to typescript@>=4.9.4. TypeScript 5.0 is coming soon and has some great features we are excited to bring into wagmi. To prepare for this, update your TypeScript version to 4.9.4 or higher. There are likely no breaking changes if you are coming from typescript@4.7.x || typescript@4.8.x.
-
#1705
9ff797dc
Thanks @jxom! - Added the following chains to the@wagmi/core/chains
entrypoint:crossbell
(thanks @Songkeys)filecoin
&filecoinHyperspace
(thanks @neil0x46dc)gnosisChiado
(thanks @theNvN)metis
&metisGoerli
(thanks @CookedCookee)
- #1685
917f5bc1
Thanks @jxom! - Replaced qrcodemodal with web3modal for the WalletConnect v2 Connector.
- #1636
025f6771
Thanks @DanielSinclair! - AddedisRainbow
flag to injectedwindow.ethereum
types.
-
#1570
216f585b
Thanks @wslyvh! - AddedwatchPendingTransactions
-
#1470
3a1a6c9f
Thanks @jxom! - TheWalletConnectConnector
now supports WalletConnect v2.It can be enabled by setting
version
to'2'
and supplying a WalletConnect CloudprojectId
.
-
#1539
732da004
Thanks @0xFlicker! - All Providers (ie. Alchemy, Infura, Public) now use the ENS Registry address on the wagmiChain
object (chain.contracts.ensRegistry
). -
#1574
ecde3d10
Thanks @jxom! - Added the following chains:iotex
iotexTestnet
zkSync
zkSyncTestnet
-
#1542
731b3b73
Thanks @jxom! - Added the following chains:evmos
evmosTestnet
gnosis
-
#1542
731b3b73
Thanks @jxom! - Updated Goerli symbol to"ETH"
. -
#1542
731b3b73
Thanks @jxom! - Updated Arbitrum Goerli RPC and Block Explorer. -
#1542
731b3b73
Thanks @jxom! - Fixed issue where connecting to MetaMask may return with a stale address. -
#1542
731b3b73
Thanks @jxom! - Removed ENS registry for Sepolia.
-
#1508
0b50b62f
Thanks @jxom! - Updated@wagmi/chains
to0.1.3
. -
#1504
11b8b794
Thanks @tmm! - Converted ethers custom "ACTION_REJECTED" error to standard RPC Error.
-
#1431
af28f8f9
Thanks @jxom! - Re-export connectors from@wagmi/connectors
-
#1431
af28f8f9
Thanks @jxom! - AddedLedgerConnector
connector
-
#1442
cde15289
Thanks @0xproflupin! - Added Phantom wallet support toInjectedConnector
-
#1444
310a8bc4
Thanks @jxom! - Assert that aconnector
exists before invoking the callback inwatchSigner
. -
#1434
100e2a3b
Thanks @tmm! - UpdatedMockConnector
chainId
behavior to default to first chain fromchains
if not provided inoptions
.
-
#1437
c34a3dc6
Thanks @jxom! - Omitted"EIP712Domain"
type fromsignTypedData
types
arg since ethers throws an internal error if you include it. -
#1445
51dd53cb
Thanks @jxom! - Fixed an issue where the wagmi client wouldn't rehydrate the store in local storage whenautoConnect
is truthy.
-
#1344
57a19374
Thanks @jxom! - Breaking: the shape of theChain
type has been modified.The
rpcUrls
shape has changed to include an array of URLs, and also the transport method (http
orwebSocket
):type Chain = { ... rpcUrls: { - [key: string]: string + [key: string]: { + http: string[] + webSocket: string[] + } } ... }
Note that you will also need to ensure that usage is migrated:
- const rpcUrl = mainnet.rpcUrls.alchemy + const rpcUrl = mainnet.rpcUrls.alchemy.http[0]
The
multicall
andens
attributes have been moved into thecontracts
object:type Contract = { address: Address blockCreated?: number } type Chain = { ... - multicall: Contract - ens: Contract + contracts: { + multicall3: Contract + ensRegistry: Contract + } ... }
Note that you will also need to ensure that usage is migrated:
- const multicallContract = mainnet.multicall + const multicallContract = mainnet.contracts.multicall3
-
#1344
57a19374
Thanks @jxom! - Breaking: Upgraded@coinbase/wallet-sdk
peer dependency to3.6.0
.Migration steps: Update
@coinbase/wallet-sdk
to^3.6.0
. -
#1344
57a19374
Thanks @jxom! - Breaking: Removed thewait
argument onwaitForTransaction
. Use the transactionhash
instead.const data = await waitForTransaction({ - wait: transaction.wait + hash: transaction.hash })
-
#1344
57a19374
Thanks @jxom! - Breaking: With the introduction of the@wagmi/core/chains
entrypoint,@wagmi/core
no longer exports the following:chain
allChains
defaultChains
defaultL2Chains
chainId
etherscanBlockExplorers
alchemyRpcUrls
,infuraRpcUrls
,publicRpcUrls
Read below for migration steps.
The
chain
export has been removed.@wagmi/core
now only exports themainnet
&goerli
chains. If you need to use an alternative chain (polygon
,optimism
, etc), you will need to import it from the@wagmi/core/chains
entrypoint.import { - chain configureChains } from '@wagmi/core' + import { mainnet, polygon, optimism } from '@wagmi/core/chains' const { ... } = configureChains( - [chain.mainnet, chain.polygon, chain.optimism], + [mainnet, polygon, optimism], { ... } )
The
allChains
export has been removed. If you need a list of all chains, you can utilize@wagmi/core/chains
entrypoint.- import { allChains } from '@wagmi/core' + import * as allChains from '@wagmi/core/chains' const { ... } = configureChains(allChains, ...)
The
defaultChains
&defaultL2Chains
exports have been removed. If you still need thedefaultChains
ordefaultL2Chains
exports, you can build them yourself:- import { defaultChains } from '@wagmi/core' + import { mainnet, goerli } from '@wagmi/core/chains' + const defaultChains = [mainnet, goerli]
The
defaultChains
export was previously populated withmainnet
&goerli
.- import { defaultL2Chains } from '@wagmi/core' + import { + arbitrum, + arbitrumGoerli, + polygon, + polygonMumbai, + optimism, + optimismGoerli + } from '@wagmi/core/chains' + const defaultL2Chains = [ + arbitrum, + arbitrumGoerli, + polygon, + polygonMumbai, + optimism + optimismGoerli + ]
The
defaultL2Chains
export was previously populated witharbitrum
&optimism
.The
chainId
export has been removed. You can extract a chain ID from the chain itself.- import { chainId } from '@wagmi/core' + import { mainnet, polygon, optimism } from '@wagmi/core/chains' -const mainnetChainId = chainId.mainnet -const polygonChainId = chainId.polygon -const optimismChainId = chainId.optimism +const mainnetChainId = mainnet.chainId +const polygonChainId = polygon.chainId +const optimismChainId = optimism.chainId
The
etherscanBlockExplorers
export has been removed. You can extract a block explorer from the chain itself.- import { etherscanBlockExplorers } from '@wagmi/core' + import { mainnet, polygon, optimism } from '@wagmi/core/chains' -const mainnetEtherscanBlockExplorer = etherscanBlockExplorers.mainnet -const polygonEtherscanBlockExplorer = etherscanBlockExplorers.polygon -const optimismEtherscanBlockExplorer = etherscanBlockExplorers.optimism +const mainnetEtherscanBlockExplorer = mainnet.blockExplorer +const polygonEtherscanBlockExplorer = polygon.blockExplorer +const optimismEtherscanBlockExplorer = optimism.blockExplorer
The
alchemyRpcUrls
,infuraRpcUrls
&publicRpcUrls
exports have been removed. You can extract a RPC URL from the chain itself.- import { alchemyRpcUrls, infuraRpcUrls, publicRpcUrls } from '@wagmi/core' + import { mainnet } from '@wagmi/core/chains' -const mainnetAlchemyRpcUrl = alchemyRpcUrls.mainnet -const mainnetInfuraRpcUrl = infuraRpcUrls.mainnet -const mainnetOptimismRpcUrl = publicRpcUrls.mainnet +const mainnetAlchemyRpcUrl = mainnet.rpcUrls.alchemy +const mainnetInfuraRpcUrl = mainnet.rpcUrls.infura +const mainnetOptimismRpcUrl = mainnet.rpcUrls.optimism
-
#1344
57a19374
Thanks @jxom! - Breaking: ChangedwaitForTransaction
behavior to throw an error if the transaction reverted. -
#1344
57a19374
Thanks @jxom! - Updated errors to usecause
instead ofinternal
-
#1344
57a19374
Thanks @jxom! -waitForTransaction
now respects repriced (sped up) transactions. -
#1344
57a19374
Thanks @jxom! -waitForTransaction
now throws an error for cancelled or replaced transactions.
- #1411
659be184
Thanks @tmm! - Fixed issue where block invalidation was not properly disabled when settingenabled: false
.
-
#1406
4f18c450
Thanks @tmm! - Function for selecting the EIP-1193 Ethereum Provider to target. Defaults to() => typeof window !== 'undefined' ? window.ethereum : undefined
.import { InjectedConnector } from "@wagmi/core/connectors/injected"; const connector = new InjectedConnector({ options: { name: "My Injected Wallet", getProvider: () => typeof window !== "undefined" ? window.myInjectedWallet : undefined, }, });
-
#1386
206a2adb
Thanks @jxom! - Fixed an issue wherepersister
would still usewindow.localStorage
instead of the wagmistorage
. -
#1376
a70a9528
Thanks @jxom! - Fixed issue whereswitchChain
onWalletConnectConnector
would not resolve. -
#1386
206a2adb
Thanks @jxom! - Addedserialize
/deserialize
as config options tocreateStorage
. -
#1392
88afc849
Thanks @tmm! - Added check for active connector when connecting
- #1384
027e88d6
Thanks @tmm! - Fixed issue reconnecting after disconnect withMetaMaskConnector
in MetaMask mobile browser.
- #1294
b2f88949
Thanks @tmm! - Setabi
return type value forprepareContractWrite
as more permissive when not inferrable asAbi
.
-
#1202
9bf56af
Thanks @tmm! - Breaking: Removed the following deprecated chains:ropsten
rinkeby
kovan
optimismKovan
arbitrumRinkeby
If you feel you still need to include one of these testnets in your application, you will have to define it manually:
-import { rinkeby } from 'wagmi' +import { Chain } from 'wagmi' +export const rinkeby: Chain = { + id: 4, + name: 'Rinkeby', + network: 'rinkeby', + nativeCurrency: { name: 'Rinkeby Ether', symbol: 'ETH', decimals: 18 }, + rpcUrls: { + alchemy: 'https://eth-rinkeby.alchemyapi.io/v2', + default: 'https://rpc.ankr.com/eth_rinkeby', + infura: 'https://rinkeby.infura.io/v3', + public: 'https://rpc.ankr.com/eth_rinkeby', + }, + blockExplorers: { + etherscan: 'https://rinkeby.etherscan.io', + default: 'https://rinkeby.etherscan.io', + }, + ens: { + address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', + }, + multicall: { + address: '0xca11bde05977b3631167028862be2a173976ca11', + blockCreated: 10299530, + }, + testnet: true, }
You can reference these removed chains here.
-
#1202
9bf56af
Thanks @tmm! - Breaking:addressOrName
renamed toaddress
forfetchBalance
andfetchEnsAvatar
.const result = await fetchBalance({ - addressOrName: '0x…', + address: '0x…', })
If you were using an ENS name instead of an address, you can resolve the name to an address before passing it to the action.
+ const { data: address } = await fetchEnsAddress({ name: 'example.eth' }) const result = await fetchBalance({ - addressOrName: 'example.eth', + address, })
-
#1202
9bf56af
Thanks @tmm! - Breaking: MadeapiKey
required oninfuraProvider
andalchemyProvider
.import { configureChains } from 'wagmi' const config = configureChains(defaultChains, [ - alchemyProvider(), + alchemyProvider({ apiKey: process.env.ALCHEMY_API_KEY }) ])
You can find your Alchemy API key from the Alchemy Dashboard, or your Infura API key from the Infura Dashboard.
- #1232
c0ca509
Thanks @tmm! - Added validation to check that chain is configured for connector when accessingSigner
.
- #1207
c73d463
Thanks @lvshaoping007! - Added Kucoin wallet support toInjectedConnector
-
#1132
d41c0d6
Thanks @toniocodo! - Added ERC-4626 ABI -
#1201
9a07efa
Thanks @jxom! - Fixed issue where non-checksum addresses did not resolve with an ENS name
-
#1174
196a458
Thanks @jxom! - Fixed an issue whereclient.chains
(active connector chains) would be populated when there is no active connector (disconnected user). -
#1176
389765f
Thanks @jxom! - Migrate away from Alchemy RPC URLs in the public RPC URL list
-
81ce9e6
Thanks @jxom! - AddisPortal
to injected MetaMask flags. -
c2c0109
Thanks @jxom! - Add etherscan block explorer to Optimism Goerli
-
#1162
30335b3
Thanks @tmm! - Fixed issue where non-indexed event parameter types were set tonull
. -
#1162
30335b3
Thanks @tmm! - Fixed issue whereuseContractReads
anduseContractInfiniteReads
types were slowing down TypeScript compiler.
- #1074
8db807f
Thanks @IljaDaderko! - ExportedEventListener
type
-
#940
b6cb8f4
Thanks @jxom! - Breaking:watchSigner
now requires an arguments object (that accepts an optionalchainId
) as it's first parameter.import { watchSigner } from `@wagmi/core` -watchSigner(signer => { +watchSigner({}, signer => { console.log('new signer!', signer) })
-
#940
b6cb8f4
Thanks @jxom! - Breaking:prepareSendTransaction
now throws when achainId
is specified and the end-user is on a different chain id (the wrong network). -
#941
0c96009
Thanks @tmm! - Breaking:addressOrName
andcontractInterface
renamed toaddress
andabi
respectively for contract actions:getContract
,multicall
,prepareWriteContract
,readContract
,readContracts
,watchContractEvent
,watchMulticall
,watchReadContract
,watchReadContracts
,writeContract
.import { readContract } from '@wagmi/core' const result = await readContract({ - addressOrName: '0x…', + address: '0x…', - contractInterface: […] as const, + abi: […] as const, functionName: 'balanceOf', args: ['0x…'], })
If you were using an ENS name instead of an address, you can resolve the name to an address before passing it to the action.
- import { readContract } from '@wagmi/core' + import { fetchEnsAddress, readContract } from '@wagmi/core' + const address = await fetchEnsAddress('example.eth') const result = await readContract({ - addressOrName: 'example.eth', + address, abi: […] as const, functionName: 'balanceOf', args: ['0x…'], })
-
#940
b6cb8f4
Thanks @jxom! - Breaking:prepareWriteContract
now throws when achainId
is specified and the end-user is on a different chain id (the wrong network). -
#940
b6cb8f4
Thanks @jxom! - Breaking:prepareSendTransaction
now only accepts asigner
instead ofsignerOrProvider
.This is to reach parity with
prepareWriteContract
.If no
signer
is provided, wagmi will use the signer that is currently connected. If no user is connected, thenprepareWriteContract
will throw an error. -
#941
0c96009
Thanks @tmm! - Breaking:args
config option must now be an array for the following actions:readContract
,writeContract
,prepareWriteContract
,multicall
,readContracts
,watchMulticall
, andwatchReadContracts
.import { readContract } from '@wagmi/core' const result = await readContract({ address: '0x…', abi: […], functionName: 'balanceOf', - args: '0x…', + args: ['0x…'], })
-
#941
0c96009
Thanks @tmm! - Breaking:watchContractEvent
now accepts a configuration object and callback instead of positional arguments.import { watchContractEvent } from '@wagmi/core' - const unsubscribe = watchContractEvent( - { - address: '0x…', - abi: […], - }, - 'Transfer', - (from, to, tokenId) => { - // ... - }, - { once: true }, - ) + const unsubscribe = watchContractEvent( + { + address: '0x…', + abi: […], + eventName: 'Transfer', + once: true, + }, + (from, to, tokenId) => { + // ... + }, + )
-
#941
0c96009
Thanks @tmm! - Breaking: Updated TypeScript version totypescript@>=4.7.4
.@wagmi/core
can now infer types based on ABI and EIP-712 Typed Data definitions, giving you full end-to-end type-safety from your contracts to your frontend and incredible developer experience (e.g. autocomplete contract function names and catch misspellings, type contract function arguments, etc.).For this to work, you must upgrade to
typescript@>=4.7.4
. Why is TypeScript v4.7.4 or greater necessary? TypeScript 4.7.4 introduced the ability to extend constraints on inferred type variables, which is used extensively to help narrow types for ABIs. Good news! When upgrading TypeScript from 4.6 to 4.7 there are likely no breaking changes for your set up. -
#941
0c96009
Thanks @tmm! - Breaking: Updated TypeScript generics for contract interaction and typed data actions.Adding a const assertion to
abi
allows TypeScript to inferfunctionName
,args
,overrides
, and return types for functions, andeventName
andlistener
types for events.import { readContract } from '@wagmi/core' const result = await readContract({ address: '0x…', - abi: […], + abi: […] as const, functionName: 'balanceOf', // will autocomplete and catch typos args: ['0x…'], // inferred based on `functionName` }) result // inferred based on `functionName`
This works for the following actions:
readContract
,writeContract
,prepareWriteContract
,multicall
,readContracts
,watchMulticall
,watchReadContracts
, andwatchContractEvent
.Adding a const assertion to
signTypedData
's config option,types
, allows TypeScript to infervalue
.import { signTypedData } from '@wagmi/core' const result = await signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], - }, + } as const, value: { // `value` is inferred based on `types` from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })
-
#1061
a4ffe8b
Thanks @alecananian! - Added Arbitrum Goerli Arbiscan block explorer -
#940
b6cb8f4
Thanks @jxom! - ThefetchSigner
action now accepts an optionalchainId
to use for signer initialization as an argument.import { fetchSigner } from "@wagmi/core"; import { optimism } from "@wagmi/core/chains"; // ... fetchSigner({ chainId: optimism.id });
-
#1048
ed13074
Thanks @Max-3-7! - Added support for Avalanche core wallet -
#1046
ab9ecaa
Thanks @jxom! - make ethers block format validator compatible with Celo -
#1050
73d4d47
Thanks @jxom! - update dependencieszustand@4.1.1
aa51bc4d
Thanks @jxom! - Fixed an issue inCoinbaseWalletConnector
where the browser extension would unintendedly reset the network when the browser is refreshed.
- #955
e326cd80
Thanks @0xFlicker! - Added Infura RPC URL for Sepolia
cec14089
Thanks @jxom! - Fixed an issue whereuseProvider
&getProvider
were not returning referentially equal providers.
cec14089
Thanks @jxom! - Fixed an issue where thewatch
option was not respecting the neighboringchainId
option inuseBlockNumber
.
cec14089
Thanks @jxom! - Fixed an issue where block listeners (viawatch
) were firing excessively on L2 chains.
-
#936
3329d1f
Thanks @jxom! - Added the ability to provide a custom logger to override how logs are broadcasted to the consumer in wagmi.A custom logger can be provided to the wagmi client via
logger
.logger?: { warn: typeof console.warn | null }
Passing in a custom logger
You can pass in a function to define your own custom logger.
+ import { logWarn } from './logger'; const client = createClient({ ... + logger: { + warn: message => logWarn(message) + } ... })
Disabling a logger
You can disable a logger by passing
null
as the value.const client = createClient({ ... + logger: { + warn: null + } ... })
-
#912
e529e12
Thanks @zouhangwithsweet! - Added BitKeep to injected flags -
#912 Thanks @mytangying! - Added MathWallet to injected flags
-
#904
c231058
Thanks @jxom! - Minimized contract interface returned fromprepareWriteContract
.
- #767
e9392f3
Thanks @klyap! - Add Optimism Goerli chain ahead of Kovan deprecation.
- #817
7e5cac7
Thanks @alecananian! - Added custom name mapping for 1inch Wallet injected provider
- #806
0b34e56
Thanks @vmichalik! - Fix canonical testnet native asset symbols by changing them to ETH
-
#658
d70c115
Thanks @jxom! - Breaking: The configuration passed to thesendTransaction
action now needs to be:- prepared with the
prepareSendTransaction
action (new functionality), or - recklessly unprepared (previous functionality)
Why? Read here
import { prepareSendTransaction, sendTransaction } from '@wagmi/core' +const config = await prepareSendTransaction({ + request: { + to: 'moxey.eth', + value: parseEther('1'), + } +}) const result = await sendTransaction({ - request: { - to: 'moxey.eth', - value: parseEther('1') - } + ...config })
It is possible to use
sendTransaction
without preparing the configuration first by passingmode: 'recklesslyUnprepared'
.import { sendTransaction } from '@wagmi/core' const result = await sendTransaction({ + mode: 'recklesslyUnprepared', request: { to: 'moxey.eth', value: parseEther('1'), } })
- prepared with the
-
#760
d8af6bf
Thanks @tmm! - Breaking:alchemyProvider
andinfuraProvider
now use a genericapiKey
configuration option instead ofalchemyId
andinfuraId
.import { alchemyProvider } from '@wagmi/core/providers/alchemy' import { infuraProvider } from '@wagmi/core/providers/infura' alchemyProvider({ - alchemyId: 'yourAlchemyApiKey', + apiKey: 'yourAlchemyApiKey', }) infuraProvider({ - infuraId: 'yourInfuraApiKey', + apiKey: 'yourInfuraApiKey', })
-
#727
ac3b9b8
Thanks @tmm! - Breaking: Moved thepollingInterval
config option from the chain provider config toconfigureChains
config.const { chains, provider } = configureChains( [chain.mainnet, chain.polygon], [ - alchemyProvider({ apiKey, pollingInterval: 5000 }), - publicProvider({ pollingInterval: 5000 }) + alchemyProvider({ apiKey }), + publicProvider() ], + { pollingInterval: 5000 } )
-
#658
d70c115
Thanks @jxom! - Breaking: ThesendTransaction
action now returns an object only consisting ofhash
&wait
, and not the fullTransactionResponse
.If you require the full
TransactionResponse
, you can usefetchTransaction
:import { sendTransaction, fetchTransaction } from '@wagmi/core' const { hash, wait, - ...transaction } = sendTransaction(...) +const transaction = fetchTransaction({ hash })
Why? The old implementation of
sendTransaction
created a long-running async task, causing UX pitfalls when invoked in a click handler.
-
#658
d70c115
Thanks @jxom! - Breaking: If achainId
is passed towriteContract
orsendTransaction
, it will no longer attempt to switch chain before sending the transaction. Instead, it will throw an error if the user is on the wrong chain.Why?
- Eagerly prompting to switch chain in these actions created a long-running async task that that makes iOS App Links vulnerable.
- Not all wallets support programmatic chain switching.
-
#658
d70c115
Thanks @jxom! - Breaking: The configuration passed to thewriteContract
action now needs to be:- prepared with the
prepareWriteContract
action (new functionality), or - recklessly unprepared (previous functionality)
Why? Read here
import { prepareWriteContract, writeContract } from '@wagmi/core' const tokenId = 69 +const config = await prepareWriteContract({ + addressOrName: '0x...', + contractInterface: wagmiAbi, + functionName: 'mint', + args: [tokenId] +}) const result = await writeContract({ - addressOrName: '0x...', - contractInterface: wagmiAbi, - functionName: 'mint', - args: [tokenId], + ...config })
It is possible to use
writeContract
without preparing the configuration first by passingmode: 'recklesslyUnprepared'
.import { writeContract } from '@wagmi/core' const tokenId = 69 const result = await writeContract({ + mode: 'recklesslyUnprepared', addressOrName: '0x...', contractInterface: wagmiAbi, functionName: 'mint', args: [tokenId], })
- prepared with the
-
#658
d70c115
Thanks @jxom! - Added theprepareSendTransaction
hook that prepares the parameters required for sending a transaction.It returns config to be passed through to
sendTransaction
.import { prepareSendTransaction, sendTransaction } from "@wagmi/core"; const config = await prepareSendTransaction({ request: { to: "moxey.eth", value: parseEther("1"), }, }); const result = await sendTransaction(config);
-
#658
d70c115
Thanks @jxom! - Added theprepareWriteContract
hook that prepares the parameters required for a contract write transaction.It returns config to be passed through to
writeContract
.Example:
import { prepareWriteContract, writeContract } from "@wagmi/core"; const config = await prepareWriteContract({ addressOrName: "0x...", contractInterface: wagmiAbi, functionName: "mint", }); const result = await writeContract(config);
-
#759
959953d
Thanks @tmm! - AddedfetchTransaction
action:import { fetchTransaction } from "@wagmi/core"; const transaction = await fetchTransaction({ hash: "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", });
- #721
abea25f
Thanks @tmm! - Stay connected to existingclient.connector
whenconnect
action fails to connect to new connector.
- #693
56e468c
Thanks @markdalgleish! - Fix import errors with Coinbase Wallet SDK in Vite
- #616
7a7a17a
Thanks @tmm! - AddsUNSTABLE_shimOnConnectSelectAccount
flag. With this flag and "disconnected" withshimDisconnect
enabled, the user is prompted to select a different MetaMask account (than the currently connected account) when trying to connect (e.g.useConnect
/connect
action).
- #622
d171581
Thanks @tmm! - Usedomain.chainId
to validate and switch chain before signing insignTypedData
.
- #618
a5138e8
Thanks @tmm! - Fix adding chains when using MetaMask mobile app, addpublicRpcUrls
constant, and default to public endpoint when adding chain.
-
fc94210
Thanks @jxom! - Breaking: Theprovider
config option is now required oncreateClient
. It is recommended to pass theprovider
given fromconfigureChains
.import { createClient, + defaultChains, + configureChains } from 'wagmi' +import { publicProvider } from 'wagmi/providers/publicProvider' +const { provider } = configureChains(defaultChains, [ + publicProvider +]) const client = createClient({ + provider })
If you previously used an ethers.js Provider, you now need to provide your
chains
on the Provider instance:import { createClient, + defaultChains } from 'wagmi' import ethers from 'ethers' const client = createClient({ - provider: getDefaultProvider() + provider: Object.assign(getDefaultProvider(), { chains: defaultChains }) })
4f8f3c0
Thanks @nachoiacovino! - Use ethereum-lists chains symbols
-
fc94210
Thanks @jxom! - Breaking: Removed thechainId
parameter fromconnectors
function oncreateClient
.const client = createClient({ - connectors({ chainId }) { + connectors() { ... } })
If you previously derived RPC URLs from the
chainId
onconnectors
, you can now remove that logic aswagmi
now handles RPC URLs internally when used withconfigureChains
.import { chain, + configureChains, createClient } from 'wagmi'; +import { publicProvider } from 'wagmi/providers/public' import { CoinbaseWalletConnector } from 'wagmi/connectors/coinbaseWallet' import { InjectedConnector } from 'wagmi/connectors/injected' import { MetaMaskConnector } from 'wagmi/connectors/metaMask' import { WalletConnectConnector } from 'wagmi/connectors/walletConnect' +const { chains } = configureChains( + [chain.mainnet], + [publicProvider()] +); const client = createClient({ - connectors({ chainId }) { - const chain = chains.find((x) => x.id === chainId) ?? defaultChain - const rpcUrl = chain.rpcUrls.alchemy - ? `${chain.rpcUrls.alchemy}/${alchemyId}` - : chain.rpcUrls.default - return [ + connectors: [ new MetaMaskConnector({ chains }), new CoinbaseWalletConnector({ chains, options: { appName: 'wagmi', - chainId: chain.id, - jsonRpcUrl: rpcUrl, }, }), new WalletConnectConnector({ chains, options: { qrcode: true, - rpc: { [chain.id]: rpcUrl }, }, }), new InjectedConnector({ chains, options: { name: 'Injected' }, }), ] - }, })
- #611
3089c34
Thanks @tmm! - Breaking:Connector
sgetProvider
method no longer supports thecreate
config parameter. Use thechainId
config option instead.
- #596
a770af7
Thanks @tmm! - Breaking:TypedDataDomain
andTypedDataField
types were removed and incorporated intoSignTypedDataArgs
.
4f8f3c0
Thanks @nachoiacovino! - Update symbols to match ethereum-lists/chains
-
fc94210
Thanks @jxom! - Breaking: ThewriteContract
function parameters have been consolidated into a singular config parameter.Before:
writeContract( { addressOrName: "0xecb504d39723b0be0e3a9aa33d646642d1051ee1", contractInterface: wagmigotchiABI, }, "feed", );
After:
readContract({ addressOrName: "0xecb504d39723b0be0e3a9aa33d646642d1051ee1", contractInterface: wagmigotchiABI, functionName: "feed", });
-
fc94210
Thanks @jxom! - Breaking: ThereadContract
&watchReadContract
function parameters have been consolidated into a singular config parameter.Before:
readContract( { addressOrName: "0xecb504d39723b0be0e3a9aa33d646642d1051ee1", contractInterface: wagmigotchiABI, }, "getHunger", { args: [0] }, ); watchReadContract( { addressOrName: "0xecb504d39723b0be0e3a9aa33d646642d1051ee1", contractInterface: wagmigotchiABI, }, "getHunger", { args: [0] }, (result) => {}, );
After:
readContract({ addressOrName: "0xecb504d39723b0be0e3a9aa33d646642d1051ee1", contractInterface: wagmigotchiABI, functionName: "getHunger", args: [0], }); watchReadContract( { addressOrName: "0xecb504d39723b0be0e3a9aa33d646642d1051ee1", contractInterface: wagmigotchiABI, functionName: "getHunger", args: [0], }, (result) => {}, );
- #598
fef26bf
Thanks @markdalgleish! - Update@coinbase/wallet-sdk
peer dependency to>=3.3.0
to fix errors when connecting with older versions of the Coinbase Wallet extension and mobile app.
-
#611
3089c34
Thanks @tmm! - AddedchainId
config parameter forwriteContract
andsendTransaction
.If
chainId
is provided, the connector will validate thatchainId
is the active chain before sending a transaction (and switch tochainId
if necessary).
- #582
b03830a
Thanks @jxom! - Fixed an issue where the wagmi client'sstatus
would not update from"disconnected"
to"connecting" -> "connected"
when theconnect
action is invoked.
-
fc94210
Thanks @jxom! - Added amulticall
&watchMulticall
action that provides multicall support.Internally uses the
multicall3
contract.
fc94210
Thanks @jxom! - Added areadContracts
&watchReadContracts
action that provides the ability to batch up multiple ethers Contract read-only methods.
- #549
89b3a74
Thanks @tmm! - Turns onnoUncheckedIndexedAccess
andstrictNullChecks
for better runtime safety.
- #526
e95c5f9
Thanks @jxom! - AddedshimChainChangedDisconnect
option toInjectedConnector
. Defaults totrue
forMetaMaskConnector
.
-
#526
e95c5f9
Thanks @jxom! - AddedchainId
config option to theconnect
action.Example:
import { connect } from "@wagmi/core"; await connect({ chainId: 69 });
-
#408
bfcc3a5
Thanks @jxom! - Breaking: Theconnectors
option oncreateClient
no longer reacts to chain switching.Passing a function to
connectors
has been deprecated.If you previously derived an RPC URL from the
chainId
inconnectors
, you will need to migrate to use theconfigureChains
API.import { providers } from "ethers"; import { chain, createClient, defaultChains } from "wagmi"; import { CoinbaseWalletConnector } from "wagmi/connectors/coinbaseWallet"; import { InjectedConnector } from "wagmi/connectors/injected"; import { MetaMaskConnector } from "wagmi/connectors/metaMask"; import { WalletConnectConnector } from "wagmi/connectors/walletConnect"; const alchemyId = process.env.ALCHEMY_ID; const chains = defaultChains; const defaultChain = chain.mainnet; const client = createClient({ autoConnect: true, connectors({ chainId }) { const chain = chains.find((x) => x.id === chainId) ?? defaultChain; const rpcUrl = chain.rpcUrls.alchemy ? `${chain.rpcUrls.alchemy}/${alchemyId}` : chain.rpcUrls.default; return [ new MetaMaskConnector({ chains }), new CoinbaseWalletConnector({ chains, options: { appName: "wagmi", chainId: chain.id, jsonRpcUrl: rpcUrl, }, }), new WalletConnectConnector({ chains, options: { qrcode: true, rpc: { [chain.id]: rpcUrl }, }, }), new InjectedConnector({ chains, options: { name: "Injected", shimDisconnect: true, }, }), ]; }, });
import { chain, createClient, defaultChains } from "wagmi"; import { alchemyProvider } from "wagmi/providers/alchemy"; import { publicProvider } from "wagmi/providers/public"; import { CoinbaseWalletConnector } from "wagmi/connectors/coinbaseWallet"; import { InjectedConnector } from "wagmi/connectors/injected"; import { MetaMaskConnector } from "wagmi/connectors/metaMask"; import { WalletConnectConnector } from "wagmi/connectors/walletConnect"; const alchemyId = process.env.ALCHEMY_ID; const { chains } = configureChains(defaultChains, [ alchemyProvider({ alchemyId }), publicProvider(), ]); const client = createClient({ autoConnect: true, connectors: [ new MetaMaskConnector({ chains }), new CoinbaseWalletConnector({ chains, options: { appName: "wagmi", }, }), new WalletConnectConnector({ chains, options: { qrcode: true, }, }), new InjectedConnector({ chains, options: { name: "Injected", shimDisconnect: true, }, }), ], });
-
#468
44a884b
Thanks @tmm! - Breaking: Duplicate exports with different names and the same functionality were removed to simplify the public API. In addition, confusing exports were renamed to be more descriptive.createWagmiClient
alias was removed. UsecreateClient
instead.useWagmiClient
alias was removed. UseuseClient
instead.WagmiClient
alias was removed. UseClient
instead.createWagmiStorage
alias was removed. UsecreateStorage
instead.Provider
was renamed andWagmiProvider
alias was removed. UseWagmiConfig
instead.
-
#408
bfcc3a5
Thanks @jxom! - AddconfigureChains
API.The
configureChains
function allows you to configure your chains with a selected provider (Alchemy, Infura, JSON RPC, Public RPC URLs). This means you don't have to worry about deriving your own RPC URLs for each chain, or instantiating a Ethereum Provider.configureChains
accepts 3 parameters: an array of chains, and an array of providers, and a config object.Learn more about configuring chains & providers.
import { providers } from "ethers"; import { chain, createClient, defaultChains } from "wagmi"; import { CoinbaseWalletConnector } from "wagmi/connectors/coinbaseWallet"; import { InjectedConnector } from "wagmi/connectors/injected"; import { MetaMaskConnector } from "wagmi/connectors/metaMask"; import { WalletConnectConnector } from "wagmi/connectors/walletConnect"; const alchemyId = process.env.ALCHEMY_ID; const chains = defaultChains; const defaultChain = chain.mainnet; const client = createClient({ autoConnect: true, connectors({ chainId }) { const chain = chains.find((x) => x.id === chainId) ?? defaultChain; const rpcUrl = chain.rpcUrls.alchemy ? `${chain.rpcUrls.alchemy}/${alchemyId}` : chain.rpcUrls.default; return [ new MetaMaskConnector({ chains }), new CoinbaseWalletConnector({ chains, options: { appName: "wagmi", chainId: chain.id, jsonRpcUrl: rpcUrl, }, }), new WalletConnectConnector({ chains, options: { qrcode: true, rpc: { [chain.id]: rpcUrl }, }, }), new InjectedConnector({ chains, options: { name: "Injected", shimDisconnect: true, }, }), ]; }, provider: ({ chainId }) => new providers.AlchemyProvider(chainId, alchemyId), });
import { chain, createClient, defaultChains } from "wagmi"; import { alchemyProvider } from "wagmi/providers/alchemy"; import { publicProvider } from "wagmi/providers/public"; import { CoinbaseWalletConnector } from "wagmi/connectors/coinbaseWallet"; import { InjectedConnector } from "wagmi/connectors/injected"; import { MetaMaskConnector } from "wagmi/connectors/metaMask"; import { WalletConnectConnector } from "wagmi/connectors/walletConnect"; const alchemyId = process.env.ALCHEMY_ID; const { chains, provider, webSocketProvider } = configureChains( defaultChains, [alchemyProvider({ alchemyId }), publicProvider()], ); const client = createClient({ autoConnect: true, connectors: [ new MetaMaskConnector({ chains }), new CoinbaseWalletConnector({ chains, options: { appName: "wagmi", }, }), new WalletConnectConnector({ chains, options: { qrcode: true, }, }), new InjectedConnector({ chains, options: { name: "Injected", shimDisconnect: true, }, }), ], provider, webSocketProvider, });
-
#404
f81c156
Thanks @holic! - AddProviderRpcError
andRpcError
error classes.Certain wagmi-standardized errors may wrap
ProviderRpcError
orRpcError
. For these cases, you can access the original provider rpc or rpc error value using theinternal
property.
- #447
b9ebf78
Thanks @tmm! - Fix case where connector disconnected while app was closed and stale data was returned when autoconnecting. For example, MetaMask was locked when page was closed.
4e03666
Thanks @tmm! - bump dependencies #429 add imToken support for WC switch chains #432 fix MetaMask and Brave Wallet collision #436
- #412
80bef4f
Thanks @markdalgleish! - Import providers fromethers
peer dependency rather than@ethersproject/providers
to avoid multiple conflicting versions being installed
-
018c2a1
Thanks @tmm! - - warn and fallback to default client #380-
remove signerOrProvider option from read contract #390
-
MetaMaskConnector #391
-
afc4607
Thanks @tmm! - - Fix time scaling e9593df- Use fully-specified path for use-sync-external-store import 7b235c1
- Update serialize 236fc17
- #311
24ce011
Thanks @tmm! - - Favourmessage
event overconnecting
event to conform to EIP-1193- Export
useWaitForTransaction
- Export
- #311
24ce011
Thanks @tmm! - AddcacheOnBlock
config foruseContractRead
Updatereact-query
to v4 FixwatchBlockNumber
listener leak
- showtime
- update block explorers and rpc urls structure
- last beta
- update zustand
- Add
cacheOnBlock
config foruseContractRead
- Update
react-query
to v4 - Fix
watchBlockNumber
listener leak
- keep previous data when watching
- add chainId to actions and hooks
- fix stale connectors when switching chains
- republish
- improve type support for ethers providers
- update babel target
-
- Favour
message
event overconnecting
event to conform to EIP-1193 - Export
useWaitForTransaction
- Favour
- add
connecting
event to connectors
- don't persist account data when
autoConnect
is falsy
- remove storage persistence of
connector
- add
chains
to client state
- Fix issue where
getProvider
was not being awaited ingetSigner
- fix: persist connector chains to local storage
- Initial 0.3.0 release
- #236
53bad61
Thanks @markdalgleish! - Updated@walletconnect/ethereum-provider
to v1.7.4
-
e338c3b
Thanks @tmm! - checksum connector address on change eventsadd shim to injected connector for simulating disconnect
-
#52
da7a3a6
Thanks @tmm! - Moves connectors to their own entrypoints to reduce bundle size.// old - WalletLinkConnector unused, but still in final bundle import { InjectedConnector, WalletConnectConnector } from "wagmi"; // new - WalletLinkConnector not in final bundle import { InjectedConnector } from "wagmi/connectors/injected"; import { WalletConnectConnector } from "wagmi/connectors/walletConnect";