New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

chainmaker

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chainmaker

npm module to create blockchain

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

ChainMaker (beta)

This is a npm module to create, read and update blockchains for browser/chromium environment.

This module is a work in progress and to be used only for beta testing until an official production realease is announced.

Feel free to drop in your suggestions to fsdevkris@gmail.com

Install

npm install chainmaker

API

ChainMaker()

new ChainMaker()

Class to Create, Read and Update BlockChains.

Methods

  • (static) createBlockchain(name) → {Object}

    Method to create a new Blockchain. Parameters:

    NameTypeDescription
    nameStringName of the Blockchain.

    Returns: this Reference to self to enable method chaining Type: Object

  • (static) createTransaction(toAddress, data) → {Object}

    Method to create a Transaction on the Blockchain. Parameters:

    NameTypeDescription
    toAddressStringWallet address of the Recipient.
    dataObjectdata to be transferred.

    Returns: this Reference to self to enable method chaining Type: Object

  • (static) createWallet() → {Object}

    Method to create a crypto wallet containing crypto keys and wallet address.

    Returns: this Reference to self to enable method chaining Type: Object

  • (static) getWalletAddress() → {String}

    Method to obtain wallet address.

    Returns: wallet address. Type: String

  • (static) loadBlockChain(name)

    Method to load locally saved Blockchain. Parameters:

    NameTypeDescription
    nameStringName of the Blockchain.
  • (static) loadWallet(walletAddress)

    Method to load locally saved Wallet Private Key. Parameters:

    NameTypeDescription
    walletAddressStringWallet address.
  • (static) mine(difficulty) → {Object}

    Method to mine a block with given difficulty Parameters:

    NameTypeDescription
    difficultyNumberlevel of mining set by n/w.

    Returns: Valid Block of a Blockchain || Error Object generated due to interrupt Type: Object

  • (static) saveBlockChain() → {Promise}

    Method to locally save the Blockchain offline.

    Returns: Async function to save Blockchain. Type: Promise

  • (static) saveWallet() → {Promise}

    Method to save wallet address.

    Returns: Async function to save Wallet private key. Type: Promise

Keywords

blockchain

FAQs

Package last updated on 26 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts