Nightmarish Pawnshop Mystic
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

ethereumjs-tx

1.3.7 • Public • Published

SYNOPSIS

NPM Package Build Status Coverage Status Gitter or #ethereumjs on freenode

js-standard-style

INSTALL

npm install ethereumjs-tx

USAGE

const EthereumTx = require('ethereumjs-tx')
const privateKey = Buffer.from('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex')
 
const txParams = {
  nonce: '0x00',
  gasPrice: '0x09184e72a000', 
  gasLimit: '0x2710',
  to: '0x0000000000000000000000000000000000000000', 
  value: '0x00', 
  data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057',
  // EIP 155 chainId - mainnet: 1, ropsten: 3
  chainId: 3
}
 
const tx = new EthereumTx(txParams)
tx.sign(privateKey)
const serializedTx = tx.serialize()

Note: this package expects ECMAScript 6 (ES6) as a minimum environment. From browsers lacking ES6 support, please use a shim (like es6-shim) before including any of the builds from this repo.

BROWSER

For a browser build please see https://github.com/ethereumjs/browser-builds.

API

./docs/

LICENSE

MPL-2.0

install

npm i ethereumjs-tx

Downloadsweekly downloads

50,266

version

1.3.7

license

MPL-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability