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

@epicchain/bs-electron

v1.0.0

Published

`@epicchain/bs-electron` is a specialized package aimed at optimizing communication between the **main** and **renderer** processes within **Electron** applications. It provides a robust and flexible set of **APIs** that allow seamless integration of **bl

Readme

@epicchain/bs-electron

Overview

@epicchain/bs-electron is a specialized package aimed at optimizing communication between the main and renderer processes within Electron applications. It provides a robust and flexible set of APIs that allow seamless integration of blockchain services into desktop apps. The package is specifically tailored for developers looking to embed blockchain interactions into their Electron-based desktop applications while delivering a native-like experience. This allows developers to create decentralized desktop applications that interact with blockchain networks in a secure, optimized, and user-friendly manner.

The package ensures that the performance and responsiveness of blockchain operations within the Electron app are top-notch, without compromising the core features and functionality of the underlying blockchain technology. The integration of blockchain services into desktop apps has never been easier, enabling real-time blockchain interactions like transactions, smart contract calls, token transfers, and much more within the native desktop environment.

Key Features

  • Efficient Communication Between Main and Renderer Process: Seamlessly connects the Electron main process with the renderer process, ensuring smooth inter-process communication (IPC). This facilitates real-time blockchain operations within the renderer process without interrupting the main application flow.

  • Blockchain Integration: Simplifies the integration of blockchain services such as smart contract interactions, wallet management, transaction processing, and decentralized application (dApp) functionalities. This can be extended to support any blockchain platform that requires integration into Electron apps.

  • Native-Like Experience: Embeds blockchain interactions into Electron apps with native-like performance. The user interface (UI) and overall app behavior resemble the behavior of native desktop applications, making it intuitive and accessible for users.

  • Optimized for Performance: Handles the communication between processes in an optimized manner, ensuring low-latency communication, efficient data transfer, and fast response times for blockchain actions.

  • Comprehensive Blockchain Actions: Offers a set of predefined actions that cover common blockchain functionalities such as transaction sending, token transfers, balance checking, smart contract execution, and more.

  • Easy-to-Use API: The API is designed to be as simple as possible to use, reducing the complexity of integrating blockchain features into Electron apps. Developers can focus on building their application while leveraging blockchain capabilities effortlessly.

  • Cross-Platform Support: The package supports both Windows and macOS platforms, ensuring that blockchain-powered desktop applications can be used by a wider audience without compatibility issues.

  • Security: Designed with a security-first mindset, ensuring that all blockchain interactions are conducted in a secure environment, minimizing the risks involved with blockchain transactions.

  • Real-Time Interaction: Leverages real-time interaction for blockchain operations, making it ideal for applications that require instant feedback, such as decentralized finance (DeFi) platforms, NFT marketplaces, and more.

Installation

You can easily install @epicchain/bs-electron into your Electron project using npm or yarn.

Using npm

npm install @epicchain/bs-electron

Using yarn

yarn add @epicchain/bs-electron

Once installed, you can start using the features and APIs that come with this package.

Basic Usage

The package integrates easily into your Electron project by enhancing the communication between the main and renderer processes and providing blockchain functionalities. Below is an example to help you get started.

Setting Up Blockchain Integration

  1. Main Process (main.js)

    The main process is responsible for controlling the lifecycle of your Electron app, initializing the blockchain service, and communicating with the renderer process. In this example, we set up a simple Blockchain service instance.

const { app, BrowserWindow } = require('electron');
const { BlockchainService } = require('@epicchain/bs-electron');

let mainWindow;

app.on('ready', () => {
  // Create an instance of the BlockchainService
  const blockchainService = new BlockchainService();

  // Initialize the blockchain service
  blockchainService.initialize()
    .then(() => {
      console.log('Blockchain Service Initialized');
    })
    .catch((error) => {
      console.error('Error initializing Blockchain Service', error);
    });

  // Create the Electron browser window
  mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true
    }
  });

  // Load the HTML file for the renderer process
  mainWindow.loadURL('index.html');
});
  1. Renderer Process (renderer.js)

    The renderer process is responsible for interacting with the user and handling all the user interface elements. In this case, it will communicate with the main process to request blockchain actions and handle the results.

const { ipcRenderer } = require('electron');
const { BlockchainService } = require('@epicchain/bs-electron');

// Handle blockchain action requests
ipcRenderer.on('blockchainAction', (event, actionData) => {
  const blockchainService = new BlockchainService();

  // Execute the blockchain action (e.g., sending a transaction)
  blockchainService.executeAction(actionData).then(result => {
    // Send the result back to the main process
    event.sender.send('blockchainActionResult', result);
  }).catch((error) => {
    console.error('Error executing blockchain action', error);
    event.sender.send('blockchainActionResult', { error: 'Error executing action' });
  });
});
  1. Renderer-to-Main Communication

    The renderer process can send a request to the main process for performing blockchain-related tasks, such as sending a transaction, querying blockchain data, or calling a smart contract.

// Sending a blockchain action to the main process
ipcRenderer.send('blockchainAction', {
  action: 'sendTransaction',
  data: {
    from: 'address1',
    to: 'address2',
    amount: 100,
    token: 'XPR'
  }
});
  1. Main-to-Renderer Communication

    The result of the blockchain action is then sent back from the main process to the renderer process for further use, such as updating the UI.

ipcRenderer.on('blockchainActionResult', (event, result) => {
  if (result.error) {
    console.error('Blockchain Action Failed', result.error);
  } else {
    console.log('Blockchain Action Result:', result);
  }
});

API Documentation

BlockchainService

The core class provided by @epicchain/bs-electron for interacting with blockchain services.

Methods

  • initialize(): Initializes the blockchain service and prepares it for interaction.

    Returns: Promise<void>

  • executeAction(data): Executes a blockchain action, such as sending a transaction or interacting with a smart contract.

    Parameters:

    • data (Object): An object containing the necessary data for the blockchain action (e.g., transaction details, smart contract interaction data).

    Returns: Promise<Object> - The result of the blockchain action.

BlockchainAction Events

  • blockchainAction: Event triggered by the renderer process to request a blockchain action.
  • blockchainActionResult: Event sent back from the main process to the renderer process with the result of the blockchain action.

Example Projects

We encourage you to explore the following example projects where this package has been used to build blockchain-powered Electron applications:

  1. DeFi Desktop App - A decentralized finance app allowing users to manage their assets and perform blockchain transactions.
  2. NFT Marketplace - A desktop marketplace for buying and selling NFTs with integrated blockchain transactions.
  3. Blockchain Wallet - A secure desktop wallet for storing and sending cryptocurrencies and tokens.

Contributing

We welcome contributions from the community! If you'd like to contribute to the development of @epicchain/bs-electron, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes with a descriptive message.
  4. Submit a pull request with a clear explanation of what you’ve changed.

We encourage you to write tests and ensure that your changes don't break any existing functionality. Contributions that improve documentation, performance, or usability are highly appreciated.

License

@epicchain/bs-electron is licensed under the MIT License. You are free to use, modify, and distribute the package as per the terms of the MIT License.

Contact

For support, inquiries, or feedback, feel free to contact us at: