Skip to content

Commit

Permalink
fix: revert #3153
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Feb 23, 2025
1 parent 8c13d23 commit 6f6140a
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/actions/wallet/prepareTransactionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,26 @@ export async function prepareTransactionRequest<
return chainId
}

if (parameters.includes('nonce') && typeof nonce === 'undefined' && account) {
if (nonceManager) {
const chainId = await getChainId()
request.nonce = await nonceManager.consume({
address: account.address,
chainId,
client,
})
} else {
request.nonce = await getAction(
client,
getTransactionCount,
'getTransactionCount',
)({
address: account.address,
blockTag: 'pending',
})
}
}

if (
(parameters.includes('blobVersionedHashes') ||
parameters.includes('sidecars')) &&
Expand Down Expand Up @@ -403,26 +423,6 @@ export async function prepareTransactionRequest<
: account,
} as EstimateGasParameters)

if (parameters.includes('nonce') && typeof nonce === 'undefined' && account) {
if (nonceManager) {
const chainId = await getChainId()
request.nonce = await nonceManager.consume({
address: account.address,
chainId,
client,
})
} else {
request.nonce = await getAction(
client,
getTransactionCount,
'getTransactionCount',
)({
address: account.address,
blockTag: 'pending',
})
}
}

assertRequest(request as AssertRequestParameters)

delete request.parameters
Expand Down

0 comments on commit 6f6140a

Please sign in to comment.