Socket
Socket
Sign inDemoInstall

web3-eth

Package Overview
Dependencies
Maintainers
4
Versions
446
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.6.1-dev.1ab7a6b.0 to 4.6.1-dev.2f73aa5.0

5

lib/commonjs/index.d.ts

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

export { detectTransactionType } from './utils/detect_transaction_type.js';
export { transactionBuilder } from './utils/transaction_builder.js';
export { transactionBuilder, getTransactionFromOrToAttr } from './utils/transaction_builder.js';
export { waitForTransactionReceipt } from './utils/wait_for_transaction_receipt.js';
export { trySendTransaction } from './utils/try_send_transaction.js';
export { SendTxHelper } from './utils/send_tx_helper.js';
export default Web3Eth;

9

lib/commonjs/index.js

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.transactionBuilder = exports.detectTransactionType = void 0;
exports.SendTxHelper = exports.trySendTransaction = exports.waitForTransactionReceipt = exports.getTransactionFromOrToAttr = exports.transactionBuilder = exports.detectTransactionType = void 0;
/**

@@ -84,3 +84,10 @@ * The `web3-eth` package allows you to interact with an Ethereum blockchain and Ethereum smart contracts.

Object.defineProperty(exports, "transactionBuilder", { enumerable: true, get: function () { return transaction_builder_js_1.transactionBuilder; } });
Object.defineProperty(exports, "getTransactionFromOrToAttr", { enumerable: true, get: function () { return transaction_builder_js_1.getTransactionFromOrToAttr; } });
var wait_for_transaction_receipt_js_1 = require("./utils/wait_for_transaction_receipt.js");
Object.defineProperty(exports, "waitForTransactionReceipt", { enumerable: true, get: function () { return wait_for_transaction_receipt_js_1.waitForTransactionReceipt; } });
var try_send_transaction_js_1 = require("./utils/try_send_transaction.js");
Object.defineProperty(exports, "trySendTransaction", { enumerable: true, get: function () { return try_send_transaction_js_1.trySendTransaction; } });
var send_tx_helper_js_1 = require("./utils/send_tx_helper.js");
Object.defineProperty(exports, "SendTxHelper", { enumerable: true, get: function () { return send_tx_helper_js_1.SendTxHelper; } });
exports.default = web3_eth_js_1.Web3Eth;
//# sourceMappingURL=index.js.map

@@ -203,3 +203,3 @@ import { FormatType, DataFormat, EthExecutionAPI, SignedTransactionInfoAPI, Address, BlockNumberOrTag, Bytes, Filter, Numbers, TransactionReceipt, Transaction, TransactionCall, Web3EthExecutionAPI, TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, TransactionWithFromAndToLocalWalletIndex, TransactionForAccessList, Eip712TypedData } from 'web3-types';

*/
export declare function getTransaction<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat: ReturnFormat): Promise<{
export declare function getTransaction<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat?: ReturnFormat): Promise<{
readonly yParity: string;

@@ -415,3 +415,3 @@ readonly r: string;

*/
export declare function sign<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, message: Bytes, addressOrIndex: Address | number, returnFormat: ReturnFormat): Promise<{
export declare function sign<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, message: Bytes, addressOrIndex: Address | number, returnFormat?: ReturnFormat): Promise<{
readonly messageHash: string;

@@ -428,3 +428,3 @@ readonly r: string;

*/
export declare function signTransaction<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transaction: Transaction, returnFormat: ReturnFormat): Promise<SignedTransactionInfoAPI>;
export declare function signTransaction<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transaction: Transaction, returnFormat?: ReturnFormat): Promise<SignedTransactionInfoAPI>;
/**

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

*/
export declare function call<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transaction: TransactionCall, blockNumber: BlockNumberOrTag | undefined, returnFormat: ReturnFormat): Promise<import("web3-types").ByteTypes[ReturnFormat["bytes"]]>;
export declare function call<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transaction: TransactionCall, blockNumber?: BlockNumberOrTag, returnFormat?: ReturnFormat): Promise<import("web3-types").ByteTypes[ReturnFormat["bytes"]]>;
/**

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

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

const response = yield web3_rpc_methods_1.ethRpcMethods.getHashRate(web3Context.requestManager);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -106,3 +106,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getGasPrice(web3Context.requestManager);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -118,3 +118,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getMaxPriorityFeePerGas(web3Context.requestManager);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -130,3 +130,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getBlockNumber(web3Context.requestManager);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -145,3 +145,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getBalance(web3Context.requestManager, address, blockNumberFormatted);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -161,3 +161,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getStorageAt(web3Context.requestManager, address, storageSlotFormatted, blockNumberFormatted);
return (0, web3_utils_1.format)({ format: 'bytes' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'bytes' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -176,3 +176,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getCode(web3Context.requestManager, address, blockNumberFormatted);
return (0, web3_utils_1.format)({ format: 'bytes' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'bytes' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -198,3 +198,3 @@ }

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

@@ -220,3 +220,3 @@ }

}
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -242,3 +242,3 @@ }

}
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -265,3 +265,3 @@ }

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

@@ -274,3 +274,3 @@ }

*/
function getTransaction(web3Context, transactionHash, returnFormat) {
function getTransaction(web3Context, transactionHash, returnFormat = web3Context.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -281,3 +281,5 @@ const transactionHashFormatted = (0, web3_utils_1.format)({ format: 'bytes32' }, transactionHash, web3_types_1.DEFAULT_RETURN_FORMAT);

? response
: (0, format_transaction_js_1.formatTransaction)(response, returnFormat, { fillInputAndData: true });
: (0, format_transaction_js_1.formatTransaction)(response, returnFormat, {
fillInputAndData: true,
});
});

@@ -293,3 +295,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getPendingTransactions(web3Context.requestManager);
return response.map(transaction => (0, format_transaction_js_1.formatTransaction)(transaction, returnFormat, {
return response.map(transaction => (0, format_transaction_js_1.formatTransaction)(transaction, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat, {
fillInputAndData: true,

@@ -320,3 +322,5 @@ }));

? response
: (0, format_transaction_js_1.formatTransaction)(response, returnFormat, { fillInputAndData: true });
: (0, format_transaction_js_1.formatTransaction)(response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat, {
fillInputAndData: true,
});
});

@@ -335,3 +339,3 @@ }

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

@@ -350,3 +354,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getTransactionCount(web3Context.requestManager, address, blockNumberFormatted);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -385,7 +389,7 @@ }

});
const transactionHashFormatted = (0, web3_utils_1.format)({ format: 'bytes32' }, transactionHash, returnFormat);
const transactionHashFormatted = (0, web3_utils_1.format)({ format: 'bytes32' }, transactionHash, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
sendTxHelper.emitSent(transactionFormatted);
sendTxHelper.emitTransactionHash(transactionHashFormatted);
const transactionReceipt = yield (0, wait_for_transaction_receipt_js_1.waitForTransactionReceipt)(web3Context, transactionHash, returnFormat);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents((0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat));
const transactionReceipt = yield (0, wait_for_transaction_receipt_js_1.waitForTransactionReceipt)(web3Context, transactionHash, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents((0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat));
sendTxHelper.emitReceipt(transactionReceiptFormatted);

@@ -447,6 +451,6 @@ resolve(yield sendTxHelper.handleResolve({

sendTxHelper.emitSent(signedTransactionFormattedHex);
const transactionHashFormatted = (0, web3_utils_1.format)({ format: 'bytes32' }, transactionHash, returnFormat);
const transactionHashFormatted = (0, web3_utils_1.format)({ format: 'bytes32' }, transactionHash, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
sendTxHelper.emitTransactionHash(transactionHashFormatted);
const transactionReceipt = yield (0, wait_for_transaction_receipt_js_1.waitForTransactionReceipt)(web3Context, transactionHash, returnFormat);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents((0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat));
const transactionReceipt = yield (0, wait_for_transaction_receipt_js_1.waitForTransactionReceipt)(web3Context, transactionHash, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents((0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat));
sendTxHelper.emitReceipt(transactionReceiptFormatted);

@@ -478,3 +482,3 @@ resolve(yield sendTxHelper.handleResolve({

*/
function sign(web3Context, message, addressOrIndex, returnFormat) {
function sign(web3Context, message, addressOrIndex, returnFormat = web3Context.defaultReturnFormat) {
var _a;

@@ -500,3 +504,3 @@ return __awaiter(this, void 0, void 0, function* () {

*/
function signTransaction(web3Context, transaction, returnFormat) {
function signTransaction(web3Context, transaction, returnFormat = web3Context.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -525,3 +529,3 @@ const response = yield web3_rpc_methods_1.ethRpcMethods.signTransaction(web3Context.requestManager, (0, format_transaction_js_1.formatTransaction)(transaction, web3_types_1.ETH_DATA_FORMAT));

*/
function call(web3Context, transaction, blockNumber = web3Context.defaultBlock, returnFormat) {
function call(web3Context, transaction, blockNumber = web3Context.defaultBlock, returnFormat = web3Context.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -548,3 +552,3 @@ const blockNumberFormatted = (0, web3_validator_1.isBlockTag)(blockNumber)

const response = yield web3_rpc_methods_1.ethRpcMethods.estimateGas(web3Context.requestManager, transactionFormatted, blockNumberFormatted);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

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

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

@@ -594,3 +598,3 @@ return result;

// Response is number in hex formatted string
response, returnFormat);
response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -610,3 +614,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getProof(web3Context.requestManager, address, storageKeysFormatted, blockNumberFormatted);
return (0, web3_utils_1.format)(schemas_js_1.accountSchema, response, returnFormat);
return (0, web3_utils_1.format)(schemas_js_1.accountSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -634,3 +638,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.getFeeHistory(web3Context.requestManager, blockCountFormatted, newestBlockFormatted, rewardPercentilesFormatted);
return (0, web3_utils_1.format)(schemas_js_1.feeHistorySchema, response, returnFormat);
return (0, web3_utils_1.format)(schemas_js_1.feeHistorySchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -649,3 +653,3 @@ }

const response = (yield web3_rpc_methods_1.ethRpcMethods.createAccessList(web3Context.requestManager, (0, format_transaction_js_1.formatTransaction)(transaction, web3_types_1.ETH_DATA_FORMAT), blockNumberFormatted));
return (0, web3_utils_1.format)(schemas_js_1.accessListResultSchema, response, returnFormat);
return (0, web3_utils_1.format)(schemas_js_1.accessListResultSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -661,3 +665,3 @@ }

const response = yield web3_rpc_methods_1.ethRpcMethods.signTypedData(web3Context.requestManager, address, typedData, useLegacy);
return (0, web3_utils_1.format)({ format: 'bytes' }, response, returnFormat);
return (0, web3_utils_1.format)({ format: 'bytes' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -664,0 +668,0 @@ }

@@ -31,3 +31,2 @@ "use strict";

const web3_eth_abi_1 = require("web3-eth-abi");
const web3_types_1 = require("web3-types");
// eslint-disable-next-line import/no-cycle

@@ -71,3 +70,3 @@ const rpc_method_wrappers_js_1 = require("../rpc_method_wrappers.js");

*/
function getRevertReason(web3Context, transaction, contractAbi, returnFormat = web3_types_1.DEFAULT_RETURN_FORMAT) {
function getRevertReason(web3Context, transaction, contractAbi, returnFormat = web3Context.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -74,0 +73,0 @@ try {

import { FormatType, DataFormat, EthExecutionAPI, Web3BaseWalletAccount, HexString, TransactionReceipt, Transaction, TransactionCall, TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, TransactionWithFromAndToLocalWalletIndex, TransactionHash } from 'web3-types';
import { Web3Context, Web3PromiEvent } from 'web3-core';
import { JsonSchema } from 'web3-validator';
import { SendSignedTransactionEvents, SendTransactionEvents, SendTransactionOptions } from '../types.js';

@@ -33,5 +34,6 @@ export declare class SendTxHelper<ReturnFormat extends DataFormat, ResolveType = FormatType<TransactionReceipt, ReturnFormat>, TxType = Transaction | TransactionWithFromLocalWalletIndex | TransactionWithToLocalWalletIndex | TransactionWithFromAndToLocalWalletIndex> {

}): Promise<unknown>;
emitConfirmation({ receipt, transactionHash, }: {
emitConfirmation({ receipt, transactionHash, customTransactionReceiptSchema, }: {
receipt: ResolveType;
transactionHash: TransactionHash;
customTransactionReceiptSchema?: JsonSchema;
}): void;

@@ -38,0 +40,0 @@ handleResolve({ receipt, tx }: {

@@ -146,5 +146,5 @@ "use strict";

}
emitConfirmation({ receipt, transactionHash, }) {
emitConfirmation({ receipt, transactionHash, customTransactionReceiptSchema, }) {
if (this.promiEvent.listenerCount('confirmation') > 0) {
(0, watch_transaction_for_confirmations_js_1.watchTransactionForConfirmations)(this.web3Context, this.promiEvent, receipt, transactionHash, this.returnFormat);
(0, watch_transaction_for_confirmations_js_1.watchTransactionForConfirmations)(this.web3Context, this.promiEvent, receipt, transactionHash, this.returnFormat, customTransactionReceiptSchema);
}

@@ -151,0 +151,0 @@ }

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

exports.getTransactionFromOrToAttr = getTransactionFromOrToAttr;
const getTransactionNonce = (web3Context, address, returnFormat = web3_types_1.DEFAULT_RETURN_FORMAT) => __awaiter(void 0, void 0, void 0, function* () {
const getTransactionNonce = (web3Context, address, returnFormat = web3Context.defaultReturnFormat) => __awaiter(void 0, void 0, void 0, function* () {
if ((0, web3_validator_1.isNullish)(address)) {

@@ -96,3 +96,3 @@ // TODO if (web3.eth.accounts.wallet) use address from local wallet

return __awaiter(this, void 0, void 0, function* () {
let populatedTransaction = (0, web3_utils_1.format)(schemas_js_1.transactionSchema, options.transaction, web3_types_1.DEFAULT_RETURN_FORMAT);
let populatedTransaction = (0, web3_utils_1.format)(schemas_js_1.transactionSchema, options.transaction, options.web3Context.defaultReturnFormat);
if ((0, web3_validator_1.isNullish)(populatedTransaction.from)) {

@@ -99,0 +99,0 @@ populatedTransaction.from = (0, exports.getTransactionFromOrToAttr)('from', options.web3Context, undefined, options.privateKey);

import { Web3Context } from 'web3-core';
import { EthExecutionAPI, Bytes, TransactionReceipt, DataFormat } from 'web3-types';
export declare function waitForTransactionReceipt<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat: ReturnFormat): Promise<TransactionReceipt>;
export declare function waitForTransactionReceipt<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat: ReturnFormat, customGetTransactionReceipt?: (web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat: ReturnFormat) => Promise<TransactionReceipt>): Promise<TransactionReceipt>;

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

const rpc_method_wrappers_js_1 = require("../rpc_method_wrappers.js");
function waitForTransactionReceipt(web3Context, transactionHash, returnFormat) {
function waitForTransactionReceipt(web3Context, transactionHash, returnFormat, customGetTransactionReceipt) {
var _a;

@@ -43,3 +43,3 @@ return __awaiter(this, void 0, void 0, function* () {

try {
return (0, rpc_method_wrappers_js_1.getTransactionReceipt)(web3Context, transactionHash, returnFormat);
return (customGetTransactionReceipt !== null && customGetTransactionReceipt !== void 0 ? customGetTransactionReceipt : rpc_method_wrappers_js_1.getTransactionReceipt)(web3Context, transactionHash, returnFormat);
}

@@ -46,0 +46,0 @@ catch (error) {

import { EthExecutionAPI, TransactionReceipt } from 'web3-types';
import { Web3Context, Web3PromiEvent } from 'web3-core';
import { DataFormat } from 'web3-types';
import { JsonSchema } from 'web3-validator';
import { SendSignedTransactionEvents, SendTransactionEvents } from '../types.js';

@@ -9,2 +10,3 @@ export declare type Web3PromiEventEventTypeBase<ReturnFormat extends DataFormat> = SendTransactionEvents<ReturnFormat> | SendSignedTransactionEvents<ReturnFormat>;

transactionReceipt: TransactionReceipt;
customTransactionReceiptSchema?: JsonSchema;
transactionPromiEvent: Web3PromiEvent<ResolveType, Web3PromiEventEventTypeBase<ReturnFormat>>;

@@ -18,2 +20,2 @@ returnFormat: ReturnFormat;

*/
export declare const watchTransactionByPolling: <ReturnFormat extends DataFormat, ResolveType = TransactionReceipt>({ web3Context, transactionReceipt, transactionPromiEvent, returnFormat, }: WaitProps<ReturnFormat, ResolveType>) => void;
export declare const watchTransactionByPolling: <ReturnFormat extends DataFormat, ResolveType = TransactionReceipt>({ web3Context, transactionReceipt, transactionPromiEvent, customTransactionReceiptSchema, returnFormat, }: WaitProps<ReturnFormat, ResolveType>) => void;

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

*/
const watchTransactionByPolling = ({ web3Context, transactionReceipt, transactionPromiEvent, returnFormat, }) => {
const watchTransactionByPolling = ({ web3Context, transactionReceipt, transactionPromiEvent, customTransactionReceiptSchema, returnFormat, }) => {
var _a;

@@ -36,3 +36,3 @@ // Having a transactionReceipt means that the transaction has already been included

confirmations: (0, web3_utils_1.format)({ format: 'uint' }, confirmations, returnFormat),
receipt: (0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: (0, web3_utils_1.format)(customTransactionReceiptSchema !== null && customTransactionReceiptSchema !== void 0 ? customTransactionReceiptSchema : schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat),
latestBlockHash: (0, web3_utils_1.format)({ format: 'bytes32' }, nextBlock.hash, returnFormat),

@@ -39,0 +39,0 @@ });

@@ -8,2 +8,2 @@ import { TransactionReceipt } from 'web3-types';

*/
export declare const watchTransactionBySubscription: <ReturnFormat extends DataFormat, ResolveType = TransactionReceipt>({ web3Context, transactionReceipt, transactionPromiEvent, returnFormat, }: WaitProps<ReturnFormat, ResolveType>) => void;
export declare const watchTransactionBySubscription: <ReturnFormat extends DataFormat, ResolveType = TransactionReceipt>({ web3Context, transactionReceipt, transactionPromiEvent, customTransactionReceiptSchema, returnFormat, }: WaitProps<ReturnFormat, ResolveType>) => void;

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

*/
const watchTransactionBySubscription = ({ web3Context, transactionReceipt, transactionPromiEvent, returnFormat, }) => {
const watchTransactionBySubscription = ({ web3Context, transactionReceipt, transactionPromiEvent, customTransactionReceiptSchema, returnFormat, }) => {
// The following variable will stay true except if the data arrived,

@@ -44,3 +44,3 @@ // or if watching started after an error had occurred.

confirmations: (0, web3_utils_1.format)({ format: 'uint' }, confirmations, returnFormat),
receipt: (0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: (0, web3_utils_1.format)(customTransactionReceiptSchema !== null && customTransactionReceiptSchema !== void 0 ? customTransactionReceiptSchema : schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat),
latestBlockHash: (0, web3_utils_1.format)({ format: 'bytes32' }, newBlockHeader.parentHash, returnFormat),

@@ -60,2 +60,3 @@ });

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -69,2 +70,3 @@ });

transactionReceipt,
customTransactionReceiptSchema,
transactionPromiEvent,

@@ -71,0 +73,0 @@ returnFormat,

import { Bytes, EthExecutionAPI, TransactionReceipt } from 'web3-types';
import { Web3Context, Web3PromiEvent } from 'web3-core';
import { JsonSchema } from 'web3-validator';
import { DataFormat } from 'web3-types';
import { Web3PromiEventEventTypeBase } from './watch_transaction_by_polling.js';
export declare function watchTransactionForConfirmations<ReturnFormat extends DataFormat, Web3PromiEventEventType extends Web3PromiEventEventTypeBase<ReturnFormat>, ResolveType = TransactionReceipt>(web3Context: Web3Context<EthExecutionAPI>, transactionPromiEvent: Web3PromiEvent<ResolveType, Web3PromiEventEventType>, transactionReceipt: TransactionReceipt, transactionHash: Bytes, returnFormat: ReturnFormat): void;
export declare function watchTransactionForConfirmations<ReturnFormat extends DataFormat, Web3PromiEventEventType extends Web3PromiEventEventTypeBase<ReturnFormat>, ResolveType = TransactionReceipt>(web3Context: Web3Context<EthExecutionAPI>, transactionPromiEvent: Web3PromiEvent<ResolveType, Web3PromiEventEventType>, transactionReceipt: TransactionReceipt, transactionHash: Bytes, returnFormat: ReturnFormat, customTransactionReceiptSchema?: JsonSchema): void;

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

const watch_transaction_by_subscription_js_1 = require("./watch_transaction_by_subscription.js");
function watchTransactionForConfirmations(web3Context, transactionPromiEvent, transactionReceipt, transactionHash, returnFormat) {
function watchTransactionForConfirmations(web3Context, transactionPromiEvent, transactionReceipt, transactionHash, returnFormat, customTransactionReceiptSchema) {
if ((0, web3_validator_1.isNullish)(transactionReceipt) || (0, web3_validator_1.isNullish)(transactionReceipt.blockHash))

@@ -23,3 +23,3 @@ throw new web3_errors_1.TransactionMissingReceiptOrBlockHashError({

confirmations: (0, web3_utils_1.format)({ format: 'uint' }, 1, returnFormat),
receipt: (0, web3_utils_1.format)(schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: (0, web3_utils_1.format)(customTransactionReceiptSchema !== null && customTransactionReceiptSchema !== void 0 ? customTransactionReceiptSchema : schemas_js_1.transactionReceiptSchema, transactionReceipt, returnFormat),
latestBlockHash: (0, web3_utils_1.format)({ format: 'bytes32' }, transactionReceipt.blockHash, returnFormat),

@@ -34,2 +34,3 @@ });

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -43,2 +44,3 @@ });

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -45,0 +47,0 @@ });

@@ -63,4 +63,7 @@ /*

export { detectTransactionType } from './utils/detect_transaction_type.js';
export { transactionBuilder } from './utils/transaction_builder.js';
export { transactionBuilder, getTransactionFromOrToAttr } from './utils/transaction_builder.js';
export { waitForTransactionReceipt } from './utils/wait_for_transaction_receipt.js';
export { trySendTransaction } from './utils/try_send_transaction.js';
export { SendTxHelper } from './utils/send_tx_helper.js';
export default Web3Eth;
//# sourceMappingURL=index.js.map

@@ -87,3 +87,3 @@ /*

const response = yield ethRpcMethods.getHashRate(web3Context.requestManager);
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -98,3 +98,3 @@ }

const response = yield ethRpcMethods.getGasPrice(web3Context.requestManager);
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -109,3 +109,3 @@ }

const response = yield ethRpcMethods.getMaxPriorityFeePerGas(web3Context.requestManager);
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -120,3 +120,3 @@ }

const response = yield ethRpcMethods.getBlockNumber(web3Context.requestManager);
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -134,3 +134,3 @@ }

const response = yield ethRpcMethods.getBalance(web3Context.requestManager, address, blockNumberFormatted);
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -149,3 +149,3 @@ }

const response = yield ethRpcMethods.getStorageAt(web3Context.requestManager, address, storageSlotFormatted, blockNumberFormatted);
return format({ format: 'bytes' }, response, returnFormat);
return format({ format: 'bytes' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -163,3 +163,3 @@ }

const response = yield ethRpcMethods.getCode(web3Context.requestManager, address, blockNumberFormatted);
return format({ format: 'bytes' }, response, returnFormat);
return format({ format: 'bytes' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -184,3 +184,3 @@ }

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

@@ -205,3 +205,3 @@ }

}
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -226,3 +226,3 @@ }

}
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -248,3 +248,3 @@ }

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

@@ -256,3 +256,3 @@ }

*/
export function getTransaction(web3Context, transactionHash, returnFormat) {
export function getTransaction(web3Context, transactionHash, returnFormat = web3Context.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -263,3 +263,5 @@ const transactionHashFormatted = format({ format: 'bytes32' }, transactionHash, DEFAULT_RETURN_FORMAT);

? response
: formatTransaction(response, returnFormat, { fillInputAndData: true });
: formatTransaction(response, returnFormat, {
fillInputAndData: true,
});
});

@@ -274,3 +276,3 @@ }

const response = yield ethRpcMethods.getPendingTransactions(web3Context.requestManager);
return response.map(transaction => formatTransaction(transaction, returnFormat, {
return response.map(transaction => formatTransaction(transaction, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat, {
fillInputAndData: true,

@@ -300,3 +302,5 @@ }));

? response
: formatTransaction(response, returnFormat, { fillInputAndData: true });
: formatTransaction(response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat, {
fillInputAndData: true,
});
});

@@ -314,3 +318,3 @@ }

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

@@ -328,3 +332,3 @@ }

const response = yield ethRpcMethods.getTransactionCount(web3Context.requestManager, address, blockNumberFormatted);
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -362,7 +366,7 @@ }

});
const transactionHashFormatted = format({ format: 'bytes32' }, transactionHash, returnFormat);
const transactionHashFormatted = format({ format: 'bytes32' }, transactionHash, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
sendTxHelper.emitSent(transactionFormatted);
sendTxHelper.emitTransactionHash(transactionHashFormatted);
const transactionReceipt = yield waitForTransactionReceipt(web3Context, transactionHash, returnFormat);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents(format(transactionReceiptSchema, transactionReceipt, returnFormat));
const transactionReceipt = yield waitForTransactionReceipt(web3Context, transactionHash, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents(format(transactionReceiptSchema, transactionReceipt, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat));
sendTxHelper.emitReceipt(transactionReceiptFormatted);

@@ -423,6 +427,6 @@ resolve(yield sendTxHelper.handleResolve({

sendTxHelper.emitSent(signedTransactionFormattedHex);
const transactionHashFormatted = format({ format: 'bytes32' }, transactionHash, returnFormat);
const transactionHashFormatted = format({ format: 'bytes32' }, transactionHash, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
sendTxHelper.emitTransactionHash(transactionHashFormatted);
const transactionReceipt = yield waitForTransactionReceipt(web3Context, transactionHash, returnFormat);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents(format(transactionReceiptSchema, transactionReceipt, returnFormat));
const transactionReceipt = yield waitForTransactionReceipt(web3Context, transactionHash, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents(format(transactionReceiptSchema, transactionReceipt, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat));
sendTxHelper.emitReceipt(transactionReceiptFormatted);

@@ -453,3 +457,3 @@ resolve(yield sendTxHelper.handleResolve({

*/
export function sign(web3Context, message, addressOrIndex, returnFormat) {
export function sign(web3Context, message, addressOrIndex, returnFormat = web3Context.defaultReturnFormat) {
var _a;

@@ -474,3 +478,3 @@ return __awaiter(this, void 0, void 0, function* () {

*/
export function signTransaction(web3Context, transaction, returnFormat) {
export function signTransaction(web3Context, transaction, returnFormat = web3Context.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -498,3 +502,3 @@ const response = yield ethRpcMethods.signTransaction(web3Context.requestManager, formatTransaction(transaction, ETH_DATA_FORMAT));

*/
export function call(web3Context, transaction, blockNumber = web3Context.defaultBlock, returnFormat) {
export function call(web3Context, transaction, blockNumber = web3Context.defaultBlock, returnFormat = web3Context.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -520,3 +524,3 @@ const blockNumberFormatted = isBlockTag(blockNumber)

const response = yield ethRpcMethods.estimateGas(web3Context.requestManager, transactionFormatted, blockNumberFormatted);
return format({ format: 'uint' }, response, returnFormat);
return format({ format: 'uint' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -549,3 +553,3 @@ }

}
return format(logSchema, res, returnFormat);
return format(logSchema, res, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -564,3 +568,3 @@ return result;

// Response is number in hex formatted string
response, returnFormat);
response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -579,3 +583,3 @@ }

const response = yield ethRpcMethods.getProof(web3Context.requestManager, address, storageKeysFormatted, blockNumberFormatted);
return format(accountSchema, response, returnFormat);
return format(accountSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -602,3 +606,3 @@ }

const response = yield ethRpcMethods.getFeeHistory(web3Context.requestManager, blockCountFormatted, newestBlockFormatted, rewardPercentilesFormatted);
return format(feeHistorySchema, response, returnFormat);
return format(feeHistorySchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -616,3 +620,3 @@ }

const response = (yield ethRpcMethods.createAccessList(web3Context.requestManager, formatTransaction(transaction, ETH_DATA_FORMAT), blockNumberFormatted));
return format(accessListResultSchema, response, returnFormat);
return format(accessListResultSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});

@@ -627,5 +631,5 @@ }

const response = yield ethRpcMethods.signTypedData(web3Context.requestManager, address, typedData, useLegacy);
return format({ format: 'bytes' }, response, returnFormat);
return format({ format: 'bytes' }, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat);
});
}
//# sourceMappingURL=rpc_method_wrappers.js.map

@@ -26,5 +26,4 @@ /*

};
import { ContractExecutionError, Eip838ExecutionError, InvalidResponseError } from 'web3-errors';
import { ContractExecutionError, Eip838ExecutionError, InvalidResponseError, } from 'web3-errors';
import { decodeContractErrorData, isAbiErrorFragment } from 'web3-eth-abi';
import { DEFAULT_RETURN_FORMAT, } from 'web3-types';
// eslint-disable-next-line import/no-cycle

@@ -67,3 +66,3 @@ import { call } from '../rpc_method_wrappers.js';

*/
export function getRevertReason(web3Context, transaction, contractAbi, returnFormat = DEFAULT_RETURN_FORMAT) {
export function getRevertReason(web3Context, transaction, contractAbi, returnFormat = web3Context.defaultReturnFormat) {
return __awaiter(this, void 0, void 0, function* () {

@@ -70,0 +69,0 @@ try {

@@ -143,5 +143,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

}
emitConfirmation({ receipt, transactionHash, }) {
emitConfirmation({ receipt, transactionHash, customTransactionReceiptSchema, }) {
if (this.promiEvent.listenerCount('confirmation') > 0) {
watchTransactionForConfirmations(this.web3Context, this.promiEvent, receipt, transactionHash, this.returnFormat);
watchTransactionForConfirmations(this.web3Context, this.promiEvent, receipt, transactionHash, this.returnFormat, customTransactionReceiptSchema);
}

@@ -148,0 +148,0 @@ }

@@ -26,3 +26,3 @@ /*

};
import { DEFAULT_RETURN_FORMAT, ETH_DATA_FORMAT, } from 'web3-types';
import { ETH_DATA_FORMAT, } from 'web3-types';
import { privateKeyToAddress } from 'web3-eth-accounts';

@@ -70,3 +70,3 @@ import { getId } from 'web3-net';

};
export const getTransactionNonce = (web3Context, address, returnFormat = DEFAULT_RETURN_FORMAT) => __awaiter(void 0, void 0, void 0, function* () {
export const getTransactionNonce = (web3Context, address, returnFormat = web3Context.defaultReturnFormat) => __awaiter(void 0, void 0, void 0, function* () {
if (isNullish(address)) {

@@ -91,3 +91,3 @@ // TODO if (web3.eth.accounts.wallet) use address from local wallet

return __awaiter(this, void 0, void 0, function* () {
let populatedTransaction = format(transactionSchema, options.transaction, DEFAULT_RETURN_FORMAT);
let populatedTransaction = format(transactionSchema, options.transaction, options.web3Context.defaultReturnFormat);
if (isNullish(populatedTransaction.from)) {

@@ -94,0 +94,0 @@ populatedTransaction.from = getTransactionFromOrToAttr('from', options.web3Context, undefined, options.privateKey);

@@ -33,3 +33,3 @@ /*

import { getTransactionReceipt } from '../rpc_method_wrappers.js';
export function waitForTransactionReceipt(web3Context, transactionHash, returnFormat) {
export function waitForTransactionReceipt(web3Context, transactionHash, returnFormat, customGetTransactionReceipt) {
var _a;

@@ -40,3 +40,3 @@ return __awaiter(this, void 0, void 0, function* () {

try {
return getTransactionReceipt(web3Context, transactionHash, returnFormat);
return (customGetTransactionReceipt !== null && customGetTransactionReceipt !== void 0 ? customGetTransactionReceipt : getTransactionReceipt)(web3Context, transactionHash, returnFormat);
}

@@ -43,0 +43,0 @@ catch (error) {

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

*/
export const watchTransactionByPolling = ({ web3Context, transactionReceipt, transactionPromiEvent, returnFormat, }) => {
export const watchTransactionByPolling = ({ web3Context, transactionReceipt, transactionPromiEvent, customTransactionReceiptSchema, returnFormat, }) => {
var _a;

@@ -33,3 +33,3 @@ // Having a transactionReceipt means that the transaction has already been included

confirmations: format({ format: 'uint' }, confirmations, returnFormat),
receipt: format(transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: format(customTransactionReceiptSchema !== null && customTransactionReceiptSchema !== void 0 ? customTransactionReceiptSchema : transactionReceiptSchema, transactionReceipt, returnFormat),
latestBlockHash: format({ format: 'bytes32' }, nextBlock.hash, returnFormat),

@@ -36,0 +36,0 @@ });

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

*/
export const watchTransactionBySubscription = ({ web3Context, transactionReceipt, transactionPromiEvent, returnFormat, }) => {
export const watchTransactionBySubscription = ({ web3Context, transactionReceipt, transactionPromiEvent, customTransactionReceiptSchema, returnFormat, }) => {
// The following variable will stay true except if the data arrived,

@@ -41,3 +41,3 @@ // or if watching started after an error had occurred.

confirmations: format({ format: 'uint' }, confirmations, returnFormat),
receipt: format(transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: format(customTransactionReceiptSchema !== null && customTransactionReceiptSchema !== void 0 ? customTransactionReceiptSchema : transactionReceiptSchema, transactionReceipt, returnFormat),
latestBlockHash: format({ format: 'bytes32' }, newBlockHeader.parentHash, returnFormat),

@@ -57,2 +57,3 @@ });

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -66,2 +67,3 @@ });

transactionReceipt,
customTransactionReceiptSchema,
transactionPromiEvent,

@@ -68,0 +70,0 @@ returnFormat,

@@ -7,3 +7,3 @@ import { format } from 'web3-utils';

import { watchTransactionBySubscription } from './watch_transaction_by_subscription.js';
export function watchTransactionForConfirmations(web3Context, transactionPromiEvent, transactionReceipt, transactionHash, returnFormat) {
export function watchTransactionForConfirmations(web3Context, transactionPromiEvent, transactionReceipt, transactionHash, returnFormat, customTransactionReceiptSchema) {
if (isNullish(transactionReceipt) || isNullish(transactionReceipt.blockHash))

@@ -20,3 +20,3 @@ throw new TransactionMissingReceiptOrBlockHashError({

confirmations: format({ format: 'uint' }, 1, returnFormat),
receipt: format(transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: format(customTransactionReceiptSchema !== null && customTransactionReceiptSchema !== void 0 ? customTransactionReceiptSchema : transactionReceiptSchema, transactionReceipt, returnFormat),
latestBlockHash: format({ format: 'bytes32' }, transactionReceipt.blockHash, returnFormat),

@@ -31,2 +31,3 @@ });

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -40,2 +41,3 @@ });

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -42,0 +44,0 @@ });

@@ -47,4 +47,7 @@ /**

export { detectTransactionType } from './utils/detect_transaction_type.js';
export { transactionBuilder } from './utils/transaction_builder.js';
export { transactionBuilder, getTransactionFromOrToAttr } from './utils/transaction_builder.js';
export { waitForTransactionReceipt } from './utils/wait_for_transaction_receipt.js';
export { trySendTransaction } from './utils/try_send_transaction.js';
export { SendTxHelper } from './utils/send_tx_helper.js';
export default Web3Eth;
//# sourceMappingURL=index.d.ts.map

@@ -203,3 +203,3 @@ import { FormatType, DataFormat, EthExecutionAPI, SignedTransactionInfoAPI, Address, BlockNumberOrTag, Bytes, Filter, Numbers, TransactionReceipt, Transaction, TransactionCall, Web3EthExecutionAPI, TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, TransactionWithFromAndToLocalWalletIndex, TransactionForAccessList, Eip712TypedData } from 'web3-types';

*/
export declare function getTransaction<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat: ReturnFormat): Promise<{
export declare function getTransaction<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat?: ReturnFormat): Promise<{
readonly yParity: string;

@@ -415,3 +415,3 @@ readonly r: string;

*/
export declare function sign<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, message: Bytes, addressOrIndex: Address | number, returnFormat: ReturnFormat): Promise<{
export declare function sign<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, message: Bytes, addressOrIndex: Address | number, returnFormat?: ReturnFormat): Promise<{
readonly messageHash: string;

@@ -428,3 +428,3 @@ readonly r: string;

*/
export declare function signTransaction<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transaction: Transaction, returnFormat: ReturnFormat): Promise<SignedTransactionInfoAPI>;
export declare function signTransaction<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transaction: Transaction, returnFormat?: ReturnFormat): Promise<SignedTransactionInfoAPI>;
/**

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

*/
export declare function call<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transaction: TransactionCall, blockNumber: BlockNumberOrTag | undefined, returnFormat: ReturnFormat): Promise<import("web3-types").ByteTypes[ReturnFormat["bytes"]]>;
export declare function call<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transaction: TransactionCall, blockNumber?: BlockNumberOrTag, returnFormat?: ReturnFormat): Promise<import("web3-types").ByteTypes[ReturnFormat["bytes"]]>;
/**

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

import { FormatType, DataFormat, EthExecutionAPI, Web3BaseWalletAccount, HexString, TransactionReceipt, Transaction, TransactionCall, TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, TransactionWithFromAndToLocalWalletIndex, TransactionHash } from 'web3-types';
import { Web3Context, Web3PromiEvent } from 'web3-core';
import { JsonSchema } from 'web3-validator';
import { SendSignedTransactionEvents, SendTransactionEvents, SendTransactionOptions } from '../types.js';

@@ -33,5 +34,6 @@ export declare class SendTxHelper<ReturnFormat extends DataFormat, ResolveType = FormatType<TransactionReceipt, ReturnFormat>, TxType = Transaction | TransactionWithFromLocalWalletIndex | TransactionWithToLocalWalletIndex | TransactionWithFromAndToLocalWalletIndex> {

}): Promise<unknown>;
emitConfirmation({ receipt, transactionHash, }: {
emitConfirmation({ receipt, transactionHash, customTransactionReceiptSchema, }: {
receipt: ResolveType;
transactionHash: TransactionHash;
customTransactionReceiptSchema?: JsonSchema;
}): void;

@@ -38,0 +40,0 @@ handleResolve({ receipt, tx }: {

import { Web3Context } from 'web3-core';
import { EthExecutionAPI, Bytes, TransactionReceipt, DataFormat } from 'web3-types';
export declare function waitForTransactionReceipt<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat: ReturnFormat): Promise<TransactionReceipt>;
export declare function waitForTransactionReceipt<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat: ReturnFormat, customGetTransactionReceipt?: (web3Context: Web3Context<EthExecutionAPI>, transactionHash: Bytes, returnFormat: ReturnFormat) => Promise<TransactionReceipt>): Promise<TransactionReceipt>;
//# sourceMappingURL=wait_for_transaction_receipt.d.ts.map
import { EthExecutionAPI, TransactionReceipt } from 'web3-types';
import { Web3Context, Web3PromiEvent } from 'web3-core';
import { DataFormat } from 'web3-types';
import { JsonSchema } from 'web3-validator';
import { SendSignedTransactionEvents, SendTransactionEvents } from '../types.js';

@@ -9,2 +10,3 @@ export declare type Web3PromiEventEventTypeBase<ReturnFormat extends DataFormat> = SendTransactionEvents<ReturnFormat> | SendSignedTransactionEvents<ReturnFormat>;

transactionReceipt: TransactionReceipt;
customTransactionReceiptSchema?: JsonSchema;
transactionPromiEvent: Web3PromiEvent<ResolveType, Web3PromiEventEventTypeBase<ReturnFormat>>;

@@ -18,3 +20,3 @@ returnFormat: ReturnFormat;

*/
export declare const watchTransactionByPolling: <ReturnFormat extends DataFormat, ResolveType = TransactionReceipt>({ web3Context, transactionReceipt, transactionPromiEvent, returnFormat, }: WaitProps<ReturnFormat, ResolveType>) => void;
export declare const watchTransactionByPolling: <ReturnFormat extends DataFormat, ResolveType = TransactionReceipt>({ web3Context, transactionReceipt, transactionPromiEvent, customTransactionReceiptSchema, returnFormat, }: WaitProps<ReturnFormat, ResolveType>) => void;
//# sourceMappingURL=watch_transaction_by_polling.d.ts.map

@@ -8,3 +8,3 @@ import { TransactionReceipt } from 'web3-types';

*/
export declare const watchTransactionBySubscription: <ReturnFormat extends DataFormat, ResolveType = TransactionReceipt>({ web3Context, transactionReceipt, transactionPromiEvent, returnFormat, }: WaitProps<ReturnFormat, ResolveType>) => void;
export declare const watchTransactionBySubscription: <ReturnFormat extends DataFormat, ResolveType = TransactionReceipt>({ web3Context, transactionReceipt, transactionPromiEvent, customTransactionReceiptSchema, returnFormat, }: WaitProps<ReturnFormat, ResolveType>) => void;
//# sourceMappingURL=watch_transaction_by_subscription.d.ts.map
import { Bytes, EthExecutionAPI, TransactionReceipt } from 'web3-types';
import { Web3Context, Web3PromiEvent } from 'web3-core';
import { JsonSchema } from 'web3-validator';
import { DataFormat } from 'web3-types';
import { Web3PromiEventEventTypeBase } from './watch_transaction_by_polling.js';
export declare function watchTransactionForConfirmations<ReturnFormat extends DataFormat, Web3PromiEventEventType extends Web3PromiEventEventTypeBase<ReturnFormat>, ResolveType = TransactionReceipt>(web3Context: Web3Context<EthExecutionAPI>, transactionPromiEvent: Web3PromiEvent<ResolveType, Web3PromiEventEventType>, transactionReceipt: TransactionReceipt, transactionHash: Bytes, returnFormat: ReturnFormat): void;
export declare function watchTransactionForConfirmations<ReturnFormat extends DataFormat, Web3PromiEventEventType extends Web3PromiEventEventTypeBase<ReturnFormat>, ResolveType = TransactionReceipt>(web3Context: Web3Context<EthExecutionAPI>, transactionPromiEvent: Web3PromiEvent<ResolveType, Web3PromiEventEventType>, transactionReceipt: TransactionReceipt, transactionHash: Bytes, returnFormat: ReturnFormat, customTransactionReceiptSchema?: JsonSchema): void;
//# sourceMappingURL=watch_transaction_for_confirmations.d.ts.map
{
"name": "web3-eth",
"version": "4.6.1-dev.1ab7a6b.0+1ab7a6b",
"version": "4.6.1-dev.2f73aa5.0+2f73aa5",
"description": "Web3 module to interact with the Ethereum blockchain and smart contracts.",

@@ -33,3 +33,3 @@ "main": "./lib/commonjs/index.js",

"build:check": "node -e \"require('./lib')\"",
"lint": "eslint --ext .js,.ts .",
"lint": "eslint --cache --cache-strategy content --ext .ts .",
"lint:fix": "eslint --fix --ext .js,.ts .",

@@ -63,18 +63,18 @@ "format": "prettier --write '**/*'",

"typescript": "^4.7.4",
"web3-providers-http": "4.1.1-dev.1ab7a6b.0+1ab7a6b"
"web3-providers-http": "4.1.1-dev.2f73aa5.0+2f73aa5"
},
"dependencies": {
"setimmediate": "^1.0.5",
"web3-core": "4.3.3-dev.1ab7a6b.0+1ab7a6b",
"web3-errors": "1.1.5-dev.1ab7a6b.0+1ab7a6b",
"web3-eth-abi": "4.2.2-dev.1ab7a6b.0+1ab7a6b",
"web3-eth-accounts": "4.1.3-dev.1ab7a6b.0+1ab7a6b",
"web3-net": "4.0.8-dev.1ab7a6b.0+1ab7a6b",
"web3-providers-ws": "4.0.8-dev.1ab7a6b.0+1ab7a6b",
"web3-rpc-methods": "1.2.1-dev.1ab7a6b.0+1ab7a6b",
"web3-types": "1.6.1-dev.1ab7a6b.0+1ab7a6b",
"web3-utils": "4.2.4-dev.1ab7a6b.0+1ab7a6b",
"web3-validator": "2.0.6-dev.1ab7a6b.0+1ab7a6b"
"web3-core": "4.3.3-dev.2f73aa5.0+2f73aa5",
"web3-errors": "1.1.5-dev.2f73aa5.0+2f73aa5",
"web3-eth-abi": "4.2.2-dev.2f73aa5.0+2f73aa5",
"web3-eth-accounts": "4.1.3-dev.2f73aa5.0+2f73aa5",
"web3-net": "4.0.8-dev.2f73aa5.0+2f73aa5",
"web3-providers-ws": "4.0.8-dev.2f73aa5.0+2f73aa5",
"web3-rpc-methods": "1.2.1-dev.2f73aa5.0+2f73aa5",
"web3-types": "1.6.1-dev.2f73aa5.0+2f73aa5",
"web3-utils": "4.2.4-dev.2f73aa5.0+2f73aa5",
"web3-validator": "2.0.6-dev.2f73aa5.0+2f73aa5"
},
"gitHead": "1ab7a6b8aa46d5984d41fd69c78103fcf1f0973b"
"gitHead": "2f73aa5c1de205f30a3961388be27c47c7a28dc5"
}

@@ -66,4 +66,7 @@ /*

export { detectTransactionType } from './utils/detect_transaction_type.js';
export { transactionBuilder } from './utils/transaction_builder.js';
export { transactionBuilder, getTransactionFromOrToAttr } from './utils/transaction_builder.js';
export { waitForTransactionReceipt } from './utils/wait_for_transaction_receipt.js';
export { trySendTransaction } from './utils/try_send_transaction.js';
export { SendTxHelper } from './utils/send_tx_helper.js';
export default Web3Eth;

@@ -125,3 +125,7 @@ /*

return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -139,3 +143,7 @@

return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -153,3 +161,7 @@

return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -166,3 +178,7 @@ /**

return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -188,3 +204,7 @@

);
return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -213,3 +233,7 @@

);
return format({ format: 'bytes' }, response as Bytes, returnFormat);
return format(
{ format: 'bytes' },
response as Bytes,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -235,3 +259,7 @@

);
return format({ format: 'bytes' }, response as Bytes, returnFormat);
return format(
{ format: 'bytes' },
response as Bytes,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -267,3 +295,7 @@

}
return format(blockSchema, response as unknown as Block, returnFormat);
return format(
blockSchema,
response as unknown as Block,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -297,3 +329,7 @@

return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -327,3 +363,7 @@

return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -362,3 +402,7 @@

return format(blockSchema, response as unknown as Block, returnFormat);
return format(
blockSchema,
response as unknown as Block,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -373,3 +417,3 @@

transactionHash: Bytes,
returnFormat: ReturnFormat,
returnFormat: ReturnFormat = web3Context.defaultReturnFormat as ReturnFormat,
) {

@@ -388,3 +432,5 @@ const transactionHashFormatted = format(

? response
: formatTransaction(response, returnFormat, { fillInputAndData: true });
: formatTransaction(response, returnFormat, {
fillInputAndData: true,
});
}

@@ -403,5 +449,9 @@

return response.map(transaction =>
formatTransaction(transaction as unknown as Transaction, returnFormat, {
fillInputAndData: true,
}),
formatTransaction(
transaction as unknown as Transaction,
returnFormat ?? web3Context.defaultReturnFormat,
{
fillInputAndData: true,
},
),
);

@@ -443,3 +493,5 @@ }

? response
: formatTransaction(response, returnFormat, { fillInputAndData: true });
: formatTransaction(response, returnFormat ?? web3Context.defaultReturnFormat, {
fillInputAndData: true,
});
}

@@ -471,3 +523,3 @@

response as unknown as TransactionReceipt,
returnFormat,
returnFormat ?? web3Context.defaultReturnFormat,
) as TransactionReceipt);

@@ -495,3 +547,7 @@ }

return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -539,3 +595,3 @@

);
try {

@@ -569,3 +625,3 @@ transactionFormatted = await sendTxHelper.populateGasPrice({

transactionHash as Bytes,
returnFormat,
returnFormat ?? web3Context.defaultReturnFormat,
);

@@ -580,7 +636,11 @@ sendTxHelper.emitSent(transactionFormatted);

transactionHash,
returnFormat,
returnFormat ?? web3Context.defaultReturnFormat,
);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents(
format(transactionReceiptSchema, transactionReceipt, returnFormat),
format(
transactionReceiptSchema,
transactionReceipt,
returnFormat ?? web3Context.defaultReturnFormat,
),
);

@@ -684,3 +744,3 @@

transactionHash as Bytes,
returnFormat,
returnFormat ?? web3Context.defaultReturnFormat,
);

@@ -695,7 +755,11 @@

transactionHash,
returnFormat,
returnFormat ?? web3Context.defaultReturnFormat,
);
const transactionReceiptFormatted = sendTxHelper.getReceiptWithEvents(
format(transactionReceiptSchema, transactionReceipt, returnFormat),
format(
transactionReceiptSchema,
transactionReceipt,
returnFormat ?? web3Context.defaultReturnFormat,
),
);

@@ -740,3 +804,3 @@

addressOrIndex: Address | number,
returnFormat: ReturnFormat,
returnFormat: ReturnFormat = web3Context.defaultReturnFormat as ReturnFormat,
) {

@@ -773,3 +837,3 @@ const messageFormatted = format({ format: 'bytes' }, message, DEFAULT_RETURN_FORMAT);

transaction: Transaction,
returnFormat: ReturnFormat,
returnFormat: ReturnFormat = web3Context.defaultReturnFormat as ReturnFormat,
) {

@@ -808,3 +872,3 @@ const response = await ethRpcMethods.signTransaction(

blockNumber: BlockNumberOrTag = web3Context.defaultBlock,
returnFormat: ReturnFormat,
returnFormat: ReturnFormat = web3Context.defaultReturnFormat as ReturnFormat,
) {

@@ -846,3 +910,7 @@ const blockNumberFormatted = isBlockTag(blockNumber as string)

return format({ format: 'uint' }, response as Numbers, returnFormat);
return format(
{ format: 'uint' },
response as Numbers,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -882,3 +950,7 @@

return format(logSchema, res as unknown as Log, returnFormat);
return format(
logSchema,
res as unknown as Log,
returnFormat ?? web3Context.defaultReturnFormat,
);
});

@@ -903,3 +975,3 @@

response as unknown as number,
returnFormat,
returnFormat ?? web3Context.defaultReturnFormat,
);

@@ -934,3 +1006,7 @@ }

return format(accountSchema, response as unknown as AccountObject, returnFormat);
return format(
accountSchema,
response as unknown as AccountObject,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -975,3 +1051,7 @@

return format(feeHistorySchema, response as unknown as FeeHistory, returnFormat);
return format(
feeHistorySchema,
response as unknown as FeeHistory,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -999,3 +1079,7 @@

return format(accessListResultSchema, response, returnFormat);
return format(
accessListResultSchema,
response,
returnFormat ?? web3Context.defaultReturnFormat,
);
}

@@ -1021,3 +1105,3 @@

return format({ format: 'bytes' }, response, returnFormat);
return format({ format: 'bytes' }, response, returnFormat ?? web3Context.defaultReturnFormat);
}

@@ -19,3 +19,8 @@ /*

import { Web3Context } from 'web3-core';
import { ContractExecutionError, Eip838ExecutionError, InvalidResponseError , MultipleErrors } from 'web3-errors';
import {
ContractExecutionError,
Eip838ExecutionError,
InvalidResponseError,
MultipleErrors,
} from 'web3-errors';
import { decodeContractErrorData, isAbiErrorFragment } from 'web3-eth-abi';

@@ -84,3 +89,3 @@ import {

contractAbi?: ContractAbi,
returnFormat: ReturnFormat = DEFAULT_RETURN_FORMAT as ReturnFormat,
returnFormat: ReturnFormat = web3Context.defaultReturnFormat as ReturnFormat,
): Promise<undefined | RevertReason | RevertReasonWithCustomError | string> {

@@ -87,0 +92,0 @@ try {

@@ -36,3 +36,3 @@ /*

import { Web3Context, Web3EventEmitter, Web3PromiEvent } from 'web3-core';
import { isNullish } from 'web3-validator';
import { isNullish, JsonSchema } from 'web3-validator';
import {

@@ -261,5 +261,7 @@ ContractExecutionError,

transactionHash,
customTransactionReceiptSchema,
}: {
receipt: ResolveType;
transactionHash: TransactionHash;
customTransactionReceiptSchema?: JsonSchema;
}) {

@@ -277,2 +279,3 @@ if (this.promiEvent.listenerCount('confirmation') > 0) {

this.returnFormat,
customTransactionReceiptSchema,
);

@@ -279,0 +282,0 @@ }

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

DataFormat,
DEFAULT_RETURN_FORMAT,
FormatType,

@@ -103,3 +102,3 @@ ETH_DATA_FORMAT,

address?: Address,
returnFormat: ReturnFormat = DEFAULT_RETURN_FORMAT as ReturnFormat,
returnFormat: ReturnFormat = web3Context.defaultReturnFormat as ReturnFormat,
) => {

@@ -138,3 +137,3 @@ if (isNullish(address)) {

options.transaction,
DEFAULT_RETURN_FORMAT,
options.web3Context.defaultReturnFormat,
) as InternalTransaction;

@@ -141,0 +140,0 @@

@@ -33,15 +33,26 @@ /*

returnFormat: ReturnFormat,
customGetTransactionReceipt?: (
web3Context: Web3Context<EthExecutionAPI>,
transactionHash: Bytes,
returnFormat: ReturnFormat,
) => Promise<TransactionReceipt>,
): Promise<TransactionReceipt> {
const pollingInterval =
web3Context.transactionReceiptPollingInterval ?? web3Context.transactionPollingInterval;
const [awaitableTransactionReceipt, IntervalId] = pollTillDefinedAndReturnIntervalId(async () => {
try {
return getTransactionReceipt(web3Context, transactionHash, returnFormat);
} catch (error) {
console.warn('An error happen while trying to get the transaction receipt', error);
return undefined;
}
}, pollingInterval);
const [awaitableTransactionReceipt, IntervalId] = pollTillDefinedAndReturnIntervalId(
async () => {
try {
return (customGetTransactionReceipt ?? getTransactionReceipt)(
web3Context,
transactionHash,
returnFormat,
);
} catch (error) {
console.warn('An error happen while trying to get the transaction receipt', error);
return undefined;
}
},
pollingInterval,
);

@@ -69,8 +80,6 @@ const [timeoutId, rejectOnTimeout] = rejectIfTimeout(

} finally {
if(timeoutId)
clearTimeout(timeoutId);
if(IntervalId)
clearInterval(IntervalId);
if (timeoutId) clearTimeout(timeoutId);
if (IntervalId) clearInterval(IntervalId);
blockTimeoutResourceCleaner.clean();
}
}

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

import { DataFormat } from 'web3-types';
import { JsonSchema } from 'web3-validator';
import { SendSignedTransactionEvents, SendTransactionEvents } from '../types.js';

@@ -34,2 +35,3 @@ import { transactionReceiptSchema } from '../schemas.js';

transactionReceipt: TransactionReceipt;
customTransactionReceiptSchema?: JsonSchema;
transactionPromiEvent: Web3PromiEvent<ResolveType, Web3PromiEventEventTypeBase<ReturnFormat>>;

@@ -51,2 +53,3 @@ returnFormat: ReturnFormat;

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -73,3 +76,7 @@ }: WaitProps<ReturnFormat, ResolveType>) => {

confirmations: format({ format: 'uint' }, confirmations, returnFormat),
receipt: format(transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: format(
customTransactionReceiptSchema ?? transactionReceiptSchema,
transactionReceipt,
returnFormat,
),
latestBlockHash: format(

@@ -76,0 +83,0 @@ { format: 'bytes32' },

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

import { WaitProps, watchTransactionByPolling } from './watch_transaction_by_polling.js';
/**

@@ -37,2 +36,3 @@ * This function watches a Transaction by subscribing to new heads.

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -71,3 +71,7 @@ }: WaitProps<ReturnFormat, ResolveType>) => {

),
receipt: format(transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: format(
customTransactionReceiptSchema ?? transactionReceiptSchema,
transactionReceipt,
returnFormat,
),
latestBlockHash: format(

@@ -91,2 +95,3 @@ { format: 'bytes32' },

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -101,2 +106,3 @@ });

transactionReceipt,
customTransactionReceiptSchema,
transactionPromiEvent,

@@ -103,0 +109,0 @@ returnFormat,

@@ -20,3 +20,3 @@ /*

import { format } from 'web3-utils';
import { isNullish } from 'web3-validator';
import { isNullish, JsonSchema } from 'web3-validator';

@@ -45,2 +45,3 @@ import {

returnFormat: ReturnFormat,
customTransactionReceiptSchema?: JsonSchema,
) {

@@ -60,3 +61,7 @@ if (isNullish(transactionReceipt) || isNullish(transactionReceipt.blockHash))

confirmations: format({ format: 'uint' }, 1, returnFormat),
receipt: format(transactionReceiptSchema, transactionReceipt, returnFormat),
receipt: format(
customTransactionReceiptSchema ?? transactionReceiptSchema,
transactionReceipt,
returnFormat,
),
latestBlockHash: format({ format: 'bytes32' }, transactionReceipt.blockHash, returnFormat),

@@ -72,2 +77,3 @@ });

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -80,2 +86,3 @@ });

transactionPromiEvent,
customTransactionReceiptSchema,
returnFormat,

@@ -82,0 +89,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 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 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

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