Skip to content

Commit

Permalink
Merge pull request #30 from scaffold-eth/backmerge-main-upstream
Browse files Browse the repository at this point in the history
Backmerge main upstream
  • Loading branch information
technophile-04 authored May 15, 2024
2 parents 68996ae + 20b9886 commit 1f6b614
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-owls-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

update useTransactor parameter types (scaffold-eth#846)
5 changes: 5 additions & 0 deletions .changeset/small-rats-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

bump burner-connector version
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const Faucet = () => {
}, []);

const sendETH = async () => {
if (!faucetAddress) {
if (!faucetAddress || !inputAddress) {
return;
}
try {
Expand All @@ -64,7 +64,6 @@ export const Faucet = () => {
to: inputAddress,
value: parseEther(sendValue as `${number}`),
account: faucetAddress,
chain: hardhat,
});
setLoading(false);
setInputAddress(undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export const FaucetButton = () => {
const faucetTxn = useTransactor(localWalletClient);

const sendETH = async () => {
if (!address) return;
try {
setLoading(true);
await faucetTxn({
chain: hardhat,
account: FAUCET_ADDRESS,
to: address,
value: parseEther(NUM_OF_ETH),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { getPublicClient } from "@wagmi/core";
import { Hash, SendTransactionParameters, WalletClient } from "viem";
import { useWalletClient } from "wagmi";
import { Config, useWalletClient } from "wagmi";
import { SendTransactionMutate } from "wagmi/query";
import { wagmiConfig } from "~~/services/web3/wagmiConfig";
import { getBlockExplorerTxLink, getParsedError, notification } from "~~/utils/scaffold-eth";
import { TransactorFuncOptions } from "~~/utils/scaffold-eth/contract";

type TransactionFunc = (
tx: (() => Promise<Hash>) | SendTransactionParameters,
tx: (() => Promise<Hash>) | Parameters<SendTransactionMutate<Config, undefined>>[0],
options?: TransactorFuncOptions,
) => Promise<Hash | undefined>;

Expand Down Expand Up @@ -58,7 +59,7 @@ export const useTransactor = (_walletClient?: WalletClient): TransactionFunc =>
const result = await tx();
transactionHash = result;
} else if (tx != null) {
transactionHash = await walletClient.sendTransaction(tx);
transactionHash = await walletClient.sendTransaction(tx as SendTransactionParameters);
} else {
throw new Error("Incorrect transaction passed to transactor");
}
Expand Down
2 changes: 1 addition & 1 deletion templates/base/packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@uniswap/sdk-core": "~4.0.1",
"@uniswap/v2-sdk": "~3.0.1",
"blo": "~1.0.1",
"burner-connector": "~0.0.5",
"burner-connector": "~0.0.6",
"daisyui": "4.5.0",
"next": "~14.0.4",
"next-themes": "~0.2.1",
Expand Down

0 comments on commit 1f6b614

Please sign in to comment.