JSPM

txdata

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q32610F
  • License LGPL-3.0

Get The Transaction's Data For sendRawTransaction RPC

Package Exports

  • txdata

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (txdata) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Get The Transaction's Data For sendRawTransaction RPC

Installation

Node.js

npm install txdata
  • Include txdata.js in your html file. (not required for the meteor package)

Usage

Use the TxData object directly from the global namespace:

var TxData = require("txdata");
var ABI = [
{
    "constant": false,
    "inputs": [
      {
        "name": "_to",
        "type": "address"
      },
      {
        "name": "_value",
        "type": "uint256"
      }
    ],
    "name": "transfer",
    "outputs": [
      {
        "name": "success",
        "type": "bool"
      } 
    ],
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "function"
  }
];

var funName = "transfer";

var toAddr = "0xD6fcD18d4a09CE1aF030E450C8a244D847584188";
var toValue = 1*Math.pow(10,18);

var params = [toAddr,toValue];

var data  = TxData(ABI,funName,params);

Contribute!

Requirements

  • Node.js
  • npm

License

LGPL-3.0+ © 2018 Contributors