Skip to content

Latest commit

 

History

History
3113 lines (1942 loc) · 129 KB

CHANGELOG.md

File metadata and controls

3113 lines (1942 loc) · 129 KB

@wagmi/core

2.11.2

Patch Changes

2.11.1

Patch Changes

2.11.0

Minor Changes

Patch Changes

2.10.6

Patch Changes

2.10.5

Patch Changes

2.10.4

Patch Changes

2.10.3

Patch Changes

2.10.2

Patch Changes

2.10.1

Patch Changes

  • Bumped versions.

2.10.0

Minor Changes

2.9.8

Patch Changes

2.9.7

Patch Changes

2.9.6

Patch Changes

2.9.5

Patch Changes

2.9.4

Patch Changes

2.9.3

Patch Changes

2.9.2

Patch Changes

2.9.1

Patch Changes

2.9.0

Minor Changes

2.8.1

Patch Changes

  • #3869 d4a78eb0 Thanks @jxom! - Fixed issue where prepareTransactionRequest would internally call unsupported wallet RPC methods.

2.8.0

Minor Changes

  • #3868 c2af20b8 Thanks @jxom! - Added supportsSimulation property to connectors that indicates if the connector's wallet supports contract simulation.

Patch Changes

2.7.0

Minor Changes

  • #3857 d4274c03 Thanks @tmm! - Added addEthereumChainParameter to switchChain-related methods.

Patch Changes

  • #3849 4781a405 Thanks @tmm! - Fixed shimDisconnect: 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.

2.6.19

Patch Changes

  • e3c832a1 Thanks @jxom! - Fixed undefined navigator issue in MetaMask connector.

2.6.18

Patch Changes

2.6.17

Patch Changes

  • #3822 a97bfbae Thanks @jxom! - Fixed an issue where Wagmi would not correctly rehydrate the active chain when a persisted store was being used.

2.6.16

Patch Changes

  • #3788 42ad380d Thanks @tmm! - Refactored connectors to remove unnecessarily event listeners.

2.6.15

Patch Changes

2.6.14

Patch Changes

  • #3777 b3b54ef1 Thanks @desfero! - Fixed writeContract to forward chainIn when simulating contract call

  • #3779 3da20bb8 Thanks @jxom! - Fixed an issue where eth_requestAccounts would be called upon reconnect instead of eth_accounts.

  • a3d1858f Thanks @jxom! - Fixed hydration conditional in createConfig.

2.6.13

Patch Changes

  • b80236dc Thanks @jxom! - Removed unneeded uniqueBy check on connectors state.

2.6.12

Patch Changes

  • #3763 a59069e9 Thanks @tmm! - Fixed getConnectorClient internal address comparison.

  • #3608 0acd3132 Thanks @mqklin! - Disabled wallet_requestPermissions prompt when shimDisconnect is false.

2.6.11

Patch Changes

  • e1ca4e63 Thanks @tmm! - Deprecated normalizeChainId. Use Number instead.

2.6.10

Patch Changes

  • dbdca8fd Thanks @jxom! - Fixed issue where duplicate connectors could be instantiated if injected after page mount.

2.6.9

Patch Changes

2.6.8

Patch Changes

2.6.7

Patch Changes

  • #3642 b479b5e8 Thanks @johanneskares! - Fixed a bug where minification caused the wrong functions to be called on the client.

  • f5648dd2 Thanks @jxom! - Updated prepareTransactionRequest types for viem@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.

2.6.6

Patch Changes

2.6.5

Patch Changes

2.6.4

Patch Changes

2.6.3

Patch Changes

  • #3533 9c3b85dd Thanks @tmm! - Fixed account property passthrough for actions.

  • 2a72214a Thanks @tmm! - Shimmed EIP-1193 removeListener for injected since some wallets do not follow spec.

2.6.2

Patch Changes

  • #3519 414eb048 Thanks @tmm! - Fixed multicall passing through all properties to Viem method.

  • #3518 338e857d Thanks @tmm! - Fixed internal store migration between versions.

2.6.1

Patch Changes

  • #3510 660ff80d Thanks @tmm! - Fixed issue where connectors returning multiple addresses didn't checksum correctly.

  • #3433 101a7dd1 Thanks @tmm! - Fixed getClient and getPublicClient throwing when used with unconfigured chainId.

2.6.0

Minor Changes

  • #3496 ba7f8a75 Thanks @tmm! - Updated action internals to resolve Viem Client actions.

2.5.0

Minor Changes

2.4.0

Minor Changes

2.3.1

Patch Changes

  • #3476 3be5bb7b Thanks @jxom! - Modified persist strategy to only store "critical" properties that are needed before hydration.

2.3.0

Minor Changes

Patch Changes

  • #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.

2.2.1

Patch Changes

2.2.0

Minor Changes

2.1.2

Patch Changes

  • #3407 e00b8205 Thanks @jxom! - Added a prelude gas estimate check to sendTransaction/useSendTransaction.

2.1.1

Patch Changes

2.1.0

Minor Changes

2.0.2

Patch Changes

  • #3384 ee868c33 Thanks @tmm! - Fixed connectors not bubbling error when connecting with chainId and subsequent user rejection.

2.0.1

Major Changes

  • #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

    Breaking Changes & Migration Guide

1.4.13

Patch Changes

  • Updated dependencies [bbbbf587]:
    • @wagmi/connectors@3.1.11

1.4.12

Patch Changes

  • 53ca1f7e Thanks @tmm! - Removed LedgerConnector due to security vulnerability

  • Updated dependencies [53ca1f7e]:

    • @wagmi/connectors@3.1.10

1.4.11

Patch Changes

1.4.10

Patch Changes

  • Updated dependencies [e8f7bcbc]:
    • @wagmi/connectors@3.1.8

1.4.9

Patch Changes

1.4.8

Patch Changes

1.4.7

Patch Changes

  • Updated dependencies [a1950449]:
    • @wagmi/connectors@3.1.5

1.4.6

Patch Changes

  • Updated dependencies [4e6ec415]:
    • @wagmi/connectors@3.1.4

1.4.5

Patch Changes

  • Updated dependencies [e78aa337]:
    • @wagmi/connectors@3.1.3

1.4.4

Patch Changes

  • #3125 725e73fe Thanks @lukasrosario! - Fixed an issue where dataSuffix was not being passed down into viem's simulateContract, causing the data to be omitted from requests.

1.4.3

Patch Changes

1.4.2

Patch Changes

  • Updated dependencies [3aaba328]:
    • @wagmi/connectors@3.1.2

1.4.1

Patch Changes

  • Updated dependencies [bf831bb3]:
    • @wagmi/connectors@3.1.1

1.4.0

Minor Changes

Patch Changes

  • Updated dependencies [2abeb285]:
    • @wagmi/connectors@3.1.0

1.3.10

Patch Changes

1.3.9

Patch Changes

1.3.8

Patch Changes

1.3.7

Patch Changes

1.3.6

Patch Changes

1.3.5

Patch Changes

1.3.4

Patch Changes

1.3.3

Patch Changes

1.3.2

Patch Changes

1.3.1

Patch Changes

1.3.0

Minor Changes

  • #2619 0d79748c Thanks @jxom! - Updated references:
    • Updated @safe-global/safe-apps-sdk to ^8.0.0 (the one with viem support)

1.2.2

Patch Changes

1.2.1

Patch Changes

1.2.0

Minor Changes

Patch Changes

1.1.1

Patch Changes

1.1.0

Minor Changes

Patch Changes

1.0.8

Patch Changes

1.0.7

Patch Changes

  • #2433 54fcff5f Thanks @jxom! - Added ability to pass an account to writeContract/prepareWriteContract.

1.0.6

Patch Changes

1.0.5

Patch Changes

1.0.4

Patch Changes

1.0.3

Patch Changes

  • #2338 92bfdc2c Thanks @jxom! - Fixed an issue where synchronous switch chain behavior (WalletConnect v2) would encounter chain id race conditions in watchWalletClient.

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Major Changes

1.0.0-next.7

Major Changes

  • #2235 708b2ce2 Thanks @jxom! - Added config.setPublicClient & config.setWebSocketPublicClient

  • Updated references.

Patch Changes

  • Updated dependencies []:
    • @wagmi/connectors@1.0.0-next.5

1.0.0-next.6

Major Changes

  • #2235 708b2ce2 Thanks @jxom! - Added config.setPublicClient & config.setWebSocketPublicClient

  • Added config.setConnectors

Patch Changes

  • Updated dependencies []:
    • @wagmi/connectors@1.0.0-next.6

