2.1.2 • Published 5 years ago

ethereumjs-tx v2.1.2

Weekly downloads
195,578
License
MPL-2.0
Repository
github
Last release
5 years ago

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

@qiibee/qb-api@thorswap-lib/hdwallet-ledger@tyz-wallet/crypto-rpcdapid-payment-eth-proof-of-burndapid-registry-ethereum-contract@haywael/typechainca-contracts@dojimanetwork/dojimajs@syoonk/perijsbhp-jsupgradeable-toolkit@truffle-teams/deployment-providersmc-module@amra-finance/ding-plugin-ledger-web@amra-finance/ding-plugin-trezor-websvt-js@lianlian2019/blockchain_sdk@bhpnet/bhpnet-js-sdkbhpnetbhpnet-jsbhpnetwork-jsbuild-testtinblox-token-swap@coinspace/cs-ethereum-wallet@minden-matic/maticjsweb3_htdfhdwalletcoinoxs@thesis-co/mechamittens-extensionperi-finance-js@bitexchange-ltd/bitexchange-server-7.5.0-beta.3caver-web3-01@ncally/xendfinance-sdk@horizon-protocol/horizon-jsweb3-yeetobsshieldsample.usample.unifyunova-asset-apibnc-onboard-metamaskdltlabs.unifyio.dltlabs.unifytx-commonsunova-middleware-smartcontract-blockchainether-linkstaking_2.0vite-walleteth-sign-utilsdecentral-games-mobile-server@dodoex-io/wallet@infinitebrahmanuniverse/nolb-ethecosmos-crypto-lib@getsafle/keyless-transactions@getsafle/keyless-transactions-private@getsafle/vault-housekeeper@tubyte/corelagrange-js@everything-registry/sub-chunk-1619@tnrdd/sf-ethereum-contracts@entropyxyz/entropy-js@1kx/typechainmintme-web3jsflux-pulse-readerflexvaultfission-translatefission-translationsflex-ether-fixfreight-trust-web3-eeafoxone-walletfoxtrot-cloud-gatherergarnet-flame-mastergamma-field-generatorgamefi-cefi-bot-deployergamefi-cefi-bot-enhancerganache-coreganache-core-scganache-core-tempganache-core-tpforkfugitnesciuntfugiatdolorfugitdignissimosfugiatquifysical-accessorgalactic-sentinel-nodefugarationejswallet-managerinciduntrerumjanusndxrjanusndxr-demojanus.framework.jnsjasmine-eth-tshhh_djh_1kafirchain-tetriskambria-walletkameleonkameleon-clientkanban-sdkinfinitechain_browserinfinitechain_clientinfinitechain_nodejsinfinitechain_server
2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.3.7

6 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.7.3

9 years ago

0.7.2

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.14

9 years ago

0.6.12

9 years ago

0.6.11

9 years ago

0.6.10

9 years ago

0.6.9

9 years ago

0.6.8

9 years ago

0.6.7

9 years ago

0.6.6

9 years ago

0.6.5

9 years ago

0.6.4

9 years ago

0.6.3

9 years ago

0.6.2

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.9

9 years ago

0.5.8

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.4

9 years ago

0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago