From f2a7cefab96691ebed8b8e45ffde071c47b58dbe Mon Sep 17 00:00:00 2001 From: Will Cory Date: Tue, 11 Jun 2024 15:17:43 -0700 Subject: [PATCH] fix: Make to optional in sendTransaction (#4009) * 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 --- .changeset/breezy-bananas-cheer.md | 5 +++++ packages/core/src/actions/sendTransaction.ts | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .changeset/breezy-bananas-cheer.md diff --git a/.changeset/breezy-bananas-cheer.md b/.changeset/breezy-bananas-cheer.md new file mode 100644 index 0000000000..ec2bd3239c --- /dev/null +++ b/.changeset/breezy-bananas-cheer.md @@ -0,0 +1,5 @@ +--- +"@wagmi/core": patch +--- + +Marked `to` as optional for `sendTransaction`. diff --git a/packages/core/src/actions/sendTransaction.ts b/packages/core/src/actions/sendTransaction.ts index e1322d1d7b..da4b7e02dc 100644 --- a/packages/core/src/actions/sendTransaction.ts +++ b/packages/core/src/actions/sendTransaction.ts @@ -1,6 +1,5 @@ import type { Account, - Address, Chain, Client, TransactionRequest, @@ -41,9 +40,7 @@ export type SendTransactionParameters< 'chain' | 'gas' > & ChainIdParameter & - ConnectorParameter & { - to: Address - } + ConnectorParameter > }[number] & { /** Gas provided for transaction execution, or `null` to skip the prelude gas estimation. */