UNPKG

@privy-io/react-auth

Version:

React client for the Privy Auth API

76 lines (72 loc) 2.72 kB
import { g as LoginToFrame, U as User, h as LoginToMiniApp } from './types-gBbAJUjT.js'; import '@coinbase/wallet-sdk'; import '@reown/appkit'; import '@solana/wallet-adapter-base'; import 'react'; import 'viem'; import '@privy-io/js-sdk-core'; import '@privy-io/public-api'; import '@base-org/account'; import '@solana/wallet-standard-features'; import '@wallet-standard/base'; import '@wallet-standard/features'; import '@metamask/eth-sig-util'; import '@solana/web3.js'; import 'eventemitter3'; /** * @deprecated Use `UseLoginToMiniAppInterface` instead */ type UseLoginToFrameInterface = { /** * Initializes the login to Farcaster Mini App flow. * * @returns a Promise that resolves to a nonce that must be signed by the Farcaster wallet. */ initLoginToFrame: () => Promise<{ nonce: string; }>; /** * Logs in a user into a Farcaster Mini App with the signed nonce message. * * @param message - the SIWF message which was signed by the Farcaster wallets * @param signature - the signature of the message, verifying the user's Farcaster wallets * @param fid - the Farcaster user ID */ loginToFrame: ({ message, signature }: LoginToFrame) => Promise<User | null>; }; /** * @experimental * @deprecated Use `useLoginToMiniApp` instead * * Use this hook to log a user into a Farcaster Mini App * * @returns initLoginToFrame - initializes a Farcaster Mini App login flow. * @returns loginToFrame - authenticates a user into a Farcaster Mini App. */ declare const useLoginToFrame: () => UseLoginToFrameInterface; type UseLoginToMiniAppInterface = { /** * Initializes the login to Farcaster Mini App flow. * * @returns a Promise that resolves to a nonce that must be signed by the Farcaster wallet. */ initLoginToMiniApp: () => Promise<{ nonce: string; }>; /** * Logs in a user into a Farcaster Mini App with the signed nonce message. * * @param message - the SIWF message which was signed by the Farcaster wallets * @param signature - the signature of the message, verifying the user's Farcaster wallets * @param fid - the Farcaster user ID */ loginToMiniApp: ({ message, signature }: LoginToMiniApp) => Promise<User | null>; }; /** * Use this hook to log a user into a Farcaster Mini App (formerly known as frames) * * @returns initLoginToMiniApp - initializes a Farcaster Mini App login flow. * @returns loginToMiniApp - authenticates a user into a Farcaster Mini App. */ declare const useLoginToMiniApp: () => UseLoginToMiniAppInterface; export { type UseLoginToFrameInterface, type UseLoginToMiniAppInterface, useLoginToFrame, useLoginToMiniApp };