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

@notifi-network/fusion-sdk

v0.1.4

Published

SDK utils for Notifi Fusion parser development. This includes types and helpers for accessing ephemeral/persistent storage, RPCs for different chains, and other utilities.

Readme

Fusion SDK

Fusion SDK provides TypeScript/JavaScript wrappers and types for interacting with Notifi Fusion blockchain services, including EVM, Sui, Solana, storage management, and subscriptions.

Installation

npm install fusion-sdk

Usage

import {
  EvmRpc,
  SuiRpc,
  SolanaRpc,
  PersistentStorage,
  EphemeralStorage,
  Subscriptions,
  BlockchainType,
  HttpMethod,
  Region,
  getParserBlobInput
} from "fusion-sdk";

const evm = new EvmRpc("your-context-id");
const sui = new SuiRpc("your-context-id");
const solana = new SolanaRpc("your-context-id");
const persistentStorage = new PersistentStorage("your-context-id");
const ephemeralStorage = new EphemeralStorage("your-context-id");
const subscriptions = new Subscriptions("your-context-id");

API Reference

Classes

EvmRpc

EVM-specific blockchain operations.

Methods:

  • runEthCall(request): Executes an Ethereum call operation.
  • getAccountBalance(request): Retrieves the account balance for an Ethereum address.
const evm = new EvmRpc("your-context-id");
const balance = await evm.getAccountBalance({ address: "0x..." });

SuiRpc

Sui blockchain operations.

Methods:

  • getSuiAccountBalance(request): Retrieves the account balance for a Sui address.
  • runSuiTransaction(request): Executes a Sui transaction.
  • getSuiObject(request): Retrieves a Sui object.
const sui = new SuiRpc("your-context-id");
const balance = await sui.getSuiAccountBalance({ address: "0x..." });

SolanaRpc

Solana blockchain operations.

Methods:

  • getSolanaBalance(request): Retrieves the balance for a Solana address.
  • getSolanaAccountInfo(request): Retrieves account information for a Solana address.
  • getSolanaSlot(request): Retrieves the current Solana slot.
const solana = new SolanaRpc("your-context-id");
const balance = await solana.getSolanaBalance({ address: "..." });

PersistentStorage

CRUD operations for persistent storage.

Methods:

  • put(request): Stores a string value in persistent storage.
  • get(request): Retrieves a value from persistent storage.
  • delete(request): Deletes a value from persistent storage.
const persistentStorage = new PersistentStorage("your-context-id");
await persistentStorage.put({ key: "foo", value: "bar" });
const value = await persistentStorage.get({ key: "foo" });

Optimistic Concurrency Example: Fetch a value, increment its version, update, and retry on exception (optimistic locking with 100ms jitter):

function sleep(ms: number) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

async function updateWithOptimisticLock(key: string, newValue: string, maxRetries = 3) {
  let attempt = 0;
  while (attempt < maxRetries) {
    try {
      // Fetch current value and version
      const current = await persistentStorage.get({ key });
      const currentVersion = current.version ?? 0;
      // Attempt to update with incremented version
      await persistentStorage.put({ key, value: newValue, version: currentVersion + 1 });
      return true;
    } catch (err) {
      attempt++;
      if (attempt >= maxRetries) throw err;
      // Add 100ms jitter before retrying
      await sleep(100 + Math.floor(Math.random() * 100));
    }
  }
  return false;
}

// Usage
await updateWithOptimisticLock("foo", "newBar");

This pattern helps ensure updates are atomic and consistent, retrying if another process updates the value concurrently.

EphemeralStorage

Operations for ephemeral storage.

Methods:

  • put(request): Stores a string value in ephemeral storage.
  • get(request): Retrieves a value from ephemeral storage.
  • delete(request): Deletes a value from ephemeral storage.
  • peek(request): Peeks at the next value in a queue in ephemeral storage.
  • enqueue(request): Enqueues a value into a queue in ephemeral storage.
  • dequeue(request): Dequeues a value from a queue in ephemeral storage.
  • getModuleExecutionParams(request): Retrieves module execution parameters.
  • getOnChainBlock(request): Retrieves an on-chain block.
const ephemeralStorage = new EphemeralStorage("your-context-id");
await ephemeralStorage.put({ key: "temp", value: "baz" });
const value = await ephemeralStorage.get({ key: "temp" });

Subscriptions

Manage and retrieve subscription data.

Methods:

  • getSubscriptions(request): Retrieves subscription data.
const subscriptions = new Subscriptions("your-context-id");
const subs = await subscriptions.getSubscriptions({ eventTypeId: "event-type-id" });

All wrappers require a contextId string for gRPC requests. This is provided as an argument in the parse function in the Fusion system.

Types & Enums

  • BlockchainType: Enum for supported blockchains (EVM, Solana, Sui, etc.)

Utility Functions

  • getParserBlobInput(contextId: string, urlForBlob: string): Fetches and parses block data from storage. The response can be typed as:
    • EvmBlockAndLogs for EVM chains
    • SolanaBlockAndLogs for Solana
    • SuiCheckpointTransactions for Sui This allows you to safely cast and work with chain-specific block data structures in your application. Not applicable to OffChain parsers.

Environment Variables (SDK developer usage)

  • EVM_RPC_ADDRESS: EVM gRPC endpoint (default: localhost:50054)
  • SUI_RPC_ADDRESS: Sui gRPC endpoint (default: localhost:50057)
  • SOLANA_RPC_ADDRESS: Solana gRPC endpoint (default: localhost:50055)
  • PERSISTENT_STORAGE_ADDRESS: Persistent storage gRPC endpoint (default: localhost:50053)
  • EPHEMERAL_STORAGE_ADDRESS: Ephemeral storage gRPC endpoint (default: localhost:50052)
  • SUBSCRIPTION_MANAGER_ADDRESS: Subscriptions gRPC endpoint (default: localhost:50056)
  • GRPC_INSECURE: Set to "true" for insecure local connections

Publishing

To publish to npm:

npm publish

Ensure your documentation and API are up to date before publishing.

License

See LICENSE.