contract-registry

1.0.1 • Public • Published

contract-registry-node

CLI and proxy module for interacting with smart contract registry ABIs, deployments and docs.

Setup

Generate an API_KEY in the contract registry and create a contracts.js file following this convention:

const config = {
        registry = MyCoolCompany,
        api_key = '1234abc', // or process.env.API_KEY
        contracts = [
            voting: {
                projectName: voting, 
                version: 1.1
            },
            todo-list: {
                projectName: todo-list, 
                version: latest
            }
        ]
    };
    module.exports = contracts;

The CLI will reference this file to populate a .contracts/ directory with smart contract ABIs, deployment addresses and documentation. This module also serves to proxy this, so in your react application you can,

import contractRegistry from "contract-registry";

const { abi, env } = contractRegistry.voting;

console.log(env.networks["testnet"].address);

Usage

  • contract-registry pull — Read contracts.js and pull ABIs, docs and deployment addresses
  • contract-registry docs — View smart contract docs in a web browser

Readme

Keywords

Package Sidebar

Install

npm i contract-registry

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

2.02 kB

Total Files

3

Last publish

Collaborators

  • natecxo