@privy-io/react-auth 2.21.4 → 2.22.0

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.
Files changed (42) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/extended-chains.js +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/privy-provider-DXrPQcjO.js +34 -0
  5. package/dist/cjs/{smart-wallets-Cgv0XYXg.js → smart-wallets-ohOqJE5r.js} +1 -1
  6. package/dist/cjs/smart-wallets.js +1 -1
  7. package/dist/cjs/solana.js +1 -1
  8. package/dist/cjs/ui.js +2 -2
  9. package/dist/cjs/use-sign-with-user-signer-mIruAdfm.js +1 -0
  10. package/dist/cjs/{useActiveWallet-CYfVhCkS.js → useActiveWallet-BOhTaQoP.js} +1 -1
  11. package/dist/cjs/{useFundWallet-CdT-bV73.js → useFundWallet-BlDOcTKs.js} +1 -1
  12. package/dist/dts/extended-chains.d.mts +1 -1
  13. package/dist/dts/extended-chains.d.ts +1 -1
  14. package/dist/dts/farcaster.d.mts +1 -1
  15. package/dist/dts/farcaster.d.ts +1 -1
  16. package/dist/dts/index.d.mts +16 -4
  17. package/dist/dts/index.d.ts +16 -4
  18. package/dist/dts/smart-wallets.d.mts +1 -1
  19. package/dist/dts/smart-wallets.d.ts +1 -1
  20. package/dist/dts/solana.d.mts +63 -6
  21. package/dist/dts/solana.d.ts +63 -6
  22. package/dist/dts/{types-DRqchVAL.d.mts → types-koC7eIOP.d.mts} +62 -3
  23. package/dist/dts/{types-DRqchVAL.d.ts → types-koC7eIOP.d.ts} +62 -3
  24. package/dist/dts/ui.d.mts +1 -1
  25. package/dist/dts/ui.d.ts +1 -1
  26. package/dist/dts/{useSolanaWallets-yARRzx3f.d.mts → useSolanaWallets-CDu74ZFA.d.mts} +4 -1
  27. package/dist/dts/{useSolanaWallets-yARRzx3f.d.ts → useSolanaWallets-CDu74ZFA.d.ts} +4 -1
  28. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  29. package/dist/esm/extended-chains.mjs +1 -1
  30. package/dist/esm/index.mjs +1 -1
  31. package/dist/esm/privy-provider-CoOSBvfN.mjs +31 -0
  32. package/dist/esm/{smart-wallets-ScQvzONo.mjs → smart-wallets-TO2YIcTb.mjs} +1 -1
  33. package/dist/esm/smart-wallets.mjs +1 -1
  34. package/dist/esm/solana.mjs +1 -1
  35. package/dist/esm/ui.mjs +2 -2
  36. package/dist/esm/{use-sign-with-user-signer-DYa7HrQH.mjs → use-sign-with-user-signer-u7zZ9cLA.mjs} +1 -1
  37. package/dist/esm/{useActiveWallet-CBnd9EMy.mjs → useActiveWallet-DknggGRp.mjs} +1 -1
  38. package/dist/esm/{useFundWallet-DSxHvjFr.mjs → useFundWallet-DvuaQdcB.mjs} +1 -1
  39. package/package.json +19 -8
  40. package/dist/cjs/privy-provider-dT3e7Jkf.js +0 -29
  41. package/dist/cjs/use-sign-with-user-signer-gh4MDT3P.js +0 -1
  42. package/dist/esm/privy-provider-BkunMgHl.mjs +0 -29
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { c as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig, L as LoginMethod, a3 as ExternalWalletMetadata, a4 as TelegramAuthResult, a5 as TelegramWebAppData, a6 as OAuthUserInfo, a7 as SiwsMessageType, a8 as OAuthFlowState, a9 as LoginWithCode, aa as OtpFlowState, ab as PasskeyFlowState, ac as SiweFlowState, ad as BaseAccountSdkType, ae as UnsignedTransactionRequestWithChainId, af as BaseConnectedWalletType, C as ConnectedSolanaWallet, ag as SessionSignerInput, ah as TelegramAuthFlowState } from './types-DRqchVAL.js';
4
- export { aA as Apple, aN as AppleOAuthWithMetadata, aV as ContractUIOptions, aE as CrossAppAccount, aQ as CrossAppAccountWithMetadata, ax as Discord, aI as DiscordOAuthWithMetadata, aS as Email, as as EmailWithMetadata, aZ as Farcaster, aO as FarcasterWithMetadata, ay as Github, aJ as GithubOAuthWithMetadata, av as Google, aG as GoogleOAuthWithMetadata, aC as Line, aL as LineOAuthWithMetadata, aF as LinkedAccountType, a as LinkedAccountWithMetadata, az as LinkedIn, aM as LinkedInOAuthWithMetadata, a$ as LoginMethodOrderOption, aj as MessageTypes, al as MoonpayConfig, am as MoonpayCurrencyCode, aX as MoonpayFundingConfig, an as MoonpayPaymentMethod, aW as NativeFundingConfig, ar as NonEmptyArray, a_ as Passkey, aR as PasskeyWithMetadata, aT as Phone, at as PhoneWithMetadata, aY as PriceDisplayOptions, P as PrivyErrorCode, ao as Quantity, ak as SmartWallet, e as SolanaCluster, l as SolanaFundingConfig, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, aD as Telegram, aP as TelegramWithMetadata, aB as Tiktok, aK as TiktokOAuthWithMetadata, ap as TransactionLog, aq as TransactionReceipt, aU as TransactionUIOptions, aw as Twitter, aH as TwitterOAuthWithMetadata, ai as TypedMessage, au as WalletWithMetadata } from './types-DRqchVAL.js';
3
+ import { c as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig, L as LoginMethod, a3 as ExternalWalletMetadata, a4 as TelegramAuthResult, a5 as TelegramWebAppData, a6 as OAuthUserInfo, a7 as SiwsMessageType, a8 as OAuthFlowState, a9 as LoginWithCode, aa as OtpFlowState, ab as PasskeyFlowState, ac as SiweFlowState, ad as BaseAccountSdkType, ae as UnsignedTransactionRequestWithChainId, af as BaseConnectedWalletType, C as ConnectedSolanaWallet, ag as SessionSignerInput, ah as TelegramAuthFlowState } from './types-koC7eIOP.js';
4
+ export { aA as Apple, aN as AppleOAuthWithMetadata, aV as ContractUIOptions, aE as CrossAppAccount, aQ as CrossAppAccountWithMetadata, ax as Discord, aI as DiscordOAuthWithMetadata, aS as Email, as as EmailWithMetadata, aZ as Farcaster, aO as FarcasterWithMetadata, ay as Github, aJ as GithubOAuthWithMetadata, av as Google, aG as GoogleOAuthWithMetadata, aC as Line, aL as LineOAuthWithMetadata, aF as LinkedAccountType, a as LinkedAccountWithMetadata, az as LinkedIn, aM as LinkedInOAuthWithMetadata, a$ as LoginMethodOrderOption, aj as MessageTypes, al as MoonpayConfig, am as MoonpayCurrencyCode, aX as MoonpayFundingConfig, an as MoonpayPaymentMethod, aW as NativeFundingConfig, ar as NonEmptyArray, a_ as Passkey, aR as PasskeyWithMetadata, aT as Phone, at as PhoneWithMetadata, aY as PriceDisplayOptions, P as PrivyErrorCode, ao as Quantity, ak as SmartWallet, e as SolanaCluster, l as SolanaFundingConfig, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, aD as Telegram, aP as TelegramWithMetadata, aB as Tiktok, aK as TiktokOAuthWithMetadata, ap as TransactionLog, aq as TransactionReceipt, aU as TransactionUIOptions, aw as Twitter, aH as TwitterOAuthWithMetadata, ai as TypedMessage, au as WalletWithMetadata } from './types-koC7eIOP.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import { AppKit } from '@reown/appkit';
@@ -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-yARRzx3f.js';
20
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-yARRzx3f.js';
19
+ import { P as PrivyEvents } from './useSolanaWallets-CDu74ZFA.js';
20
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CDu74ZFA.js';
21
21
  import * as viem_accounts from 'viem/accounts';
