Skip to content

Commit

Permalink
fix: request params
Browse files Browse the repository at this point in the history
  • Loading branch information
dhvanipa committed Oct 20, 2024
1 parent d3ec645 commit 7b4fcd0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/common/src/writeContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ export async function writeContract<
const nonce = nonceManager.nextNonce();

const fullRequest = { ...feeRef.fees, ...preparedRequest, nonce };
if (request.maxFeePerGas !== undefined && request.maxFeePerGas !== null) {
fullRequest.maxFeePerGas = request.maxFeePerGas;
}
if (request.maxPriorityFeePerGas !== undefined && request.maxPriorityFeePerGas !== null) {
fullRequest.maxPriorityFeePerGas = request.maxPriorityFeePerGas;
}
debug("calling", fullRequest.functionName, "with nonce", nonce, "at", fullRequest.address);
return await getAction(client, viem_writeContract, "writeContract")(fullRequest as never);
},
Expand Down

0 comments on commit 7b4fcd0

Please sign in to comment.