1.0.0-next.5

Major Changes

  • #2235 708b2ce2 Thanks @jxom! - Added config.setPublicClient & config.setWebSocketPublicClient

1.0.0-next.4

Major Changes

  • Updated viem. Removed goerli export from main entrypoint.

Patch Changes

  • Updated dependencies []:
    • @wagmi/connectors@1.0.0-next.5

1.0.0-next.3

Major Changes

  • Updated references.

Patch Changes

  • Updated dependencies []:
    • @wagmi/connectors@1.0.0-next.4

1.0.0-next.2

Major Changes

  • Breaking: Renamed createClient to createConfig
  • Breaking: Renamed getClient to getConfig
  • Breaking: Removed request as an argument to prepareSendTransaction & sendTransation. Arguments now belong on the root level of the Action.

Patch Changes

  • Updated dependencies []:
    • @wagmi/chains@1.0.0-next.0
    • @wagmi/connectors@1.0.0-next.3

1.0.0-next.1

Major Changes

  • updated viem

Patch Changes

  • Updated dependencies []:
    • @wagmi/connectors@1.0.0-next.2

1.0.0-next.0

Major Changes

Patch Changes

  • Updated dependencies [a7dda00c]:
    • @wagmi/connectors@1.0.0-next.1

0.10.11

Patch Changes

  • #2270 6d1fa9df Thanks @jxom! - Updated references.

  • Updated dependencies []:

    • @wagmi/connectors@0.3.19

0.10.10

Patch Changes

  • #2208 cfc696d8 Thanks @bangtoven! - Bumped references to apply coinbase wallet sdk updates

  • Updated dependencies []:

    • @wagmi/connectors@0.3.16

0.10.9

Patch Changes

0.10.8

Patch Changes

  • #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

0.10.7

Patch Changes

  • #2082 2ccc8a25 Thanks @jxom! - Updated references.

  • Updated dependencies []:

    • @wagmi/connectors@0.3.10

0.10.6

Patch Changes

  • #2056 944f6513 Thanks @tmm! - Bumped references.

  • Updated dependencies []:

    • @wagmi/connectors@0.3.8

0.10.5

Patch Changes

  • #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

0.10.4

Patch Changes

  • #2046 90d8e9b8 Thanks @tmm! - Exported internal type.

  • Updated dependencies []:

    • @wagmi/connectors@0.3.6

0.10.3

Patch Changes

  • #2039 bac893ab Thanks @tmm! - Updated references.

  • #2043 49a58320 Thanks @tmm! - Removed InjectedConnector shimChainChangedDisconnect shim (no longer necessary).

  • Updated dependencies []:

    • @wagmi/connectors@0.3.6

0.10.2

Patch Changes

  • #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

0.10.0

