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

@lnfi-network/nodeflow-sdk

v1.0.2

Published

NodeFlow SDK is a React library that enables seamless asset bridging between EVM chains and the Bitcoin Lightning Network.

Downloads

1,389

Readme

NodeFlow SDK

NodeFlow SDK is a React library that enables seamless asset bridging between EVM chains and the Bitcoin Lightning Network.

Features

  • Cross-Chain Bridge: Bridge assets between EVM chains and Lightning Network
  • Multi-Chain Support: Base, BSC, and more
  • Wallet Integration: Built-in WalletConnect support
  • Dynamic Configuration: Auto-detects supported networks from API
  • Responsive UI: Dark theme with customizable modal

Installation

yarn add @lnfi-network/nodeflow-sdk
# or
npm install @lnfi-network/nodeflow-sdk

Peer dependencies (wagmi, viem, @reown/appkit, etc.) will be installed automatically.

Configuration

| Item | Value | Description | | :--- | :--- | :--- | | Project ID | Get from WalletConnect | Required for wallet connection | | Dev API URL | <API_BASE_URL> | Development/Testnet | | Prod API URL | (Contact support) | Production |


Quick Start

import { 
  NodeFlowProvider, 
  NodeFlowModal, 
  nodeFlowSend, 
  nodeFlowReceive,
  useNodeFlowPairs  // Hook to get available asset pairs
} from '@lnfi-network/nodeflow-sdk';

function App() {
  return (
    <NodeFlowProvider 
      projectId="your-walletconnect-project-id" 
      apiUrl="<API_BASE_URL>"
    >
      <NodeFlowModal />
      <MyBridgeUI />
    </NodeFlowProvider>
  );
}

function MyBridgeUI() {
  // Get available trading pairs dynamically - no hardcoded asset IDs needed!
  const { pairs, defaultAssetId, isReady } = useNodeFlowPairs();
  
  if (!isReady) return <div>Loading...</div>;

  return (
    <div>
      {/* Lightning → EVM: Get tokens by paying LN invoice */}
      <button onClick={() => nodeFlowSend({
        assetId: defaultAssetId,  // Use dynamic asset ID
        amount: 1000,             // Amount in sats
        onSuccess: (result) => console.log('Success!', result)
      })}>
        Get Tokens (Pay Lightning)
      </button>
      
      {/* EVM → Lightning: Pay LN invoice with tokens */}
      <button onClick={() => nodeFlowReceive({
        assetId: defaultAssetId,
        invoice: "lnbc...",       // Lightning invoice to pay
        onSuccess: (result) => console.log('Paid!', result)
      })}>
        Pay Invoice (Use Tokens)
      </button>
    </div>
  );
}

How It Works

Lightning → EVM (Get Tokens)

User pays a Lightning invoice to receive EVM tokens.

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Lightning → EVM (nodeFlowSend)                           │
└─────────────────────────────────────────────────────────────────────────────┘

    User                           SDK                           LSP Node
      │                              │                               │
      │  nodeFlowSend({              │                               │
      │    assetId, amount           │                               │
      │  })                          │                               │
      ├─────────────────────────────►│                               │
      │                              │                               │
      │                              │  Request Quote & Invoice      │
      │                              ├──────────────────────────────►│
      │                              │  ◄── { invoice }              │
      │                              │                               │
      │  Show Invoice QR             │                               │
      ◄──────────────────────────────│                               │
      │                              │                               │
      │  User pays via LN wallet     │                               │
      ├──────────────────────────────┼──────────────────────────────►│
      │                              │                               │
      │                              │  LSP releases tokens on-chain │
      │                              │  ◄──────────────────────────────
      │                              │                               │
      │  ✅ Tokens received!          │                               │
      ◄──────────────────────────────│                               │

EVM → Lightning (Pay Invoice)

User pays a Lightning invoice using their EVM tokens.

┌─────────────────────────────────────────────────────────────────────────────┐
│                    EVM → Lightning (nodeFlowReceive)                        │
└─────────────────────────────────────────────────────────────────────────────┘

    User                           SDK                           LSP Node
      │                              │                               │
      │  nodeFlowReceive({           │                               │
      │    assetId, invoice          │                               │
      │  })                          │                               │
      ├─────────────────────────────►│                               │
      │                              │                               │
      │  Show quote & confirm        │                               │
      ◄──────────────────────────────│                               │
      │                              │                               │
      │  Approve & Deposit tokens    │                               │
      ├─────────────────────────────►│                               │
      │                              │                               │
      │                              │  Lock tokens in contract      │
      │                              ├──────────────────────────────►│
      │                              │                               │
      │                              │  LSP pays LN invoice          │
      │                              │  ◄──────────────────────────────
      │                              │                               │
      │  ✅ Invoice paid!             │                               │
      ◄──────────────────────────────│                               │

API Reference

Components

<NodeFlowProvider>

Main provider component. Wrap your app with this.

| Prop | Type | Required | Description | | :--- | :--- | :--- | :--- | | projectId | string | ✅ | WalletConnect Project ID | | apiUrl | string | ✅ | NodeFlow API URL | | themeMode | 'dark' \| 'light' | - | Theme mode (default: 'dark') | | customNetworks | Network[] | - | Custom network configuration |

<NodeFlowModal>

Modal component for transaction UI. Add once inside the provider.


Functions

nodeFlowSend(options)

Lightning → EVM: Get tokens by paying a Lightning invoice.

| Option | Type | Description | | :--- | :--- | :--- | | assetId | string | Asset ID (get from useNodeFlowPairs) | | amount | number | Amount in satoshis | | onProgress | (step, data) => void | Progress callback | | onSuccess | (result) => void | Success callback | | onError | (error) => void | Error callback |

Progress steps: 'init''signature''deposit''pending''complete'

const result = await nodeFlowSend({
  assetId: defaultAssetId,
  amount: 1000,
  onProgress: (step) => console.log('Step:', step),
  onSuccess: (result) => console.log('Success:', result),
});

nodeFlowReceive(options)

EVM → Lightning: Pay a Lightning invoice using tokens.

| Option | Type | Description | | :--- | :--- | :--- | | assetId | string | Asset ID (get from useNodeFlowPairs) | | invoice | string | Lightning invoice to pay | | onProgress | (step, data) => void | Progress callback | | onSuccess | (result) => void | Success callback | | onError | (error) => void | Error callback |

Progress steps: 'init''approve''deposit''complete'

const result = await nodeFlowReceive({
  assetId: defaultAssetId,
  invoice: 'lnbc...',
  onSuccess: (result) => console.log('Paid:', result),
});

Hooks

useNodeFlowPairs()

Get available trading pairs for the current chain.

const { 
  pairs,          // All available pairs
  defaultAssetId, // First pair's asset ID
  currentPair,    // Currently selected pair
  setCurrentPair, // Set current pair
  isReady         // Whether pairs are loaded
} = useNodeFlowPairs();

useNodeFlowState()

Get SDK configuration state.

const { 
  supportedChainIds, // Supported chain IDs from backend
  isConfigReady,     // Config loaded
  apiUrl,            // Current API URL
  targetNetwork      // Current network
} = useNodeFlowState();

Using NodeFlowConfig (Existing Wagmi Setup)

If you already have Wagmi configured in your app, use NodeFlowConfig instead:

import { NodeFlowConfig, NodeFlowModal } from '@lnfi-network/nodeflow-sdk';

// Inside your existing WagmiProvider
<NodeFlowConfig apiUrl="<API_BASE_URL>">
  <NodeFlowModal />
  <YourApp />
</NodeFlowConfig>

License

MIT