22
22
  import '@coinbase/wallet-sdk';
23
23
  import '@solana/wallet-adapter-base';
@@ -3551,6 +3551,18 @@ interface UseCrossAppAccountsInterface {
3551
3551
  sendTransaction: (tx: UnsignedTransactionRequestWithChainId, o: {
3552
3552
  address: string;
3553
3553
  }) => Promise<string>;
3554
+ /**
3555
+ * For users who have linked an account from another privy app, prompts the user to sign a transaction
3556
+ * with their embedded wallet from the linked privy app.
3557
+ *
3558
+ * This will redirect the user to a page on the target Privy app where they can sign the transaction.
3559
+ *
3560
+ * @param tx {UnsignedTransactionRequestWithChainId} the transaction to send
3561
+ * @param options.address {string} the address of the embedded wallet from the linked privy app
3562
+ */
3563
+ signTransaction: (tx: UnsignedTransactionRequestWithChainId, o: {
3564
+ address: string;
3565
+ }) => Promise<string>;
3554
3566
  }
3555
3567
  /**
3556
3568
  * Hook to use cross-app accounts
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import react__default from 'react';
3
- import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-DRqchVAL.js';
3
+ import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-koC7eIOP.js';
4
4
  import { SmartAccountClient } from 'permissionless';
5
5
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
6
6
  import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import react__default from 'react';
3
- import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-DRqchVAL.js';
3
+ import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-koC7eIOP.js';
4
4
  import { SmartAccountClient } from 'permissionless';
5
5
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
6
6
  import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
@@ -1,18 +1,19 @@
1
- import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-DRqchVAL.js';
2
- export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-DRqchVAL.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-yARRzx3f.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-yARRzx3f.js';
1
+ import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-koC7eIOP.js';
2
+ export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-koC7eIOP.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-CDu74ZFA.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CDu74ZFA.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';
8
8
  import { Transaction, VersionedTransaction, Cluster, SendOptions, TransactionSignature, Connection } from '@solana/web3.js';
9
9
  import EventEmitter from 'eventemitter3';
10
10
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
11
+ import { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
12
+ export { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
11
13
  import '@coinbase/wallet-sdk';
12
14
  import '@reown/appkit';
13
15
  import 'react';
14
16
  import 'viem';
15
- import '@privy-io/js-sdk-core';
16
17
  import '@privy-io/public-api';
17
18
  import '@base-org/account';
18
19
  import '@metamask/eth-sig-util';
@@ -127,6 +128,7 @@ declare class PrivyStandardWallet implements SolanaStandardWallet {
127
128
 
128
129
  /**
129
130
  * Use this hook to get Privy's implementation of the Standard Wallet interface.
131
+ * @deprecated use `useConnectedStandardSolanaWallets` instead.
130
132
  */
