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

@exec402/react

v0.6.3

Published

React hooks and components for exec402 protocol

Downloads

3,678

Readme

@exec402/react

React hooks and components for exec402 protocol

Installation

npm install @exec402/react

Peer Dependencies

npm install react wagmi viem @tanstack/react-query

Usage

Setup Provider

Wrap your app with ExecProvider inside wagmi and react-query providers:

import { ExecProvider } from "@exec402/react";
import { WagmiProvider } from "wagmi";
import { QueryClientProvider } from "@tanstack/react-query";

function App() {
  return (
    <WagmiProvider config={wagmiConfig}>
      <QueryClientProvider client={queryClient}>
        <ExecProvider network="testnet">
          {children}
        </ExecProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
}

useCall

Create a contract call task:

import { useCall } from "@exec402/react";

function MyComponent() {
  const { mutate, isPending } = useCall();

  const handleCall = () => {
    mutate({
      target: "0x1234...",
      data: "0xabcd...",
      amount: "1000000",
    });
  };

  return <button onClick={handleCall} disabled={isPending}>Call</button>;
}

useTransfer

Create a transfer task:

import { useTransfer } from "@exec402/react";

function MyComponent() {
  const { mutate } = useTransfer();

  mutate({
    recipients: ["0x1234..."],
    amounts: ["1000000"],
  });
}

useTasks

Query task list:

import { useTasks } from "@exec402/react";

function TaskList() {
  const { data, isLoading } = useTasks({ status: "pending", limit: 10 });

  return (
    <ul>
      {data?.tasks.map((task) => (
        <li key={task.id}>{task.id}</li>
      ))}
    </ul>
  );
}

useTask

Query a single task:

import { useTask } from "@exec402/react";

function TaskDetail({ taskId }: { taskId: string }) {
  const { data: task } = useTask(taskId);

  return <div>{task?.status}</div>;
}

useExecuteCall / useExecuteTransfer

Execute a pending task:

import { useExecuteCall, useTask } from "@exec402/react";

function ExecuteTask({ taskId }: { taskId: string }) {
  const { data: task } = useTask(taskId);
  const { mutate: execute } = useExecuteCall();

  return (
    <button onClick={() => task && execute(task)}>
      Execute
    </button>
  );
}

useExecClient

Access the underlying ExecClient instance:

import { useExecClient } from "@exec402/react";

function MyComponent() {
  const client = useExecClient();

  // Use client directly
  const info = await client.getInfo();
}

API Reference

Hooks

| Hook | Description | |------|-------------| | useCall | Create a contract call task | | useTransfer | Create a transfer task | | useTasks | Query task list | | useTask | Query a single task | | useExecuteCall | Execute a call task | | useExecuteTransfer | Execute a transfer task | | useCanisterInfo | Get canister information | | useExecClient | Access ExecClient instance | | useExecContext | Access ExecContext (client + network) |

Components

| Component | Description | |-----------|-------------| | ExecProvider | Context provider for exec402 |