1.2.0 • Published 5 years ago

datxjs-tx v1.2.0

Weekly downloads
6
License
MPL-2.0
Repository
github
Last release
5 years ago

SYNOPSIS

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

INSTALL

npm install datxjs-tx

USAGE

const Tx = require('datxjs-tx').Transaction
const privateKey = Buffer.from(
  'e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109',
  'hex',
)

const txParams = {
  nonce: '0x00',
  gasPrice: '0x09184e72a000',
  gasLimit: '0x2710',
  to: '0x0000000000000000000000000000000000000000',
  value: '0x00',
  data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057',
}

const tx = new Tx(txParams)
tx.sign(privateKey)
const serializedTx = tx.serialize()

Chain and Hardfork Support

This library uses the ethereumjs-common package to support different chain and hardfork options, see API documentation for details.

Currently all hardforks up to petersburg are supported, EIP-155 replay protection is activated since the spuriousDragon hardfork.

API

./docs/

EthereumJS

See our organizational documentation for an introduction to EthereumJS as well as information on current standards and best practices.

If you want to join for work or do improvements on the libraries have a look at our contribution guidelines.

LICENSE

MPL-2.0