131
133
  interface UsePrivyStandardWalletInterface {
132
134
  /**
@@ -140,11 +142,13 @@ interface UsePrivyStandardWalletInterface {
140
142
  }
141
143
  /**
142
144
  * Use this hook to get Privy's implementation of the Standard Wallet interface.
145
+ * @deprecated use `useConnectedStandardSolanaWallets` instead.
143
146
  */
144
147
  declare function usePrivyStandardWallet(): UsePrivyStandardWalletInterface;
145
148
 
146
149
  /**
147
150
  * Use this hook to get the wallets that implement the Solana Standard Wallet interface.
151
+ * @deprecated use `useConnectedStandardSolanaWallets` instead.
148
152
  */
149
153
  interface UseSolanaStandardWalletsInterface {
150
154
  /**
@@ -156,6 +160,7 @@ interface UseSolanaStandardWalletsInterface {
156
160
  */
157
161
  wallets: SolanaStandardWallet[];
158
162
  }
163
+ /** @deprecated use `useConnectedStandardSolanaWallets` instead. */
159
164
  declare function useSolanaStandardWallets(): UseSolanaStandardWalletsInterface;
160
165
 
161
166
  /**
@@ -190,6 +195,9 @@ declare const useFundWallet: (callbacks?: PrivyEvents["fundSolanaWallet"]) => Us
190
195
 
191
196
  declare const useSolanaFundingPlugin: () => void;
192
197
 
198
+ /**
199
+ * @deprecated This plugin is no longer used, as Phantom now supports Solana Ledger signatures out of the box
200
+ */
193
201
  declare const useSolanaLedgerPlugin: () => void;
194
202
 
195
203
  /**
@@ -316,4 +324,53 @@ declare function useSignMessage(callbacks?: PrivyEvents['signSolanaMessage']): {
316
324
  }) => Promise<Uint8Array>;
317
325
  };
318
326
 
319
- export { PrivyStandardWallet, SolanaStandardWallet, SolanaTransactionReceipt, SupportedSolanaTransaction, type UseFundWalletInterface, type UseImportWalletInterface, type UsePrivyStandardWalletInterface, type UseSendTransactionInterface, type UseSignMessageInterface, type UseSignTransactionInterface, type UseSolanaStandardWalletsInterface, useFundWallet, useImportWallet, usePrivyStandardWallet, useSendTransaction, useSignMessage, useSignTransaction, useSolanaFundingPlugin, useSolanaLedgerPlugin, useSolanaStandardWallets };
327
+ /**
328
+ * Use this hook to get the wallets that implement the Solana Standard Wallet interface.
329
+ */
330
+ interface UseConnectedStandardWallets {
331
+ /**
332
+ * Whether the wallets are ready to be used.
333
+ */
334
+ ready: boolean;
335
+ /**
336
+ * The connected wallets.
337
+ */
338
+ wallets: ConnectedStandardSolanaWallet[];
339
+ }
340
+ declare function useConnectedStandardWallets(): UseConnectedStandardWallets;
341
+
342
+ interface UseCreateWalletInterface {
343
+ /**
344
+ * Creates a Solana embedded wallet for the current user.
345
+ *
346
+ * This method will error if the user already has an embedded wallet or if they
347
+ * exit in the middle of the flow.
348
+ *
349
+ * @returns Promise for the {@link Wallet} object for the newly created Solana embedded wallet
350
+ */
351
+ createWallet: (options?: CreateWalletOptions) => Promise<{
352
+ wallet: Wallet;
353
+ }>;
354
+ }
355
+ declare function useCreateWallet(): UseCreateWalletInterface;
356
+
357
+ /**
358
+ * Hook to export a Solana wallet.
359
+ */
360
+ interface UseExportWalletInterface {
361
+ /**
362
+ * Shows the user a Privy modal, from which they can copy their embedded solana wallet's private
363
+ * key for easy export to another wallet client (e.g. Phantom, Backpack). The private key is loaded
364
+ * on an iframe running on a separate domain from your app, meaning your app cannot access it.
365
+ *
366
+ * This method will error if the user is not authenticated or does not have an embedded solana wallet.
367
+ * @param options {@link {address: string}} (optional) wallet address to export the private key for
368
+ * @returns Promise that resolves once the user exits the modal
369
+ */
370
+ exportWallet: (options?: {
371
+ address: string;
372
+ }) => Promise<void>;
373
+ }
374
+ declare function useExportWallet(): UseExportWalletInterface;
375
+
376
+ export { PrivyStandardWallet, SolanaStandardWallet, SolanaTransactionReceipt, SupportedSolanaTransaction, type UseConnectedStandardWallets, type UseFundWalletInterface, type UseImportWalletInterface, type UsePrivyStandardWalletInterface, type UseSendTransactionInterface, type UseSignMessageInterface, type UseSignTransactionInterface, type UseSolanaStandardWalletsInterface, useConnectedStandardWallets, useCreateWallet, useExportWallet, useFundWallet, useImportWallet, usePrivyStandardWallet, useSendTransaction, useSignMessage, useSignTransaction, useSolanaFundingPlugin, useSolanaLedgerPlugin, useSolanaStandardWallets };
@@ -1,18 +1,19 @@
1
- import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-DRqchVAL.js';
2
- export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-DRqchVAL.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-yARRzx3f.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-yARRzx3f.js';
1
+ import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-koC7eIOP.js';
2
+ export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-koC7eIOP.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-CDu74ZFA.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CDu74ZFA.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';
8
8
  import { Transaction, VersionedTransaction, Cluster, SendOptions, TransactionSignature, Connection } from '@solana/web3.js';
9
9
  import EventEmitter from 'eventemitter3';
10
10
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
11
+ import { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
12
+ export { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
11
13
  import '@coinbase/wallet-sdk';
12
14
  import '@reown/appkit';
13
15
  import 'react';
14
16
  import 'viem';
15
- import '@privy-io/js-sdk-core';
16
17
  import '@privy-io/public-api';
17
18
  import '@base-org/account';
18
19
  import '@metamask/eth-sig-util';
@@ -127,6 +128,7 @@ declare class PrivyStandardWallet implements SolanaStandardWallet {
127
128
 
128
129
  /**
129
130
  * Use this hook to get Privy's implementation of the Standard Wallet interface.
131
+ * @deprecated use `useConnectedStandardSolanaWallets` instead.
130
132
  */
131
133
  interface UsePrivyStandardWalletInterface {
132
134
  /**
@@ -140,11 +142,13 @@ interface UsePrivyStandardWalletInterface {
140
142
  }
141
143
  /**
142
144
  * Use this hook to get Privy's implementation of the Standard Wallet interface.
145
+ * @deprecated use `useConnectedStandardSolanaWallets` instead.
143
146
  */
144
147
  declare function usePrivyStandardWallet(): UsePrivyStandardWalletInterface;
145
148
 
146
149
  /**
147
150
  * Use this hook to get the wallets that implement the Solana Standard Wallet interface.
151
+ * @deprecated use `useConnectedStandardSolanaWallets` instead.
148
152
  */
149
153
  interface UseSolanaStandardWalletsInterface {
150
154
  /**
@@ -156,6 +160,7 @@ interface UseSolanaStandardWalletsInterface {
156
160
  */
157
161
  wallets: SolanaStandardWallet[];
158
162
  }
163
+ /** @deprecated use `useConnectedStandardSolanaWallets` instead. */
159
164
  declare function useSolanaStandardWallets(): UseSolanaStandardWalletsInterface;
160
165
 
161
166
  /**
@@ -190,6 +195,9 @@ declare const useFundWallet: (callbacks?: PrivyEvents["fundSolanaWallet"]) => Us
190
195
 
191
196
  declare const useSolanaFundingPlugin: () => void;
192
197
 
198
+ /**
199
+ * @deprecated This plugin is no longer used, as Phantom now supports Solana Ledger signatures out of the box
200
+ */
193
201
  declare const useSolanaLedgerPlugin: () => void;
194
202
 
195
203
  /**
@@ -316,4 +324,53 @@ declare function useSignMessage(callbacks?: PrivyEvents['signSolanaMessage']): {
316
324
  }) => Promise<Uint8Array>;
317
325
  };
318
326
 
319
- export { PrivyStandardWallet, SolanaStandardWallet, SolanaTransactionReceipt, SupportedSolanaTransaction, type UseFundWalletInterface, type UseImportWalletInterface, type UsePrivyStandardWalletInterface, type UseSendTransactionInterface, type UseSignMessageInterface, type UseSignTransactionInterface, type UseSolanaStandardWalletsInterface, useFundWallet, useImportWallet, usePrivyStandardWallet, useSendTransaction, useSignMessage, useSignTransaction, useSolanaFundingPlugin, useSolanaLedgerPlugin, useSolanaStandardWallets };
327
+ /**
328
+ * Use this hook to get the wallets that implement the Solana Standard Wallet interface.
329
+ */
330
+ interface UseConnectedStandardWallets {
331
+ /**
332
+ * Whether the wallets are ready to be used.
333
+ */
334
+ ready: boolean;
335
+ /**
336
+ * The connected wallets.
337
+ */
338
+ wallets: ConnectedStandardSolanaWallet[];
339
+ }
340
+ declare function useConnectedStandardWallets(): UseConnectedStandardWallets;
341
+
342
+ interface UseCreateWalletInterface {
343
+ /**
344
+ * Creates a Solana embedded wallet for the current user.
345
+ *
346
+ * This method will error if the user already has an embedded wallet or if they
347
+ * exit in the middle of the flow.
348
+ *
349
+ * @returns Promise for the {@link Wallet} object for the newly created Solana embedded wallet
350
+ */
351
+ createWallet: (options?: CreateWalletOptions) => Promise<{
352
+ wallet: Wallet;
353
+ }>;
354
+ }
355
+ declare function useCreateWallet(): UseCreateWalletInterface;
356
+
357
+ /**
358
+ * Hook to export a Solana wallet.
359
+ */
360
+ interface UseExportWalletInterface {
361
+ /**
362
+ * Shows the user a Privy modal, from which they can copy their embedded solana wallet's private
363
+ * key for easy export to another wallet client (e.g. Phantom, Backpack). The private key is loaded
364
+ * on an iframe running on a separate domain from your app, meaning your app cannot access it.
365
+ *
366
+ * This method will error if the user is not authenticated or does not have an embedded solana wallet.
367
+ * @param options {@link {address: string}} (optional) wallet address to export the private key for
368
+ * @returns Promise that resolves once the user exits the modal
369
+ */
370
+ exportWallet: (options?: {
371
+ address: string;
372
+ }) => Promise<void>;
373
+ }
374
+ declare function useExportWallet(): UseExportWalletInterface;
375
+
376
+ export { PrivyStandardWallet, SolanaStandardWallet, SolanaTransactionReceipt, SupportedSolanaTransaction, type UseConnectedStandardWallets, type UseFundWalletInterface, type UseImportWalletInterface, type UsePrivyStandardWalletInterface, type UseSendTransactionInterface, type UseSignMessageInterface, type UseSignTransactionInterface, type UseSolanaStandardWalletsInterface, useConnectedStandardWallets, useCreateWallet, useExportWallet, useFundWallet, useImportWallet, usePrivyStandardWallet, useSendTransaction, useSignMessage, useSignTransaction, useSolanaFundingPlugin, useSolanaLedgerPlugin, useSolanaStandardWallets };
@@ -881,6 +881,7 @@ interface ConnectedWallet extends BaseConnectedEthereumWallet, PrivyConnectedWal
881
881
  }
882
882
  /**
883
883
  * Object representation of a connected Solana wallet for the user.
884
+ * @deprecated use `ConnectedStandardSolanaWallet` instead.
884
885
  */
885
886
  interface ConnectedSolanaWallet extends BaseConnectedSolanaWallet, PrivyConnectedWallet {
886
887
  /**
@@ -1621,8 +1622,11 @@ interface PrivyClientConfig {
1621
1622
  */
1622
1623
  disableAutomaticMigration?: boolean;
1623
1624
  /**
1624
- * @deprecated. Instead, use the server-driven configuration found in the Privy console: https://dashboard.privy.io/apps/YOUR_APP_ID/embedded. This client-side setting
1625
- * is currently honored, but will be fully removed in a future release.
1625
+ * @deprecated
1626
+ *
1627
+ * This client-side setting has no effect on TEE-execution wallets and will
1628
+ * be fully removed in a future release. Instead, use the server-driven
1629
+ * configuration found in the Privy dashbaord.
1626
1630
  *
1627
1631
  * If true, Privy will prompt users to create a password for their Privy embedded wallet.
1628
1632
  * If false, embedded wallets will be created without the need of password.
@@ -1970,7 +1974,7 @@ type PrivyPalette = {
1970
1974
  foregroundAccent: string;
1971
1975
  accent: string;
1972
1976
  accentLight: string;
1973
- accentLightest: string;
1977
+ accentHover: string;
1974
1978
  accentDark: string;
1975
1979
  accentDarkest: string;
1976
1980
  success: string;
@@ -1980,6 +1984,61 @@ type PrivyPalette = {
1980
1984
  successLight: string;
1981
1985
  error: string;
1982
1986
  errorLight: string;
1987
+ borderDefault: string;
1988
+ borderHover: string;
1989
+ borderFocus: string;
1990
+ borderError: string;
1991
+ borderSuccess: string;
1992
+ borderWarning: string;
1993
+ borderInfo: string;
1994
+ borderInteractive: string;
1995
+ borderInteractiveHover: string;
1996
+ backgroundHover: string;
1997
+ backgroundClicked: string;
1998
+ backgroundDisabled: string;
1999
+ backgroundInteractive: string;
2000
+ backgroundInteractiveHover: string;
2001
+ backgroundInteractiveClicked: string;
2002
+ backgroundInteractiveDisabled: string;
2003
+ foregroundHover: string;
2004
+ foregroundClicked: string;
2005
+ foregroundDisabled: string;
2006
+ foregroundInteractive: string;
2007
+ foregroundInteractiveHover: string;
2008
+ warningDark: string;
2009
+ errorDark: string;
2010
+ successBg: string;
2011
+ errorBg: string;
2012
+ errorBgHover: string;
2013
+ warnBg: string;
2014
+ infoBg: string;
2015
+ infoBgHover: string;
2016
+ accentHasGoodContrast: string;
2017
+ linkNavigationColor: string;
2018
+ linkNavigationDecoration: string;
2019
+ iconDefault: string;
2020
+ iconMuted: string;
2021
+ iconSubtle: string;
2022
+ iconInverse: string;
2023
+ iconSuccess: string;
2024
+ iconWarning: string;
2025
+ iconError: string;
2026
+ iconInteractive: string;
2027
+ iconDefaultHover: string;
2028
+ iconMutedHover: string;
2029
+ iconSubtleHover: string;
2030
+ iconDefaultClicked: string;
2031
+ iconMutedClicked: string;
2032
+ iconSubtleClicked: string;
2033
+ iconDefaultDisabled: string;
2034
+ iconMutedDisabled: string;
2035
+ iconSubtleDisabled: string;
2036
+ iconErrorHover: string;
2037
+ iconInteractiveHover: string;
2038
+ iconErrorClicked: string;
2039
+ iconInteractiveClicked: string;
2040
+ iconMutedDisabledAlt: string;
2041
+ iconSubtleDisabledAlt: string;
1983
2042
  };
1984
2043
  type EmbeddedWalletCreateOnLoginConfig = 'users-without-wallets' | 'all-users' | 'off';
1985
2044
  type OtpFlowState = {
@@ -881,6 +881,7 @@ interface ConnectedWallet extends BaseConnectedEthereumWallet, PrivyConnectedWal
881
881
  }
882
882
  /**
883
883
  * Object representation of a connected Solana wallet for the user.
884
+ * @deprecated use `ConnectedStandardSolanaWallet` instead.
884
885
  */
885
886
  interface ConnectedSolanaWallet extends BaseConnectedSolanaWallet, PrivyConnectedWallet {
886
887
  /**
@@ -1621,8 +1622,11 @@ interface PrivyClientConfig {
1621
1622
  */
1622
1623
  disableAutomaticMigration?: boolean;
1623
1624
  /**
1624
- * @deprecated. Instead, use the server-driven configuration found in the Privy console: https://dashboard.privy.io/apps/YOUR_APP_ID/embedded. This client-side setting
1625
- * is currently honored, but will be fully removed in a future release.
1625
+ * @deprecated
1626
+ *
1627
+ * This client-side setting has no effect on TEE-execution wallets and will
1628
+ * be fully removed in a future release. Instead, use the server-driven
1629
+ * configuration found in the Privy dashbaord.
1626
1630
  *
1627
1631
  * If true, Privy will prompt users to create a password for their Privy embedded wallet.
1628
1632
  * If false, embedded wallets will be created without the need of password.
@@ -1970,7 +1974,7 @@ type PrivyPalette = {
1970
1974
  foregroundAccent: string;
1971
1975
  accent: string;
1972
1976
  accentLight: string;
1973
- accentLightest: string;
1977
+ accentHover: string;
1974
1978
  accentDark: string;
1975
1979
  accentDarkest: string;
1976
1980
  success: string;
@@ -1980,6 +1984,61 @@ type PrivyPalette = {
1980
1984
  successLight: string;
1981
1985
  error: string;
1982
1986
  errorLight: string;
1987
+ borderDefault: string;
1988
+ borderHover: string;
1989
+ borderFocus: string;
1990
+ borderError: string;
1991
+ borderSuccess: string;
1992
+ borderWarning: string;
1993
+ borderInfo: string;
1994
+ borderInteractive: string;
1995
+ borderInteractiveHover: string;
1996
+ backgroundHover: string;
1997
+ backgroundClicked: string;
1998
+ backgroundDisabled: string;
1999
+ backgroundInteractive: string;
2000
+ backgroundInteractiveHover: string;
2001
+ backgroundInteractiveClicked: string;
2002
+ backgroundInteractiveDisabled: string;
2003
+ foregroundHover: string;
2004
+ foregroundClicked: string;
2005
+ foregroundDisabled: string;
2006
+ foregroundInteractive: string;
2007
+ foregroundInteractiveHover: string;
2008
+ warningDark: string;
2009
+ errorDark: string;
2010
+ successBg: string;
2011
+ errorBg: string;
2012
+ errorBgHover: string;
2013
+ warnBg: string;
2014
+ infoBg: string;
2015
+ infoBgHover: string;
2016
+ accentHasGoodContrast: string;
2017
+ linkNavigationColor: string;
2018
+ linkNavigationDecoration: string;
2019
+ iconDefault: string;
2020
+ iconMuted: string;
2021
+ iconSubtle: string;
2022
+ iconInverse: string;
2023
+ iconSuccess: string;
2024
+ iconWarning: string;
2025
+ iconError: string;
2026
+ iconInteractive: string;
2027
+ iconDefaultHover: string;
2028
+ iconMutedHover: string;
2029
+ iconSubtleHover: string;
2030
+ iconDefaultClicked: string;
2031
+ iconMutedClicked: string;
2032
+ iconSubtleClicked: string;
2033
+ iconDefaultDisabled: string;
2034
+ iconMutedDisabled: string;
2035
+ iconSubtleDisabled: string;
2036
+ iconErrorHover: string;
2037
+ iconInteractiveHover: string;
2038
+ iconErrorClicked: string;
2039
+ iconInteractiveClicked: string;
2040
+ iconMutedDisabledAlt: string;
2041
+ iconSubtleDisabledAlt: string;
1983
2042
  };
1984
2043
  type EmbeddedWalletCreateOnLoginConfig = 'users-without-wallets' | 'all-users' | 'off';
1985
2044
  type OtpFlowState = {
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-DRqchVAL.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-koC7eIOP.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-DRqchVAL.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-koC7eIOP.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, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-DRqchVAL.js';
2
+ import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-koC7eIOP.js';
3
3
  import { MouseEvent } from 'react';
4
4
 
5
5
  /**
@@ -381,6 +381,8 @@ interface PrivyEvents {
381
381
  *
382
382
  * @returns wallets {ConnectedSolanaWallet[]} an array of connected Solana wallets
383
383
  * @returns createWallet {() => Promise<Wallet>} an method to create an embedded Solana wallet.
384
+ *
385
+ * @deprecated use `useConnectedStandardSolanaWallets` instead.
384
386
  */
385
387
  interface UseSolanaWalletsInterface {
386
388
  /**
@@ -419,6 +421,7 @@ interface UseSolanaWalletsInterface {
419
421
  address: string;
420
422
  }) => Promise<void>;
421
423
  }
424
+ /** @deprecated use `useConnectedStandardSolanaWallets` instead. */
422
425
  declare const useSolanaWallets: () => UseSolanaWalletsInterface;
423
426
 
424
427
  export { type CallbackError as C, type PrivyEvents as P, type UseSolanaWalletsInterface as U, useSolanaWallets as u };
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-DRqchVAL.js';
2
+ import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-koC7eIOP.js';
3
3
  import { MouseEvent } from 'react';
4
4
 
5
5
  /**
@@ -381,6 +381,8 @@ interface PrivyEvents {
381
381
  *
382
382
  * @returns wallets {ConnectedSolanaWallet[]} an array of connected Solana wallets
383
383
  * @returns createWallet {() => Promise<Wallet>} an method to create an embedded Solana wallet.
384
+ *
385
+ * @deprecated use `useConnectedStandardSolanaWallets` instead.
384
386
  */
385
387
  interface UseSolanaWalletsInterface {
386
388
  /**
@@ -419,6 +421,7 @@ interface UseSolanaWalletsInterface {
419
421
  address: string;
420
422
  }) => Promise<void>;
421
423
  }
424
+ /** @deprecated use `useConnectedStandardSolanaWallets` instead. */
422
425
  declare const useSolanaWallets: () => UseSolanaWalletsInterface;
423
426
 
424
427
  export { type CallbackError as C, type PrivyEvents as P, type UseSolanaWalletsInterface as U, useSolanaWallets as u };
@@ -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 c}from"viem/chains";import{u as s,g as l,c as p}from"./use-sign-with-user-signer-DYa7HrQH.mjs";import{o as d,w as m,e as u,a as h,b0 as y,b1 as I,b2 as g,x as f}from"./privy-provider-BkunMgHl.mjs";import{u as v}from"./internal-context-qdNgTV5f.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-ScQvzONo.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-DCwuPDUk.mjs";import"ofetch";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/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"zustand";import"@headlessui/react";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@walletconnect/ethereum-provider";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/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"@heroicons/react/24/outline";import"@tanstack/react-virtual";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"@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}=s(),{hideWalletUIs:P,openPrivyModal:S,chains:b,appId:A,rpcConfig:W,client:M}=v(),k=d(),{wallets:F}=m(),{setModalData:x}=u(),q=l(T),R=!!q&&p(q),_=async(o=c.id)=>{let s=w(F);if(!s)throw Error("No connected wallet found");let l="string"==typeof o?r(o):o;if(![c.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let p=b.find((e=>e.id===l));if(!p)throw Error("Chain not configured");await s.switchChain(p.id);let d=await s.getEthereumProvider(),m=t({account:s.address,transport:n(d)}),u=a({address:s.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:p,transport:i(f(p,W,A)),publicTransport:i(f(p,W,A)),signer:u})};return{signMessage:async({message:e},o)=>{let r=await _(o);return new Promise((async(o,t)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);P.current=!0,x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.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}}}),S(I)})).finally((()=>{P.current=!1}))},signTypedData:async(e,o)=>{let r=await _(o);return new Promise((async(o,t)=>{P.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.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}}}),S(I)})).finally((()=>{P.current=!1}))},sendTransaction:async e=>{let r=await _(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:c,entropyIdVerifier:s}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:c,entropyIdVerifier:s,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:c,entropyIdVerifier:s,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);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}}}),S(I)})).finally((()=>{P.current=!1}))},signTransaction:async e=>{let r=await _(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:c,entropyIdVerifier:s}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:c,entropyIdVerifier:s,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:c,entropyIdVerifier:s,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);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:!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);return r.signTransaction(i)},onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(I)})).finally((()=>{P.current=!1}))}}}export{T as useAbstractSmartWallets};
1
+ import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as t}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as o,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,g as l,c as p}from"./use-sign-with-user-signer-u7zZ9cLA.mjs";import{o as d,w as m,e as u,a as h,a$ as y,b0 as g,b1 as I,x as f}from"./privy-provider-CoOSBvfN.mjs";import{u as v}from"./internal-context-qdNgTV5f.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-TO2YIcTb.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-DCwuPDUk.mjs";import"ofetch";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/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"zustand";import"@headlessui/react";import"lucide-react";import"@walletconnect/ethereum-provider";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";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/solid/CheckCircleIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";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/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";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:P,openPrivyModal:S,chains:b,appId:A,rpcConfig:W,client:M}=v(),k=d(),{wallets:F}=m(),{setModalData:x}=u(),_=l(T),q=!!_&&p(_),E=async(t=s.id)=>{let c=w(F);if(!c)throw Error("No connected wallet found");let l="string"==typeof t?r(t):t;if(![s.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let p=b.find((e=>e.id===l));if(!p)throw Error("Chain not configured");await c.switchChain(p.id);let d=await c.getEthereumProvider(),m=o({account:c.address,transport:n(d)}),u=a({address:c.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:p,transport:i(f(p,W,A)),publicTransport:i(f(p,W,A)),signer:u})};return{signMessage:async({message:e},t)=>{let r=await E(t);return new Promise((async(t,o)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);P.current=!0,x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTypedData:async(e,t)=>{let r=await E(t);return new Promise((async(t,o)=>{P.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},sendTransaction:async e=>{let r=await E(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:I,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:o,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 o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);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}}}),S(g)})).finally((()=>{P.current=!1}))},signTransaction:async e=>{let r=await E(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:I,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:o,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 o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);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:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);return r.signTransaction(i)},onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))}}}export{T as useAbstractSmartWallets};
@@ -1 +1 @@
1
- import{useMemo as r}from"react";import{create as e,rawSign as t}from"@privy-io/js-sdk-core";import{u as a}from"./internal-context-qdNgTV5f.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-DYa7HrQH.mjs";import"viem";const u=()=>{let{refreshSessionAndUser:t,privy:i}=a();return r((()=>({async createWallet(r){let a=await e(i,{request:{chain_type:r.chainType}}),s=await t();if(!s)throw Error("User must be authenticated before creating a Privy wallet");return{user:s,wallet:a}}})),[t,i])},d=()=>{let{user:e}=i(),{privy:u}=a(),{signWithUserSigner:d}=s();return r((()=>({async signRawHash({address:r,chainType:a,hash:i}){if(!e)throw Error("User must be authenticated before signing");let s=n(e,a).filter((r=>o(r))).find((e=>e.address===r));if(!s)throw Error("Wallet not found");let h=await t(u,d,{wallet_id:s.id,params:{hash:i}});if(h.data&&"signature"in h.data&&"hex"===h.data.encoding)return{signature:h.data.signature};throw Error("Failed to sign")}})),[u,d,e])};export{u as useCreateWallet,d as useSignRawHash};
1
+ import{useMemo as r}from"react";import{create as e,rawSign as t}from"@privy-io/js-sdk-core";import{u as a}from"./internal-context-qdNgTV5f.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-u7zZ9cLA.mjs";import"viem";const u=()=>{let{refreshSessionAndUser:t,privy:i}=a();return r((()=>({async createWallet(r){let a=await e(i,{request:{chain_type:r.chainType}}),s=await t();if(!s)throw Error("User must be authenticated before creating a Privy wallet");return{user:s,wallet:a}}})),[t,i])},d=()=>{let{user:e}=i(),{privy:u}=a(),{signWithUserSigner:d}=s();return r((()=>({async signRawHash({address:r,chainType:a,hash:i}){if(!e)throw Error("User must be authenticated before signing");let s=n(e,a).filter((r=>o(r))).find((e=>e.address===r));if(!s)throw Error("Wallet not found");let h=await t(u,d,{wallet_id:s.id,params:{hash:i}});if(h.data&&"signature"in h.data&&"hex"===h.data.encoding)return{signature:h.data.signature};throw Error("Failed to sign")}})),[u,d,e])};export{u as useCreateWallet,d as useSignRawHash};