Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web3-eth

Package Overview
Dependencies
Maintainers
4
Versions
486
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-eth - npm Package Compare versions

Comparing version 4.8.3-dev.9b32205.0 to 4.8.3-dev.b3cb1b7.0

7

lib/commonjs/rpc_method_wrappers.js

@@ -333,3 +333,6 @@ "use strict";

// geth indexing error, we poll until transactions stopped indexing
if (typeof error === 'object' && !(0, web3_validator_1.isNullish)(error) && 'message' in error && error.message === 'transaction indexing is in progress') {
if (typeof error === 'object' &&
!(0, web3_validator_1.isNullish)(error) &&
'message' in error &&
error.message === 'transaction indexing is in progress') {
console.warn('Transaction indexing is in progress.');

@@ -343,3 +346,3 @@ }

? response
: ((0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat));
: (0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -346,0 +349,0 @@ }

@@ -70,3 +70,3 @@ "use strict";

};
const defaultTransactionTypeParser = (transaction) => {
const defaultTransactionTypeParser = transaction => {
var _a, _b;

@@ -73,0 +73,0 @@ const tx = transaction;

@@ -73,3 +73,4 @@ "use strict";

let formatTx = tx;
if ((0, web3_validator_1.isNullish)(tx.data) && (0, web3_validator_1.isNullish)(tx.input) && (0, web3_validator_1.isNullish)(tx.gas)) { // eth.call runs into error if data isnt filled and gas is not defined, its a simple transaction so we fill it with 21000
if ((0, web3_validator_1.isNullish)(tx.data) && (0, web3_validator_1.isNullish)(tx.input) && (0, web3_validator_1.isNullish)(tx.gas)) {
// eth.call runs into error if data isnt filled and gas is not defined, its a simple transaction so we fill it with 21000
formatTx = Object.assign(Object.assign({}, tx), { gas: 21000 });

@@ -76,0 +77,0 @@ }

@@ -312,3 +312,6 @@ /*

// geth indexing error, we poll until transactions stopped indexing
if (typeof error === 'object' && !isNullish(error) && 'message' in error && error.message === 'transaction indexing is in progress') {
if (typeof error === 'object' &&
!isNullish(error) &&
'message' in error &&
error.message === 'transaction indexing is in progress') {
console.warn('Transaction indexing is in progress.');

@@ -322,3 +325,3 @@ }

? response
: (format(transactionReceiptSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat));
: format(transactionReceiptSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -325,0 +328,0 @@ }

@@ -67,3 +67,3 @@ /*

};
export const defaultTransactionTypeParser = (transaction) => {
export const defaultTransactionTypeParser = transaction => {
var _a, _b;

@@ -70,0 +70,0 @@ const tx = transaction;

@@ -70,3 +70,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

let formatTx = tx;
if (isNullish(tx.data) && isNullish(tx.input) && isNullish(tx.gas)) { // eth.call runs into error if data isnt filled and gas is not defined, its a simple transaction so we fill it with 21000
if (isNullish(tx.data) && isNullish(tx.input) && isNullish(tx.gas)) {
// eth.call runs into error if data isnt filled and gas is not defined, its a simple transaction so we fill it with 21000
formatTx = Object.assign(Object.assign({}, tx), { gas: 21000 });

@@ -73,0 +74,0 @@ }

{
"name": "web3-eth",
"version": "4.8.3-dev.9b32205.0+9b32205",
"version": "4.8.3-dev.b3cb1b7.0+b3cb1b7",
"description": "Web3 module to interact with the Ethereum blockchain and smart contracts.",

@@ -62,18 +62,18 @@ "main": "./lib/commonjs/index.js",

"typescript": "^4.7.4",
"web3-providers-http": "4.2.1-dev.9b32205.0+9b32205"
"web3-providers-http": "4.2.1-dev.b3cb1b7.0+b3cb1b7"
},
"dependencies": {
"setimmediate": "^1.0.5",
"web3-core": "4.5.2-dev.9b32205.0+9b32205",
"web3-errors": "1.3.1-dev.9b32205.0+9b32205",
"web3-eth-abi": "4.2.4-dev.9b32205.0+9b32205",
"web3-eth-accounts": "4.2.2-dev.9b32205.0+9b32205",
"web3-net": "4.1.1-dev.9b32205.0+9b32205",
"web3-providers-ws": "4.0.9-dev.9b32205.0+9b32205",
"web3-rpc-methods": "1.3.1-dev.9b32205.0+9b32205",
"web3-types": "1.7.1-dev.9b32205.0+9b32205",
"web3-utils": "4.3.2-dev.9b32205.0+9b32205",
"web3-validator": "2.0.7-dev.9b32205.0+9b32205"
"web3-core": "4.5.2-dev.b3cb1b7.0+b3cb1b7",
"web3-errors": "1.3.1-dev.b3cb1b7.0+b3cb1b7",
"web3-eth-abi": "4.2.4-dev.b3cb1b7.0+b3cb1b7",
"web3-eth-accounts": "4.2.2-dev.b3cb1b7.0+b3cb1b7",
"web3-net": "4.1.1-dev.b3cb1b7.0+b3cb1b7",
"web3-providers-ws": "4.0.9-dev.b3cb1b7.0+b3cb1b7",
"web3-rpc-methods": "1.3.1-dev.b3cb1b7.0+b3cb1b7",
"web3-types": "1.7.1-dev.b3cb1b7.0+b3cb1b7",
"web3-utils": "4.3.2-dev.b3cb1b7.0+b3cb1b7",
"web3-validator": "2.0.7-dev.b3cb1b7.0+b3cb1b7"
},
"gitHead": "9b322052ef266cc57b29080b20053991e0c9a0a9"
"gitHead": "b3cb1b782cc2c62bd87909c7cdc426ed43a49c1c"
}

@@ -299,6 +299,6 @@ /*

transactions: res.transactions ?? [],
}
};
return result;
}
return res;

@@ -512,3 +512,3 @@ }

try {
response = await ethRpcMethods.getTransactionReceipt(
response = await ethRpcMethods.getTransactionReceipt(
web3Context.requestManager,

@@ -519,16 +519,20 @@ transactionHashFormatted,

// geth indexing error, we poll until transactions stopped indexing
if (typeof error === 'object' && !isNullish(error) && 'message' in error && (error as { message: string }).message === 'transaction indexing is in progress') {
console.warn('Transaction indexing is in progress.')
if (
typeof error === 'object' &&
!isNullish(error) &&
'message' in error &&
(error as { message: string }).message === 'transaction indexing is in progress'
) {
console.warn('Transaction indexing is in progress.');
} else {
throw error;
}
}
return isNullish(response)
? response
: (format(
: format(
transactionReceiptSchema,
response as unknown as TransactionReceipt,
returnFormat ?? web3Context.defaultReturnFormat,
));
);
}

@@ -578,3 +582,3 @@

options: SendTransactionOptions<ResolveType> = { checkRevertBeforeSending: true },
transactionMiddleware?: TransactionMiddleware
transactionMiddleware?: TransactionMiddleware,
): Web3PromiEvent<ResolveType, SendTransactionEvents<ReturnFormat>> {

@@ -592,5 +596,5 @@ const promiEvent = new Web3PromiEvent<ResolveType, SendTransactionEvents<ReturnFormat>>(

let transaction = {...transactionObj};
if(!isNullish(transactionMiddleware)){
let transaction = { ...transactionObj };
if (!isNullish(transactionMiddleware)) {
transaction = await transactionMiddleware.processTransaction(transaction);

@@ -597,0 +601,0 @@ }

@@ -260,6 +260,6 @@ /*

properties: {
baseFeePerGas: {
baseFeePerGas: {
format: 'uint',
},
blobGasUsed: {
blobGasUsed: {
format: 'uint',

@@ -349,3 +349,3 @@ },

},
withdrawals: {
withdrawals: {
type: 'array',

@@ -356,3 +356,3 @@ items: {

},
withdrawalsRoot: {
withdrawalsRoot: {
format: 'bytes32',

@@ -366,12 +366,12 @@ },

properties: {
author: {
author: {
format: 'bytes32',
},
excessDataGas: {
excessDataGas: {
format: 'uint',
},
baseFeePerGas: {
baseFeePerGas: {
format: 'uint',
},
blobGasUsed: {
blobGasUsed: {
format: 'uint',

@@ -451,3 +451,3 @@ },

},
withdrawals: {
withdrawals: {
type: 'array',

@@ -458,3 +458,3 @@ items: {

},
withdrawalsRoot: {
withdrawalsRoot: {
format: 'bytes32',

@@ -461,0 +461,0 @@ },

@@ -95,14 +95,14 @@ /*

export type TransactionMiddlewareData = Transaction
| TransactionWithFromLocalWalletIndex
| TransactionWithToLocalWalletIndex
| TransactionWithFromAndToLocalWalletIndex;
export type TransactionMiddlewareData =
| Transaction
| TransactionWithFromLocalWalletIndex
| TransactionWithToLocalWalletIndex
| TransactionWithFromAndToLocalWalletIndex;
export interface TransactionMiddleware{
export interface TransactionMiddleware {
// for transaction processing before signing
processTransaction(
transaction: TransactionMiddlewareData,
transaction: TransactionMiddlewareData,
options?: { [key: string]: unknown },
): Promise<TransactionMiddlewareData>;
}
}

@@ -78,5 +78,3 @@ /*

export const defaultTransactionTypeParser: TransactionTypeParser = (
transaction
) => {
export const defaultTransactionTypeParser: TransactionTypeParser = transaction => {
const tx = transaction as unknown as Transaction;

@@ -143,3 +141,3 @@ if (!isNullish(tx.type)) {

(web3Context?.transactionTypeParser ?? defaultTransactionTypeParser)(
transaction as unknown as Record<string, unknown>
transaction as unknown as Record<string, unknown>,
);

@@ -146,0 +144,0 @@

@@ -144,3 +144,3 @@ /*

);
return TransactionFactory.fromTxData(

@@ -147,0 +147,0 @@ getEthereumjsTxDataFromTransaction(formattedTransaction),

@@ -37,21 +37,20 @@ /*

const pollingInterval = web3Context.transactionPollingInterval;
const [intervalId, promiseToError] =
rejectIfConditionAtInterval(async () => {
let lastBlockNumber;
try {
lastBlockNumber = await getBlockNumber(web3Context, NUMBER_DATA_FORMAT);
} catch (error) {
console.warn('An error happen while trying to get the block number', error);
return undefined;
}
const numberOfBlocks = lastBlockNumber - starterBlockNumber;
if (numberOfBlocks >= web3Context.transactionBlockTimeout) {
return new TransactionBlockTimeoutError({
starterBlockNumber,
numberOfBlocks,
transactionHash,
});
}
const [intervalId, promiseToError] = rejectIfConditionAtInterval(async () => {
let lastBlockNumber;
try {
lastBlockNumber = await getBlockNumber(web3Context, NUMBER_DATA_FORMAT);
} catch (error) {
console.warn('An error happen while trying to get the block number', error);
return undefined;
}, pollingInterval);
}
const numberOfBlocks = lastBlockNumber - starterBlockNumber;
if (numberOfBlocks >= web3Context.transactionBlockTimeout) {
return new TransactionBlockTimeoutError({
starterBlockNumber,
numberOfBlocks,
transactionHash,
});
}
return undefined;
}, pollingInterval);

@@ -58,0 +57,0 @@ const clean = () => {

@@ -126,9 +126,14 @@ /*

let formatTx = tx;
if (isNullish(tx.data) && isNullish(tx.input) && isNullish(tx.gas)) { // eth.call runs into error if data isnt filled and gas is not defined, its a simple transaction so we fill it with 21000
if (isNullish(tx.data) && isNullish(tx.input) && isNullish(tx.gas)) {
// eth.call runs into error if data isnt filled and gas is not defined, its a simple transaction so we fill it with 21000
formatTx = {
...tx,
gas: 21000
}
gas: 21000,
};
}
const reason = await getRevertReason(this.web3Context, formatTx, this.options.contractAbi);
const reason = await getRevertReason(
this.web3Context,
formatTx,
this.options.contractAbi,
);
if (reason !== undefined) {

@@ -135,0 +140,0 @@ throw await getTransactionError<ReturnFormat>(

@@ -59,3 +59,3 @@ /*

(async () => {
if (confirmations >= web3Context.transactionConfirmationBlocks){
if (confirmations >= web3Context.transactionConfirmationBlocks) {
clearInterval(intervalId);

@@ -62,0 +62,0 @@ return;

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

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 too big to display

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