Skip to content

Commit

Permalink
fix: Make to optional in sendTransaction (#4009)
Browse files Browse the repository at this point in the history
* fix: Make to optional in sendTransaction

To should be optional since you can not set it when deploying a contract.

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbwFAEgDOBTAdgEwCpQCGWahAxjMBFgDRIC+cAZlBCHAOQDuhA5iMAD05StTQckoSLETYyEHBgAiGMABsIATyWEYhRizacAbsAwgJSeSXhQMaOAF44hHsHiZcBYqQpUsABQIjIQOxJo0iDi6hABccHIKyqoa2jFBIWFYmgCU9DlAA

* chore: tweaks

---------

Co-authored-by: Tom Meagher <tom@meagher.co>
  • Loading branch information
roninjin10 and tmm committed Jun 11, 2024
1 parent f0ea0b2 commit f2a7cef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-bananas-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/core": patch
---

Marked `to` as optional for `sendTransaction`.
5 changes: 1 addition & 4 deletions packages/core/src/actions/sendTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type {
Account,
Address,
Chain,
Client,
TransactionRequest,
Expand Down Expand Up @@ -41,9 +40,7 @@ export type SendTransactionParameters<
'chain' | 'gas'
> &
ChainIdParameter<config, chainId> &
ConnectorParameter & {
to: Address
}
ConnectorParameter
>
}[number] & {
/** Gas provided for transaction execution, or `null` to skip the prelude gas estimation. */
Expand Down

0 comments on commit f2a7cef

Please sign in to comment.