ethereumjs-tx

WebJar for ethereumjs-tx

License

License

Categories

Categories

JavaScript Languages
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

ethereumjs-tx
Last Version

Last Version

2.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

ethereumjs-tx
WebJar for ethereumjs-tx
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/ethereumjs/ethereumjs-tx

Download ethereumjs-tx

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/ethereumjs-tx/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>ethereumjs-tx</artifactId>
    <version>2.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/ethereumjs-tx/
implementation 'org.webjars.npm:ethereumjs-tx:2.1.2'
// https://jarcasting.com/artifacts/org.webjars.npm/ethereumjs-tx/
implementation ("org.webjars.npm:ethereumjs-tx:2.1.2")
'org.webjars.npm:ethereumjs-tx:jar:2.1.2'
<dependency org="org.webjars.npm" name="ethereumjs-tx" rev="2.1.2">
  <artifact name="ethereumjs-tx" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='ethereumjs-tx', version='2.1.2')
)
libraryDependencies += "org.webjars.npm" % "ethereumjs-tx" % "2.1.2"
[org.webjars.npm/ethereumjs-tx "2.1.2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : ethereumjs-common jar [1.5.0,2)
org.webjars.npm : ethereumjs-util jar [6.0.0,7)

Project Modules

There are no modules declared in this project.

SYNOPSIS

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

INSTALL

npm install ethereumjs-tx

USAGE

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

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

// The second parameter is not necessary if these values are used
const tx = new EthereumTx(txParams, { chain: 'mainnet', hardfork: 'petersburg' })
tx.sign(privateKey)
const serializedTx = tx.serialize()

Chain and Hardfork Support

The Transaction and FakeTransaction constructors receives a second parameter that lets you specify the chain and hardfork to be used. By default, mainnet and petersburg will be used.

There are two ways of customizing these. The first one, as shown in the previous section, is by using an object with chain and hardfork names. You can see en example of this in ./examples/ropsten-tx.ts.

The second option is by passing the option common set to an instance of ethereumjs-common' Common. This is specially useful for custom networks or chains/hardforks not yet supported by ethereumjs-common. You can see en example of this in ./examples/custom-chain-tx.ts.

MuirGlacier Support

The MuirGlacier hardfork is supported by the library since the v2.1.2 release.

Istanbul Support

Support for reduced non-zero call data gas prices from the Istanbul hardfork (EIP-2028) has been added to the library along with the v2.1.1 release.

EIP-155 support

EIP-155 replay protection is activated since the spuriousDragon hardfork. To disable it, set the hardfork in the Transaction's constructor.

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

org.webjars.npm

EthereumJS

Ethereum Javascript Community - Your Javascript Gateway to Ethereum

Versions

Version
2.1.2
1.3.3
1.1.2