@privy-io/react-auth 2.13.4 → 2.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/{frame-gaUtF4i1.js → frame-Czznns2Z.js} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal-context-VGU3duZo.js +1 -0
- package/dist/cjs/{privy-provider-D6g11fbX.js → privy-provider-MQXR_94C.js} +5 -5
- package/dist/cjs/{smart-wallets-Dydi7jce.js → smart-wallets-QMreSRgO.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{useActiveWallet-C8qBjAv_.js → useActiveWallet-KIL5_ZKg.js} +1 -1
- package/dist/cjs/{useFundWallet-CgL9_ys6.js → useFundWallet-B-tpTxi5.js} +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +4 -4
- package/dist/dts/index.d.ts +4 -4
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +4 -4
- package/dist/dts/solana.d.ts +4 -4
- package/dist/dts/{types-DyEV6BvF.d.mts → types-BWtvBcM8.d.mts} +2 -1
- package/dist/dts/{types-DyEV6BvF.d.ts → types-BWtvBcM8.d.ts} +2 -1
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{useSolanaWallets-Du4VmXQ1.d.mts → useSolanaWallets-mdkbgoJN.d.mts} +1 -1
- package/dist/dts/{useSolanaWallets-Du4VmXQ1.d.ts → useSolanaWallets-mdkbgoJN.d.ts} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/{frame-DcLJJ5Fa.mjs → frame-S_4wR3Zf.mjs} +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal-context-pX7RZwl3.mjs +1 -0
- package/dist/esm/{privy-provider-D-S6WjSN.mjs → privy-provider-CKeDZ7hH.mjs} +5 -5
- package/dist/esm/{smart-wallets-CvCZnbNw.mjs → smart-wallets-svgZ8ws9.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{useActiveWallet-D3ih4wyY.mjs → useActiveWallet-C-0_400K.mjs} +1 -1
- package/dist/esm/{useFundWallet-B42vponG.mjs → useFundWallet-Bj-cO428.mjs} +1 -1
- package/package.json +3 -3
- package/dist/cjs/internal-context-D-v3o9iX.js +0 -1
- package/dist/esm/internal-context-BOEPXMqX.mjs +0 -1
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-
|
|
4
|
-
export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-
|
|
3
|
+
import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-BWtvBcM8.js';
|
|
4
|
+
export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-BWtvBcM8.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { TurnstileProps } from '@marsidev/react-turnstile';
|
|
7
7
|
import EventEmitter from 'eventemitter3';
|
|
@@ -16,8 +16,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
|
16
16
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
|
|
17
17
|
import { Cluster } from '@solana/web3.js';
|
|
18
18
|
import { FetchOptions } from 'ofetch';
|
|
19
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
20
|
-
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
19
|
+
import { P as PrivyEvents } from './useSolanaWallets-mdkbgoJN.js';
|
|
20
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-mdkbgoJN.js';
|
|
21
21
|
import '@coinbase/wallet-sdk';
|
|
22
22
|
import '@solana/wallet-adapter-base';
|
|
23
23
|
import '@solana/wallet-standard-features';
|
|
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
|
|
|
7
7
|
import * as viem from 'viem';
|
|
8
8
|
import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
|
|
9
9
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
10
|
-
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-
|
|
10
|
+
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-BWtvBcM8.js';
|
|
11
11
|
import '@coinbase/wallet-sdk';
|
|
12
12
|
import '@solana/wallet-adapter-base';
|
|
13
13
|
import '@privy-io/public-api';
|
|
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
|
|
|
7
7
|
import * as viem from 'viem';
|
|
8
8
|
import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
|
|
9
9
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
10
|
-
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-
|
|
10
|
+
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-BWtvBcM8.js';
|
|
11
11
|
import '@coinbase/wallet-sdk';
|
|
12
12
|
import '@solana/wallet-adapter-base';
|
|
13
13
|
import '@privy-io/public-api';
|
package/dist/dts/solana.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-
|
|
2
|
-
export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-BWtvBcM8.js';
|
|
2
|
+
export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-BWtvBcM8.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-mdkbgoJN.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-mdkbgoJN.js';
|
|
5
5
|
import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
|
|
6
6
|
import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
|
|
7
7
|
import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
|
package/dist/dts/solana.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-
|
|
2
|
-
export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-BWtvBcM8.js';
|
|
2
|
+
export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-BWtvBcM8.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-mdkbgoJN.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-mdkbgoJN.js';
|
|
5
5
|
import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
|
|
6
6
|
import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
|
|
7
7
|
import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
|
|
@@ -266,7 +266,8 @@ declare enum PrivyErrorCode {
|
|
|
266
266
|
USER_DOES_NOT_EXIST = "user_does_not_exist",
|
|
267
267
|
INSUFFICIENT_BALANCE = "insufficient_balance",
|
|
268
268
|
ACCOUNT_TRANSFER_REQUIRED = "account_transfer_required",
|
|
269
|
-
BUFFER_NOT_DEFINED = "buffer_not_defined"
|
|
269
|
+
BUFFER_NOT_DEFINED = "buffer_not_defined",
|
|
270
|
+
UNSUPPORTED_WALLET_TYPE = "unsupported_wallet_type"
|
|
270
271
|
}
|
|
271
272
|
|
|
272
273
|
declare class WalletTimeoutError extends PrivyConnectorError {
|
|
@@ -266,7 +266,8 @@ declare enum PrivyErrorCode {
|
|
|
266
266
|
USER_DOES_NOT_EXIST = "user_does_not_exist",
|
|
267
267
|
INSUFFICIENT_BALANCE = "insufficient_balance",
|
|
268
268
|
ACCOUNT_TRANSFER_REQUIRED = "account_transfer_required",
|
|
269
|
-
BUFFER_NOT_DEFINED = "buffer_not_defined"
|
|
269
|
+
BUFFER_NOT_DEFINED = "buffer_not_defined",
|
|
270
|
+
UNSUPPORTED_WALLET_TYPE = "unsupported_wallet_type"
|
|
270
271
|
}
|
|
271
272
|
|
|
272
273
|
declare class WalletTimeoutError extends PrivyConnectorError {
|
package/dist/dts/ui.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions } from './types-BWtvBcM8.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Chain, Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@coinbase/wallet-sdk';
|
package/dist/dts/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions } from './types-BWtvBcM8.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Chain, Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@coinbase/wallet-sdk';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from '@privy-io/js-sdk-core';
|
|
2
|
-
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-
|
|
2
|
+
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-BWtvBcM8.js';
|
|
3
3
|
import { MouseEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from '@privy-io/js-sdk-core';
|
|
2
|
-
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-
|
|
2
|
+
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-BWtvBcM8.js';
|
|
3
3
|
import { MouseEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as o}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as t,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{u as c,f as l,l as d,au as p,m,v as u,a as h,aH as y,aI as I,aJ as g,n as v}from"./privy-provider-
|
|
1
|
+
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as o}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as t,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{u as c,f as l,l as d,au as p,m,v as u,a as h,aH as y,aI as I,aJ as g,n as v}from"./privy-provider-CKeDZ7hH.mjs";import{u as f}from"./internal-context-pX7RZwl3.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-svgZ8ws9.mjs";import"react/jsx-runtime";import"mipd";import"react";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"zustand";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"qrcode";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=c(),{hideWalletUIs:S,openPrivyModal:P,chains:b,appId:A,rpcConfig:W,client:M}=f(),k=l(),{wallets:F}=d(),{setModalData:q}=p(),x=m(T),R=!!x&&u(x),D=async(o=s.id)=>{let c=w(F);if(!c)throw Error("No connected wallet found");let l="string"==typeof o?r(o):o;if(![s.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let d=b.find((e=>e.id===l));if(!d)throw Error("Chain not configured");await c.switchChain(d.id);let p=await c.getEthereumProvider(),m=t({account:c.address,transport:n(p)}),u=a({address:c.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:d,transport:i(v(d,W,A)),publicTransport:i(v(d,W,A)),signer:u})};return{signMessage:async({message:e},o)=>{let r=await D(o);return new Promise((async(o,t)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);S.current=!0,q({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:R,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),P(I)})).finally((()=>{S.current=!1}))},signTypedData:async(e,o)=>{let r=await D(o);return new Promise((async(o,t)=>{S.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);q({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:R,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),P(I)})).finally((()=>{S.current=!1}))},sendTransaction:async e=>{let r=await D(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{S.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);q({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:R,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:g,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest({...t,isSponsored:void 0!==t.paymaster&&void 0!==t.paymasterInput})},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest({...t,isSponsored:void 0!==t.paymaster&&void 0!==t.paymasterInput});return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data,eip_712_meta:{paymaster_params:{paymaster:i.paymaster,paymaster_input:i.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),P(I)})).finally((()=>{S.current=!1}))},signTransaction:async e=>{let r=await D(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{S.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);q({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:R,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:g,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest({...t,isSponsored:void 0!==t.paymaster&&void 0!==t.paymasterInput})},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest({...t,isSponsored:void 0!==t.paymaster&&void 0!==t.paymasterInput});return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest({...t,isSponsored:void 0!==t.paymaster&&void 0!==t.paymasterInput});return r.signTransaction(i)},onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),P(I)})).finally((()=>{S.current=!1}))}}}export{T as useAbstractSmartWallets};
|
package/dist/esm/farcaster.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as t}from"react";import{F as e}from"./frame-
|
|
1
|
+
import{useCallback as t}from"react";import{F as e}from"./frame-S_4wR3Zf.mjs";import{u as i,P as r}from"./internal-context-pX7RZwl3.mjs";import"ofetch";const a=()=>{let{client:a,setAuthenticated:n,setUser:s}=i();return{initLoginToFrame:t((async()=>{let t=new e;if(!a)throw new r("Must initialize Privy client first.");return a.startAuthFlow(t),await t.init()}),[a]),loginToFrame:t((async({message:t,signature:i})=>{if(!a)throw new r("Must initialize Privy client first.");if(!(a.authFlow instanceof e))throw new r("Must initialize Farcaster frame flow first.");let o=(t=>{let e=t.match(/farcaster:\/\/fid\/(\d+)/);return e&&e[1]?parseInt(e[1],10):null})(t);if(!o)throw new r("Invalid message format; could not parse Farcaster ID.");a.authFlow.setAuthData({message:t,signature:i,fid:o});let{user:l}=await a.authenticate();return l&&(s(l),n(!0)),l}),[a,s,n])}};export{a as useLoginToFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as t,an as s,ao as i,f as e}from"./internal-context-
|
|
1
|
+
import{P as t,an as s,ao as i,f as e}from"./internal-context-pX7RZwl3.mjs";class a{async init(){if(!this.api)throw new t("Auth flow has no API instance");let{nonce:i,expires_at:e}=await this.api.post(s,{});return{nonce:i,expiresAt:e}}async authenticate(){if(!this.message||!this.signature||!this.fid)throw new t("Auth flow has no message, signature, or fid");if(!this.api)throw new t("Auth flow has no API instance");try{let s=await this.api.post(i,{message:this.message,signature:this.signature,fid:this.fid});if(!s)throw new t("No response from authentication");return s}catch(t){throw e(t)}}async link(){throw Error("Not implemented")}setAuthData({message:t,signature:s,fid:i}){this.message=t,this.signature=s,this.fid=i}constructor(){this.meta={}}}export{a as F};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e,g as t,a as r,b as o,c as i,d as n,C as s,e as l,s as d,P as h,f as w,h as p,i as m,G as y,W as k,j as f,k as C,l as W,m as v,n as P,o as _,p as x,q as j,r as q,t as G,v as $,w as Y,x as Z,y as ee}from"./privy-provider-D-S6WjSN.mjs";export{B as Captcha,D as ConnectorManager,F as EthereumWalletConnector,X as LoginModal,N as PrivyClient,z as PrivyProvider,V as VERSION,E as WalletConnector,L as errorIndicatesMaxMfaRetries,M as errorIndicatesMfaTimeout,K as errorIndicatesMfaVerificationFailed,A as getAccessToken,S as useCreateWallet,O as useIdentityToken,U as useImportWallet,Q as useLogout,I as useMfa,J as useMfaEnrollment,H as usePrivy,R as useRegisterMfaListener,T as useSolanaWallets}from"./privy-provider-D-S6WjSN.mjs";import{useCallback as te,useMemo as re,useEffect as oe,useContext as ie,useState as ae,useRef as ne}from"react";import{u as se,P as le,a as ce,I as ue}from"./internal-context-BOEPXMqX.mjs";export{c as useActiveWallet,a as useConnectWallet,b as useFundWallet,u as useLogin}from"./useActiveWallet-D3ih4wyY.mjs";import{F as de}from"./frame-DcLJJ5Fa.mjs";import{zeroAddress as he,getAddress as we,createWalletClient as pe,http as ge,parseSignature as me}from"viem";import{hashAuthorization as ye}from"viem/utils";import{getWallet as Ae,updateWallet as ke}from"@privy-io/js-sdk-core";export{DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS,addPrivyRpcToChain,addRpcUrlOverrideToChain}from"@privy-io/js-sdk-core";export{g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"zustand";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"qrcode";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";const fe=()=>{let{user:o}=e(),{walletProxy:i}=se();return{recover:te((async e=>{if(!i)throw Error("Wallet proxy is not ready");let a=await t();if(!o||!a)throw new le("User must be logged in before attempting to modify the recovery method.");let{entropyId:n,entropyIdVerifier:s}=r(o);try{await i.recover({entropyId:n,entropyIdVerifier:s,accessToken:a,...e})}catch{throw new le("Unable to recover wallets")}}),[i,o])}},Ce=()=>{let{client:e,setAuthenticated:t,setUser:r}=se();return re((()=>({init:async()=>{if(!e)throw new le("Must initialize Privy client first.");let t=new de;return e.startAuthFlow(t),await t.init()},login:async({fid:o,message:i,signature:a})=>{if(!e)throw new le("Must initialize Privy client first.");if(!(e.authFlow instanceof de))throw new le("Must initialize Farcaster frame flow first.");e.authFlow.setAuthData({message:i,signature:a,fid:o});let{user:n}=await e.authenticate();if(!n)throw new le("Failed to login with Farcaster V2");return r(n),t(!0),{user:n}}})),[e,r,t])},Ie=t=>{o("login",t);let r=i(),a=n(),{ready:c,user:u}=e(),{initLoginWithHeadlessOAuth:h,loginWithHeadlessOAuth:w,oAuthState:p,setOAuthState:g,isHeadlessOAuthLoading:m}=se(),y=te((async e=>{try{if(r.enabled&&"success"!==r.status)throw new s(r.error,null,ce.CAPTCHA_FAILURE);return await h(e.provider,r.token,e.disableSignup)}catch(e){throw g({status:"error",error:e}),e}}),[h,r]),A=te((async()=>{let e=l();try{if(u)return console.warn("Cannot login with OAuth when already logged in"),u;if(!e.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(e.popupFlow)return}catch(e){throw g({status:"error",error:e}),e}try{return await w(e)}catch(e){throw g({status:"error",error:e}),e}finally{d()}}),[w]);return oe((()=>{let e=l();c&&a&&e.inProgress&&!e.withPrivyUi&&!e.popupFlow&&A().catch((()=>{}))}),[c,a]),{initOAuth:y,loading:m,state:p}},Ee=e=>{let t=i(),{emailOtpState:r,setEmailOtpState:o,initLoginWithEmail:a,loginWithCode:n}=se();return{sendCode:te((async({email:r,disableSignup:i})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await a({email:r,captchaToken:e,disableSignup:i,withPrivyUi:!1})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[a]),loginWithCode:te((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);let{user:o,isNewUser:i,wasAlreadyAuthenticated:a,linkedAccount:l}=await n(r);e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:a,loginMethod:"email",loginAccount:l})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[n,t.status]),state:r}},We=e=>{let t=i(),{initSignupWithPasskey:r,signupWithPasskey:o,passkeyAuthState:a,setPasskeyAuthState:n}=se();return{signupWithPasskey:te((async()=>{try{let i;if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),i=await t.waitForResult()),await r({captchaToken:i,withPrivyUi:!1});let{user:a,isNewUser:n,wasAlreadyAuthenticated:l,loginAccount:c}=await o();e?.onComplete?.({user:a,isNewUser:n,wasAlreadyAuthenticated:l,loginMethod:"passkey",loginAccount:c})}catch(t){throw n({status:"error",error:t}),e?.onError?.(t.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),t}}),[o,t.status]),state:a}},Te=e=>{let t=i(),{initLoginWithPasskey:r,loginWithPasskey:o,passkeyAuthState:a,setPasskeyAuthState:n}=se();return{loginWithPasskey:te((async i=>{try{let a;if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),a=await t.waitForResult()),await r({captchaToken:a,withPrivyUi:!1});let{user:n,isNewUser:l,wasAlreadyAuthenticated:c,loginAccount:u}=await o(i);e?.onComplete?.({user:n,isNewUser:l,wasAlreadyAuthenticated:c,loginMethod:"passkey",loginAccount:u})}catch(i){throw n({status:"error",error:i}),e?.onError?.(i.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),i}}),[o,t.status]),state:a}},Ue=e=>{let{initLinkWithPasskey:t,linkWithPasskey:r,passkeyAuthState:o,setPasskeyAuthState:i}=se();return{linkWithPasskey:te((async()=>{try{await t();let o=await r();if(!o)throw Error("Error, user not found");let i=o.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.({user:o,linkMethod:"passkey",linkedAccount:i})}catch(t){throw i({status:"error",error:t}),e?.onError?.(t.privyErrorCode||ce.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),t}}),[r]),state:o}},Se=e=>{let t=i(),{smsOtpState:r,setSmsOtpState:o,initLoginWithSms:a,loginWithCode:n}=se();return{sendCode:te((async({phoneNumber:r,disableSignup:i})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await a({phoneNumber:r,captchaToken:e,disableSignup:i,withPrivyUi:!1})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[a]),loginWithCode:te((async({code:r})=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);let{user:o,isNewUser:i,wasAlreadyAuthenticated:a,linkedAccount:l}=await n(r);e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:a,loginMethod:"sms",loginAccount:l})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[n,t.status]),state:r}},ve=t=>{let{connectOrCreateWallet:r}=e();return o("connectOrCreateWallet",t),{connectOrCreateWallet:r}},Re=e=>{let t=i(),{siweState:r,setSiweState:o,linkWithSiwe:a,generateSiweMessage:n}=se();return{generateSiweMessage:te((async({address:t,chainId:r})=>{try{if(!t||!r)throw Error("wallet address and chainId required to generate nonce");return await n({address:t,chainId:r}).then((e=>e))}catch(t){throw o({status:"error",error:t}),e?.onError?.(t.privyErrorCode||ce.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[n]),linkWithSiwe:te((async({signature:r,message:i,chainId:n,walletClientType:l,connectorType:c})=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);let{user:o,linkedAccount:u}=await a({message:i,signature:r,chainId:n,walletClientType:l,connectorType:c});u&&e?.onSuccess?.({user:o,linkMethod:"siwe",linkedAccount:u})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[a,t.status]),state:r}},Pe=e=>{let t=i(),{siweState:r,setSiweState:o,client:a,generateSiweMessage:n,loginWithSiwe:l}=se();return{generateSiweNonce:te((async r=>{try{let e;if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),o({status:"generating-message"});let i=await a.generateSiweNonce({address:r?.address,captchaToken:e});return o({status:"awaiting-signature"}),i}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[a,t]),generateSiweMessage:te((async({address:t,chainId:r})=>{try{return await n({address:t,chainId:r})}catch(t){throw o({status:"error",error:t}),e?.onError?.(t.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),t}}),[n]),loginWithSiwe:te((async({message:r,signature:i,disableSignup:a})=>{try{let o;if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),o=await t.waitForResult());let n=await l({message:r,signature:i,captchaToken:o,disableSignup:a});return e?.onComplete?.({user:n,isNewUser:!1,wasAlreadyAuthenticated:!1,loginMethod:"siwe",loginAccount:null}),n}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[l,t.status]),state:r}};function be(){let{signTransaction:e}=ie(h);return{signTransaction:e}}function Ne(e){let{linkEmail:t,linkPhone:r,linkWallet:i,linkGoogle:a,linkApple:n,linkTwitter:s,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkSpotify:w,linkInstagram:p,linkTelegram:g,linkFarcaster:m,linkPasskey:y}=ie(h);return o("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:i,linkGoogle:a,linkApple:n,linkTwitter:s,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkSpotify:w,linkInstagram:p,linkFarcaster:m,linkTelegram:g,linkPasskey:y}}function Oe(e){let{updateEmail:t,updatePhone:r}=ie(h);return o("update",e),{updateEmail:t,updatePhone:r}}const _e=()=>{let{connectCoinbaseSmartWallet:e}=se();return{connectCoinbaseSmartWallet:e}},Me=()=>{let{startCrossAppAuthFlow:t,unlinkCrossAppAccount:r,signMessageWithCrossAppWallet:o,signTypedDataWithCrossAppWallet:i,sendTransactionWithCrossAppWallet:a}=e();return{loginWithCrossAppAccount:({appId:e})=>t({appId:e,action:"login"}),linkCrossAppAccount:({appId:e})=>t({appId:e,action:"link"}),unlinkCrossAppAccount:r,signMessage:o,signTypedData:i,sendTransaction:a}};function Fe(e){let{sendTransaction:t}=ie(h);return o("sendTransaction",e),{sendTransaction:t}}function Le(e){let{setWalletPassword:t}=ie(h);return o("setWalletPassword",e),{setWalletPassword:t}}function He(){let t=w(),{getAccessToken:r}=e(),o=p(),{client:i,setUser:a,setAuthenticated:n,setIsNewUser:s,initializeWalletProxy:l}=se(),{create:c}=m();return{createGuestAccount:async()=>{if(!t.id||!i)throw Error("SDK not yet ready");i.startAuthFlow(new y(t.id));try{let e=await i.authenticate(),u=e.user,d=e.isNewUser??!1;if(!u)throw new le("Unable to authenticate guest account");let h=await r(),w=await l(k);if(h&&w)try{let e=f(u,t.embeddedWallets.ethereum.createOnLogin),r=C(u,t.embeddedWallets.solana.createOnLogin);e&&r?(u=(await c({chainType:"ethereum",latestUser:u})).user,u=(await c({chainType:"solana",latestUser:u})).user):r?u=(await c({chainType:"solana",latestUser:u})).user:e?u=(await c({chainType:"ethereum",latestUser:u})).user:a(u)}catch(e){a(u),console.warn("Unable to create embedded wallet for guest account")}return s(d),n(!0),o("login","onComplete",{user:u,isNewUser:d,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),u}catch(e){throw o("login","onError",e.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),e}}}}function De(e){let{setWalletRecovery:t}=ie(h);return o("setWalletRecovery",e),{setWalletRecovery:t}}function xe(e){let{signMessage:t}=ie(h);return o("signMessage",e),{signMessage:t}}const Ke=()=>{let{ready:t,wallets:r}=W(),{user:o}=e(),{rpcConfig:i,chains:a,appId:n}=se();return{signAuthorization:te((async(e,s)=>{let l;if(!o)throw Error("User must be authenticated before signing with a Privy wallet");if(!t)throw Error("Wallets are not ready");let c=s?.address??v(o)?.address??he,u=r.find((e=>we(e.address)===we(c)));if(!u)throw Error("Signing wallet not found.");let d=e.chainId??Number(u.chainId.split(":")[1]);if(0===d)l={chainId:0,address:e.contractAddress,nonce:e.nonce??0};else{let t=a.find((e=>e.id===d));if(!t)throw Error("Error, chain not configured in PrivyProvider config");let r=pe({account:c,chain:t,transport:ge(P(t,i,n))});l=await r.prepareAuthorization({...e})}let h=await u.getEthereumProvider(),w=await h.request({method:"secp256k1_sign",params:[ye(l)]});return{...l,...me(w)}}),[t,r,o,a])}};function ze(e){let{signTypedData:t}=ie(h);return o("signTypedData",e),{signTypedData:t}}const je=()=>{let{isModalOpen:e}=ie(h);return{isOpen:e}};function qe(e){let{getAccessToken:t}=ie(h);return o("accessToken",e),{getAccessToken:t}}function Ve(t){let{authenticated:r,user:i}=e(),{initLoginWithOAuth:a}=se(),n=p();return o("oAuthAuthorization",t),{reauthorize:e=>Ge(r,i,a,n,e.provider)}}let Ge=async(e,t,r,o,i)=>{if(!e)throw o("linkAccount","onError",ce.MUST_BE_AUTHENTICATED,{linkMethod:i}),new le("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(i))))throw new le(`OAuth account of type ${i} not linked to the account.`);await r(i)};function Be(e){let{client:t}=se(),[r,o]=ae({status:"initial"});return{linkWithCustomJwt:te((async r=>{try{o({status:"initial"}),t.startAuthFlow(new _(r)),o({status:"loading"});let{user:i}=await t.link();if(!i)throw Error("Error, user not found");let a=i.linkedAccounts.filter((e=>"custom_auth"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime())).at(0);return o({status:"done"}),e?.onSuccess?.({user:i,linkMethod:"custom",linkedAccount:a}),{user:i}}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR,{linkMethod:"custom"}),r}}),[t.startAuthFlow,t.link]),state:r}}const Qe=e=>{let t=x();return o("customAuth",e),{status:t}};function Xe({isAuthenticated:e,isLoading:t,...r}){let o=ne();oe((()=>{t||o.current?.()}),[e,t]);let i=te((e=>(o.current=e,()=>{o.current=void 0})),[]);return j({...r,subscribe:i})}function Je(){let{getFarcasterSignerPublicKey:t,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}=e();return{getFarcasterSignerPublicKey:t,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}}const $e=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=se();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!0}),revokeWallets:async()=>await e({showDelegationUIs:!0})}},Ye=()=>{let{addSessionSignersInternal:t,removeSessionSignersInternal:r}=(()=>{let{getAccessToken:t,user:r}=e(),o=se(),{signWithUserSigner:i}=q(),a=async({wallet:e,additional_signers:a})=>{let n=await t();if(!r||!n)throw new le("User must be authenticated and have an embedded wallet to delegate actions.");if(!e.id)throw new le("Wallet to add signers to must have ID on server");if(!o.walletProxy)throw new le("Wallet proxy not initialized.");await ke(o.privy,{wallet_id:e.id},i,{additional_signers:a})};return{addSessionSignersInternal:async({address:e,signers:i})=>{let n=await t();if(!r||!n)throw new le("User must be authenticated and have an embedded wallet to add a session signer.");let s=o.walletProxy??await o.initializeWalletProxy(15e3);if(!s)throw new le("Wallet proxy not initialized.");let l=G(r,e);if(!l)throw new le("Address to add signers too is not associated with current user.");if($(l)){if(0===i.length)throw new le("Must specify at least one signer to add.");let e=[...(await Ae(o.privy,{wallet_id:l.id})).additional_signers,...Y(i)];await a({wallet:l,additional_signers:e})}else{if(l.delegated)return{user:r};if(i.length>0)throw new le("This embedded wallet does not support specifying signers. If signing is enabled in the dashboard, signer will default to that key. Otherwise, no signatures will be required for the wallet.");let t=Z({address:e,user:r}),a=ee({address:e,user:r});await o.recoverEmbeddedWallet({address:e}),await s.createDelegatedAction({accessToken:n,rootWallet:a,delegatedWallets:[t]})}let c=await o.refreshSessionAndUser();if(!c)throw Error("Could not refresh user");return{user:c}},removeSessionSignersInternal:async({address:e})=>{let i=await t();if(!r||!i)throw new le("User must be authenticated and have an embedded wallet to delegate actions.");if(!(o.walletProxy??await o.initializeWalletProxy(15e3)))throw new le("Wallet proxy not initialized.");let n=G(r,e);if(!n)throw new le("Address to remove signers from is not associated with current user.");$(n)?await a({wallet:n,additional_signers:[]}):await o.client.revokeDelegatedWallet();let s=await o.refreshSessionAndUser();if(!s)throw Error("Could not refresh user");return{user:s}}}})();return{addSessionSigners:async({address:e,signers:r})=>t({address:e,signers:r}),removeSessionSigners:async({address:e})=>r({address:e})}},Ze=()=>{let{setUser:e,client:t}=ie(ue),{user:r}=ie(h);return{user:r,refreshUser:te((async()=>{let r=await(t?.updateUserAndIdToken());return e(r??null),r}),[t,e])}},et=e=>{let t=i(),{initLoginWithTelegram:r,loginWithTelegram:o,telegramAuthState:a,setTelegramAuthState:n}=se();return{login:te((async i=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);await r(t.token,i?.disableSignup);let{user:a,isNewUser:n,loginAccount:l,wasAlreadyAuthenticated:c}=await o({intent:"login"});e?.onComplete?.({user:a,isNewUser:n,wasAlreadyAuthenticated:c,loginMethod:"telegram",loginAccount:l})}catch(i){throw n({status:"error",error:i}),e?.onError?.(i.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),i}}),[r,o,t]),state:a}},tt=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=se();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!1}),revokeWallets:async()=>await e({showDelegationUIs:!1})}};export{_e as useConnectCoinbaseSmartWallet,ve as useConnectOrCreateWallet,Me as useCrossAppAccounts,Qe as useCustomAuth,$e as useDelegatedActions,Je as useFarcasterSigner,He as useGuestAccounts,tt as useHeadlessDelegatedActions,Ne as useLinkAccount,Be as useLinkJwtAccount,Ue as useLinkWithPasskey,Re as useLinkWithSiwe,Ee as useLoginWithEmail,Ce as useLoginWithFarcasterV2,Ie as useLoginWithOAuth,Te as useLoginWithPasskey,Pe as useLoginWithSiwe,Se as useLoginWithSms,et as useLoginWithTelegram,je as useModalStatus,Ve as useOAuthTokens,fe as useRecoverEmbeddedWallet,Fe as useSendTransaction,Ye as useSessionSigners,Le as useSetWalletPassword,De as useSetWalletRecovery,Ke as useSignAuthorization,xe as useSignMessage,be as useSignTransaction,ze as useSignTypedData,We as useSignupWithPasskey,Xe as useSubscribeToJwtAuthWithFlag,j as useSyncJwtBasedAuthState,qe as useToken,Oe as useUpdateAccount,Ze as useUser,W as useWallets};
|
|
1
|
+
import{u as e,g as t,a as r,b as o,c as i,d as n,C as s,e as l,s as d,P as h,f as w,h as p,i as m,G as y,W as k,j as f,k as C,l as W,m as v,n as P,o as _,p as x,q as j,r as q,t as G,v as $,w as Y,x as Z,y as ee}from"./privy-provider-CKeDZ7hH.mjs";export{B as Captcha,D as ConnectorManager,F as EthereumWalletConnector,X as LoginModal,N as PrivyClient,z as PrivyProvider,V as VERSION,E as WalletConnector,L as errorIndicatesMaxMfaRetries,M as errorIndicatesMfaTimeout,K as errorIndicatesMfaVerificationFailed,A as getAccessToken,S as useCreateWallet,O as useIdentityToken,U as useImportWallet,Q as useLogout,I as useMfa,J as useMfaEnrollment,H as usePrivy,R as useRegisterMfaListener,T as useSolanaWallets}from"./privy-provider-CKeDZ7hH.mjs";import{useCallback as te,useMemo as re,useEffect as oe,useContext as ie,useState as ae,useRef as ne}from"react";import{u as se,P as le,a as ce,I as ue}from"./internal-context-pX7RZwl3.mjs";export{c as useActiveWallet,a as useConnectWallet,b as useFundWallet,u as useLogin}from"./useActiveWallet-C-0_400K.mjs";import{F as de}from"./frame-S_4wR3Zf.mjs";import{zeroAddress as he,getAddress as we,createWalletClient as pe,http as ge,parseSignature as me}from"viem";import{hashAuthorization as ye}from"viem/utils";import{getWallet as Ae,updateWallet as ke}from"@privy-io/js-sdk-core";export{DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS,addPrivyRpcToChain,addRpcUrlOverrideToChain}from"@privy-io/js-sdk-core";export{g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"zustand";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"qrcode";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";const fe=()=>{let{user:o}=e(),{walletProxy:i}=se();return{recover:te((async e=>{if(!i)throw Error("Wallet proxy is not ready");let a=await t();if(!o||!a)throw new le("User must be logged in before attempting to modify the recovery method.");let{entropyId:n,entropyIdVerifier:s}=r(o);try{await i.recover({entropyId:n,entropyIdVerifier:s,accessToken:a,...e})}catch{throw new le("Unable to recover wallets")}}),[i,o])}},Ce=()=>{let{client:e,setAuthenticated:t,setUser:r}=se();return re((()=>({init:async()=>{if(!e)throw new le("Must initialize Privy client first.");let t=new de;return e.startAuthFlow(t),await t.init()},login:async({fid:o,message:i,signature:a})=>{if(!e)throw new le("Must initialize Privy client first.");if(!(e.authFlow instanceof de))throw new le("Must initialize Farcaster frame flow first.");e.authFlow.setAuthData({message:i,signature:a,fid:o});let{user:n}=await e.authenticate();if(!n)throw new le("Failed to login with Farcaster V2");return r(n),t(!0),{user:n}}})),[e,r,t])},Ie=t=>{o("login",t);let r=i(),a=n(),{ready:c,user:u}=e(),{initLoginWithHeadlessOAuth:h,loginWithHeadlessOAuth:w,oAuthState:p,setOAuthState:g,isHeadlessOAuthLoading:m}=se(),y=te((async e=>{try{if(r.enabled&&"success"!==r.status)throw new s(r.error,null,ce.CAPTCHA_FAILURE);return await h(e.provider,r.token,e.disableSignup)}catch(e){throw g({status:"error",error:e}),e}}),[h,r]),A=te((async()=>{let e=l();try{if(u)return console.warn("Cannot login with OAuth when already logged in"),u;if(!e.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(e.popupFlow)return}catch(e){throw g({status:"error",error:e}),e}try{return await w(e)}catch(e){throw g({status:"error",error:e}),e}finally{d()}}),[w]);return oe((()=>{let e=l();c&&a&&e.inProgress&&!e.withPrivyUi&&!e.popupFlow&&A().catch((()=>{}))}),[c,a]),{initOAuth:y,loading:m,state:p}},Ee=e=>{let t=i(),{emailOtpState:r,setEmailOtpState:o,initLoginWithEmail:a,loginWithCode:n}=se();return{sendCode:te((async({email:r,disableSignup:i})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await a({email:r,captchaToken:e,disableSignup:i,withPrivyUi:!1})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[a]),loginWithCode:te((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);let{user:o,isNewUser:i,wasAlreadyAuthenticated:a,linkedAccount:l}=await n(r);e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:a,loginMethod:"email",loginAccount:l})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[n,t.status]),state:r}},We=e=>{let t=i(),{initSignupWithPasskey:r,signupWithPasskey:o,passkeyAuthState:a,setPasskeyAuthState:n}=se();return{signupWithPasskey:te((async()=>{try{let i;if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),i=await t.waitForResult()),await r({captchaToken:i,withPrivyUi:!1});let{user:a,isNewUser:n,wasAlreadyAuthenticated:l,loginAccount:c}=await o();e?.onComplete?.({user:a,isNewUser:n,wasAlreadyAuthenticated:l,loginMethod:"passkey",loginAccount:c})}catch(t){throw n({status:"error",error:t}),e?.onError?.(t.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),t}}),[o,t.status]),state:a}},Te=e=>{let t=i(),{initLoginWithPasskey:r,loginWithPasskey:o,passkeyAuthState:a,setPasskeyAuthState:n}=se();return{loginWithPasskey:te((async i=>{try{let a;if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),a=await t.waitForResult()),await r({captchaToken:a,withPrivyUi:!1});let{user:n,isNewUser:l,wasAlreadyAuthenticated:c,loginAccount:u}=await o(i);e?.onComplete?.({user:n,isNewUser:l,wasAlreadyAuthenticated:c,loginMethod:"passkey",loginAccount:u})}catch(i){throw n({status:"error",error:i}),e?.onError?.(i.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),i}}),[o,t.status]),state:a}},Ue=e=>{let{initLinkWithPasskey:t,linkWithPasskey:r,passkeyAuthState:o,setPasskeyAuthState:i}=se();return{linkWithPasskey:te((async()=>{try{await t();let o=await r();if(!o)throw Error("Error, user not found");let i=o.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.({user:o,linkMethod:"passkey",linkedAccount:i})}catch(t){throw i({status:"error",error:t}),e?.onError?.(t.privyErrorCode||ce.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),t}}),[r]),state:o}},Se=e=>{let t=i(),{smsOtpState:r,setSmsOtpState:o,initLoginWithSms:a,loginWithCode:n}=se();return{sendCode:te((async({phoneNumber:r,disableSignup:i})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await a({phoneNumber:r,captchaToken:e,disableSignup:i,withPrivyUi:!1})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[a]),loginWithCode:te((async({code:r})=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);let{user:o,isNewUser:i,wasAlreadyAuthenticated:a,linkedAccount:l}=await n(r);e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:a,loginMethod:"sms",loginAccount:l})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[n,t.status]),state:r}},ve=t=>{let{connectOrCreateWallet:r}=e();return o("connectOrCreateWallet",t),{connectOrCreateWallet:r}},Re=e=>{let t=i(),{siweState:r,setSiweState:o,linkWithSiwe:a,generateSiweMessage:n}=se();return{generateSiweMessage:te((async({address:t,chainId:r})=>{try{if(!t||!r)throw Error("wallet address and chainId required to generate nonce");return await n({address:t,chainId:r}).then((e=>e))}catch(t){throw o({status:"error",error:t}),e?.onError?.(t.privyErrorCode||ce.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[n]),linkWithSiwe:te((async({signature:r,message:i,chainId:n,walletClientType:l,connectorType:c})=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);let{user:o,linkedAccount:u}=await a({message:i,signature:r,chainId:n,walletClientType:l,connectorType:c});u&&e?.onSuccess?.({user:o,linkMethod:"siwe",linkedAccount:u})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[a,t.status]),state:r}},Pe=e=>{let t=i(),{siweState:r,setSiweState:o,client:a,generateSiweMessage:n,loginWithSiwe:l}=se();return{generateSiweNonce:te((async r=>{try{let e;if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),o({status:"generating-message"});let i=await a.generateSiweNonce({address:r?.address,captchaToken:e});return o({status:"awaiting-signature"}),i}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[a,t]),generateSiweMessage:te((async({address:t,chainId:r})=>{try{return await n({address:t,chainId:r})}catch(t){throw o({status:"error",error:t}),e?.onError?.(t.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),t}}),[n]),loginWithSiwe:te((async({message:r,signature:i,disableSignup:a})=>{try{let o;if(t.enabled&&"error"===t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),o=await t.waitForResult());let n=await l({message:r,signature:i,captchaToken:o,disableSignup:a});return e?.onComplete?.({user:n,isNewUser:!1,wasAlreadyAuthenticated:!1,loginMethod:"siwe",loginAccount:null}),n}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),r}}),[l,t.status]),state:r}};function be(){let{signTransaction:e}=ie(h);return{signTransaction:e}}function Ne(e){let{linkEmail:t,linkPhone:r,linkWallet:i,linkGoogle:a,linkApple:n,linkTwitter:s,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkSpotify:w,linkInstagram:p,linkTelegram:g,linkFarcaster:m,linkPasskey:y}=ie(h);return o("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:i,linkGoogle:a,linkApple:n,linkTwitter:s,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkSpotify:w,linkInstagram:p,linkFarcaster:m,linkTelegram:g,linkPasskey:y}}function Oe(e){let{updateEmail:t,updatePhone:r}=ie(h);return o("update",e),{updateEmail:t,updatePhone:r}}const _e=()=>{let{connectCoinbaseSmartWallet:e}=se();return{connectCoinbaseSmartWallet:e}},Me=()=>{let{startCrossAppAuthFlow:t,unlinkCrossAppAccount:r,signMessageWithCrossAppWallet:o,signTypedDataWithCrossAppWallet:i,sendTransactionWithCrossAppWallet:a}=e();return{loginWithCrossAppAccount:({appId:e})=>t({appId:e,action:"login"}),linkCrossAppAccount:({appId:e})=>t({appId:e,action:"link"}),unlinkCrossAppAccount:r,signMessage:o,signTypedData:i,sendTransaction:a}};function Fe(e){let{sendTransaction:t}=ie(h);return o("sendTransaction",e),{sendTransaction:t}}function Le(e){let{setWalletPassword:t}=ie(h);return o("setWalletPassword",e),{setWalletPassword:t}}function He(){let t=w(),{getAccessToken:r}=e(),o=p(),{client:i,setUser:a,setAuthenticated:n,setIsNewUser:s,initializeWalletProxy:l}=se(),{create:c}=m();return{createGuestAccount:async()=>{if(!t.id||!i)throw Error("SDK not yet ready");i.startAuthFlow(new y(t.id));try{let e=await i.authenticate(),u=e.user,d=e.isNewUser??!1;if(!u)throw new le("Unable to authenticate guest account");let h=await r(),w=await l(k);if(h&&w)try{let e=f(u,t.embeddedWallets.ethereum.createOnLogin),r=C(u,t.embeddedWallets.solana.createOnLogin);e&&r?(u=(await c({chainType:"ethereum",latestUser:u})).user,u=(await c({chainType:"solana",latestUser:u})).user):r?u=(await c({chainType:"solana",latestUser:u})).user:e?u=(await c({chainType:"ethereum",latestUser:u})).user:a(u)}catch(e){a(u),console.warn("Unable to create embedded wallet for guest account")}return s(d),n(!0),o("login","onComplete",{user:u,isNewUser:d,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),u}catch(e){throw o("login","onError",e.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),e}}}}function De(e){let{setWalletRecovery:t}=ie(h);return o("setWalletRecovery",e),{setWalletRecovery:t}}function xe(e){let{signMessage:t}=ie(h);return o("signMessage",e),{signMessage:t}}const Ke=()=>{let{ready:t,wallets:r}=W(),{user:o}=e(),{rpcConfig:i,chains:a,appId:n}=se();return{signAuthorization:te((async(e,s)=>{let l;if(!o)throw Error("User must be authenticated before signing with a Privy wallet");if(!t)throw Error("Wallets are not ready");let c=s?.address??v(o)?.address??he,u=r.find((e=>we(e.address)===we(c)));if(!u)throw Error("Signing wallet not found.");let d=e.chainId??Number(u.chainId.split(":")[1]);if(0===d)l={chainId:0,address:e.contractAddress,nonce:e.nonce??0};else{let t=a.find((e=>e.id===d));if(!t)throw Error("Error, chain not configured in PrivyProvider config");let r=pe({account:c,chain:t,transport:ge(P(t,i,n))});l=await r.prepareAuthorization({...e})}let h=await u.getEthereumProvider(),w=await h.request({method:"secp256k1_sign",params:[ye(l)]});return{...l,...me(w)}}),[t,r,o,a])}};function ze(e){let{signTypedData:t}=ie(h);return o("signTypedData",e),{signTypedData:t}}const je=()=>{let{isModalOpen:e}=ie(h);return{isOpen:e}};function qe(e){let{getAccessToken:t}=ie(h);return o("accessToken",e),{getAccessToken:t}}function Ve(t){let{authenticated:r,user:i}=e(),{initLoginWithOAuth:a}=se(),n=p();return o("oAuthAuthorization",t),{reauthorize:e=>Ge(r,i,a,n,e.provider)}}let Ge=async(e,t,r,o,i)=>{if(!e)throw o("linkAccount","onError",ce.MUST_BE_AUTHENTICATED,{linkMethod:i}),new le("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(i))))throw new le(`OAuth account of type ${i} not linked to the account.`);await r(i)};function Be(e){let{client:t}=se(),[r,o]=ae({status:"initial"});return{linkWithCustomJwt:te((async r=>{try{o({status:"initial"}),t.startAuthFlow(new _(r)),o({status:"loading"});let{user:i}=await t.link();if(!i)throw Error("Error, user not found");let a=i.linkedAccounts.filter((e=>"custom_auth"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime())).at(0);return o({status:"done"}),e?.onSuccess?.({user:i,linkMethod:"custom",linkedAccount:a}),{user:i}}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||ce.UNKNOWN_AUTH_ERROR,{linkMethod:"custom"}),r}}),[t.startAuthFlow,t.link]),state:r}}const Qe=e=>{let t=x();return o("customAuth",e),{status:t}};function Xe({isAuthenticated:e,isLoading:t,...r}){let o=ne();oe((()=>{t||o.current?.()}),[e,t]);let i=te((e=>(o.current=e,()=>{o.current=void 0})),[]);return j({...r,subscribe:i})}function Je(){let{getFarcasterSignerPublicKey:t,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}=e();return{getFarcasterSignerPublicKey:t,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}}const $e=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=se();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!0}),revokeWallets:async()=>await e({showDelegationUIs:!0})}},Ye=()=>{let{addSessionSignersInternal:t,removeSessionSignersInternal:r}=(()=>{let{getAccessToken:t,user:r}=e(),o=se(),{signWithUserSigner:i}=q(),a=async({wallet:e,additional_signers:a})=>{let n=await t();if(!r||!n)throw new le("User must be authenticated and have an embedded wallet to delegate actions.");if(!e.id)throw new le("Wallet to add signers to must have ID on server");if(!o.walletProxy)throw new le("Wallet proxy not initialized.");await ke(o.privy,{wallet_id:e.id},i,{additional_signers:a})};return{addSessionSignersInternal:async({address:e,signers:i})=>{let n=await t();if(!r||!n)throw new le("User must be authenticated and have an embedded wallet to add a session signer.");let s=o.walletProxy??await o.initializeWalletProxy(15e3);if(!s)throw new le("Wallet proxy not initialized.");let l=G(r,e);if(!l)throw new le("Address to add signers too is not associated with current user.");if($(l)){if(0===i.length)throw new le("Must specify at least one signer to add.");let e=[...(await Ae(o.privy,{wallet_id:l.id})).additional_signers,...Y(i)];await a({wallet:l,additional_signers:e})}else{if(l.delegated)return{user:r};if(i.length>0)throw new le("This embedded wallet does not support specifying signers. If signing is enabled in the dashboard, signer will default to that key. Otherwise, no signatures will be required for the wallet.");let t=Z({address:e,user:r}),a=ee({address:e,user:r});await o.recoverEmbeddedWallet({address:e}),await s.createDelegatedAction({accessToken:n,rootWallet:a,delegatedWallets:[t]})}let c=await o.refreshSessionAndUser();if(!c)throw Error("Could not refresh user");return{user:c}},removeSessionSignersInternal:async({address:e})=>{let i=await t();if(!r||!i)throw new le("User must be authenticated and have an embedded wallet to delegate actions.");if(!(o.walletProxy??await o.initializeWalletProxy(15e3)))throw new le("Wallet proxy not initialized.");let n=G(r,e);if(!n)throw new le("Address to remove signers from is not associated with current user.");$(n)?await a({wallet:n,additional_signers:[]}):await o.client.revokeDelegatedWallet();let s=await o.refreshSessionAndUser();if(!s)throw Error("Could not refresh user");return{user:s}}}})();return{addSessionSigners:async({address:e,signers:r})=>t({address:e,signers:r}),removeSessionSigners:async({address:e})=>r({address:e})}},Ze=()=>{let{setUser:e,client:t}=ie(ue),{user:r}=ie(h);return{user:r,refreshUser:te((async()=>{let r=await(t?.updateUserAndIdToken());return e(r??null),r}),[t,e])}},et=e=>{let t=i(),{initLoginWithTelegram:r,loginWithTelegram:o,telegramAuthState:a,setTelegramAuthState:n}=se();return{login:te((async i=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,ce.CAPTCHA_FAILURE);await r(t.token,i?.disableSignup);let{user:a,isNewUser:n,loginAccount:l,wasAlreadyAuthenticated:c}=await o({intent:"login"});e?.onComplete?.({user:a,isNewUser:n,wasAlreadyAuthenticated:c,loginMethod:"telegram",loginAccount:l})}catch(i){throw n({status:"error",error:i}),e?.onError?.(i.privyErrorCode||ce.UNKNOWN_AUTH_ERROR),i}}),[r,o,t]),state:a}},tt=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=se();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!1}),revokeWallets:async()=>await e({showDelegationUIs:!1})}};export{_e as useConnectCoinbaseSmartWallet,ve as useConnectOrCreateWallet,Me as useCrossAppAccounts,Qe as useCustomAuth,$e as useDelegatedActions,Je as useFarcasterSigner,He as useGuestAccounts,tt as useHeadlessDelegatedActions,Ne as useLinkAccount,Be as useLinkJwtAccount,Ue as useLinkWithPasskey,Re as useLinkWithSiwe,Ee as useLoginWithEmail,Ce as useLoginWithFarcasterV2,Ie as useLoginWithOAuth,Te as useLoginWithPasskey,Pe as useLoginWithSiwe,Se as useLoginWithSms,et as useLoginWithTelegram,je as useModalStatus,Ve as useOAuthTokens,fe as useRecoverEmbeddedWallet,Fe as useSendTransaction,Ye as useSessionSigners,Le as useSetWalletPassword,De as useSetWalletRecovery,Ke as useSignAuthorization,xe as useSignMessage,be as useSignTransaction,ze as useSignTypedData,We as useSignupWithPasskey,Xe as useSubscribeToJwtAuthWithFlag,j as useSyncJwtBasedAuthState,qe as useToken,Oe as useUpdateAccount,Ze as useUser,W as useWallets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FetchError as a}from"ofetch";import{createContext as e,useContext as s}from"react";var t;class i extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(a,e,s){super(a),e instanceof Error&&(this.cause=e),this.privyErrorCode=s}}class n extends i{constructor(a,e,s,t,i,n){super(s,t,i),this.type=a,this.status=e,this.data=n}}class r extends i{constructor(a,e,s){super(a,e,s),this.type="client_error"}}class _ extends r{constructor(){super("Request timed out",void 0,"client_request_timeout")}}class o extends i{constructor(a,e,s){super(a,e,s),this.type="connector_error"}}const l=e=>{if(e instanceof i)return e;if(!(e instanceof a))return u(e);if(!e.response)return new n("api_error",null,e.message,e);let{type:s,message:t,error:r,code:_}=e.data;return new n(s||"ApiError",e.response.status,t||r,e,_,e.data)},u=a=>a instanceof i?a:a instanceof Error?new r(a.message,a):new r(`Internal error: ${a}`);var p=((t={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",t.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",t.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",t.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",t.INVALID_DATA="invalid_data",t.INVALID_CAPTCHA="invalid_captcha",t.LINKED_TO_ANOTHER_USER="linked_to_another_user",t.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",t.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",t.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",t.USER_EXITED_UPDATE_FLOW="exited_update_flow",t.ALLOWLIST_REJECTED="allowlist_rejected",t.OAUTH_USER_DENIED="oauth_user_denied",t.OAUTH_UNEXPECTED="oauth_unexpected",t.UNKNOWN_AUTH_ERROR="unknown_auth_error",t.USER_EXITED_AUTH_FLOW="exited_auth_flow",t.USER_EXITED_LINK_FLOW="exited_link_flow",t.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",t.MUST_BE_AUTHENTICATED="must_be_authenticated",t.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",t.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",t.CLIENT_REQUEST_TIMEOUT="client_request_timeout",t.INVALID_CREDENTIALS="invalid_credentials",t.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",t.UNKNOWN_MFA_ERROR="unknown_mfa_error",t.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",t.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",t.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",t.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",t.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",t.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",t.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",t.TRANSACTION_FAILURE="transaction_failure",t.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",t.NOT_SUPPORTED="not_supported",t.CAPTCHA_TIMEOUT="captcha_timeout",t.INVALID_MESSAGE="invalid_message",t.UNABLE_TO_SIGN="unable_to_sign",t.CAPTCHA_FAILURE="captcha_failure",t.CAPTCHA_DISABLED="captcha_disabled",t.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",t.TOO_MANY_REQUESTS="too_many_requests",t.USER_LIMIT_REACHED="max_accounts_reached",t.DISALLOWED_LOGIN_METHOD="disallowed_login_method",t.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",t.PASSKEY_NOT_ALLOWED="passkey_not_allowed",t.USER_DOES_NOT_EXIST="user_does_not_exist",t.INSUFFICIENT_BALANCE="insufficient_balance",t.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",t.BUFFER_NOT_DEFINED="buffer_not_defined",t.UNSUPPORTED_WALLET_TYPE="unsupported_wallet_type",t);class d extends r{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}}class c extends r{constructor(a="Embedded wallet error",e){super(a,e,"unknown_embedded_wallet_error")}}class E extends r{constructor(a="User must be authenticated"){super(a,void 0,"must_be_authenticated")}}class A extends r{constructor(a){super("This application is in development mode and must be upgraded to production to log in new users.",a,"max_accounts_reached")}}const h="/api/v1/sessions",v="/api/v1/sessions/logout",S="/api/v1/siwe/init",T="/api/v1/siwe/authenticate",m="/api/v1/siwe/link",w="/api/v1/siwe/link_smart_wallet",I="/api/v1/siwe/unlink",D="/api/v1/siwe/transfer",N="/api/v1/siws/init",O="/api/v1/siws/authenticate",L="/api/v1/siws/link",g="/api/v1/siws/unlink",R="/api/v1/farcaster/init",W="/api/v1/farcaster/authenticate",U="/api/v1/farcaster/link",f="/api/v1/farcaster/status",k="/api/v1/farcaster/unlink",y="/api/v1/farcaster/transfer",C="api/v2/farcaster/init",P="api/v2/farcaster/authenticate",M="/api/v1/passwordless/init",F="/api/v1/passwordless/authenticate",b="/api/v1/passwordless/link",x="/api/v1/passwordless/unlink",H="/api/v1/passwordless/update",B="/api/v1/passwordless/transfer",V="/api/v1/passwordless_sms/init",Y="/api/v1/passwordless_sms/link",K="/api/v1/passwordless_sms/unlink",G="/api/v1/passwordless_sms/authenticate",X="/api/v1/passwordless_sms/update",$="/api/v1/passwordless_sms/transfer",q="/api/v1/oauth/init",j="/api/v1/oauth/authenticate",Q="/api/v1/oauth/link",z="/api/v1/oauth/unlink",J="/api/v1/oauth/transfer",Z="/api/v1/recovery/oauth/init",aa="/api/v1/recovery/oauth/init_icloud",ea="/api/v1/recovery/oauth/authenticate",sa="/api/v1/passkeys/link/init",ta="/api/v1/passkeys/authenticate/init",ia="/api/v1/passkeys/register/init",na="/api/v1/passkeys/link",ra="/api/v1/passkeys/authenticate",_a="/api/v1/passkeys/register",oa="/api/v1/telegram/authenticate",la="/api/v1/telegram/link",ua="/api/v1/telegram/unlink",pa="/api/v1/telegram/transfer",da="/api/v1/mfa/passwordless_sms/init",ca="/api/v1/mfa/passkeys/init",Ea="/api/v1/users/me/accept_terms",Aa="/api/v1/analytics_events",ha="/api/v1/custom_jwt_account/authenticate",va="/api/v1/custom_jwt_account/link",Sa="/api/v1/guest/authenticate",Ta="/api/v1/plugins/moonpay_on_ramp/sign",ma="/api/v1/funding/coinbase_on_ramp/init",wa="/api/v1/funding/coinbase_on_ramp/status",Ia="/api/v1/wallets/revoke",Da="/api/v1/users/me",Na="/api/v1/scan/transaction",Oa=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},La=a=>()=>{throw Error(a.trim())},ga=/*#__PURE__*/e({setAuthenticated:Oa,setUser:Oa,setIsNewUser:Oa,isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",onCustomAuthAuthenticated:Oa,hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:Oa,initializeWalletProxy:Oa,getAuthMeta:Oa,getAuthFlow:Oa,closePrivyModal:Oa,openPrivyModal:Oa,connectWallet:Oa,initLoginWithWallet:Oa,loginWithWallet:Oa,initLoginWithFarcaster:Oa,loginWithFarcaster:Oa,loginWithCode:Oa,initLoginWithEmail:Oa,initLoginWithSms:Oa,initUpdateEmail:Oa,initUpdatePhone:Oa,resendEmailCode:Oa,resendSmsCode:Oa,initLoginWithHeadlessOAuth:Oa,loginWithHeadlessOAuth:Oa,crossAppAuthFlow:Oa,initLoginWithOAuth:Oa,loginWithOAuth:Oa,passkeyAuthState:{status:"initial"},setPasskeyAuthState:Oa,initSignupWithPasskey:Oa,signupWithPasskey:Oa,initLoginWithPasskey:Oa,loginWithPasskey:Oa,initLinkWithPasskey:Oa,linkWithPasskey:Oa,refreshSessionAndUser:Oa,walletProxy:null,createAnalyticsEvent:Oa,acceptTerms:Oa,getUsdTokenPrice:Oa,getUsdPriceForSol:Oa,getSplTokenMetadata:Oa,recoverEmbeddedWallet:Oa,updateWallets:Oa,fundWallet:Oa,openModal:Oa,setReadyToTrue:Oa,requestFarcasterSignerStatus:Oa,initLoginWithTelegram:Oa,loginWithTelegram:Oa,generateSiweMessage:Oa,generateSiweMessageForSmartWallet:Oa,loginWithSiwe:Oa,linkWithSiwe:Oa,linkSmartWallet:Oa,delegateWallet:Oa,revokeDelegatedWallets:Oa,exportSolanaWallet:Oa,connectCoinbaseSmartWallet:Oa,initiateAccountTransfer:Oa,emailOtpState:{status:"initial"},setEmailOtpState:Oa,smsOtpState:{status:"initial"},setSmsOtpState:Oa,siweState:{status:"initial"},setSiweState:Oa,oAuthState:{status:"initial"},setOAuthState:Oa,telegramAuthState:{status:"initial"},setTelegramAuthState:Oa,isHeadlessOAuthLoading:!1,isHeadlessSigning:Oa}),Ra=()=>s(ga);export{ma as $,X as A,i as B,oa as C,la as D,_ as E,h as F,v as G,Aa as H,ga as I,ha as J,va as K,Sa as L,u as M,n as N,da as O,r as P,ca as Q,Ea as R,x as S,K as T,I as U,g as V,z as W,k as X,ua as Y,Ia as Z,Ta as _,p as a,wa as a0,S as a1,T as a2,m as a3,w as a4,N as a5,O as a6,J as a7,pa as a8,y as a9,D as aa,$ as ab,B as ac,L as ad,Da as ae,Na as af,ea as ag,aa as ah,Z as ai,c as aj,A as ak,E as al,d as am,C as an,P as ao,Oa as b,b as c,M as d,H as e,l as f,o as g,W as h,U as i,R as j,f as k,Q as l,q as m,La as n,j as o,F as p,_a as q,ra as r,na as s,ia as t,Ra as u,ta as v,sa as w,G as x,Y as y,V as z};
|