Socket
Socket
Sign inDemoInstall

@ethereumjs/tx

Package Overview
Dependencies
Maintainers
3
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethereumjs/tx - npm Package Compare versions

Comparing version 4.0.0-beta.3 to 4.0.0-rc.1

6

dist/baseTransaction.d.ts
/// <reference types="node" />
import { Chain, Common, Hardfork } from '@ethereumjs/common';
import { Address, BigIntLike } from '@ethereumjs/util';
import { AccessListEIP2930TxData, AccessListEIP2930ValuesArray, Capability, FeeMarketEIP1559TxData, FeeMarketEIP1559ValuesArray, JsonTx, TxData, TxOptions, TxValuesArray } from './types';
import { Address } from '@ethereumjs/util';
import { Capability } from './types';
import type { AccessListEIP2930TxData, AccessListEIP2930ValuesArray, FeeMarketEIP1559TxData, FeeMarketEIP1559ValuesArray, JsonTx, TxData, TxOptions, TxValuesArray } from './types';
import type { BigIntLike } from '@ethereumjs/util';
interface TransactionCache {

@@ -6,0 +8,0 @@ hash: Buffer | undefined;

/// <reference types="node" />
import { Common } from '@ethereumjs/common';
import { BaseTransaction } from './baseTransaction';
import { AccessList, AccessListBuffer, FeeMarketEIP1559TxData, FeeMarketEIP1559ValuesArray, JsonTx, TxOptions } from './types';
import type { AccessList, AccessListBuffer, FeeMarketEIP1559TxData, FeeMarketEIP1559ValuesArray, JsonTx, TxOptions } from './types';
import type { Common } from '@ethereumjs/common';
/**

@@ -6,0 +6,0 @@ * Typed transaction with a new gas fee market mechanism

/// <reference types="node" />
import { Common } from '@ethereumjs/common';
import { BaseTransaction } from './baseTransaction';
import { AccessList, AccessListBuffer, AccessListEIP2930TxData, AccessListEIP2930ValuesArray, JsonTx, TxOptions } from './types';
import type { AccessList, AccessListBuffer, AccessListEIP2930TxData, AccessListEIP2930ValuesArray, JsonTx, TxOptions } from './types';
import type { Common } from '@ethereumjs/common';
/**

@@ -6,0 +6,0 @@ * Typed transaction with optional access lists

/// <reference types="node" />
import { Common } from '@ethereumjs/common';
import { BaseTransaction } from './baseTransaction';
import { JsonTx, TxData, TxOptions, TxValuesArray } from './types';
import type { JsonTx, TxData, TxOptions, TxValuesArray } from './types';
import type { Common } from '@ethereumjs/common';
/**

@@ -6,0 +6,0 @@ * An Ethereum non-typed (legacy) transaction

/// <reference types="node" />
import { AccessListEIP2930TxData, FeeMarketEIP1559TxData, TxData, TxOptions, TypedTransaction } from './types';
import type { AccessListEIP2930TxData, FeeMarketEIP1559TxData, TxData, TxOptions, TypedTransaction } from './types';
export declare class TransactionFactory {

@@ -4,0 +4,0 @@ private constructor();

/// <reference types="node" />
import { Common } from '@ethereumjs/common';
import { AddressLike, BigIntLike, BufferLike, PrefixedHexString } from '@ethereumjs/util';
import { FeeMarketEIP1559Transaction } from './eip1559Transaction';
import { AccessListEIP2930Transaction } from './eip2930Transaction';
import { Transaction } from './legacyTransaction';
import type { FeeMarketEIP1559Transaction } from './eip1559Transaction';
import type { AccessListEIP2930Transaction } from './eip2930Transaction';
import type { Transaction } from './legacyTransaction';
import type { Common } from '@ethereumjs/common';
import type { AddressLike, BigIntLike, BufferLike, PrefixedHexString } from '@ethereumjs/util';
/**

@@ -8,0 +8,0 @@ * Can be used in conjunction with {@link Transaction.supports}

@@ -1,3 +0,3 @@

import { Common } from '@ethereumjs/common';
import { AccessList, AccessListBuffer } from './types';
import type { AccessList, AccessListBuffer } from './types';
import type { Common } from '@ethereumjs/common';
export declare function checkMaxInitCodeSize(common: Common, length: number): void;

@@ -4,0 +4,0 @@ export declare class AccessLists {

@@ -63,7 +63,7 @@ "use strict";

}
if (address.length != 20) {
if (address.length !== 20) {
throw new Error('Invalid EIP-2930 transaction: address length should be 20 bytes');
}
for (let storageSlot = 0; storageSlot < storageSlots.length; storageSlot++) {
if (storageSlots[storageSlot].length != 32) {
if (storageSlots[storageSlot].length !== 32) {
throw new Error('Invalid EIP-2930 transaction: storage slot length should be 32 bytes');

@@ -70,0 +70,0 @@ }

{
"name": "@ethereumjs/tx",
"version": "4.0.0-beta.3",
"version": "4.0.0-rc.1",
"description": "A simple module for creating, manipulating and signing Ethereum transactions",

@@ -53,5 +53,5 @@ "keywords": [

"dependencies": {
"@ethereumjs/common": "3.0.0-beta.3",
"@ethereumjs/rlp": "4.0.0-beta.3",
"@ethereumjs/util": "8.0.0-beta.3",
"@ethereumjs/common": "3.0.0-rc.1",
"@ethereumjs/rlp": "4.0.0-rc.1",
"@ethereumjs/util": "8.0.0-rc.1",
"ethereum-cryptography": "^1.1.2"

@@ -61,17 +61,9 @@ },

"@types/minimist": "^1.2.0",
"@types/node": "^16.11.7",
"@types/tape": "^4.13.2",
"eslint": "^8.0.0",
"karma": "^6.3.2",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.0",
"karma-tap": "^4.2.0",
"karma-typescript": "^5.5.3",
"@types/node-dir": "^0.0.34",
"minimist": "^1.2.0",
"node-dir": "^0.1.16",
"nyc": "^15.1.0",
"tape": "^5.3.1",
"ts-node": "^10.2.1",
"typescript": "^4.4.2"
"node-dir": "^0.1.16"
},
"engines": {
"node": ">=14"
}
}

@@ -14,9 +14,11 @@ # @ethereumjs/tx

# INSTALL
## Installation
`npm install @ethereumjs/tx`
To obtain the latest version, simply require the project using `npm`:
# USAGE
```shell
npm install @ethereumjs/tx
```
## Setup
## Usage

@@ -63,3 +65,3 @@ ### Static Constructor Methods

## Transaction Types
### Transaction Types

@@ -209,5 +211,5 @@ This library supports the following transaction types ([EIP-2718](https://eips.ethereum.org/EIPS/eip-2718)):

## Sending a Transaction
### Sending a Transaction
### L2 Support
#### L2 Support

@@ -332,9 +334,9 @@ This library has been tested to work with various L2 networks (`v3.3.0`+). All predefined supported custom chains introduced with `Common` `v2.4.0` or higher are supported, the following is a simple example to send a tx to the xDai chain:

# API
## API
## Docs
### Docs
Generated TypeDoc API [Documentation](./docs/README.md)
## BigInt Support
### BigInt Support

@@ -345,10 +347,8 @@ Starting with v4 the usage of [BN.js](https://github.com/indutny/bn.js/) for big numbers has been removed from the library and replaced with the usage of the native JS [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) data type (introduced in `ES2020`).

# EthereumJS
## EthereumJS
See our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices.
See our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices. If you want to join for work or carry out improvements on the libraries, please review our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html) first.
If you want to join for work or do improvements on the libraries have a look at our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html).
## License
# LICENSE
[MPL-2.0](<https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)>)

@@ -355,0 +355,0 @@

import { Chain, Common, Hardfork } from '@ethereumjs/common'
import {
Address,
BigIntLike,
MAX_INTEGER,
MAX_UINT64,
SECP256K1_ORDER_DIV_2,
bufferToBigInt,

@@ -9,6 +11,3 @@ bufferToHex,

isTruthy,
MAX_INTEGER,
MAX_UINT64,
publicToAddress,
SECP256K1_ORDER_DIV_2,
toBuffer,

@@ -18,6 +17,7 @@ unpadBuffer,

import {
import { Capability } from './types'
import type {
AccessListEIP2930TxData,
AccessListEIP2930ValuesArray,
Capability,
FeeMarketEIP1559TxData,

@@ -30,2 +30,3 @@ FeeMarketEIP1559ValuesArray,

} from './types'
import type { BigIntLike } from '@ethereumjs/util'

@@ -32,0 +33,0 @@ interface TransactionCache {

@@ -1,4 +0,4 @@

import { Common } from '@ethereumjs/common'
import { RLP } from '@ethereumjs/rlp'
import {
MAX_INTEGER,
arrToBufArr,

@@ -10,3 +10,2 @@ bigIntToHex,

ecrecover,
MAX_INTEGER,
toBuffer,

@@ -18,3 +17,5 @@ validateNoLeadingZeroes,

import { BaseTransaction } from './baseTransaction'
import {
import { AccessLists, checkMaxInitCodeSize } from './util'
import type {
AccessList,

@@ -27,3 +28,3 @@ AccessListBuffer,

} from './types'
import { AccessLists, checkMaxInitCodeSize } from './util'
import type { Common } from '@ethereumjs/common'

@@ -30,0 +31,0 @@ const TRANSACTION_TYPE = 2

@@ -1,4 +0,4 @@

import { Common } from '@ethereumjs/common'
import { RLP } from '@ethereumjs/rlp'
import {
MAX_INTEGER,
arrToBufArr,

@@ -10,3 +10,2 @@ bigIntToHex,

ecrecover,
MAX_INTEGER,
toBuffer,

@@ -18,3 +17,5 @@ validateNoLeadingZeroes,

import { BaseTransaction } from './baseTransaction'
import {
import { AccessLists, checkMaxInitCodeSize } from './util'
import type {
AccessList,

@@ -27,3 +28,3 @@ AccessListBuffer,

} from './types'
import { AccessLists, checkMaxInitCodeSize } from './util'
import type { Common } from '@ethereumjs/common'

@@ -30,0 +31,0 @@ const TRANSACTION_TYPE = 1

@@ -1,4 +0,4 @@

import { Common } from '@ethereumjs/common'
import { RLP } from '@ethereumjs/rlp'
import {
MAX_INTEGER,
arrToBufArr,

@@ -10,3 +10,2 @@ bigIntToHex,

ecrecover,
MAX_INTEGER,
toBuffer,

@@ -19,5 +18,8 @@ unpadBuffer,

import { BaseTransaction } from './baseTransaction'
import { Capability, JsonTx, TxData, TxOptions, TxValuesArray } from './types'
import { Capability } from './types'
import { checkMaxInitCodeSize } from './util'
import type { JsonTx, TxData, TxOptions, TxValuesArray } from './types'
import type { Common } from '@ethereumjs/common'
const TRANSACTION_TYPE = 0

@@ -24,0 +26,0 @@

@@ -6,3 +6,4 @@ import { bufferToBigInt, toBuffer } from '@ethereumjs/util'

import { Transaction } from './legacyTransaction'
import {
import type {
AccessListEIP2930TxData,

@@ -9,0 +10,0 @@ FeeMarketEIP1559TxData,

@@ -1,8 +0,7 @@

import { Common } from '@ethereumjs/common'
import { AddressLike, BigIntLike, BufferLike, PrefixedHexString } from '@ethereumjs/util'
import type { FeeMarketEIP1559Transaction } from './eip1559Transaction'
import type { AccessListEIP2930Transaction } from './eip2930Transaction'
import type { Transaction } from './legacyTransaction'
import type { Common } from '@ethereumjs/common'
import type { AddressLike, BigIntLike, BufferLike, PrefixedHexString } from '@ethereumjs/util'
import { FeeMarketEIP1559Transaction } from './eip1559Transaction'
import { AccessListEIP2930Transaction } from './eip2930Transaction'
import { Transaction } from './legacyTransaction'
/**

@@ -9,0 +8,0 @@ * Can be used in conjunction with {@link Transaction.supports}

@@ -1,6 +0,8 @@

import { Common } from '@ethereumjs/common'
import { bufferToHex, setLengthLeft, toBuffer } from '@ethereumjs/util'
import { AccessList, AccessListBuffer, AccessListItem, isAccessList } from './types'
import { isAccessList } from './types'
import type { AccessList, AccessListBuffer, AccessListItem } from './types'
import type { Common } from '@ethereumjs/common'
export function checkMaxInitCodeSize(common: Common, length: number) {

@@ -72,7 +74,7 @@ const maxInitCodeSize = common.param('vm', 'maxInitCodeSize')

}
if (address.length != 20) {
if (address.length !== 20) {
throw new Error('Invalid EIP-2930 transaction: address length should be 20 bytes')
}
for (let storageSlot = 0; storageSlot < storageSlots.length; storageSlot++) {
if (storageSlots[storageSlot].length != 32) {
if (storageSlots[storageSlot].length !== 32) {
throw new Error('Invalid EIP-2930 transaction: storage slot length should be 32 bytes')

@@ -79,0 +81,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc