import { useCallback } from "react" ; import { useMoralis } from "../useMoralis" ; import { UseResolveCallOptions , _useResolveCall , } from "../../internal/_useResolveAsyncCall" ; export type Web3TransferResult = unknown ; export interface UseWeb3TransferOptions extends UseResolveCallOptions { } type TransferType = "native" | "erc20" | "erc721" | "erc1155" ; type TransferSystem = "evm" ; export type Web3TransferParameters = { type ? : TransferType ; receiver ? : string ; contractAddress ? : string ; deprecated contract_address ? : string ; amount ? : string ; tokenId ? : string ; deprecated token_id ? : string ; system ? : TransferSystem ; } ; export interface Web3TransferFetchOptions { onError ? : ( error : Error ) => void ; onSuccess ? : ( results : Web3TransferResult ) => void ; onComplete ? : ( ) => void ; throwOnError ? : boolean ; params ? : Web3TransferParameters ; } export const useWeb3Transfer = ( params ? , options ? ) => { const { Moralis } = useMoralis ( ) ; const call = useCallback ( async ( callParams ) => { const allParams = { ... params , ... callParams , } ; return await Moralis . Web3 . transfer ( allParams ) ; } , [ ] ) ; return _useResolveCall < Web3TransferResult , Web3TransferParameters > ( call , null , params , options , false ) ; } ;