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) {

Contract Interaction

- execution.executeAsync({ callData: params.callData }) + execution.executeAsync({ + callData: params.callData, + value: params.value, + msgSender: params.msgSender, + }) } onSimulate={(params) => execution.callAsync({ diff --git a/yarn.lock b/yarn.lock index 17e1012..66f715d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1327,7 +1327,7 @@ __metadata: resolution: "@ethui/site@workspace:." dependencies: "@biomejs/biome": "npm:^1.9.4" - "@ethui/ui": "npm:^0.0.137" + "@ethui/ui": "npm:^0.0.139" "@hookform/resolvers": "npm:^5.2.1" "@mdx-js/react": "npm:^3.1.0" "@mdx-js/rollup": "npm:^3.1.0" @@ -1382,9 +1382,9 @@ __metadata: languageName: unknown linkType: soft -"@ethui/ui@npm:^0.0.137": - version: 0.0.137 - resolution: "@ethui/ui@npm:0.0.137" +"@ethui/ui@npm:^0.0.139": + version: 0.0.139 + resolution: "@ethui/ui@npm:0.0.139" dependencies: "@ethui/abiparse": "npm:^0.0.4" "@fontsource/source-code-pro": "npm:^5.2.5" @@ -1422,7 +1422,7 @@ __metadata: react-dom: ^19 tailwindcss: ^4.1 viem: ^2.31 - checksum: 10c0/100756886057a31c6951f67000b417617dd2badad8eabd3fd82f4652a749d7149ae5b96a5efe74e8a56a29850f5bb1b5218ebf2091e7022a62c32a5fc8a3988b + checksum: 10c0/31bb60fc198f4052c87de4a4aaf36dccb847fba1d1758624eba4f9e8cfe8d4da8c066b1d81d07481d5e31f4d56aca0636c3eb2e5fd8867742542efa9ac44f8f7 languageName: node linkType: hard