New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

augur-abi

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

augur-abi

Contract ABI serialization

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

augur-abi

Build Status Coverage Status npm version

augur-abi provides Ethereum contract ABI data serialization methods. ABI encoding is needed to invoke functions on Ethereum smart contracts.

Installation

$ npm install augur-abi

Usage

To use augur-abi in Node.js, just require it:

var augur_abi = require("augur-abi");

A minified, browserified file dist/augur-abi.min.js is included for use in the browser. Including this file simply attaches the augur_abi object to window:

<script src="dist/augur-abi.min.js" type="text/javascript"></script>

The encode method encodes the full ABI data (prefix + parameters) needed for a contract function call. For example, to encode a method named double that takes a single 256-bit integer parameter with a value of 3:

var encoded = augur_abi.encode({
    name: "double",
    signature: ["int256"],
    params: ["0x3"]
});
// encoded:
"0x6ffa1caa0000000000000000000000000000000000000000000000000000000000000003"

encoded is the concatenation of the method's prefix 0x6ffa1caa, which is derived from the name of the method "double" and its signature "[int256]", and the encoded parameter value, ["0x3"].

Tests

Unit tests are in the test directory, and can be run with mocha:

$ npm test

FAQs

Package last updated on 22 Aug 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc