diff --git a/.changeset/witty-glasses-matter.md b/.changeset/witty-glasses-matter.md new file mode 100644 index 00000000..66767ec8 --- /dev/null +++ b/.changeset/witty-glasses-matter.md @@ -0,0 +1,5 @@ +--- +"@delvtech/drift-viem": minor +--- + +Remove forced `simulateContract` from viem adapter `write` diff --git a/packages/drift-viem/src/ViemReadWriteAdapter.ts b/packages/drift-viem/src/ViemReadWriteAdapter.ts index 1626e1ef..2820bfc4 100644 --- a/packages/drift-viem/src/ViemReadWriteAdapter.ts +++ b/packages/drift-viem/src/ViemReadWriteAdapter.ts @@ -70,16 +70,9 @@ export class ViemReadWriteAdapter< TAbi extends Abi, TFunctionName extends FunctionName, >(params: AdapterWriteParams) { - const viemParams = createSimulateContractParameters( - Object.assign({}, params, { - from: params.from || (await this.getSignerAddress()), - }), + const writePromise = this.walletClient.writeContract( + params ); - const writePromise = this.publicClient - .simulateContract(viemParams) - .then(({ request }) => - this.walletClient.writeContract(request as WriteContractParameters), - ); if (params.onMined) { writePromise.then((hash) => {