233 KiB
Raw Permalink Blame History

wagmi

3.5.0

Minor Changes

  • Added useSignTransaction (#4995)

Patch Changes

  • Updated dependencies [8b96e2f]:
    • @wagmi/core@3.4.0
    • @wagmi/connectors@7.2.1

3.4.4

Patch Changes

  • Updated dependencies [c1dedd9, 9dbdd82]:
    • @wagmi/core@3.3.4
    • @wagmi/connectors@7.2.0

3.4.3

Patch Changes

  • Added ability to sign arbitrary hash on webAuthn#connect. (#4994)

  • Updated dependencies [4b3f5a3]:

    • @wagmi/core@3.3.3
    • @wagmi/connectors@7.1.7

3.4.2

Patch Changes

  • Updated dependencies [68e17db]:
    • @wagmi/core@3.3.2
    • @wagmi/connectors@7.1.6

3.4.1

Patch Changes

  • Updated dependencies [7f756bd]:
    • @wagmi/core@3.3.1
    • @wagmi/connectors@7.1.5

3.4.0

Minor Changes

  • Added useContractEvents hook. (#4905)

  • Added useBlobBaseFee and useWriteContractSync hooks. (dfe7904)

Patch Changes

  • Fixed createUseWriteContract not returning mutate/mutateAsyc with abi injected. (#4967)

  • Fixed re-subscribe every render for useWatchBlockNumber, useWatchBlocks, useWatchContractEvent, useWatchPendingTransactions. (b5d6911)

  • Updated dependencies [dfe7904, d503a2c, 5399840, 5978cc5, 67612ed, dbe9484]:

    • @wagmi/core@3.3.0
    • @wagmi/connectors@7.1.4

3.3.4

Patch Changes

  • Fixed issue where wagmi/tempo hooks were not propagating UseQueryOptions. (#4955)

3.3.3

Patch Changes

3.3.2

Patch Changes

  • Updated query internals. (4fefa57)

  • Updated dependencies [4fefa57]:

    • @wagmi/core@3.2.2
    • @wagmi/connectors@7.1.2

3.3.1

Patch Changes

  • Updated dependencies [a373b50]:
    • @wagmi/core@3.2.1
    • @wagmi/connectors@7.1.1

3.3.0

Minor Changes

  • Updated to viem@2.44.0 with Tempo Moderato support. (#4940)

    Breaking Changes (Tempo)

    • Renamed reward.useStart → reward.useDistribute
    • Renamed reward.useStartSync → reward.useDistributeSync
    • Renamed reward.useGetTotalPerSecond → reward.useGetGlobalRewardPerToken
    • Renamed reward.useWatchRewardScheduled → reward.useWatchRewardDistributed
    • Removed nonce.useNonceKeyCount
    • Removed nonce.useWatchActiveKeyCountChanged
    • Removed amm.useWatchFeeSwap

    New Features (Tempo)

    • Added dex.useCancelStale hook
    • Added dex.useCancelStaleSync hook

Patch Changes

  • Updated dependencies [2ee3f55]:
    • @wagmi/core@3.2.0
    • @wagmi/connectors@7.1.3

3.2.0

Minor Changes

  • Added first-class support and extension for Tempo via /tempo entrypoint. (#4922)

Patch Changes

  • Updated dependencies [14989e4]:
    • @wagmi/core@3.1.0
    • @wagmi/connectors@7.1.2

3.1.4

Patch Changes

  • Updated dependencies [a5c4381]:
    • @wagmi/core@3.0.2
    • @wagmi/connectors@7.0.6

3.1.3

Patch Changes

  • Fixed published exports. (ed86500)

  • Updated dependencies [ed86500]:

    • @wagmi/connectors@7.0.5

3.1.2

Patch Changes

  • Updated dependencies [9bbf13e]:
    • @wagmi/connectors@7.0.4

3.1.1

Patch Changes

  • Fixed useReadContract return type inference for ABI function overloads. (058c8c1)

  • Updated dependencies [058c8c1]:

    • @wagmi/core@3.0.1
    • @wagmi/connectors@7.0.3

3.1.0

Minor Changes

  • Deprecated custom mutate function names and renamed to mutate/mutateAsync to reduce destructure key renaming fatigue and align with TanStack Query terminology. (#4878)

    Before

    Had to destructure hook result and often rename keys when using multiple of the same hook. Could decide not to destructure, but syntax becomes awkward for mutate functions (e.g. connect.connect or connect.connectAsync).

    const { connect, isPending: connectIsPending } = useConnect();
    const {
      writeContract: transfer,
      error: transferError,
      isPending: transferIsPending,
    } = useWriteContract();
    const { writeContract: approve, error: approveError } = useWriteContract();
    

    After

    Allows you to name the hook result whatever you want and not worry about also renaming properties.

    const connect = useConnect(); // connect.isPending
    const transfer = useWriteContract(); // transfer.mutate, transfer.error, transfer.isPending
    const approve = useWriteContract(); // approve.mutate, approve.error
    

3.0.2

Patch Changes

  • Updated dependencies [0a46561]:
    • @wagmi/connectors@7.0.2

3.0.1

Patch Changes

  • Updated dependencies [856548a]:
    • @wagmi/connectors@7.0.1

3.0.0

Major Changes

  • All connector dependencies are now optional peer dependencies. This means that if you want to use a specific connector, you need to install its required dependencies. (#4857)

    baseAccount

    baseAccount requires @base-org/account

    pnpm add @base-org/account@~2.4.0
    

    coinbaseWallet

    coinbaseWallet requires @coinbase/wallet-sdk

    pnpm add @coinbase/wallet-sdk@~4.3.6
    

    gemini

    gemini requires @gemini-wallet/core

    pnpm add @gemini-wallet/core@~0.3.1
    

    metaMask

    metaMask requires @metamask/sdk

    pnpm add @metamask/sdk@~0.33.1
    

    porto

    porto requires porto

    pnpm add porto@~0.2.35
    

    safe

    safe requires @safe-global/safe-apps-provider and @safe-global/safe-apps-sdk

    pnpm add @safe-global/safe-apps-provider@~0.18.6 @safe-global/safe-apps-sdk@~9.1.0
    

    walletConnect

    walletConnect requires walletconnect/ethereum-provider

    pnpm add @walletconnect/ethereum-provider@~2.21.1
    

Patch Changes

  • Updated dependencies [73e7326]:
    • @wagmi/connectors@7.0.0
    • @wagmi/core@3.0.0

2.19.5

Patch Changes

  • Updated dependencies [5388de5]:
    • @wagmi/connectors@6.2.0

2.19.4

Patch Changes

  • Optimized internal chainId computation for useReadContracts to reduce unnecessary query invalidations. (#4872)

2.19.3

Patch Changes

  • Updated dependencies [2ddb506]:
    • @wagmi/connectors@6.1.4

2.19.2

Patch Changes

  • Updated dependencies [65cf154]:
    • @wagmi/connectors@6.1.3

2.19.1

Patch Changes

  • Updated dependencies [faf3eed]:
    • @wagmi/connectors@6.1.2

2.19.0

Minor Changes

  • Exported internal types (3e634b7)

Patch Changes

  • Updated dependencies [990dd23]:
    • @wagmi/connectors@6.1.1

2.18.2

Patch Changes

  • Updated dependencies [ae31a8d]:
    • @wagmi/connectors@6.1.0

2.18.1

Patch Changes

  • Updated dependencies [74100b0]:
    • @wagmi/core@2.22.1
    • @wagmi/connectors@6.0.1

2.18.0

Minor Changes

  • Added useSendTransactionSync and useSendCallsSync Hooks. (#4823)

Patch Changes

  • Updated dependencies [ebb2352]:
    • @wagmi/core@2.22.0
    • @wagmi/connectors@6.0.0

2.17.5

Patch Changes

  • Updated dependencies [2f0db95, 866aeb0]:
    • @wagmi/connectors@5.11.2
    • @wagmi/core@2.21.2

2.17.4

Patch Changes

2.17.3

Patch Changes

  • Updated dependencies [f05c075]:
    • @wagmi/connectors@5.11.0

2.17.2

Patch Changes

  • Updated dependencies [72b703a]:
    • @wagmi/core@2.21.1
    • @wagmi/connectors@5.10.2

2.17.1

Patch Changes

  • Updated dependencies [5937456]:
    • @wagmi/connectors@5.10.1

2.17.0

Minor Changes

Patch Changes

2.16.9

Patch Changes

2.16.8

Patch Changes

2.16.7

Patch Changes

2.16.6

Patch Changes

2.16.5

Patch Changes

2.16.4

Patch Changes

2.16.3

Patch Changes

2.16.2

Patch Changes

2.16.1

Patch Changes

2.16.0

Minor Changes

Patch Changes

2.15.7

Patch Changes

2.15.6

Patch Changes

2.15.5

Patch Changes

2.15.4

Patch Changes

2.15.3

Patch Changes

2.15.2

Patch Changes

2.15.1

Patch Changes

2.15.0

Minor Changes

Patch Changes

2.14.16

Patch Changes

2.14.15

Patch Changes

2.14.14

Patch Changes

2.14.13

Patch Changes

2.14.12

Patch Changes

2.14.11

Patch Changes

2.14.10

Patch Changes

2.14.9

Patch Changes

2.14.8

Patch Changes

2.14.7

Patch Changes

2.14.6

Patch Changes

2.14.5

Patch Changes

2.14.4

Patch Changes

2.14.3

Patch Changes

2.14.2

Patch Changes

2.14.1

Patch Changes

2.14.0

Minor Changes

Patch Changes

2.13.5

Patch Changes

2.13.4

Patch Changes

2.13.3

Patch Changes

2.13.2

Patch Changes

2.13.1

Patch Changes

2.13.0

Minor Changes

Patch Changes

2.12.33

Patch Changes

2.12.32

Patch Changes

2.12.31

Patch Changes

2.12.30

Patch Changes

2.12.29

Patch Changes

2.12.28

Patch Changes

2.12.27

Patch Changes

2.12.26

Patch Changes

2.12.25

Patch Changes

2.12.24

Patch Changes

2.12.23

Patch Changes

2.12.22

Patch Changes

2.12.21

Patch Changes

2.12.20

Patch Changes

2.12.19

Patch Changes

2.12.18

Patch Changes

2.12.17

Patch Changes

2.12.16

Patch Changes

2.12.15

Patch Changes

2.12.14

Patch Changes

2.12.13

Patch Changes

2.12.12

Patch Changes

2.12.11

Patch Changes

2.12.10

Patch Changes

2.12.9

Patch Changes

2.12.8

Patch Changes

2.12.7

Patch Changes

2.12.6

Patch Changes

2.12.5

Patch Changes

2.12.4

Patch Changes

2.12.3

Patch Changes

2.12.2

Patch Changes

2.12.1

Patch Changes

2.12.0

Minor Changes

Patch Changes

2.11.3

Patch Changes

2.11.2

Patch Changes

2.11.1

Patch Changes

2.11.0

Minor Changes

Patch Changes

2.10.11

Patch Changes

2.10.10

Patch Changes

2.10.9

Patch Changes

2.10.8

Patch Changes

2.10.7

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

2.10.0

Minor Changes

Patch Changes

2.9.12

Patch Changes

2.9.11

Patch Changes

2.9.10

Patch Changes

2.9.9

Patch 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

  • Bumped versions.

  • Updated dependencies []:

    • @wagmi/connectors@5.0.1
    • @wagmi/core@2.10.1

2.9.0

Minor Changes

Patch Changes

2.8.8

Patch Changes

2.8.7

Patch Changes

2.8.6

Patch Changes

2.8.5

Patch Changes

2.8.4

Patch Changes

2.8.3

Patch Changes

2.8.2

Patch Changes

2.8.1

Patch Changes

  • cda6a5d5 Thanks @jxom! - Updated packages.

  • Updated dependencies [cda6a5d5]:

    • @wagmi/core@2.9.1
    • @wagmi/connectors@4.3.3

2.8.0

Minor Changes

Patch Changes

  • Updated dependencies [017828fc]:
    • @wagmi/core@2.9.0
    • @wagmi/connectors@4.3.2

2.7.1

Patch Changes

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

  • Updated dependencies [d4a78eb0]:

    • @wagmi/core@2.8.1
    • @wagmi/connectors@4.3.1

2.7.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.6.0

Minor Changes

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

Patch Changes

2.5.22

Patch Changes

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

  • Updated dependencies [e3c832a1]:

    • @wagmi/connectors@4.1.28
    • @wagmi/core@2.6.19

2.5.21

Patch Changes

  • #3848 dd40a41c Thanks @jxom! - Updated MetaMask SDK.

  • Updated dependencies [dd40a41c]:

    • @wagmi/connectors@4.1.27
    • @wagmi/core@2.6.18

2.5.20

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.

  • Updated dependencies [a97bfbae]:

    • @wagmi/core@2.6.17
    • @wagmi/connectors@4.1.26

2.5.19

Patch Changes

  • #3793 f85b83ae Thanks @tmm! - Wired up config inside hooks so you can pass it explicitly and not use the WagmiProvider.

  • Updated dependencies [42ad380d]:

    • @wagmi/connectors@4.1.25
    • @wagmi/core@2.6.16

2.5.18

Patch Changes

  • Updated dependencies [b907d5ac]:
    • @wagmi/core@2.6.15
    • @wagmi/connectors@4.1.24

2.5.17

Patch Changes

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

  • Updated dependencies [b3b54ef1, 3da20bb8, a3d1858f]:

    • @wagmi/core@2.6.14
    • @wagmi/connectors@4.1.23

2.5.16

Patch Changes

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

  • Updated dependencies [b80236dc]:

    • @wagmi/core@2.6.13
    • @wagmi/connectors@4.1.22

2.5.15

Patch Changes

2.5.14

Patch Changes

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

  • Updated dependencies [e1ca4e63]:

    • @wagmi/connectors@4.1.20
    • @wagmi/core@2.6.11

2.5.13

Patch Changes

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

  • Updated dependencies [dbdca8fd]:

    • @wagmi/core@2.6.10
    • @wagmi/connectors@4.1.19

2.5.12

Patch Changes

  • #3612 97237bb0 Thanks @m1heng! - Added missing functionName parameter to useWriteContract codegen helper.

2.5.11

Patch Changes

2.5.10

Patch Changes

  • #3643 e46bcd47 Thanks @TateB! - Fixed race condition arising from reconnect.

  • Updated dependencies [e46bcd47]:

    • @wagmi/core@2.6.8
    • @wagmi/connectors@4.1.17

2.5.9

Patch Changes

2.5.8

Patch Changes

  • Updated dependencies [a91c0b64]:
    • @wagmi/core@2.6.6
    • @wagmi/connectors@4.1.15

2.5.7

Patch Changes

2.5.6

Patch Changes

2.5.5

Patch Changes

  • Updated dependencies [9c3b85dd, 2a72214a]:
    • @wagmi/core@2.6.3
    • @wagmi/connectors@4.1.12

2.5.4

Patch Changes

  • 3f8203bd Thanks @tmm! - Fixed useBlock parameters passthrough to Viem.

2.5.3

Patch Changes

2.5.2

Patch Changes

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

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

  • Updated dependencies [660ff80d, 101a7dd1]:

    • @wagmi/connectors@4.1.10
    • @wagmi/core@2.6.1

2.5.1

Patch Changes

2.5.0

Minor Changes

Patch Changes

  • Updated dependencies [ca98041d]:
    • @wagmi/core@2.5.0
    • @wagmi/connectors@4.1.8

2.4.0

Minor Changes

Patch Changes

  • Updated dependencies [370f1b4a, 370f1b4a]:
    • @wagmi/connectors@4.1.7
    • @wagmi/core@2.4.0

2.3.1

Patch Changes

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

  • Updated dependencies [3be5bb7b]:

    • @wagmi/core@2.3.1
    • @wagmi/connectors@4.1.6

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.

  • Updated dependencies [d950b666, d950b666, 90ef39bb, 1cfb6e5a]:

    • @wagmi/core@2.3.0
    • @wagmi/connectors@5.0.0

2.2.1

Patch Changes

2.2.0

Minor Changes

Patch Changes

2.1.2

Patch Changes

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

  • Updated dependencies [e00b8205]:

    • @wagmi/core@2.1.2
    • @wagmi/connectors@4.1.2

2.1.1

Patch Changes

  • #3402 64b82282 Thanks @Songkeys! - Fixed SSR cookie support for cookies that have special characters, e.g. =.

  • ec0d8b41 Thanks @tmm! - Added note to metaMask connector.

  • Updated dependencies [64b82282, ec0d8b41]:

    • @wagmi/core@2.1.1
    • @wagmi/connectors@4.1.1

2.1.0

Minor Changes

Patch Changes

  • Updated dependencies [c9cd302e]:
    • @wagmi/core@2.1.0
    • @wagmi/connectors@5.0.0

2.0.3

Patch Changes

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

  • Updated dependencies [ee868c33]:

    • @wagmi/connectors@4.0.2
    • @wagmi/core@2.0.2

2.0.2

Patch Changes

2.0.1

Major Changes

  • #3333 b3a0baaa Thanks @tmm! - Wagmi 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

Patch Changes

  • Updated dependencies [b3a0baaa, b3a0baaa]:
    • @wagmi/connectors@4.0.0
    • @wagmi/core@2.0.0

1.4.13

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.4.13

1.4.12

Patch Changes

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

  • Updated dependencies [53ca1f7e]:

    • @wagmi/core@1.4.12

1.4.11

Patch Changes

1.4.10

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.4.10

1.4.9

Patch Changes

1.4.8

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.4.8

1.4.7

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.4.7

1.4.6

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.4.6

1.4.5

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.4.5

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.

  • Updated dependencies [725e73fe]:

    • @wagmi/core@1.4.4

1.4.3

Patch Changes

1.4.2

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.4.2

1.4.1

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.4.1

1.4.0

Minor Changes

Patch Changes

  • Updated dependencies [2abeb285]:
    • @wagmi/core@1.4.0

1.3.11

Patch Changes

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

  • #2669 db75c459 Thanks @llllvvuu! - Modified useAccount and useNetwork to be reactive of wagmi Config (config).

1.3.4

Patch Changes

  • b056f809 Thanks @jxom! - Fixed an issue where onConnect was not being called when multiple instances of useAccount existed.

  • 22246d98 Thanks @jxom! - Updated references.

  • Updated dependencies [22246d98]:

    • @wagmi/core@1.3.4

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)

Patch Changes

  • Updated dependencies [0d79748c]:
    • @wagmi/core@1.3.0

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.9

Patch Changes

1.0.8

Patch Changes

1.0.7

Patch Changes

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

  • Updated dependencies [54fcff5f]:

    • @wagmi/core@1.0.7

1.0.6

Patch Changes

1.0.5

Patch Changes

1.0.4

Patch Changes

  • #2344 8a725458 Thanks @jxom! - Added gas estimation back into prepareSendTransaction.

  • Updated dependencies [8a725458]:

    • @wagmi/core@1.0.4

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.

  • Updated dependencies [92bfdc2c]:

    • @wagmi/core@1.0.3

1.0.2

Patch Changes

  • Updated dependencies [09a4fd38]:
    • @wagmi/core@1.0.2

1.0.1

Patch Changes

1.0.0

Major Changes

Patch Changes

  • Updated dependencies [5be0655c]:
    • @wagmi/core@1.0.0

1.0.0-next.9

Patch Changes

  • Fixed useContractEvent effect dependencies.

1.0.0-next.8

Patch Changes

  • Added "use client" banner

1.0.0-next.7

Major Changes

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

  • Updated references.

Patch Changes

  • Updated dependencies [708b2ce2]:
    • @wagmi/core@1.0.0-next.7

1.0.0-next.6

Major Changes

  • Added config.setConnectors

Patch Changes

  • Updated dependencies [708b2ce2]:
    • @wagmi/core@1.0.0-next.6

1.0.0-next.5

Major Changes

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

Patch Changes

  • Updated dependencies [708b2ce2]:
    • @wagmi/core@1.0.0-next.5

1.0.0-next.4

Major Changes

  • Updated viem. Removed goerli export from main entrypoint.

Patch Changes

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

1.0.0-next.3

Major Changes

  • Updated references.

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@1.0.0-next.3

1.0.0-next.2

Major Changes

  • Breaking: Renamed createClient to createConfig
  • Breaking: Renamed useClient to useConfig
  • Breaking: Removed request as an argument to usePrepareSendTransaction & useSendTransaction. Arguments now belong on the root level of the Hook.

Patch Changes

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

1.0.0-next.1

Major Changes

  • updated viem

Patch Changes

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

1.0.0-next.0

Major Changes

Patch Changes

  • Updated dependencies [a7dda00c]:
    • @wagmi/core@1.0.0-next.0

0.12.13

Patch Changes

0.12.12

Patch Changes

0.12.11

Patch Changes

0.12.10

Patch Changes

0.12.9

Patch Changes

0.12.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 [f1fee5b3, 7d64e3f5]:

    • @wagmi/core@0.10.8

0.12.7

Patch Changes

0.12.6

Patch Changes

0.12.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 [665df1bf]:

    • @wagmi/core@0.10.5

0.12.4

Patch Changes

0.12.3

Patch Changes

0.12.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 [06bf61de, 06bf61de]:

    • @wagmi/core@0.10.2

0.12.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 [0994e896]:
    • @wagmi/core@0.10.0

0.11.7

Patch Changes

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

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

    • @wagmi/core@0.9.7

0.11.6

Patch Changes

0.11.5

Patch Changes

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

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

    • @wagmi/core@0.9.5

0.11.4

Patch Changes

0.11.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 [9aaf1955, 9aaf1955]:

    • @wagmi/core@0.9.3

0.11.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 [31d06b8c, 31d06b8c]:

    • @wagmi/core@0.9.2

0.11.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 [144a0e76, 144a0e76]:

    • @wagmi/core@0.9.1

0.11.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.

Patch Changes

  • Updated dependencies [01e21897]:
    • @wagmi/core@0.9.0

0.10.15

Patch Changes

0.10.14

Patch Changes

0.10.13

Patch Changes

  • #1705 9ff797dc Thanks @jxom! - Added the following chains to the wagmi/chains entrypoint:

    • crossbell (thanks @Songkeys)
    • filecoin & filecoinHyperspace (thanks @neil0x46dc)
    • gnosisChiado (thanks @theNvN)
    • metis & metisGoerli (thanks @CookedCookee)
  • Updated dependencies [9ff797dc]:

    • @wagmi/core@0.8.17

0.10.12

Patch Changes

0.10.11

Patch Changes

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

  • Updated dependencies [917f5bc1]:

    • @wagmi/core@0.8.15

0.10.10

Patch Changes

0.10.9

Patch Changes

0.10.8

Patch Changes

0.10.7

Patch Changes

0.10.6

Patch Changes

  • #1623 c97a4bc5 Thanks @jxom! - Fixed an issue where useSigner would not update on account change.

0.10.5

Patch Changes

0.10.4

Patch Changes

0.10.3

Patch Changes

0.10.2

Patch Changes

  • #1593 216d555c Thanks @jxom! - Added CJS escape hatch bundle under the "cjs" tag.

  • Updated dependencies [216d555c]:

    • @wagmi/core@0.8.9

0.10.1

Patch Changes

0.10.0

Minor Changes

  • #1470 3a1a6c9f Thanks @jxom! - Breaking: The useSigner hook now always returns undefined when no signer is present. Previously, it returned null.

    When no signer is present, the hook will be in an "idle" status.

Patch Changes

0.9.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
  • Updated dependencies [732da004, ecde3d10]:

    • @wagmi/core@0.8.6

0.9.5

Patch Changes

0.9.4

Patch Changes

  • #1508 0b50b62f Thanks @jxom! - Updated @wagmi/chains to 0.1.3.

  • #1507 7a083bcf Thanks @jxom! - Fixed an issue where useBlockNumber would return data when watch is enabled and enabled is falsy.

  • #1504 11b8b794 Thanks @tmm! - Converted ethers custom "ACTION_REJECTED" error to standard RPC Error.

  • Updated dependencies [0b50b62f, 11b8b794]:

    • @wagmi/core@0.8.4

0.9.3

Patch Changes

0.9.2

Patch Changes

0.9.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.

  • Updated dependencies [c34a3dc6, 51dd53cb]:

    • @wagmi/core@0.8.1

0.9.0

Minor Changes

  • #1344 57a19374 Thanks @jxom! - Breaking: With the introduction of the wagmi/chains entrypoint, wagmi 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 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/chains entrypoint.

    import {
    - chain
      configureChains
    } from 'wagmi'
    + import { mainnet, polygon, optimism } from 'wagmi/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/chains entrypoint.

    - import { allChains } from 'wagmi'
    + import * as allChains from 'wagmi/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'
    + import { mainnet, goerli } from 'wagmi/chains'
    
    + const defaultChains = [mainnet, goerli]
    

    The defaultChains export was previously populated with mainnet & goerli.

    - import { defaultL2Chains } from 'wagmi'
    + import {
    +   arbitrum,
    +   arbitrumGoerli,
    +   polygon,
    +   polygonMumbai,
    +   optimism,
    +   optimismGoerli
    + } from 'wagmi/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'
    + import { mainnet, polygon, optimism } from 'wagmi/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'
    + import { mainnet, polygon, optimism } from 'wagmi/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'
    + import { mainnet } from 'wagmi/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: 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: Removed the wait config option on useWaitForTransaction. Use the transaction hash instead.

    const { data } = useWaitForTransaction({
    - wait: transaction.wait
    + hash: transaction.hash
    })
    
  • #1344 57a19374 Thanks @jxom! - Updated errors to use cause instead of internal

  • #1344 57a19374 Thanks @jxom! - useEnsResolver's result is no longer persisted by the query client since it cannot serialize its prototype methods.

  • #1344 57a19374 Thanks @jxom! - Breaking: Changed useWaitForTransaction behavior to return an error if the transaction reverted.

Patch Changes

0.8.10

Patch Changes

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

  • #1409 b557b3ee Thanks @jxom! - Ensure that useSyncExternalStoreWithTracked rerenders when no values are being tracked.

  • Updated dependencies [659be184]:

    • @wagmi/core@0.7.9

0.8.9

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/connectors/injected";
    
    const connector = new InjectedConnector({
      options: {
        name: "My Injected Wallet",
        getProvider: () =>
          typeof window !== "undefined" ? window.myInjectedWallet : undefined,
      },
    });
    
  • Updated dependencies [4f18c450]:

    • @wagmi/core@0.7.8

0.8.8

Patch Changes

0.8.7

Patch Changes

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

  • #1377 089c4f3b Thanks @jxom! - Fixed an issue where transforming useContractRead, useContractReads or useContractInfiniteReads's return data via select wasn't inferring the type.

  • Updated dependencies [027e88d6]:

    • @wagmi/core@0.7.6

0.8.6

Patch Changes

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

  • Updated dependencies [1169914a]:

    • @wagmi/core@0.7.5

0.8.5

Patch Changes

  • #1282 6d286c9e Thanks @jxom! - Fixed an issue where useContractRead would perform an unnecessary rerender if another hook had watch enabled.

0.8.4

Patch Changes

0.8.3

Patch Changes

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

  • Updated dependencies [b2f88949]:

    • @wagmi/core@0.7.3

0.8.2

Patch Changes

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

  • #1290 88450052 Thanks @tmm! - Fixed useAccount's' onConnect callback isReconnected flag.

  • Updated dependencies [e9f806b6]:

    • @wagmi/core@0.7.2

0.8.1

Patch Changes

0.8.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: 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! - Breaking: addressOrName renamed to address for useBalance and useEnsAvatar.

    const result = useBalance({
    - 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 } = useEnsAddress({ name: 'example.eth' })
    const result = useBalance({
    - addressOrName: 'example.eth',
    + address,
    })
    
  • #1202 9bf56af Thanks @tmm! - Removed CommonJS support

Patch Changes

0.7.15

Patch Changes

  • #1262 45e2ca4 Thanks @tmm! - Added default for structuralSharing for useContractRead, useContractReads, and useContractInfiniteReads.

0.7.14

Patch Changes

  • #1260 0e12f03 Thanks @ilmpc! - Deprecated isDataEqual option from and added structuralSharing option to useContractRead, useContractReads, and useContractInfiniteReads.

0.7.13

Patch Changes

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

  • Updated dependencies [ce2e0f4]:

    • @wagmi/core@0.6.12

0.7.12

Patch Changes

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

  • Updated dependencies [3ff9303]:

    • @wagmi/core@0.6.11

0.7.11

Patch Changes

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

  • Updated dependencies [c0ca509]:

    • @wagmi/core@0.6.10

0.7.10

Patch Changes

  • #1206 15ff089 Thanks @jxom! - Added scopeKey as a configuration option to the Hooks which scope its cache to a given context. Hooks that have identical scope will share the same cache.

  • #1207 c73d463 Thanks @lvshaoping007! - Added Kucoin wallet support to InjectedConnector

  • Updated dependencies [c73d463]:

    • @wagmi/core@0.6.9

0.7.9

Patch Changes

0.7.8

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

  • Updated dependencies [196a458, 389765f]:

    • @wagmi/core@0.6.7

0.7.7

Patch Changes

  • #1166 6fbe910 Thanks @jxom! - Export the React entrypoint Client type instead of @wagmi/core's Client.

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

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

  • Updated dependencies [81ce9e6, c2c0109]:

    • @wagmi/core@0.6.6

0.7.6

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.

  • Updated dependencies [30335b3, 30335b3]:

    • @wagmi/core@0.6.5

0.7.5

Patch Changes

0.7.4

Patch Changes

  • #1099 748e617 Thanks @jxom! - Added isFetchedAfterMount to the return value of hooks.

    The isFetchedAfterMount will be truthy if the hook has fetched after the component has been mounted. This value can be utilized to not show the result if it has previously been cached.

  • #1091 a3aaf59 Thanks @tmm! - Fixed useAccount onConnect/onDisconnect from not firing when the account was already connected/disconnected.

0.7.3

Patch Changes

0.7.2

Patch Changes

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

  • Updated dependencies [3be5e8b]:

    • @wagmi/core@0.6.2

0.7.1

Patch Changes

0.7.0

Minor Changes

  • #940 b6cb8f4 Thanks @jxom! - Breaking: usePrepareContractWrite now throws when a chainId is specified and the end-user is on a different chain id (the wrong network).

    If you wish to defer this check until the click handler is pressed, you can place chainId in useContractWrite instead:

    import { usePrepareContractWrite, useContractWrite } from 'wagmi'
    import { optimism } from 'wagmi/chains'
    
    // ...
    
    const { config } = usePrepareContractWrite({
      addressOrName: '0xaf0326d92b97df1221759476b072abfd8084f9be',
      contractInterface: ['function mint()'],
      functionName: 'mint',
    })
    const { write } = useContractWrite({
      ...config,
    + chainId: optimism.id
    })
    
    
  • #940 b6cb8f4 Thanks @jxom! - Breaking: The usePrepareSendTransaction hook will now only run when the end-user is connected to their wallet.

    This is to reach parity with usePrepareContractWrite.

    If the end-user is not connected, then the usePrepareSendTransaction hook will remain idle.

  • #940 b6cb8f4 Thanks @jxom! - Breaking: usePrepareSendTransaction now throws when a chainId is specified and the end-user is on a different chain id (the wrong network).

    If you wish to defer this check until the click handler is pressed, you can place chainId in useContractWrite instead:

    import { usePrepareSendTransaction, useContractWrite } from 'wagmi'
    import { optimism } from 'wagmi/chains'
    
    // ...
    
    const { config } = usePrepareSendTransaction({
      request: {
        to: 'moxey.eth',
        value: parseEther('1'),
      },
    })
    const { sendTransaction } = useSendTransaction({
      ...config,
    + chainId: optimism.id
    })
    
    
  • #941 0c96009 Thanks @tmm! - Breaking: useContractEvent no longer accepts a signerOrProvider configuration option.

  • #941 0c96009 Thanks @tmm! - Breaking: addressOrName and contractInterface renamed to address and abi respectively for contract hooks: useContract, useContractEvent, useContractRead, useContractReads, useContractInfiniteReads, useContractWrite, usePrepareContractWrite.

    import { useContractRead } from 'wagmi'
    
    const result = useContractRead({
    - 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 { useContractRead } from 'wagmi'
    + import { useContractRead, useEnsAddress } from 'wagmi'
    
    + const { data: address} = useEnsAddress({ name: 'example.eth'})
    const result = useContractRead({
    - addressOrName: 'example.eth',
    + address,
      abi: […],
      functionName: 'balanceOf',
      args: ['0x…'],
    })
    
  • #941 0c96009 Thanks @tmm! - Breaking: Updated TypeScript generics for contract and typed data hooks.

    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 { useContractRead } from 'wagmi'
    
    const result = useContractRead({
      address: '0x…',
    - abi: […],
    + abi: […] as const,
      functionName: 'balanceOf', // will autocomplete and catch typos
      args: ['0x…'], // inferred based on `abi`, `functionName`, `args`
    })
    result.data // inferred based on `functionName`
    

    This works for the following actions: useContractRead, useContractWrite, usePrepareContractWrite, useContractReads, useContractInfiniteReads, and useContractEvent.

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

    import { useSignTypedData } from 'wagmi'
    
    const result = useSignTypedData({
      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!',
      },
    })
    
  • #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 paginatedIndexesConfig fn parameter return type. fn now returns an array instead of a single object.

    import { BigNumber } from 'ethers'
    import { paginatedIndexesConfig, useContractInfiniteReads } from 'wagmi'
    
    useContractInfiniteReads({
      cacheKey: 'contracts',
      ...paginatedIndexesConfig(
    -    (index) => ({
    +    (index) => [{
          ...mlootContractConfig,
          functionName: 'tokenURI',
          args: [BigNumber.from(index)] as const,
    -    }),
    +    }],
        { start: 0, perPage: 10, direction: 'increment' },
      ),
    })
    
  • #941 0c96009 Thanks @tmm! - Breaking: args config option must now be an array for the following hooks: useContractRead, useContractWrite, usePrepareContractWrite, useContractReads, and useContractInfiniteReads.

    import { useContractRead } from 'wagmi'
    
    const { data } = useContractRead({
      address: '0x…',
      abi: […],
      functionName: 'balanceOf',
    - args: '0x…',
    + args: ['0x…'],
    })
    

Patch Changes

0.6.8

Patch Changes

  • 0b77286b Thanks @jxom! - Isolate wagmi's React Query queryClient instance.
  • 8cb07462 Thanks @jxom! - Added chainId as an argument to watchBlockNumber.
  • 53c1a474 Thanks @tmm! - Added missing decimals option to Connector watchAsset

0.6.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.

0.6.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.6.5

Patch Changes

0.6.4

Patch Changes

0.6.3

Patch Changes

  • #833 3ae6d0f Thanks @jxom! - Updated react-query@4.0.0-beta.23 to @tanstack/react-query@^4.0.10

  • Updated dependencies [1b85e54, 9655879]:

    • @wagmi/core@0.5.3

0.6.2

Patch Changes

  • #823 10b8b78 Thanks @tmm! - Add Optimism Goerli to chain lookup.

  • Updated dependencies [10b8b78]:

    • @wagmi/core@0.5.2

0.6.1

Patch Changes

0.6.0

Minor Changes

  • #658 d70c115 Thanks @jxom! - Breaking: The useSendTransaction hook's data now returns an object only consisting of hash & wait, and not the full TransactionResponse.

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

    import { useSendTransaction, useTransaction } from 'wagmi'
    
    const {
      data: {
        hash,
        wait,
    -   ...transaction
      }
    } = useSendTransaction(...)
    
    +const { data: transaction } = useTransaction({ hash })
    

    Why? The old implementation of useSendTransaction created a long-running async task, causing UX pitfalls when invoked in a click handler.

  • #658 d70c115 Thanks @jxom! - Breaking: The configuration passed to the useSendTransaction hook now needs to be either:

    • prepared with the usePrepareSendTransaction hook (new), or
    • recklessly unprepared (previous functionality)

    Why? Read here

    Prepared usage

    import { usePrepareSendTransaction, useSendTransaction } from 'wagmi'
    
    +const { config } = usePrepareSendTransaction({
    +  request: {
    +    to: 'moxey.eth',
    +    value: parseEther('1'),
    +  }
    +})
    
    const { data } = useSendTransaction({
    - request: {
    -   to: 'moxey.eth',
    -   value: parseEther('1')
    - }
    + ...config
    })
    

    Recklessly unprepared usage

    If you are not ready to upgrade to usePrepareSendTransaction, it is possible to use useSendTransaction without preparing the configuration first by passing mode: 'recklesslyUnprepared'.

    import { useSendTransaction } from 'wagmi'
    
    const { data } = useSendTransaction({
    + mode: 'recklesslyUnprepared',
      request: {
        to: 'moxey.eth',
        value: parseEther('1'),
      }
    })
    
  • #658 d70c115 Thanks @jxom! - Breaking: If a chainId is passed to useContractWrite or useSendTransaction, 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.

  • #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',
    })
    
  • #658 d70c115 Thanks @jxom! - Added the usePrepareContractWrite hook that eagerly fetches the parameters required for sending a contract write transaction such as the gas estimate.

    It returns config to be passed through to useContractWrite.

    const { config } = usePrepareContractWrite({
      addressOrName: "0xecb504d39723b0be0e3a9aa33d646642d1051ee1",
      contractInterface: wagmigotchiABI,
      functionName: "feed",
    });
    const { write } = useContractWrite(config);
    
  • #658 d70c115 Thanks @jxom! - Breaking: When useSendTransaction is in "prepare mode" (used with usePrepareSendTransaction), sendTransaction/sendTransactionAsync will be undefined until the configuration has been prepared. Ensure that your usage reflects this.

    const { config } = usePrepareSendTransaction({ ... })
    const { sendTransaction } = useSendTransaction(config)
    
    <button
      disabled={!sendTransaction}
      onClick={() => sendTransaction?.()}
    >
      Send
    </button>
    
  • #658 d70c115 Thanks @jxom! - Added the usePrepareSendTransaction hook that eagerly fetches the parameters required for sending a transaction such as the gas estimate and resolving an ENS address (if required).

    It returns config to be passed through to useSendTransaction.

    import { usePrepareSendTransaction, useSendTransaction } from "@wagmi/core";
    
    const { config } = usePrepareSendTransaction({
      request: {
        to: "moxey.eth",
        value: parseEther("1"),
      },
    });
    const { sendTransaction } = useSendTransaction(config);
    
  • #658 d70c115 Thanks @jxom! - Breaking: The sendTransaction/sendTransactionAsync configuration object has now been altered to only accept "reckless" configuration. If one or more of these values are set, it can lead to UX pitfalls.

    <button
      onClick={() => {
        sendTransaction({
    -     request: {
    +     recklesslySetUnpreparedRequest:
            to: 'moxey.eth',
            value: parseEther('1')
          }
        })
      }}
    >
      Send
    </button>
    
  • #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: When useContractWrite is in "prepare mode" (used with usePrepareContractWrite), write/writeAsync will be undefined until the configuration has been prepared. Ensure that your usage reflects this.

    const { config } = usePrepareContractWrite({ ... })
    const { write } = useContractWrite(config)
    
    <button
      disabled={!write}
      onClick={() => write?.()}
    >
      Send
    </button>
    
  • #658 d70c115 Thanks @jxom! - Breaking: The configuration passed to the useContractWrite hook now needs to be either:

    • prepared with the usePrepareContractWrite hook (new), or
    • recklessly unprepared (previous functionality)

    Why? Read here

    Prepared usage

    import { usePrepareContractWrite, useContractWrite } from 'wagmi'
    
    +const { config } = usePrepareContractWrite({
    + addressOrName: '0x...',
    + contractInterface: wagmiAbi,
    + functionName: 'mint',
    + args: [tokenId]
    +})
    
    const { data } = useContractWrite({
    - addressOrName: '0x...',
    - contractInterface: wagmiAbi,
    - functionName: 'mint',
    - args: [tokenId],
    + ...config
    })
    

    Recklessly unprepared usage

    If you are not ready to upgrade to usePrepareContractWrite, it is possible to use useContractWrite without preparing the configuration first by passing mode: 'recklesslyUnprepared'.

    import { useContractWrite } from 'wagmi'
    
    const { data } = useContractWrite({
    + mode: 'recklesslyUnprepared',
      addressOrName: '0x...',
      contractInterface: wagmiAbi,
      functionName: 'mint',
      args: [tokenId],
    })
    

Patch Changes

  • #762 ccaeed5 Thanks @jxom! - Fix useContractRead return value unexpectedly returning null for falsy values
  • #734 7c2fa04 Thanks @jxom! - Fix issue where useProvider & useWebSocketProvider would not update when chainId config changes
  • #739 c2295a5 Thanks @tmm! - Fix balance formatting for tokens that do not have 18 decimals.

0.5.11

Patch Changes

  • 4c7d123 Thanks @jxom! - Fix issue where useProvider & useWebSocketProvider would not update when chainId config changes

0.5.10

Patch Changes

  • #713 08b0113 Thanks @jxom! - Fix an issue where the useContractRead query function could return undefined instead of a serializable null.

0.5.9

Patch Changes

  • #677 35e4219 Thanks @jxom! - Parse tuples correctly in parseContractResult

  • Updated dependencies [35e4219]:

    • @wagmi/core@0.4.7

0.5.8

Patch Changes

  • #670 29a0d21 Thanks @tmm! - Fix broken release not containing deepEqual from @wagmi/core.

  • Updated dependencies [29a0d21]:

    • @wagmi/core@0.4.6

0.5.7

Patch Changes

  • #659 be76586 Thanks @jxom! - Added an isDataEqual config option to useContractRead, useContractReads & useContractInfiniteReads to define whether or not that data has changed. Defaults to deepEqual.
  • #659 be76586 Thanks @jxom! - Fixed an issue where useContractRead & useContractReads would return unstable data.

0.5.6

Patch Changes

  • #654 e66530b Thanks @jxom! - omit contractInterface from useContractRead & useContractReads query key hash
  • #654 e66530b Thanks @jxom! - fix multicall returning nullish data for all calls unexpectedly

  • Updated dependencies [e66530b]:

    • @wagmi/core@0.4.5

0.5.5

Patch Changes

  • #629 199db71 Thanks @jxom! - Add wagmi/actions entrypoint that exports imperative @wagmi/core actions
  • #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).

  • Updated dependencies [7a7a17a]:

    • @wagmi/core@0.4.4

0.5.4

Patch Changes

  • #631 a780e32 Thanks @tmm! - Fix WalletConnect stale session

  • Updated dependencies [a780e32]:

    • @wagmi/core@0.4.3

0.5.3

Patch Changes

  • #627 5985530 Thanks @jxom! - equalityFn in useSyncExternalStoreWithTracked should return truthy when there are no tracked keys.

0.5.2

Patch Changes

  • #624 416fa7e Thanks @jxom! - Fix broken WebSocketProvider type defs

  • Updated dependencies [416fa7e]:

    • @wagmi/core@0.4.2

0.5.1

Patch Changes

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

  • Updated dependencies [d171581, a5138e8]:

    • @wagmi/core@0.4.1

0.5.0

Minor Changes

  • fc94210 Thanks @jxom! - Breaking: The useContractWrite hook parameters have been consolidated into a singular config parameter.

    Before:

    useContractWrite(
      {
        addressOrName: mlootContractAddress,
        contractInterface: mlootABI,
      },
      "claim",
    );
    

    After:

    useContractWrite({
      addressOrName: mlootContractAddress,
      contractInterface: mlootABI,
      functionName: "claim",
    });
    
  • fc94210 Thanks @jxom! - Breaking: The useContractEvent hook parameters have been consolidated into a singular config parameter.

    Before:

    useContractEvent(
      {
        addressOrName: uniContractAddress,
        contractInterface: erc20ABI,
      },
      'Transfer',
      listener,
    ),
    

    After:

    useContractEvent({
      addressOrName: uniContractAddress,
      contractInterface: erc20ABI,
      eventName: "Transfer",
      listener,
    });
    
  • fc94210 Thanks @jxom! - Breaking: The client prop is now required on WagmiConfig.

    ```tsx
    import {
      createClient,
    + configureChains,
    + defaultChains
    } from 'wagmi'
    +import { publicProvider } from 'wagmi/providers/public'
    
    +const { provider, webSocketProvider } = configureChains(defaultChains, [
    + publicProvider(),
    +])
    
    +const client = createClient({
    + provider,
    + webSocketProvider,
    +})
    
    function App() {
      return (
        <WagmiConfig
    +     client={client}
        >
          <YourRoutes />
        </WagmiConfig>
      )
    }
    
  • 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 })
    })
    
  • #582 b03830a Thanks @jxom! - Breaking: The following changes were made to the useAccount return value:

    The data value is now address & connector

    {
    - data?: {
    -   address: string
    -   connector: Connector
    - }
    + address?: string
    + connector?: Connector
    }
    

    Global connection status values have been added

    The following global connection status values have been added:

    {
    + isConnecting: boolean
    + isReconnecting: boolean
    + isConnected: boolean
    + isDisconnected: boolean
    + status: 'connecting' | 'reconnecting' | 'connected' | 'disconnected'
    }
    

    The useAccount hook is now aware of any connection event in your application, so now you can use these connection status values to determine if your user is connected, disconnected or connecting to a wallet on a global scope.

    error, states & refetch values have been removed

    Since the useAccount hook never dealt with asynchronous data, all of these values were redundant & unused.

    {
    - error?: Error
    - isIdle: boolean
    - isLoading: boolean
    - isFetching: boolean
    - isSuccess: boolean
    - isError: boolean
    - isFetched: boolean
    - isRefetching: boolean
    - refetch: (options: {
    -   throwOnError: boolean
    -   cancelRefetch: boolean
    - }) => Promise<{
    -   address: string
    -   connector: Connector
    - }>
    - status: 'idle' | 'error' | 'loading' | 'success'
    }
    

    Summary of changes

    Below is the whole diff of changes to the useAccount return value.

    {
    - data?: {
    -   address: string
    -   connector: Connector
    - }
    + address?: string
    + connector?: Connector
    - error?: Error
    - isIdle: boolean
    - isLoading: boolean
    - isFetching: boolean
    - isSuccess: boolean
    - isError: boolean
    - isFetched: boolean
    - isRefetching: boolean
    + isConnecting: boolean
    + isReconnecting: boolean
    + isConnected: boolean
    + isDisconnected: boolean
    - refetch: (options: {
    -   throwOnError: boolean
    -   cancelRefetch: boolean
    - }) => Promise<{
    -   address: string
    -   connector: Connector
    - }>
    - status: 'idle' | 'error' | 'loading' | 'success'
    + status: 'connecting' | 'reconnecting' | 'connected' | 'disconnected'
    }
    
  • 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' },
        }),
      ]
    -  },
    })
    
  • #596 a770af7 Thanks @tmm! - Breaking: TypedDataDomain and TypedDataField types were removed and incorporated into SignTypedDataArgs.
  • #582 b03830a Thanks @jxom! - Breaking: The following changes were made to the useAccount configuration:

    onConnect has been added

    The onConnect callback is invoked when the account connects.

    It provides the connected address & connector, as well as a isReconnected flag for if the user reconnected via autoConnect.

    const account = useAccount({
      onConnect({ address, connector, isReconnected }) {
        console.log("Connected");
      },
    });
    

    onDisconnect has been added

    The onDisconnect callback is invoked when the account disconnected.

    const account = useAccount({
      onDisconnect() {
        console.log("Disconnected");
      },
    });
    

    suspense has been removed

    The useAccount hook is a synchronous hook – so suspense never worked.

    const account = useAccount({
    -  suspense: true,
    })
    

    onError has been removed

    The useAccount hook never had any error definitions – so onError was never invoked.

    const account = useAccount({
    - onError(error) {
    -   console.log('Error', error)
    - },
    })
    

    onSettled has been removed

    The useAccount hook is a synchronous hook. onSettled was always invoked immediately.

    const account = useAccount({
    - onSettled(data) {
    -   console.log('Settled', data)
    - },
    })
    

    If you used onSettled, you can move the code beneath the useAccount hook:

    const account = useAccount({
    - onSettled(data) {
    -   console.log('Address:', data.address)
    - },
    })
    + console.log('Address:', account.address)
    

    onSuccess has been removed

    The useAccount hook is a synchronous hook. onSuccess was always invoked immediately.

    const account = useAccount({
    - onSuccess(data) {
    -   console.log('Success', data)
    - },
    })
    

    If you used onSuccess, you can move the code beneath the useAccount hook:

    const account = useAccount({
    - onSuccess(data) {
    -   console.log('Address:', data.address)
    - },
    })
    + console.log('Address:', account.address)
    
  • #582 b03830a Thanks @jxom! - Breaking: The following changes were made to the useConnect return value:

    Connection status flags have been moved

    The isConnected, isConnecting, isReconnecting & isDisconnected flags have been moved to the useAccount hook.

    -import { useConnect } from 'wagmi'
    +import { useAccount } from 'wagmi'
    
    function App() {
      const {
        isConnected,
        isConnecting,
        isConnecting,
        isDisconnected
    - } = useConnect()
    + } = useAccount()
    }
    

    New connect mutation status flags have been added

    The isLoading, isSuccess and isError flags have been added to useConnect.

    These flags represent the local async state of useConnect.

    activeConnector has been removed

    The activeConnector value has been removed. You can find the active connector on useAccount.

    -import { useConnect } from 'wagmi'
    +import { useAccount } from 'wagmi'
    
    function App() {
    - const { activeConnector } = useConnect()
    + const { connector } = useAccount()
    }
    
  • #582 b03830a Thanks @jxom! - Breaking: The following changes were made to the useConnect configuration:

    onBeforeConnect has been renamed

    The onBeforeConnect callback has been renamed to onMutate

    onConnect has been renamed

    The onConnect callback has been renamed to onSuccess

  • #582 b03830a Thanks @jxom! - Breaking: The connector parameter to connect & connectAsync now has to be in the config object parameter shape.

    import { useConnect } from 'wagmi'
    
    function App() {
      const { connect, connectors } = useConnect()
    
      return (
        <button
    -     onClick={() => connect(connectors[0])}
    +     onClick={() => connect({ connector: connectors[0] })}
        >
          Connect
        </button>
      )
    }
    
  • #582 b03830a Thanks @jxom! - Breaking: The "switch network" functionality has been moved out of useNetwork into a new useSwitchNetwork hook.

    The useNetwork hook now accepts no configuration and only returns chain (renamed from activeChain) and chains.

    import {
      useNetwork
    + useSwitchNetwork
    } from 'wagmi'
    
    const {
    - activeChain
    + chain,
      chains,
    - data,
    - error,
    - isError,
    - isIdle,
    - isLoading,
    - isSuccess,
    - pendingChainId,
    - switchNetwork,
    - switchNetworkAsync,
    - status,
    - reset,
    -} = useNetwork({
    - chainId: 69,
    - onError(error) {},
    - onMutate(args) {},
    - onSettled(data, error) {},
    - onSuccess(data) {}
    -})
    +} = useNetwork()
    
    +const {
    + data,
    + error,
    + isError,
    + isIdle,
    + isLoading,
    + isSuccess,
    + pendingChainId,
    + switchNetwork,
    + switchNetworkAsync,
    + status,
    + reset,
    +} = useSwitchNetwork({
    + chainId: 69,
    + onError(error) {},
    + onMutate(args) {},
    + onSettled(data, error) {},
    + onSuccess(data) {}
    +})
    
  • fc94210 Thanks @jxom! - Breaking: The useContractRead hook parameters have been consolidated into a singular config parameter.

    Before:

    useContractRead(
      {
        addressOrName: wagmigotchiContractAddress,
        contractInterface: wagmigotchiABI,
      },
      "love",
      { args: "0x27a69ffba1e939ddcfecc8c7e0f967b872bac65c" },
    );
    

    After:

    useContractRead({
      addressOrName: wagmigotchiContractAddress,
      contractInterface: wagmigotchiABI,
      functionName: "love",
      args: "0x27a69ffba1e939ddcfecc8c7e0f967b872bac65c",
    });
    

Patch Changes

  • fc94210 Thanks @jxom! - Added a useContractInfiniteReads hook that provides the ability to call multiple ethers Contract read-only methods with "infinite scrolling" ("fetch more") support. Useful for rendering a dynamic list of contract data.

    Learn more

  • fc94210 Thanks @jxom! - Added a useContractReads hook that provides the ability to batch up multiple ethers Contract read-only methods.

    Learn more

  • #598 fef26bf Thanks @markdalgleish! - Update @coinbase/wallet-sdk to fix errors when connecting with older versions of the Coinbase Wallet extension and mobile app.

0.4.12

Patch Changes

0.4.11

Patch Changes

  • #566 8713c00 Thanks @jxom! - Fixed parseContractResult breaking useContractRead for more complex contract types

0.4.10

Patch Changes

  • 20a1ab7 Thanks @jxom! - Updated to react-query@4.0.0-beta.23
  • 20a1ab7 Thanks @jxom! - Fixed an issue in useContractRead where contract structs wouldn't be parsed back to an ethers Result correctly.

0.4.9

Patch Changes

0.4.8

Patch Changes

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

0.4.7

Patch Changes

  • #526 e95c5f9 Thanks @jxom! - Added shimChainChangedDisconnect option to InjectedConnector. Defaults to true for MetaMaskConnector.
  • #526 e95c5f9 Thanks @jxom! - Added chainId config option to useConnect() & connect(). Consumers can now pick what chain they want their user to be connected to.

    Examples:

    import { useConnect, chain } from "wagmi";
    import { InjectedConnector } from "wagmi/connectors/injected";
    
    function App() {
      const connect = useConnect({
        chainId: chain.polygon.id,
      });
    }
    
    import { useConnect, chain } from "wagmi";
    import { InjectedConnector } from "wagmi/connectors/injected";
    
    function App() {
      const connect = useConnect();
    
      return (
        <button onClick={() => connect({ chainId: chain.optimism.id })}>
          Connect to Optimism
        </button>
      );
    }
    
  • Updated dependencies [e95c5f9, e95c5f9, e95c5f9]:

    • @wagmi/core@0.3.6

0.4.6

Patch Changes

  • #543 4d489fd Thanks @tmm! - fix fee data formatting for null values

  • Updated dependencies [4d489fd]:

    • @wagmi/core@0.3.5

0.4.5

Patch Changes

  • 01cc47b Thanks @jxom! - Update react-query to 4.0.0-beta.19

0.4.4

Patch Changes

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

  • Updated dependencies [c4deb66]:

    • @wagmi/core@0.3.4

0.4.3

Patch Changes

0.4.2

Patch Changes

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

0.4.1

Patch Changes

0.4.0

Minor Changes

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

0.3.5

Patch Changes

  • 4e03666 Thanks @tmm! - bump dependencies #429 add imToken support for WC switch chains #432 fix MetaMask and Brave Wallet collision #436
  • Updated dependencies [4e03666]:
    • @wagmi/core@0.2.5

0.3.4

Patch Changes

0.3.3

Patch Changes

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

  • Updated dependencies [80bef4f]:

    • @wagmi/core@0.2.3

0.3.2

Patch Changes

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

    • remove signerOrProvider option from read contract #390

    • MetaMaskConnector #391

  • Updated dependencies [018c2a1]:

    • @wagmi/core@0.2.2

0.3.1

Patch Changes

  • afc4607 Thanks @tmm! - - Fix time scaling e9593df
    • Use fully-specified path for use-sync-external-store import 7b235c1
    • Update serialize 236fc17
  • Updated dependencies [afc4607]:
    • @wagmi/core@0.2.1

0.3.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

Patch Changes

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

0.3.0-next.21

Patch Changes

  • showtime

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.18

0.3.0-next.20

Patch Changes

  • update block explorers and rpc urls structure

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.17

0.3.0-next.19

Minor Changes

  • Update react-query to 4.0.0-beta.5

0.3.0-next.18

Patch Changes

  • last beta

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.16

0.3.0-next.17

Patch Changes

  • update zustand

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.15

0.3.0-next.16

Minor Changes

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

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@0.2.0-next.14

0.3.0-next.15

Patch Changes

  • keep previous data when watching

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.13

0.3.0-next.14

Patch Changes

  • add chainId to actions and hooks

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.12

0.3.0-next.13

Patch Changes

  • fix stale connectors when switching chains

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.11

0.3.0-next.12

Patch Changes

  • republish

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.10

0.3.0-next.11

Patch Changes

  • improve type support for ethers providers

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.9

0.3.0-next.10

Patch Changes

  • update babel target

  • Updated dependencies []:

    • @wagmi/core@0.2.0-next.8

0.3.0-next.9

Minor Changes

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

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@0.2.0-next.7

0.3.0-next.8

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@0.2.0-next.6

0.3.0-next.7

Minor Changes

  • don't persist account data when autoConnect is falsy

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@0.2.0-next.5

0.3.0-next.6

Minor Changes

  • fix useContractWrite mutation fn arguments

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@0.2.0-next.4

0.3.0-next.5

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@0.2.0-next.3

0.3.0-next.4

Minor Changes

  • force address to be required in useAccount

0.3.0-next.3

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@0.2.0-next.2

0.3.0-next.2

Minor Changes

  • Initial 0.3.0 release

Patch Changes

  • Updated dependencies []:
    • @wagmi/core@0.2.0-next.1

0.2.28

Patch Changes

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

  • Updated dependencies [747d895]:

    • wagmi-core@0.1.22

0.2.27

Patch Changes

  • c858c51 Thanks @tmm! - update coinbase connector

  • Updated dependencies [c858c51]:

    • wagmi-core@0.1.21

0.2.26

Patch Changes

  • Updated dependencies [36e6989]:
    • wagmi-core@0.1.20

0.2.25

Patch Changes

  • d467df6 Thanks @tmm! - fix global type leaking

  • Updated dependencies [d467df6]:

    • wagmi-core@0.1.19

0.2.24

Patch Changes

0.2.23

Patch Changes

0.2.22

Patch Changes

  • 79a2499 Thanks @tmm! - update build target to es2021

  • Updated dependencies [79a2499]:

    • wagmi-core@0.1.16

0.2.21

Patch Changes

  • f9790b5 Thanks @tmm! - fix WalletConnect issue

  • Updated dependencies [f9790b5]:

    • wagmi-core@0.1.15

0.2.20

Patch Changes

0.2.19

Patch Changes

0.2.18

Patch Changes

0.2.17

Patch Changes

  • 8e9412a Thanks @tmm! - bump walletlink

  • Updated dependencies [8e9412a]:

    • wagmi-core@0.1.13

0.2.16

Patch Changes

  • #210 684468a Thanks @tmm! - update chains to match chainslist.org

  • Updated dependencies [684468a]:

    • wagmi-core@0.1.12

0.2.15

Patch Changes

  • #195 25b6083 Thanks @tmm! - rename wagmi-private to wagmi-core

  • Updated dependencies [25b6083]:

    • wagmi-core@0.1.11

0.2.14

Patch Changes

  • #192 428cedb Thanks @tmm! - rename core and testing packages

  • Updated dependencies [428cedb]:

    • wagmi-core@0.1.10

0.2.13

Patch Changes

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

  • Updated dependencies [7034bb8]:

    • wagmi-private@0.1.9

0.2.12

Patch Changes

0.2.11

Patch Changes

  • 09f0719 Thanks @tmm! - - safe state updates h/t @bpierre
    • add useEnsResolveName hook h/t @shunkakinoki

0.2.10

Patch Changes

0.2.9

Patch Changes

0.2.8

Patch Changes

  • b49cb89 Thanks @tmm! - refactor contract read/write hook state

0.2.7

Patch Changes

  • 7132631 Thanks @tmm! - update contract read and write state

0.2.6

Patch Changes

  • #127 f05b031 Thanks @tmm! - update switch chain return type

  • Updated dependencies [f05b031]:

    • wagmi-private@0.1.7

0.2.5

Patch Changes

  • 1412eed Thanks @tmm! - add frame to injected

  • Updated dependencies [1412eed]:

    • wagmi-private@0.1.6

0.2.4

Patch Changes

0.2.3

Patch Changes

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

    add shim to injected connector for simulating disconnect

  • Updated dependencies [e338c3b]:

    • wagmi-private@0.1.5

0.2.2

Patch Changes

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

  • Updated dependencies [0176c4e]:

    • wagmi-private@0.1.4

0.2.1

Patch Changes

0.2.0

Minor Changes

0.1.7

Patch Changes

0.1.6

Patch Changes

  • 071d7fb Thanks @tmm! - add hardhat chain

  • Updated dependencies [071d7fb]:

    • wagmi-private@0.1.3

0.1.5

Patch Changes

  • db4d869 Thanks @tmm! - - add global connecting property for Provider autoConnect (h/t @sammdec)
    • fix useContractEvent error (h/t @math-marcellino)

0.1.4

Patch Changes

0.1.3

Patch Changes

  • 78bade9 Thanks @tmm! - add type definitions

  • Updated dependencies [78bade9]:

    • wagmi-private@0.1.2

0.1.2

Patch Changes

  • #56 2ebfd8e Thanks @tmm! - add chain support status

  • Updated dependencies [2ebfd8e]:

    • wagmi-private@0.1.1

0.1.1

Patch Changes

  • #54 25acd3d Thanks @tmm! - Stale contract object when useContract hook arguments change @zakangelle

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

Patch Changes

  • Updated dependencies [da7a3a6]:
    • wagmi-private@0.1.0

0.0.17

Patch Changes

0.0.16

Patch Changes

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

  • Updated dependencies [d1574cf]:

    • wagmi-private@0.0.16

0.0.15

Patch Changes

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

  • Updated dependencies [3909624]:

    • wagmi-private@0.0.15

0.0.14

Patch Changes

  • 63312e2 Thanks @tmm! - add once to contract event

  • Updated dependencies [63312e2]:

    • wagmi-private@0.0.14

0.0.13

Patch Changes

  • 6f890b0 Thanks @tmm! - update readme

  • Updated dependencies [6f890b0]:

    • wagmi-private@0.0.13

0.0.12

Patch Changes

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

  • Updated dependencies [7bc1c47]:

    • wagmi-private@0.0.12

0.0.11

Patch Changes

  • #17 571648b Thanks @tmm! - standardize connector provider

  • Updated dependencies [571648b]:

    • wagmi-private@0.0.11

0.0.10

Patch Changes

  • #15 5f7675c Thanks @tmm! - read and write contract functions

  • Updated dependencies [5f7675c]:

    • wagmi-private@0.0.10

0.0.9

Patch Changes

0.0.8

Patch Changes

  • 5332500 Thanks @tmm! - update signing

  • Updated dependencies [5332500]:

    • wagmi-private@0.0.8

0.0.7

Patch Changes

  • 0bff89a Thanks @tmm! - update injected connector

  • Updated dependencies [0bff89a]:

    • wagmi-private@0.0.7

0.0.6

Patch Changes

  • 37d39d1 Thanks @tmm! - add message signing

  • Updated dependencies [37d39d1]:

    • wagmi-private@0.0.6

0.0.5

Patch Changes

  • d7d94f0 Thanks @tmm! - fix injected connector name

  • Updated dependencies [d7d94f0]:

    • wagmi-private@0.0.5

0.0.4

Patch Changes

  • 29fbe29 Thanks @tmm! - fix external deps

  • Updated dependencies [29fbe29]:

    • wagmi-private@0.0.4

0.0.3

Patch Changes

0.0.2

Patch Changes