github wevm/viem viem@2.43.0

latest release: viem@2.43.1
11 hours ago

Minor Changes

  • #4107 b423fc17eba4f9f0648f72f5358a8e5ed9d5f092 Thanks @tmm! - Added experimental named tuple support for contract-related actions and utilities.

  • #4147 734d99d9da4b76f9aa985a800213b4ba581607df Thanks @jxom! - Added first-class support and extension for Tempo.


    Attaching a Tempo chain to your client grants your transaction actions with Tempo superpowers like batched calls and external fee payer capabilities.

    import { createClient, http } from "viem";
    import { privateKeyToAccount } from "viem/accounts";
    import { tempoTestnet } from "viem/chains";
    
    const client = createClient({
      account: privateKeyToAccount("0x…"),
      chain: tempoTestnet.extend({
        feeToken: "0x20c00000000000000000000000000000000000fa",
      }),
      transport: http(),
    });
    
    const receipt = client.sendTransactionSync({
      calls: [
        { data: "0x…", to: "0x…" },
        { data: "0x…", to: "0x…" },
        { data: "0x…", to: "0x…" },
      ],
      feePayer: privateKeyToAccount("0x…"),
    });

    You can also use Tempo Actions to call to enshrined protocol features like the Stablecoin Token Factory:

    import { createClient, http } from "viem";
    import { privateKeyToAccount } from "viem/accounts";
    import { tempoTestnet } from "viem/chains";
    import { tempoActions } from "viem/tempo";
    
    const client = createClient({
      account: privateKeyToAccount("0x…"),
      chain: tempoTestnet,
      transport: http(),
    }).extend(tempoActions());
    
    const { receipt, token } = await client.token.createSync({
      currency: "USD",
      name: "My Company USD",
      symbol: "CUSD",
    });

Patch Changes

Don't miss a new viem release

NewReleases is sending notifications on new releases.