import { ContractInterface, InvokeFunctionResponse, Overrides } from 'starknet'; /** Arguments for `useStarknetInvoke`. */ export interface UseStarknetInvokeArgs { /** The target contract. */ contract?: ContractInterface; /** The method name. */ method?: string; } /** Arguments for the `invoke` function. */ export interface InvokeArgs { /** The args the contract method is called with. */ args: T; /** Transaction overrides. */ overrides?: Overrides; /** Metadata associated with the transaction. */ metadata?: any; } /** Value returned from `useStarknetInvoke` */ export interface UseStarknetInvokeResult { /** Data returned from the invoke call. */ data?: InvokeFunctionResponse; /** True if the execute call is being invoked. */ loading: boolean; /** Error while running invoke. */ error?: unknown; /** Reset the hook state. */ reset: () => void; /** Invoke the contract method. */ invoke: ({ args, metadata }: InvokeArgs) => Promise; } /** * Hook to invoke a smart contract method. * * @remarks * * This hook calls the `Contract.invoke` method under the hood. * Arguments should be encoded according to the starknet.js version * you're using. * * @deprecated Use {@link useStarknetExecute} instead. * * @example * This example shows how to transfer some ETH. * ```tsx * function Component() { * const { address } = useAccount() * const { contract } = useContract({ * abi: compiledErc20.abi, * address: ethAddress, * }) * const { invoke } = useStarknetInvoke({ * contract, * method: 'transfer', * }) * * return ( * * ) * } * ``` */ export declare function useStarknetInvoke({ contract, method, }: UseStarknetInvokeArgs): UseStarknetInvokeResult;