Comparing version 4.8.2-dev.463d070.0 to 4.8.2-dev.5ad7e5b.0
@@ -64,21 +64,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 getBlock<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, block: string | number | bigint | Uint8Array | undefined, hydrated: boolean | undefined, returnFormat: ReturnFormat): Promise<{ | ||
readonly parentHash: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly sha3Uncles: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly miner: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly stateRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly transactionsRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly receiptsRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly logsBloom?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
readonly difficulty?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
readonly number: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly gasLimit: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly gasUsed: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly timestamp: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly extraData: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly mixHash: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly nonce: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly totalDifficulty: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly baseFeePerGas?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
readonly size: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly transactions: string[] | { | ||
transactions: string[] | { | ||
readonly blockHash?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
@@ -122,4 +104,22 @@ readonly blockNumber?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
}[]; | ||
readonly uncles: string[]; | ||
readonly hash?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
parentHash: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
sha3Uncles: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
miner: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
stateRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
transactionsRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
receiptsRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
logsBloom?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
difficulty?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
number: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
gasLimit: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
gasUsed: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
timestamp: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
extraData: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
mixHash: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
nonce: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
totalDifficulty: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
baseFeePerGas?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
size: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
uncles: string[]; | ||
hash?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
}>; | ||
@@ -126,0 +126,0 @@ /** |
@@ -179,2 +179,3 @@ "use strict"; | ||
function getBlock(web3Context, block = web3Context.defaultBlock, hydrated = false, returnFormat) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -192,3 +193,8 @@ let response; | ||
} | ||
return (0, web3_utils_1.format)(schemas_js_1.blockSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat); | ||
const res = (0, web3_utils_1.format)(schemas_js_1.blockSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat); | ||
if (!(0, web3_validator_1.isNullish)(res)) { | ||
const result = Object.assign(Object.assign({}, res), { transactions: (_a = res.transactions) !== null && _a !== void 0 ? _a : [] }); | ||
return result; | ||
} | ||
return res; | ||
}); | ||
@@ -195,0 +201,0 @@ } |
@@ -165,2 +165,3 @@ /* | ||
export function getBlock(web3Context, block = web3Context.defaultBlock, hydrated = false, returnFormat) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -178,3 +179,8 @@ let response; | ||
} | ||
return format(blockSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat); | ||
const res = format(blockSchema, response, returnFormat !== null && returnFormat !== void 0 ? returnFormat : web3Context.defaultReturnFormat); | ||
if (!isNullish(res)) { | ||
const result = Object.assign(Object.assign({}, res), { transactions: (_a = res.transactions) !== null && _a !== void 0 ? _a : [] }); | ||
return result; | ||
} | ||
return res; | ||
}); | ||
@@ -181,0 +187,0 @@ } |
@@ -64,21 +64,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 getBlock<ReturnFormat extends DataFormat>(web3Context: Web3Context<EthExecutionAPI>, block: string | number | bigint | Uint8Array | undefined, hydrated: boolean | undefined, returnFormat: ReturnFormat): Promise<{ | ||
readonly parentHash: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly sha3Uncles: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly miner: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly stateRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly transactionsRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly receiptsRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly logsBloom?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
readonly difficulty?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
readonly number: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly gasLimit: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly gasUsed: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly timestamp: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly extraData: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly mixHash: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
readonly nonce: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly totalDifficulty: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly baseFeePerGas?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
readonly size: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
readonly transactions: string[] | { | ||
transactions: string[] | { | ||
readonly blockHash?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
@@ -122,4 +104,22 @@ readonly blockNumber?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
}[]; | ||
readonly uncles: string[]; | ||
readonly hash?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
parentHash: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
sha3Uncles: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
miner: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
stateRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
transactionsRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
receiptsRoot: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
logsBloom?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
difficulty?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
number: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
gasLimit: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
gasUsed: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
timestamp: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
extraData: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
mixHash: import("web3-types").ByteTypes[ReturnFormat["bytes"]]; | ||
nonce: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
totalDifficulty: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
baseFeePerGas?: import("web3-types").NumberTypes[ReturnFormat["number"]] | undefined; | ||
size: import("web3-types").NumberTypes[ReturnFormat["number"]]; | ||
uncles: string[]; | ||
hash?: import("web3-types").ByteTypes[ReturnFormat["bytes"]] | undefined; | ||
}>; | ||
@@ -126,0 +126,0 @@ /** |
{ | ||
"name": "web3-eth", | ||
"version": "4.8.2-dev.463d070.0+463d070", | ||
"version": "4.8.2-dev.5ad7e5b.0+5ad7e5b", | ||
"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.463d070.0+463d070" | ||
"web3-providers-http": "4.1.1-dev.5ad7e5b.0+5ad7e5b" | ||
}, | ||
"dependencies": { | ||
"setimmediate": "^1.0.5", | ||
"web3-core": "4.5.1-dev.463d070.0+463d070", | ||
"web3-errors": "1.2.1-dev.463d070.0+463d070", | ||
"web3-eth-abi": "4.2.4-dev.463d070.0+463d070", | ||
"web3-eth-accounts": "4.1.4-dev.463d070.0+463d070", | ||
"web3-net": "4.1.1-dev.463d070.0+463d070", | ||
"web3-providers-ws": "4.0.9-dev.463d070.0+463d070", | ||
"web3-rpc-methods": "1.3.1-dev.463d070.0+463d070", | ||
"web3-types": "1.7.1-dev.463d070.0+463d070", | ||
"web3-utils": "4.3.2-dev.463d070.0+463d070", | ||
"web3-validator": "2.0.7-dev.463d070.0+463d070" | ||
"web3-core": "4.5.1-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-errors": "1.2.1-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-eth-abi": "4.2.4-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-eth-accounts": "4.1.4-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-net": "4.1.1-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-providers-ws": "4.0.9-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-rpc-methods": "1.3.1-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-types": "1.7.1-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-utils": "4.3.2-dev.5ad7e5b.0+5ad7e5b", | ||
"web3-validator": "2.0.7-dev.5ad7e5b.0+5ad7e5b" | ||
}, | ||
"gitHead": "463d070a574a6e09e8c3319bd54fadfd8518d847" | ||
"gitHead": "5ad7e5bad7c7d2e1794f0ff5024897f3eaddff4c" | ||
} |
@@ -289,3 +289,3 @@ /* | ||
} | ||
return format( | ||
const res = format( | ||
blockSchema, | ||
@@ -295,2 +295,12 @@ response as unknown as Block, | ||
); | ||
if (!isNullish(res)) { | ||
const result = { | ||
...res, | ||
transactions: res.transactions ?? [], | ||
} | ||
return result; | ||
} | ||
return res; | ||
} | ||
@@ -297,0 +307,0 @@ |
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 too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1321042
23417