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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@crypto/contract

v0.1.6

Published

Ethereum Contract Tools

Readme

Ethereum Contract Tool

Install

$ npm install -g @crypto/contract

Command Line Options

# print all available options
$ contract -h

Specify Contract File

# specify a contract file and enter prompt mode
$ contract -f <path_to_file>
# additionally specify the RPC host and port
$ contract -h amazing.com -p 9999 -f <path_to_file>

If omitted host defaults to localhost and port defaults to 6767.

Prompt Options

Compile

# compile the contract
contract$ compile

Deploy

# deploy the contract
contract$ deploy
# additionally set the account address to use when deploying
contract$ deploy -a <account_address>

If omitted account address defaults to the first account web3.eth.accounts[0].

# additionally set the gas amount to use when deploying
contract$ deploy -g <gas_amount>

If omitted the gas amount defaults to 1000000.

Init

# instantiate the contract
contract$ init -a <contract_address>

Set Name

# set contract instance name
contract$ name <name>
# enter interactive REPL mode
contract$ <name>

Execute Methods

# execute contract specific methods
contract$ name: newDocument('hash', {from: web3.eth.coinbase, gas: 1800000})

Watch for Events

# subscribe for specific event
contract$ notereth$ DocumentEvent({}, {fromBlock: 0, toBlock: 'latest'}).watch
# subscribe for all events
contract$ notereth$ allEvents({}, {fromBlock: 0, toBlock: 'latest'}).watch

Example

Basics

# specify contract file
$ contract -f <path_to_file>
# deploy the contract using the first unlocked account
contract$ deploy
# set contract instance name
contract$ name notereth
# enter contract interactive REPL
contract$ notereth
# execute methods from that contract
notereth$ notereth: newDocument('hash', {from: web3.eth.coinbase, gas: 1800000})

Watching

# instantiate the contract in two separate console windows at the same time
$ contract -f <path_to_file>
contract$ init -a 0x241bbd0ef9492aa17866c662b750f24003c812c6
contract$ name notereth
contract$ notereth
contract$ notereth:
# set a watcher in the first console window
contract$ notereth$ DocumentEvent({}, {fromBlock: 0, toBlock: 'latest'}).watch

Notice that the callback for the watch method is missing.

# execute some command in the second console window
contract$ notereth$ newDocument('hash', {from: web3.eth.coinbase, gas: 1800000})