Minor Changes

  • #1902 0994e896 Thanks @jxom! - Breaking: Removed the version config option for WalletConnectConnector.

    WalletConnectConnector now uses WalletConnect v2 by default. WalletConnect v1 is now WalletConnectLegacyConnector.

    WalletConnect v2

    import { WalletConnectConnector } from 'wagmi/connectors/walletConnect'
    
    const connector = new WalletConnectConnector({
      options: {
    -   version: '2',
        projectId: 'abc',
      },
    })

    WalletConnect v1

    -import { WalletConnectConnector } from 'wagmi/connectors/walletConnect'
    +import { WalletConnectConnector } from 'wagmi/connectors/walletConnectLegacy'
    
    -const connector = new WalletConnectConnector({
    +const connector = new WalletConnectLegacyConnector({
      options: {
        qrcode: true,
      },
    })

Patch Changes

  • Updated dependencies []:
    • @wagmi/connectors@0.3.2

0.9.7

Patch Changes

  • #1907 cc4e74ee Thanks @jxom! - Added the following chains to the wagmi/chains entrypoint:

    • baseGoerli
    • harmonyOne
    • polygonZkEvmTestnet
  • Updated dependencies []:

    • @wagmi/connectors@0.2.7

0.9.6

Patch Changes

  • #1882 282cc1b0 Thanks @tmm! - Updated references.

  • Updated dependencies []:

    • @wagmi/connectors@0.2.6

0.9.5

Patch Changes

  • #1812 c7fd7fbd Thanks @jxom! - Added the following chains to the wagmi/chains entrypoint:

    • filecoinCalibration
    • moonbaseAlpha
    • moonbeam
    • moonriver
  • Updated dependencies []:

    • @wagmi/connectors@0.2.5

0.9.4

Patch Changes

  • #1786 b173a431 Thanks @tmm! - Locked ethers peer dependency version to >=5.5.1 <6

  • #1787 f023fd8f Thanks @tmm! - Added SafeConnector

  • Updated dependencies []:

    • @wagmi/connectors@0.2.4

0.9.3

Patch Changes

  • #1773 9aaf1955 Thanks @jxom! - Updated @walletconnect/universal-provider on WalletConnectConnector v2. Added more signable methods to WalletConnectConnector v2.

  • #1773 9aaf1955 Thanks @jxom! - Added Telos to the wagmi/chains entrypoint. Thanks @donnyquixotic!

  • Updated dependencies []:

    • @wagmi/connectors@0.2.3

0.9.2

Patch Changes

  • #1756 31d06b8c Thanks @jxom! - Added OKC Chain. Thanks @clark-cui!

  • #1756 31d06b8c Thanks @jxom! - Fixed race condition between switchNetwork and mutation Actions that use chainId (e.g. sendTransaction). Thanks @DanInTheD4rk!

  • Updated dependencies []:

    • @wagmi/connectors@0.2.2

0.9.1

Patch Changes

  • #1752 144a0e76 Thanks @jxom! - Improved WalletConnectConnector (v2) initialization & updated dependencies.

  • #1752 144a0e76 Thanks @jxom! - Added the following chains to the wagmi/chains entrypoint:

    • Aurora – thanks @salil-naik
    • Bronos – thanks @chedetinaveen
    • Canto – thanks @tster
    • Celo – thanks @aaronmgdr
  • Updated dependencies []:

    • @wagmi/connectors@0.2.1

0.9.0

Minor Changes

  • #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.

0.8.19

Patch Changes

0.8.18

Patch Changes

0.8.17

Patch Changes

  • #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)

0.8.16

Patch Changes

0.8.15

Patch Changes

  • #1685 917f5bc1 Thanks @jxom! - Replaced qrcodemodal with web3modal for the WalletConnect v2 Connector.

0.8.14

Patch Changes

0.8.13

Patch Changes

0.8.12

Patch Changes

0.8.11

Patch Changes

0.8.10

Patch Changes

0.8.9

Patch Changes

0.8.8

Patch Changes

0.8.7

Patch Changes

0.8.6

Patch Changes

  • #1539 732da004 Thanks @0xFlicker! - All Providers (ie. Alchemy, Infura, Public) now use the ENS Registry address on the wagmi Chain object (chain.contracts.ensRegistry).

  • #1574 ecde3d10 Thanks @jxom! - Added the following chains:

    • iotex
    • iotexTestnet
    • zkSync
    • zkSyncTestnet

0.8.5

Patch Changes

0.8.4

Patch Changes

0.8.3

Patch Changes

0.8.2

Patch Changes

0.8.1

Patch Changes

  • #1437 c34a3dc6 Thanks @jxom! - Omitted "EIP712Domain" type from signTypedData 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 when autoConnect is truthy.

0.8.0

Minor Changes

  • #1344 57a19374 Thanks @jxom! - Breaking: the shape of the Chain type has been modified.

    RPC URLs

    The rpcUrls shape has changed to include an array of URLs, and also the transport method (http or webSocket):

    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]

    Contracts

    The multicall and ens attributes have been moved into the contracts 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 to 3.6.0.

    Migration steps: Update @coinbase/wallet-sdk to ^3.6.0.

  • #1344 57a19374 Thanks @jxom! - Breaking: Removed the wait argument on waitForTransaction. Use the transaction hash 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.

    Removed chain

    The chain export has been removed. @wagmi/core now only exports the mainnet & 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],
      {
        ...
      }
    )

    Removed allChains

    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, ...)

    Removed defaultChains & defaultL2Chains

    The defaultChains & defaultL2Chains exports have been removed. If you still need the defaultChains or defaultL2Chains 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 with mainnet & 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 with arbitrum & optimism.

    Removed chainId

    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

    Removed etherscanBlockExplorers

    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

    Removed alchemyRpcUrls, infuraRpcUrls & publicRpcUrls

    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: Changed waitForTransaction behavior to throw an error if the transaction reverted.

  • #1344 57a19374 Thanks @jxom! - Updated errors to use cause instead of internal

