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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@parity/electron

v5.1.13

Published

Control the Parity Ethereum node from Electron.

Downloads

14

Readme

@parity/electron

Control the Parity Ethereum client from electron.

Build Status npm (scoped) npm dependencies Status

Description

With this library, you will be able, from Electron, to:

  • download Parity Ethereum locally in Electron's user data folder.
  • run/stop/check if Parity Ethereum is running.
  • get a secure token from Parity Ethereum to access secure RPCs.

Getting Started

yarn add @parity/electron

Usage

import parityElectron, { isParityRunning } from '@parity/electron';

// Optional: override default options
parityElectron({
  logger: myCustomLoggerFunction // How do we want to log @parity/electron logs? Default is `debug`
})

isParityRunning()
  .then(() => ...);

Index

Interfaces

Functions


Functions

checkClockSync

checkClockSync(): Promise<CheckClockSyncResult>

Defined in checkClockSync.ts:21

Use SNTP to check if the local clock is synchronized; return the time drift.

Returns: Promise<CheckClockSyncResult>


defaultParityPath

defaultParityPath(): Promise<string>

Defined in getParityPath.ts:23

The default path to install parity, in case there's no other instance found on the machine.

Returns: Promise<string>


deleteParity

deleteParity(): Promise<void>

Defined in fetchParity.ts:84

Remove parity binary or partial binary in the userData folder, if it exists.

Returns: Promise<void>


fetchParity

fetchParity(mainWindow: BrowserWindow, options?: FetchParityOptions): Promise<string>

Defined in fetchParity.ts:106

Downloads Parity, saves it to Electron's userData folder, and returns the path to the downloaded binary once finished.

Parameters:

| Param | Type | Default value | | ----------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | mainWindow | BrowserWindow | - | | Default value options | FetchParityOptions | {onProgress: () => {/_ Do nothing by defaut. _/},parityChannel: 'beta'} |

Returns: Promise<string>


getParityPath

getParityPath(): Promise<string>

Defined in getParityPath.ts:104

Returns the path to Parity, or throws if parity is not found.

Returns: Promise<string>


isParityRunning

isParityRunning(options?: IsParityRunningOptions): Promise<boolean>

Defined in isParityRunning.ts:20

Detect if another instance of parity is already running or not. To achieve that, we just ping on the common hosts.

Parameters:

| Param | Type | Default value | | ----------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------- | | Default value options | IsParityRunningOptions | {wsInterface: '127.0.0.1',wsPort: '8546'} |

Returns: Promise<boolean>


killParity

killParity(): Promise<void>

Defined in runParity.ts:118

If a Parity process has been spawned with runParity, then it kills this process. However, there's no guarantee that Parity has been cleanly killed, and the Promise resolves instantly.

Returns: Promise<void>


parityElectron

parityElectron(options?: ParityElectronOptions): void

Defined in index.ts:25

Set default options for @parity/electron. Can be skipped if we don't want to override default options.

Parameters:

| Param | Type | Default value | | ----------------------- | ----------------------------------------------------------------- | ----------------- | | Default value options | ParityElectronOptions | { logger: debug } |

Returns: void


runParity

runParity(options?: RunParityOptions): Promise<void>

Defined in runParity.ts:44

Spawns a child process to run Parity.

Parameters:

| Param | Type | Default value | | ----------------------- | ------------------------------------------------------- | --------------------------------------------------------------------- | | Default value options | RunParityOptions | {flags: [],onParityError: () => {/_ Do nothing if error. _/}} |

Returns: Promise<void>


signerNewToken

signerNewToken(): Promise<string>

Defined in signerNewToken.ts:16

Runs parity signer new-token and resolves with a new secure token to be used in a dapp. Rejects if no token could be extracted.

Returns: Promise<string>