npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nejcm/wagmi-extended

v0.0.5

Published

Wagmi hooks extending functionality

Downloads

36

Readme

wagmi-extended

Wagmi hooks extending base functionality

Overview

wagmi-extended is a library that extends the functionality of the base wagmi hooks, providing additional utilities for interacting with Ethereum smart contracts in a React environment. This library is designed to simplify the process of writing to contracts by offering a more flexible API.

Installation

To install wagmi-extended, you can use:

npm:

npm install @nejcm/wagmi-extended

yarn:

yarn add @nejcm/wagmi-extended

Usage

Example: Using useWriteContract

The useWriteContract hook allows you to interact with Ethereum smart contracts by writing data to them. Below is an example of how to use this hook:

import { useWriteContract } from 'wagmi-extended';
import erc20Abi from './erc20Abi.json';

const MyComponent = () => {
  const { writeContract, writeContractAsync } = useWriteContract({
    writeProps: {
      address: '0x0000000000000000000000000000000000000000',
      abi: erc20Abi,
      functionName: 'approve',
    },
    mutation: {
      onSuccess: (response, variables) => { // correctly infers types
        ...
      },
    },
  });

  const handleWrite = async () => {
    try {
      await writeContract({
        args: ['0x0000000000000000000000000000000000000000', BigInt(1000)],
      });
      console.log('Transaction successful');
    } catch (error) {
      console.error('Transaction failed', error);
    }
  };

  const handleWriteOverride = async () => {
    try {
      await writeContract({
        // Allows overriding the default writeProps
        address: '0x0000000000000000000000000000000000000001',
        functionName: 'revoke',
        args: ['0x0000000000000000000000000000000000000000', BigInt(1000)],
      });
      console.log('Transaction successful');
    } catch (error) {
      console.error('Transaction failed', error);
    }
  };

  return <button onClick={handleWrite}>Approve</button>;
};

API

useWriteContract

  • Parameters: Accepts default useContractWrite props and an additional optional object with the following properties:

    • writeProps: An optional object containing:
      • address: Optional contract address.
      • abi: Optional contract ABI.
      • functionName: Optional name of the function to call.
      • args: Optional arguments for the function.
      • chainId: Optional chain ID.
  • Returns: Return type is the same as the default useContractWrite hook with the following two methods overridden to allow optional arguments:

    • writeContract: A function to execute the contract write operation.
    • writeContractAsync: An async version of writeContract.

Contributing

Contributions are welcome!

To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Make your changes and commit them with descriptive commit messages.
  4. Push your changes to your forked repository.
  5. Create a pull request to the main repository.

Running the project locally

To run the project locally, follow these steps:

  1. Clone the repository.
  2. Install the dependencies by running pnpm install.
  3. Build the project pnpm run build.

License

This project is licensed under the MIT License.

TODO

  • [ ] Add more useful overrides and functionality
    • [ ] Batch transaction support
    • ...
  • [ ] Expand the docs and move them to GitHub pages with Docusaurus