github wevm/viem viem@2.24.0

latest releases: viem@2.24.2, viem@2.24.1
3 days ago

Minor Changes

  • #3427 2a5ded4eab7febcf2b77a88cfe3c34a621d4dfe7 Thanks @jxom! - Stabilized EIP-7702.

    • Added prepareAuthorization and signAuthorization Actions to the Wallet Client.
    • Added hashAuthorization, recoverAuthorizationAddress, and verifyAuthorization Utilities.
    • Renamed account.experimental_signAuthorization to account.signAuthorization.
  • #3427 2a5ded4eab7febcf2b77a88cfe3c34a621d4dfe7 Thanks @jxom! - BREAKING (Experimental): Removed deprecated walletActionsEip5792 export. Use eip5792Actions instead.

  • #3427 2a5ded4eab7febcf2b77a88cfe3c34a621d4dfe7 Thanks @jxom! - BREAKING (Experimental): Removed deprecated ERC-6492 exports in viem/experimental. These are no longer experimental. Use exports from viem instead.

  • #3427 2a5ded4eab7febcf2b77a88cfe3c34a621d4dfe7 Thanks @jxom! - BREAKING (Experimental): Removed deprecated walletActionsErc7715 export. Use erc7715Actions instead.

  • #3427 2a5ded4eab7febcf2b77a88cfe3c34a621d4dfe7 Thanks @jxom! - BREAKING (Experimental):

    Removed EIP-7702 exports in viem/experimental. These are no longer experimental. Use exports from viem or viem/utils instead.

    Note, there is also a behavioral change in the stable EIP-7702 signAuthorization function. Previously, it was assumed that the signer of the Authorization was also the executor of the Transaction. This is no longer the case.

    If the signer of the Authorization is NOT the executor of the Transaction, you no longer need to pass a sponsor parameter.

    const eoa = privateKeyToAccount('0x...')
    const relay = privateKeyToAccount('0x...')
    
    const authorization = await client.signAuthorization({
      account: eoa,
      contractAddress: '0x...',
    - sponsor: true
    })
    
    const transaction = await client.sendTransaction({
      account: relay,
      authorizationList: [authorization],
    })

    If the signer of the Authorization is ALSO the executor of the Transaction, you will now need to pass the executor parameter with a value of 'self'.

    const eoa = privateKeyToAccount('0x...')
    - const relay = privateKeyToAccount('0x...')
    
    const authorization = await client.signAuthorization({
      account: eoa,
      contractAddress: '0x...',
    + executor: 'self',
    })
    
    const transaction = await client.sendTransaction({
    - account: relay,
    + account: eoa,
      authorizationList: [authorization],
    })

Patch Changes

Don't miss a new viem release

NewReleases is sending notifications on new releases.