Patch Changes

0.7.9

Patch Changes

  • #1411 659be184 Thanks @tmm! - Fixed issue where block invalidation was not properly disabled when setting enabled: false.

0.7.8

Patch Changes

  • #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,
      },
    });

0.7.7

Patch Changes

  • #1386 206a2adb Thanks @jxom! - Fixed an issue where persister would still use window.localStorage instead of the wagmi storage.

  • #1376 a70a9528 Thanks @jxom! - Fixed issue where switchChain on WalletConnectConnector would not resolve.

  • #1386 206a2adb Thanks @jxom! - Added serialize/deserialize as config options to createStorage.

  • #1392 88afc849 Thanks @tmm! - Added check for active connector when connecting

0.7.6

Patch Changes

  • #1384 027e88d6 Thanks @tmm! - Fixed issue reconnecting after disconnect with MetaMaskConnector in MetaMask mobile browser.

0.7.5

Patch Changes

  • 1169914a Thanks @jxom! - Use get_accounts for getSigner in InjectedConnector

0.7.4

Patch Changes

0.7.3

Patch Changes

  • #1294 b2f88949 Thanks @tmm! - Set abi return type value for prepareContractWrite as more permissive when not inferrable as Abi.

0.7.2

Patch Changes

  • e9f806b6 Thanks @tmm! - Bumped abitype and zustand versions.

0.7.1

Patch Changes

0.7.0

Minor Changes

  • #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 to address for fetchBalance and fetchEnsAvatar.

    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: Made apiKey required on infuraProvider and alchemyProvider.

    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.

  • #1202 9bf56af Thanks @tmm! - Removed CommonJS support

0.6.12

Patch Changes

  • #1250 ce2e0f4 Thanks @tmm! - Added support for Trust Wallet browser extension.

0.6.11

Patch Changes

  • #1234 3ff9303 Thanks @tmm! - Fixed issue with adding chain to wallet without block explorer URL.

0.6.10

Patch Changes

  • #1232 c0ca509 Thanks @tmm! - Added validation to check that chain is configured for connector when accessing Signer.

0.6.9

Patch Changes

0.6.8

Patch Changes

0.6.7

Patch Changes

  • #1174 196a458 Thanks @jxom! - Fixed an issue where client.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

0.6.6

Patch Changes

  • 81ce9e6 Thanks @jxom! - Add isPortal to injected MetaMask flags.

  • c2c0109 Thanks @jxom! - Add etherscan block explorer to Optimism Goerli

0.6.5

Patch Changes

  • #1162 30335b3 Thanks @tmm! - Fixed issue where non-indexed event parameter types were set to null.

  • #1162 30335b3 Thanks @tmm! - Fixed issue where useContractReads and useContractInfiniteReads types were slowing down TypeScript compiler.

0.6.4

Patch Changes

0.6.3

Patch Changes

0.6.2

Patch Changes

  • #1080 3be5e8b Thanks @tmm! - Added abitype to dependencies so types ship correctly.

0.6.1

Patch Changes

0.6.0

Minor Changes

  • #940 b6cb8f4 Thanks @jxom! - Breaking: watchSigner now requires an arguments object (that accepts an optional chainId) 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 a chainId is specified and the end-user is on a different chain id (the wrong network).

  • #941 0c96009 Thanks @tmm! - Breaking: addressOrName and contractInterface renamed to address and abi 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 a chainId is specified and the end-user is on a different chain id (the wrong network).

  • #940 b6cb8f4 Thanks @jxom! - Breaking: prepareSendTransaction now only accepts a signer instead of signerOrProvider.

    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, then prepareWriteContract 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, and watchReadContracts.

    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 to typescript@>=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 infer functionName, args, overrides, and return types for functions, and eventName and listener 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, and watchContractEvent.

    Adding a const assertion to signTypedData's config option, types, allows TypeScript to infer value.

    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!',
      },
    })

Patch Changes

  • #1061 a4ffe8b Thanks @alecananian! - Added Arbitrum Goerli Arbiscan block explorer

  • #940 b6cb8f4 Thanks @jxom! - The fetchSigner action now accepts an optional chainId 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 dependencies

    • zustand@4.1.1

0.5.8

