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

tape-parity

v1.2.0

Published

Tape extension that adds a Parity dev chain and Nanoeth helpers

Downloads

5

Readme

tape-parity

Build Status

Tape extension that adds a Parity dev chain and Nanoeth helpers

Usage

var test = require('tape-parity')

test('fund', async function (t) {
  await t.fund('0xd27E44f7F4118DB2c7812A363f5B76859c20e0b3', 10000)

  console.log(parseInt(await t.eth.getBalance('0xd27E44f7F4118DB2c7812A363f5B76859c20e0b3')))
})

API

A fresh Parity dev chain will created before each test and closed after all tests finish.

test([description], async t => {})

Create a new test just like in tape. t is extended with extra methods specified below:

t.eth

This is a nanoeth instance connected to the Parity dev chain.

await t.fund(address, value, [data])

Fund address with value wei and optional data. Await the transaction to be mined. value can be Number, BigInt or hex encoded string.

const receipt = await t.mined(txHash)

Await txHash to be mined and return the transaction receipt.

const account = await t.keygen([privateKey])

Generate a new account of { publicKey, privateKey, address }. Uses the current chainId.

const account = await t.keygenSeed(seed)

Generate a new account of { publicKey, privateKey, address } from a seed, which can be either a Buffer or string. Useful for deterministic tests and debugging traces. Uses the current chainId.

const txHash = await t.send({ from, to, data, nonce, value = 0, gasPrice = 1, gas = 8e6 }, privateKey)

Sign and send a new transaction with the above parameters. Note the privateKey at the end required for signing.

Examples:

  • To deploy a contract, send with { from, data }.
  • To transfer funds, send with { to, value }.
  • To call a smart contract, send with { to, data }.

const json = await t.trace(rawTx, [opts])

Trace a raw transaction, returning the various diagnostics. opts defaults to ['trace', 'vmTrace', 'stateDiff']. Requires that parity has been started with the tracing module enabled. The output is a JSON object, and can be stringified and persisted to disk for further analysis.

Install

npm install tape-parity

License

ISC