Skip to content

Commit 530f0f1

Browse files
committed
fix: use pending as default block tag for call, estimateGas, simulateBlocks - fixes #3641
1 parent be1eb7a commit 530f0f1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/actions/public/call.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export type CallParameters<
104104
blockNumber?: undefined
105105
/**
106106
* The balance of the account at a block tag.
107-
* @default 'latest'
107+
* @default 'pending'
108108
*/
109109
blockTag?: BlockTag | undefined
110110
}
@@ -159,7 +159,7 @@ export async function call<chain extends Chain | undefined>(
159159
account: account_ = client.account,
160160
batch = Boolean(client.batch?.multicall),
161161
blockNumber,
162-
blockTag = 'latest',
162+
blockTag = 'pending',
163163
accessList,
164164
blobs,
165165
blockOverrides,
@@ -349,7 +349,7 @@ async function scheduleMulticall<chain extends Chain | undefined>(
349349
typeof client.batch?.multicall === 'object' ? client.batch.multicall : {}
350350
const {
351351
blockNumber,
352-
blockTag = 'latest',
352+
blockTag = 'pending',
353353
data,
354354
multicallAddress: multicallAddress_,
355355
to,

src/actions/public/estimateGas.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export type EstimateGasParameters<
5757
blockNumber?: undefined
5858
/**
5959
* The balance of the account at a block tag.
60-
* @default 'latest'
60+
* @default 'pending'
6161
*/
6262
blockTag?: BlockTag | undefined
6363
}
@@ -194,7 +194,7 @@ export async function estimateGas<
194194
return client.request({
195195
method: 'eth_estimateGas',
196196
params: rpcStateOverride
197-
? [request, block ?? 'latest', rpcStateOverride]
197+
? [request, block ?? 'pending', rpcStateOverride]
198198
: block
199199
? [request, block]
200200
: [request],

src/actions/public/simulateBlocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export async function simulateBlocks<
183183
): Promise<SimulateBlocksReturnType<calls>> {
184184
const {
185185
blockNumber,
186-
blockTag = 'latest',
186+
blockTag = 'pending',
187187
blocks,
188188
returnFullTransactions,
189189
traceTransfers,

0 commit comments

Comments
 (0)