Patch Changes

  • 8cb07462 Thanks @jxom! - Added chainId as an argument to watchBlockNumber.
  • 53c1a474 Thanks @tmm! - Added missing decimals option to Connector watchAsset
  • 4d74dd4f Thanks @jxom! - Support ERC20 contracts that represent strings as bytes32

0.5.7

Patch Changes

  • aa51bc4d Thanks @jxom! - Fixed an issue in CoinbaseWalletConnector where the browser extension would unintendedly reset the network when the browser is refreshed.
  • cec14089 Thanks @jxom! - Fixed an issue where useProvider & getProvider were not returning referentially equal providers.
  • cec14089 Thanks @jxom! - Fixed an issue where the watch option was not respecting the neighboring chainId option in useBlockNumber.
  • cec14089 Thanks @jxom! - Fixed an issue where block listeners (via watch) were firing excessively on L2 chains.

0.5.6

Patch Changes

  • #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.

    API

    logger?: {
      warn: typeof console.warn | null
    }

    Examples

    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
    + }
      ...
    })

0.5.5

Patch Changes

0.5.4

Patch Changes

0.5.3

Patch Changes

0.5.2

Patch Changes

0.5.1

Patch Changes

0.5.0

Minor Changes

  • #658 d70c115 Thanks @jxom! - Breaking: The configuration passed to the sendTransaction action now needs to be:

    • prepared with the prepareSendTransaction action (new functionality), or
    • recklessly unprepared (previous functionality)

    Why? Read here

    Prepared usage

    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
    })

    Recklessly unprepared usage

    It is possible to use sendTransaction without preparing the configuration first by passing mode: 'recklesslyUnprepared'.

    import { sendTransaction } from '@wagmi/core'
    
    const result = await sendTransaction({
    + mode: 'recklesslyUnprepared',
      request: {
        to: 'moxey.eth',
        value: parseEther('1'),
      }
    })
  • #760 d8af6bf Thanks @tmm! - Breaking: alchemyProvider and infuraProvider now use a generic apiKey configuration option instead of alchemyId and infuraId.

    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 the pollingInterval config option from the chain provider config to configureChains 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: The sendTransaction action now returns an object only consisting of hash & wait, and not the full TransactionResponse.

    If you require the full TransactionResponse, you can use fetchTransaction:

    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 a chainId is passed to writeContract or sendTransaction, 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.

Patch Changes

  • #658 d70c115 Thanks @jxom! - Breaking: The configuration passed to the writeContract action now needs to be:

    • prepared with the prepareWriteContract action (new functionality), or
    • recklessly unprepared (previous functionality)

    Why? Read here

    Prepared usage

    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
    })

    Recklessly unprepared usage

    It is possible to use writeContract without preparing the configuration first by passing mode: 'recklesslyUnprepared'.

    import { writeContract } from '@wagmi/core'
    
    const tokenId = 69
    
    const result = await writeContract({
    + mode: 'recklesslyUnprepared',
      addressOrName: '0x...',
      contractInterface: wagmiAbi,
      functionName: 'mint',
      args: [tokenId],
    })
  • #658 d70c115 Thanks @jxom! - Added the prepareSendTransaction 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 the prepareWriteContract 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);
  • #739 c2295a5 Thanks @tmm! - Fix balance formatting for tokens that do not have 18 decimals.
  • #759 959953d Thanks @tmm! - Added fetchTransaction action:

    import { fetchTransaction } from "@wagmi/core";
    
    const transaction = await fetchTransaction({
      hash: "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060",
    });

0.4.9

Patch Changes

  • #721 abea25f Thanks @tmm! - Stay connected to existing client.connector when connect action fails to connect to new connector.
  • #721 abea25f Thanks @tmm! - Switch fetchToken action to multicall and add name output property.

0.4.8

Patch Changes

0.4.7

Patch Changes

0.4.6

Patch Changes

0.4.5

Patch Changes

  • #654 e66530b Thanks @jxom! - fix multicall returning nullish data for all calls unexpectedly

0.4.4

Patch Changes

  • #616 7a7a17a Thanks @tmm! - Adds UNSTABLE_shimOnConnectSelectAccount flag. With this flag and "disconnected" with shimDisconnect 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).

0.4.3

Patch Changes

0.4.2

Patch Changes

0.4.1

Patch Changes

  • #622 d171581 Thanks @tmm! - Use domain.chainId to validate and switch chain before signing in signTypedData.
  • #618 a5138e8 Thanks @tmm! - Fix adding chains when using MetaMask mobile app, add publicRpcUrls constant, and default to public endpoint when adding chain.

0.4.0

Minor Changes

  • fc94210 Thanks @jxom! - Breaking: The provider config option is now required on createClient. It is recommended to pass the provider given from configureChains.

    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 })
    })
  • fc94210 Thanks @jxom! - Breaking: Removed the chainId parameter from connectors function on createClient.

    const client = createClient({
    - connectors({ chainId }) {
    + connectors() {
        ...
      }
    })

    If you previously derived RPC URLs from the chainId on connectors, you can now remove that logic as wagmi now handles RPC URLs internally when used with configureChains.

    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: Connectors getProvider method no longer supports the create config parameter. Use the chainId config option instead.
  • #596 a770af7 Thanks @tmm! - Breaking: TypedDataDomain and TypedDataField types were removed and incorporated into SignTypedDataArgs.
  • fc94210 Thanks @jxom! - Breaking: The writeContract 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",
    });

Patch Changes

  • fc94210 Thanks @jxom! - Breaking: The readContract & 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! - Added chainId config parameter for writeContract and sendTransaction.

    If chainId is provided, the connector will validate that chainId is the active chain before sending a transaction (and switch to chainId if necessary).

  • #582 b03830a Thanks @jxom! - Fixed an issue where the wagmi client's status would not update from "disconnected" to "connecting" -> "connected" when the connect action is invoked.
  • fc94210 Thanks @jxom! - Added a readContracts & watchReadContracts action that provides the ability to batch up multiple ethers Contract read-only methods.

0.3.8

Patch Changes

0.3.7

Patch Changes

  • #550 2a5313e Thanks @tmm! - fix CoinbaseWalletConnector possible type error

0.3.6

Patch Changes

  • #526 e95c5f9 Thanks @jxom! - Added shimChainChangedDisconnect option to InjectedConnector. Defaults to true for MetaMaskConnector.
  • #526 e95c5f9 Thanks @jxom! - Added lastUsedChainId property to the wagmi Client.
  • #526 e95c5f9 Thanks @jxom! - Added chainId config option to the connect action.

    Example:

    import { connect } from "@wagmi/core";
    
    await connect({ chainId: 69 });

0.3.5

Patch Changes

0.3.4

Patch Changes

  • c4deb66 Thanks @jxom! - infer options.chainId config from chains on WalletConnectConnector

0.3.3

Patch Changes

0.3.2

Patch Changes

  • 17212da Thanks @jxom! - Made the defaultChains type generic in configureChains.

0.3.1

Patch Changes

0.3.0

Minor Changes

  • #408 bfcc3a5 Thanks @jxom! - Breaking: The connectors option on createClient no longer reacts to chain switching.

    Passing a function to connectors has been deprecated.

    If you previously derived an RPC URL from the chainId in connectors, you will need to migrate to use the configureChains API.

    Before

    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,
            },
          }),
        ];
      },
    });

    After

    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. Use createClient instead.
    • useWagmiClient alias was removed. Use useClient instead.
    • WagmiClient alias was removed. Use Client instead.
    • createWagmiStorage alias was removed. Use createStorage instead.
    • Provider was renamed and WagmiProvider alias was removed. Use WagmiConfig instead.
  • #408 bfcc3a5 Thanks @jxom! - Add configureChains 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.

    Before

    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),
    });

    After

    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,
    });

Patch Changes

  • #404 f81c156 Thanks @holic! - Add ProviderRpcError and RpcError error classes.

    Certain wagmi-standardized errors may wrap ProviderRpcError or RpcError. For these cases, you can access the original provider rpc or rpc error value using the internal 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.

0.2.5

Patch Changes

  • 4e03666 Thanks @tmm! - bump dependencies #429 add imToken support for WC switch chains #432 fix MetaMask and Brave Wallet collision #436

0.2.4

Patch Changes

0.2.3

Patch Changes

  • #412 80bef4f Thanks @markdalgleish! - Import providers from ethers peer dependency rather than @ethersproject/providers to avoid multiple conflicting versions being installed

0.2.2

Patch Changes

  • 018c2a1 Thanks @tmm! - - warn and fallback to default client #380

    • remove signerOrProvider option from read contract #390

    • MetaMaskConnector #391

0.2.1

