UNPKG

@worldcoin/minikit-react

Version:

minikit-react is a set of hooks for building mini-apps

72 lines (66 loc) 2.93 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { Transport, Chain, Account, Address, RpcSchema, PublicClient, ParseAccount, TransactionReceipt } from 'viem'; /** * Checks if a user is Orb verified * * @param walletAddress - The wallet address of the user * @param rpcUrl - Your preferred RPC node URL, https://worldchain-mainnet.g.alchemy.com/public by default */ declare const useIsUserVerified: (walletAddress: string, rpcUrl?: string) => { isUserVerified: boolean | null; isLoading: boolean; isError: any; }; type SearchUsernameResponseBodySuccess = Array<{ address: string; profile_picture_url: string | null; username: string; }>; type GetSearchedUsernameResult = Awaited<ReturnType<typeof getSearchedUsername>>; declare const getSearchedUsername: (username: string) => Promise<{ status: number; data: SearchUsernameResponseBodySuccess; error?: undefined; } | { status: number; error: string; data?: undefined; }>; type Props = { value: string; handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void; setSearchedUsernames: (searchedUsernames: GetSearchedUsernameResult) => void; className?: string; inputProps?: React.InputHTMLAttributes<HTMLInputElement>; }; /** * Simple component that allows users to search for usernames. * * It is encouraged to build your own components, using this as a base/reference * * You can add more <input /> props/override existing ones by passing inputProps. * Debounce delay is 300ms. */ declare const UsernameSearch: ({ value, handleChange, setSearchedUsernames, className, inputProps, }: Props) => react_jsx_runtime.JSX.Element; type AppConfig = { app_id: string; }; interface UseTransactionReceiptOptions<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | Address | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined> { client: PublicClient<transport, chain, ParseAccount<accountOrAddress>, rpcSchema>; appConfig: AppConfig; transactionId: string; confirmations?: number; timeout?: number; pollingInterval?: number; } interface UseTransactionReceiptResult { transactionHash?: `0x${string}`; receipt?: TransactionReceipt; isError: boolean; isLoading: boolean; isSuccess: boolean; error?: Error; retrigger: () => void; } declare function useWaitForTransactionReceipt<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | Address | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined>(options: UseTransactionReceiptOptions<transport, chain, accountOrAddress, rpcSchema>): UseTransactionReceiptResult; export { type AppConfig, type GetSearchedUsernameResult, UsernameSearch, useIsUserVerified, useWaitForTransactionReceipt };