Socket
Socket
Sign inDemoInstall

web3-eth

Package Overview
Dependencies
Maintainers
4
Versions
454
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.7.1-dev.fd2982d.0 to 4.8.0

4

lib/commonjs/rpc_method_wrappers.d.ts
import { FormatType, DataFormat, EthExecutionAPI, SignedTransactionInfoAPI, Address, BlockNumberOrTag, Bytes, Filter, Numbers, TransactionReceipt, Transaction, TransactionCall, Web3EthExecutionAPI, TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, TransactionWithFromAndToLocalWalletIndex, TransactionForAccessList, Eip712TypedData } from 'web3-types';
import { Web3Context, Web3PromiEvent } from 'web3-core';
import { SendSignedTransactionEvents, SendSignedTransactionOptions, SendTransactionEvents, SendTransactionOptions } from './types.js';
import { SendSignedTransactionEvents, SendSignedTransactionOptions, SendTransactionEvents, SendTransactionOptions, TransactionMiddleware } from './types.js';
/**

@@ -404,3 +404,3 @@ * View additional documentations here: {@link Web3Eth.getProtocolVersion}

*/
export declare function sendTransaction<ReturnFormat extends DataFormat, ResolveType = FormatType<TransactionReceipt, ReturnFormat>>(web3Context: Web3Context<EthExecutionAPI>, transaction: Transaction | TransactionWithFromLocalWalletIndex | TransactionWithToLocalWalletIndex | TransactionWithFromAndToLocalWalletIndex, returnFormat: ReturnFormat, options?: SendTransactionOptions<ResolveType>): Web3PromiEvent<ResolveType, SendTransactionEvents<ReturnFormat>>;
export declare function sendTransaction<ReturnFormat extends DataFormat, ResolveType = FormatType<TransactionReceipt, ReturnFormat>>(web3Context: Web3Context<EthExecutionAPI>, transactionObj: Transaction | TransactionWithFromLocalWalletIndex | TransactionWithToLocalWalletIndex | TransactionWithFromAndToLocalWalletIndex, returnFormat: ReturnFormat, options?: SendTransactionOptions<ResolveType>, transactionMiddleware?: TransactionMiddleware): Web3PromiEvent<ResolveType, SendTransactionEvents<ReturnFormat>>;
/**

@@ -407,0 +407,0 @@ * View additional documentations here: {@link Web3Eth.sendSignedTransaction}

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

*/
function sendTransaction(web3Context, transaction, returnFormat, options = { checkRevertBeforeSending: true }) {
function sendTransaction(web3Context, transactionObj, returnFormat, options = { checkRevertBeforeSending: true }, transactionMiddleware) {
const promiEvent = new web3_core_1.Web3PromiEvent((resolve, reject) => {

@@ -357,2 +357,6 @@ setImmediate(() => {

});
let transaction = Object.assign({}, transactionObj);
if (!(0, web3_validator_1.isNullish)(transactionMiddleware)) {
transaction = yield transactionMiddleware.processTransaction(transaction);
}
let transactionFormatted = (0, format_transaction_js_1.formatTransaction)(Object.assign(Object.assign({}, transaction), { from: (0, transaction_builder_js_1.getTransactionFromOrToAttr)('from', web3Context, transaction), to: (0, transaction_builder_js_1.getTransactionFromOrToAttr)('to', web3Context, transaction) }), web3_types_1.ETH_DATA_FORMAT);

@@ -359,0 +363,0 @@ try {

import { ContractExecutionError, TransactionRevertedWithoutReasonError, TransactionRevertInstructionError, TransactionRevertWithCustomError, InvalidResponseError, TransactionPollingTimeoutError } from 'web3-errors';
import { FormatType, ETH_DATA_FORMAT, DataFormat, Bytes, ContractAbi, HexString, Numbers, Transaction, TransactionReceipt } from 'web3-types';
import { FormatType, ETH_DATA_FORMAT, DataFormat, Bytes, ContractAbi, HexString, Numbers, Transaction, TransactionReceipt, TransactionWithFromAndToLocalWalletIndex, TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex } from 'web3-types';
export declare type InternalTransaction = FormatType<Transaction, typeof ETH_DATA_FORMAT>;

@@ -40,1 +40,7 @@ export declare type SendTransactionEventsBase<ReturnFormat extends DataFormat, TxType> = {

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

@@ -323,3 +323,3 @@ /*

*/
export function sendTransaction(web3Context, transaction, returnFormat, options = { checkRevertBeforeSending: true }) {
export function sendTransaction(web3Context, transactionObj, returnFormat, options = { checkRevertBeforeSending: true }, transactionMiddleware) {
const promiEvent = new Web3PromiEvent((resolve, reject) => {

@@ -334,2 +334,6 @@ setImmediate(() => {

});
let transaction = Object.assign({}, transactionObj);
if (!isNullish(transactionMiddleware)) {
transaction = yield transactionMiddleware.processTransaction(transaction);
}
let transactionFormatted = formatTransaction(Object.assign(Object.assign({}, transaction), { from: getTransactionFromOrToAttr('from', web3Context, transaction), to: getTransactionFromOrToAttr('to', web3Context, transaction) }), ETH_DATA_FORMAT);

@@ -336,0 +340,0 @@ try {

import { FormatType, DataFormat, EthExecutionAPI, SignedTransactionInfoAPI, Address, BlockNumberOrTag, Bytes, Filter, Numbers, TransactionReceipt, Transaction, TransactionCall, Web3EthExecutionAPI, TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, TransactionWithFromAndToLocalWalletIndex, TransactionForAccessList, Eip712TypedData } from 'web3-types';
import { Web3Context, Web3PromiEvent } from 'web3-core';
import { SendSignedTransactionEvents, SendSignedTransactionOptions, SendTransactionEvents, SendTransactionOptions } from './types.js';
import { SendSignedTransactionEvents, SendSignedTransactionOptions, SendTransactionEvents, SendTransactionOptions, TransactionMiddleware } from './types.js';
/**

@@ -404,3 +404,3 @@ * View additional documentations here: {@link Web3Eth.getProtocolVersion}

*/
export declare function sendTransaction<ReturnFormat extends DataFormat, ResolveType = FormatType<TransactionReceipt, ReturnFormat>>(web3Context: Web3Context<EthExecutionAPI>, transaction: Transaction | TransactionWithFromLocalWalletIndex | TransactionWithToLocalWalletIndex | TransactionWithFromAndToLocalWalletIndex, returnFormat: ReturnFormat, options?: SendTransactionOptions<ResolveType>): Web3PromiEvent<ResolveType, SendTransactionEvents<ReturnFormat>>;
export declare function sendTransaction<ReturnFormat extends DataFormat, ResolveType = FormatType<TransactionReceipt, ReturnFormat>>(web3Context: Web3Context<EthExecutionAPI>, transactionObj: Transaction | TransactionWithFromLocalWalletIndex | TransactionWithToLocalWalletIndex | TransactionWithFromAndToLocalWalletIndex, returnFormat: ReturnFormat, options?: SendTransactionOptions<ResolveType>, transactionMiddleware?: TransactionMiddleware): Web3PromiEvent<ResolveType, SendTransactionEvents<ReturnFormat>>;
/**

@@ -407,0 +407,0 @@ * View additional documentations here: {@link Web3Eth.sendSignedTransaction}

import { ContractExecutionError, TransactionRevertedWithoutReasonError, TransactionRevertInstructionError, TransactionRevertWithCustomError, InvalidResponseError, TransactionPollingTimeoutError } from 'web3-errors';
import { FormatType, ETH_DATA_FORMAT, DataFormat, Bytes, ContractAbi, HexString, Numbers, Transaction, TransactionReceipt } from 'web3-types';
import { FormatType, ETH_DATA_FORMAT, DataFormat, Bytes, ContractAbi, HexString, Numbers, Transaction, TransactionReceipt, TransactionWithFromAndToLocalWalletIndex, TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex } from 'web3-types';
export declare type InternalTransaction = FormatType<Transaction, typeof ETH_DATA_FORMAT>;

@@ -40,2 +40,8 @@ export declare type SendTransactionEventsBase<ReturnFormat extends DataFormat, TxType> = {

}
export declare type TransactionMiddlewareData = Transaction | TransactionWithFromLocalWalletIndex | TransactionWithToLocalWalletIndex | TransactionWithFromAndToLocalWalletIndex;
export interface TransactionMiddleware {
processTransaction(transaction: TransactionMiddlewareData, options?: {
[key: string]: unknown;
}): Promise<TransactionMiddlewareData>;
}
//# sourceMappingURL=types.d.ts.map
{
"name": "web3-eth",
"version": "4.7.1-dev.fd2982d.0+fd2982d",
"version": "4.8.0",
"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.1.1-dev.fd2982d.0+fd2982d"
"web3-providers-http": "^4.1.0"
},
"dependencies": {
"setimmediate": "^1.0.5",
"web3-core": "4.4.1-dev.fd2982d.0+fd2982d",
"web3-errors": "1.2.1-dev.fd2982d.0+fd2982d",
"web3-eth-abi": "4.2.3-dev.fd2982d.0+fd2982d",
"web3-eth-accounts": "4.1.3-dev.fd2982d.0+fd2982d",
"web3-net": "4.1.1-dev.fd2982d.0+fd2982d",
"web3-providers-ws": "4.0.8-dev.fd2982d.0+fd2982d",
"web3-rpc-methods": "1.3.1-dev.fd2982d.0+fd2982d",
"web3-types": "1.6.1-dev.fd2982d.0+fd2982d",
"web3-utils": "4.3.1-dev.fd2982d.0+fd2982d",
"web3-validator": "2.0.7-dev.fd2982d.0+fd2982d"
"web3-core": "^4.5.0",
"web3-errors": "^1.2.0",
"web3-eth-abi": "^4.2.2",
"web3-eth-accounts": "^4.1.2",
"web3-net": "^4.1.0",
"web3-providers-ws": "^4.0.7",
"web3-rpc-methods": "^1.3.0",
"web3-types": "^1.7.0",
"web3-utils": "^4.3.0",
"web3-validator": "^2.0.6"
},
"gitHead": "fd2982d1afacd6bf89084324b478ec04af18052e"
"gitHead": "d6d4c6df8f6b6323bc5fe277cbee969c28c845a7"
}

@@ -73,2 +73,3 @@ /*

SendTransactionOptions,
TransactionMiddleware,
} from './types.js';

@@ -548,3 +549,3 @@ // eslint-disable-next-line import/no-cycle

web3Context: Web3Context<EthExecutionAPI>,
transaction:
transactionObj:
| Transaction

@@ -556,2 +557,3 @@ | TransactionWithFromLocalWalletIndex

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

@@ -569,2 +571,8 @@ const promiEvent = new Web3PromiEvent<ResolveType, SendTransactionEvents<ReturnFormat>>(

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

@@ -571,0 +579,0 @@ | Transaction

@@ -36,2 +36,5 @@ /*

TransactionReceipt,
TransactionWithFromAndToLocalWalletIndex,
TransactionWithFromLocalWalletIndex,
TransactionWithToLocalWalletIndex,
} from 'web3-types';

@@ -92,1 +95,15 @@

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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

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

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