Patch Changes

  • afc4607 Thanks @tmm! - - Fix time scaling e9593df
    • Use fully-specified path for use-sync-external-store import 7b235c1
    • Update serialize 236fc17

0.2.0

Minor Changes

  • #311 24ce011 Thanks @tmm! - don't persist account data when autoConnect is falsy
  • #311 24ce011 Thanks @tmm! - - fix(@wagmi/core): persist connector chains to local storage
  • #311 24ce011 Thanks @tmm! - - Favour message event over connecting event to conform to EIP-1193
    • Export useWaitForTransaction
  • #311 24ce011 Thanks @tmm! - Add cacheOnBlock config for useContractRead Update react-query to v4 Fix watchBlockNumber listener leak
  • #311 24ce011 Thanks @tmm! - Fix issue where getProvider was not being awaited in getSigner
  • #311 24ce011 Thanks @tmm! - - remove storage persistence of connector
    • add chains to client state

Patch Changes

  • #311 24ce011 Thanks @tmm! - update block explorers and rpc urls structure

0.2.0-next.18

Patch Changes

  • showtime

0.2.0-next.17

Patch Changes

  • update block explorers and rpc urls structure

0.2.0-next.16

Patch Changes

  • last beta

0.2.0-next.15

Patch Changes

  • update zustand

0.2.0-next.14

Minor Changes

  • Add cacheOnBlock config for useContractRead
  • Update react-query to v4
  • Fix watchBlockNumber listener leak

0.2.0-next.13

Patch Changes

  • keep previous data when watching

0.2.0-next.12

Patch Changes

  • add chainId to actions and hooks

0.2.0-next.11

Patch Changes

  • fix stale connectors when switching chains

0.2.0-next.10

Patch Changes

  • republish

0.2.0-next.9

Patch Changes

  • improve type support for ethers providers

0.2.0-next.8

Patch Changes

  • update babel target

0.2.0-next.7

Minor Changes

    • Favour message event over connecting event to conform to EIP-1193
    • Export useWaitForTransaction

0.2.0-next.6

Minor Changes

  • add connecting event to connectors

0.2.0-next.5

Minor Changes

  • don't persist account data when autoConnect is falsy

0.2.0-next.4

Minor Changes

  • remove storage persistence of connector
  • add chains to client state

0.2.0-next.3

Minor Changes

  • Fix issue where getProvider was not being awaited in getSigner

0.2.0-next.2

Minor Changes

  • fix: persist connector chains to local storage

0.2.0-next.1

Minor Changes

  • Initial 0.3.0 release

0.1.22

Patch Changes

  • 747d895 Thanks @tmm! - add warning to WalletLinkConnector

0.1.21

Patch Changes

0.1.20

Patch Changes

0.1.19

Patch Changes

0.1.18

Patch Changes

0.1.17

Patch Changes

0.1.16

Patch Changes

0.1.15

Patch Changes

0.1.14

Patch Changes

0.1.13

Patch Changes

0.1.12

Patch Changes

0.1.11

Patch Changes

0.1.10

Patch Changes

0.1.9

Patch Changes

  • #190 7034bb8 Thanks @tmm! - add shim for metamask chain changed to prevent disconnect

0.1.8

Patch Changes

0.1.7

Patch Changes

0.1.6

Patch Changes

0.1.5

Patch Changes

  • e338c3b Thanks @tmm! - checksum connector address on change events

    add shim to injected connector for simulating disconnect

0.1.4

Patch Changes

  • 0176c4e Thanks @tmm! - added switchChain to WalletConnect and WalletLink connectors

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

  • #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";

0.0.17

Patch Changes

0.0.16

Patch Changes

  • d1574cf Thanks @tmm! - add better type information for contract results

0.0.15

Patch Changes

  • 3909624 Thanks @tmm! - make contract read and write execute overrides param optional

0.0.14

Patch Changes

0.0.13

Patch Changes

0.0.12

Patch Changes

  • #19 7bc1c47 Thanks @tmm! - remove console log from walletlink connector

0.0.11

Patch Changes

0.0.10

Patch Changes

0.0.9

Patch Changes

0.0.8

Patch Changes

0.0.7

Patch Changes

0.0.6

Patch Changes

0.0.5

Patch Changes

0.0.4

Patch Changes

0.0.3

Patch Changes

0.0.2

Patch Changes