diff --git a/package.json b/package.json index d22e06b..53f01a6 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "fix:biome": "biome check --write ." }, "dependencies": { - "@ethui/ui": "^0.0.137", + "@ethui/ui": "^0.0.139", "@hookform/resolvers": "^5.2.1", "@mdx-js/react": "^3.1.0", "@rainbow-me/rainbowkit": "^2.2.4", diff --git a/src/components/Forms/ResendTransactionDialogForm.tsx b/src/components/Forms/ResendTransactionDialogForm.tsx index cac62d2..e2d4167 100644 --- a/src/components/Forms/ResendTransactionDialogForm.tsx +++ b/src/components/Forms/ResendTransactionDialogForm.tsx @@ -65,17 +65,11 @@ export function ResendTransactionDialog({ addresses={addresses} requiresConnection={true} isConnected={isConnected} - onQuery={(params) => - execution.callAsync({ - data: params.callData, - value: params.value, - msgSender: params.msgSender, - }) - } onWrite={(params) => execution.executeAsync({ callData: params.callData, value: params.value, + msgSender: params.msgSender, }) } onSimulate={(params) => diff --git a/src/hooks/useContractExecution.ts b/src/hooks/useContractExecution.ts index 8a50cb9..ac15d23 100644 --- a/src/hooks/useContractExecution.ts +++ b/src/hooks/useContractExecution.ts @@ -56,9 +56,11 @@ export function useContractExecution(address: Address) { mutationFn: async ({ callData, value, + msgSender, }: { callData: string; value?: bigint; + msgSender?: Address; }): Promise<`0x${string}`> => { if (!callData || !publicClient || !walletClient) throw new Error("Missing required data"); @@ -66,6 +68,7 @@ export function useContractExecution(address: Address) { const hash = await walletClient.sendTransaction({ data: callData as Address, to: address, + account: msgSender || accountAddress, value, }); diff --git a/src/routes/rpc.$rpc/_l/address.$address/-components/ContractTab.tsx b/src/routes/rpc.$rpc/_l/address.$address/-components/ContractTab.tsx index 521d001..b13f5a2 100644 --- a/src/routes/rpc.$rpc/_l/address.$address/-components/ContractTab.tsx +++ b/src/routes/rpc.$rpc/_l/address.$address/-components/ContractTab.tsx @@ -2,7 +2,7 @@ import { ContractExecutionTabs } from "@ethui/ui/components/contract-execution/c import { Button } from "@ethui/ui/components/shadcn/button"; import { Card } from "@ethui/ui/components/shadcn/card"; import type { Address } from "viem"; -import { useChainId } from "wagmi"; +import { useAccount, useChainId } from "wagmi"; import { AddressView } from "#/components/AddressView"; import { AbiDialogForm } from "#/components/Forms/AbiDialogForm"; import useAbi from "#/hooks/useAbi"; @@ -38,6 +38,7 @@ export function ContractTab({ address }: ContractTabProps) { const { rpc } = useConnectionStore(); const latestAddresses = useLatestAddresses(); + const { address: connectedAddress } = useAccount(); const execution = useContractExecution(address); const { abi } = useAbi({ address }); @@ -47,8 +48,9 @@ export function ContractTab({ address }: ContractTabProps) {