Skip to content

Commit

Permalink
feat: update to use viem types
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomariscal committed Sep 14, 2023
1 parent 630a836 commit 9f925c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/cactiComponents/hooks/useSubmitTx.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { useEffect } from 'react';
import { toast } from 'react-toastify';
import { useAddRecentTransaction } from '@rainbow-me/rainbowkit';
import { CallOverrides, Overrides, PayableOverrides, UnsignedTransaction } from 'ethers';
import { CallOverrides, Overrides, PayableOverrides } from 'ethers';
import { TransactionReceipt, TransactionRequestBase } from 'viem';
import {
usePrepareContractWrite,
usePrepareSendTransaction,
useSendTransaction,
useWaitForTransaction,
} from 'wagmi';
import useBalance from './useBalance';
import { Transaction, TransactionReceipt } from 'viem/dist/types/types/transaction';

export type TxBasicParams = {
address?: `0x${string}`;
Expand Down Expand Up @@ -37,7 +37,7 @@ export const SEND_ETH_FNNAME = '8bb05f0e-05ed-11ee-be56-0242ac120002';
*/
const useSubmitTx = (
params?: TxBasicParams,
sendParams?: Transaction,
sendParams?: TransactionRequestBase,
onSuccess?: (receipt?: TransactionReceipt) => void,
onError?: (receipt?: TransactionReceipt) => void,
description?: string
Expand All @@ -58,7 +58,7 @@ const useSubmitTx = (
/* prepare a send transaction if the fnName matches the SEND_TRANSACTION unique id */
const { config: sendConfig, isError: isPrepareError } = usePrepareSendTransaction({
...(writeConfig.request ?? sendParams),
// gasLimit: sendParams?.gasLimit || 500000 TODO add in gas limti?
// gasLimit: sendParams?.gasLimit || 500000 TODO add in gas limti?
enabled: true,
onError: (e) => console.log('prepare send error', e),
});
Expand Down

0 comments on commit 9f925c7

Please sign in to comment.