@privy-io/react-auth 2.4.4 → 2.4.6-beta-20250221224248
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/{importWallet-DnBwVibu.js → importWallet-CMgoHWDA.js} +1 -1
- package/dist/cjs/index.js +21 -21
- package/dist/cjs/{prepareFundingModalData-Cb2nv4dG.js → prepareFundingModalData-COePk3KL.js} +1 -1
- package/dist/cjs/{smart-wallets-CBoK3FJE.js → smart-wallets-D8hYncDe.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +2 -2
- package/dist/cjs/useActiveWallet-DTkcjOZ9.js +5 -0
- package/dist/cjs/{useFundWallet-BhlJigGm.js → useFundWallet-jQGkRuiD.js} +1 -1
- package/dist/cjs/useWallets-CBV_3oCv.js +1 -0
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +12 -7
- package/dist/dts/index.d.ts +12 -7
- 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-vsXbDWiC.d.mts → types-VtXkq8Wj.d.mts} +25 -4
- package/dist/dts/{types-vsXbDWiC.d.ts → types-VtXkq8Wj.d.ts} +25 -4
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{useSolanaWallets-xlc6faTU.d.mts → useSolanaWallets-Du5sSdUt.d.mts} +1 -1
- package/dist/dts/{useSolanaWallets-xlc6faTU.d.ts → useSolanaWallets-Du5sSdUt.d.ts} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/{importWallet-C-D57oRC.mjs → importWallet-CNqmURb-.mjs} +1 -1
- package/dist/esm/index.mjs +21 -21
- package/dist/esm/{prepareFundingModalData-CFokVw8r.mjs → prepareFundingModalData-g3-cAzDW.mjs} +1 -1
- package/dist/esm/{smart-wallets-BvnCDN7T.mjs → smart-wallets-DodujIvL.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/useActiveWallet-Ci9-tWXQ.mjs +5 -0
- package/dist/esm/{useFundWallet-DAS_ErNP.mjs → useFundWallet-CCgPgTax.mjs} +1 -1
- package/dist/esm/useWallets-DlJamWit.mjs +1 -0
- package/package.json +4 -4
- package/dist/cjs/useActiveWallet-CcpSCPoL.js +0 -5
- package/dist/cjs/useWallets-y1wsvg5v.js +0 -1
- package/dist/esm/useActiveWallet-BzMUJJr8.mjs +0 -5
- package/dist/esm/useWallets-0lCjD0UF.mjs +0 -1
|
@@ -501,7 +501,7 @@ type LoginWithCode = {
|
|
|
501
501
|
};
|
|
502
502
|
declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
|
|
503
503
|
type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
|
|
504
|
-
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "crypto.com_wallet_extension", "crypto.com_onchain"];
|
|
504
|
+
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "crypto.com_wallet_extension", "crypto.com_onchain"];
|
|
505
505
|
type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
|
|
506
506
|
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet"];
|
|
507
507
|
type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
@@ -521,7 +521,7 @@ type WalletBranding = {
|
|
|
521
521
|
id: string;
|
|
522
522
|
icon?: string | EmbeddedSVG;
|
|
523
523
|
};
|
|
524
|
-
type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'guest';
|
|
524
|
+
type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'signer' | 'guest';
|
|
525
525
|
/** @ignore */
|
|
526
526
|
interface LinkMetadata {
|
|
527
527
|
/** Account type, most commonly useful when filtering through linkedAccounts */
|
|
@@ -548,6 +548,13 @@ type MoonpayFundingConfig = {
|
|
|
548
548
|
* Config for preferred credit card provider. We will default to using this method first if available.
|
|
549
549
|
*/
|
|
550
550
|
type PreferredCardProvider = 'coinbase' | 'moonpay';
|
|
551
|
+
/**
|
|
552
|
+
* Configuration for the funding flow UIs.
|
|
553
|
+
*/
|
|
554
|
+
type FundingUiConfig = {
|
|
555
|
+
receiveFundsTitle?: string;
|
|
556
|
+
receiveFundsSubtitle?: string;
|
|
557
|
+
};
|
|
551
558
|
/**
|
|
552
559
|
* Configuration for Solana funding
|
|
553
560
|
*/
|
|
@@ -564,6 +571,8 @@ type SolanaFundingConfig = {
|
|
|
564
571
|
/** The preferred card provider for funding */
|
|
565
572
|
preferredProvider?: PreferredCardProvider;
|
|
566
573
|
};
|
|
574
|
+
/** Customization for the funding UIs */
|
|
575
|
+
uiConfig?: FundingUiConfig;
|
|
567
576
|
};
|
|
568
577
|
/**
|
|
569
578
|
* Configuration for native funding amount.
|
|
@@ -576,6 +585,8 @@ type NativeFundingConfig = {
|
|
|
576
585
|
/** The preferred card onramp for funding */
|
|
577
586
|
preferredProvider?: PreferredCardProvider;
|
|
578
587
|
};
|
|
588
|
+
/** Customization for the funding UIs */
|
|
589
|
+
uiConfig?: FundingUiConfig;
|
|
579
590
|
} | {
|
|
580
591
|
chain?: ChainLikeWithId;
|
|
581
592
|
amount: string;
|
|
@@ -587,6 +598,8 @@ type NativeFundingConfig = {
|
|
|
587
598
|
/** The preferred card onramp for funding */
|
|
588
599
|
preferredProvider?: PreferredCardProvider;
|
|
589
600
|
};
|
|
601
|
+
/** Customization for the funding UIs */
|
|
602
|
+
uiConfig?: FundingUiConfig;
|
|
590
603
|
};
|
|
591
604
|
/**
|
|
592
605
|
* Optional configuration parameter for the fiat on-ramp.
|
|
@@ -949,6 +962,9 @@ interface CrossAppAccount {
|
|
|
949
962
|
providerApp: ProviderAppMetadata;
|
|
950
963
|
subject: string;
|
|
951
964
|
}
|
|
965
|
+
interface SignerAccount {
|
|
966
|
+
publicKey: string;
|
|
967
|
+
}
|
|
952
968
|
/** Object representation of a user's email, with additional metadata for advanced use cases. */
|
|
953
969
|
interface EmailWithMetadata extends LinkMetadata, Email {
|
|
954
970
|
/** Denotes that this is an email account. */
|
|
@@ -1038,10 +1054,15 @@ interface CrossAppAccountWithMetadata extends LinkMetadata, CrossAppAccount {
|
|
|
1038
1054
|
/** Denotes that this is a cross-app account */
|
|
1039
1055
|
type: 'cross_app';
|
|
1040
1056
|
}
|
|
1057
|
+
/** Object representation of a user's signer, with additional metadata for advanced use cases. */
|
|
1058
|
+
interface SignerAccountWithMetadata extends LinkMetadata, SignerAccount {
|
|
1059
|
+
/** Denotes that this is a signer */
|
|
1060
|
+
type: 'signer';
|
|
1061
|
+
}
|
|
1041
1062
|
/**
|
|
1042
1063
|
* Object representation of a user's linked accounts
|
|
1043
1064
|
*/
|
|
1044
|
-
type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata;
|
|
1065
|
+
type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata | SignerAccountWithMetadata;
|
|
1045
1066
|
interface User {
|
|
1046
1067
|
/** The Privy-issued DID for the user. If you need to store additional information
|
|
1047
1068
|
* about a user, you can use this DID to reference them. */
|
|
@@ -1201,7 +1222,7 @@ type PriceDisplayOptions = {
|
|
|
1201
1222
|
};
|
|
1202
1223
|
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1203
1224
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1204
|
-
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1225
|
+
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1205
1226
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
1206
1227
|
type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | `privy:${string}` | 'farcaster' | 'telegram';
|
|
1207
1228
|
type ExternalWalletsConfig = {
|
|
@@ -501,7 +501,7 @@ type LoginWithCode = {
|
|
|
501
501
|
};
|
|
502
502
|
declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
|
|
503
503
|
type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
|
|
504
|
-
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "crypto.com_wallet_extension", "crypto.com_onchain"];
|
|
504
|
+
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "crypto.com_wallet_extension", "crypto.com_onchain"];
|
|
505
505
|
type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
|
|
506
506
|
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet"];
|
|
507
507
|
type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
@@ -521,7 +521,7 @@ type WalletBranding = {
|
|
|
521
521
|
id: string;
|
|
522
522
|
icon?: string | EmbeddedSVG;
|
|
523
523
|
};
|
|
524
|
-
type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'guest';
|
|
524
|
+
type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'signer' | 'guest';
|
|
525
525
|
/** @ignore */
|
|
526
526
|
interface LinkMetadata {
|
|
527
527
|
/** Account type, most commonly useful when filtering through linkedAccounts */
|
|
@@ -548,6 +548,13 @@ type MoonpayFundingConfig = {
|
|
|
548
548
|
* Config for preferred credit card provider. We will default to using this method first if available.
|
|
549
549
|
*/
|
|
550
550
|
type PreferredCardProvider = 'coinbase' | 'moonpay';
|
|
551
|
+
/**
|
|
552
|
+
* Configuration for the funding flow UIs.
|
|
553
|
+
*/
|
|
554
|
+
type FundingUiConfig = {
|
|
555
|
+
receiveFundsTitle?: string;
|
|
556
|
+
receiveFundsSubtitle?: string;
|
|
557
|
+
};
|
|
551
558
|
/**
|
|
552
559
|
* Configuration for Solana funding
|
|
553
560
|
*/
|
|
@@ -564,6 +571,8 @@ type SolanaFundingConfig = {
|
|
|
564
571
|
/** The preferred card provider for funding */
|
|
565
572
|
preferredProvider?: PreferredCardProvider;
|
|
566
573
|
};
|
|
574
|
+
/** Customization for the funding UIs */
|
|
575
|
+
uiConfig?: FundingUiConfig;
|
|
567
576
|
};
|
|
568
577
|
/**
|
|
569
578
|
* Configuration for native funding amount.
|
|
@@ -576,6 +585,8 @@ type NativeFundingConfig = {
|
|
|
576
585
|
/** The preferred card onramp for funding */
|
|
577
586
|
preferredProvider?: PreferredCardProvider;
|
|
578
587
|
};
|
|
588
|
+
/** Customization for the funding UIs */
|
|
589
|
+
uiConfig?: FundingUiConfig;
|
|
579
590
|
} | {
|
|
580
591
|
chain?: ChainLikeWithId;
|
|
581
592
|
amount: string;
|
|
@@ -587,6 +598,8 @@ type NativeFundingConfig = {
|
|
|
587
598
|
/** The preferred card onramp for funding */
|
|
588
599
|
preferredProvider?: PreferredCardProvider;
|
|
589
600
|
};
|
|
601
|
+
/** Customization for the funding UIs */
|
|
602
|
+
uiConfig?: FundingUiConfig;
|
|
590
603
|
};
|
|
591
604
|
/**
|
|
592
605
|
* Optional configuration parameter for the fiat on-ramp.
|
|
@@ -949,6 +962,9 @@ interface CrossAppAccount {
|
|
|
949
962
|
providerApp: ProviderAppMetadata;
|
|
950
963
|
subject: string;
|
|
951
964
|
}
|
|
965
|
+
interface SignerAccount {
|
|
966
|
+
publicKey: string;
|
|
967
|
+
}
|
|
952
968
|
/** Object representation of a user's email, with additional metadata for advanced use cases. */
|
|
953
969
|
interface EmailWithMetadata extends LinkMetadata, Email {
|
|
954
970
|
/** Denotes that this is an email account. */
|
|
@@ -1038,10 +1054,15 @@ interface CrossAppAccountWithMetadata extends LinkMetadata, CrossAppAccount {
|
|
|
1038
1054
|
/** Denotes that this is a cross-app account */
|
|
1039
1055
|
type: 'cross_app';
|
|
1040
1056
|
}
|
|
1057
|
+
/** Object representation of a user's signer, with additional metadata for advanced use cases. */
|
|
1058
|
+
interface SignerAccountWithMetadata extends LinkMetadata, SignerAccount {
|
|
1059
|
+
/** Denotes that this is a signer */
|
|
1060
|
+
type: 'signer';
|
|
1061
|
+
}
|
|
1041
1062
|
/**
|
|
1042
1063
|
* Object representation of a user's linked accounts
|
|
1043
1064
|
*/
|
|
1044
|
-
type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata;
|
|
1065
|
+
type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata | SignerAccountWithMetadata;
|
|
1045
1066
|
interface User {
|
|
1046
1067
|
/** The Privy-issued DID for the user. If you need to store additional information
|
|
1047
1068
|
* about a user, you can use this DID to reference them. */
|
|
@@ -1201,7 +1222,7 @@ type PriceDisplayOptions = {
|
|
|
1201
1222
|
};
|
|
1202
1223
|
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1203
1224
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1204
|
-
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1225
|
+
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1205
1226
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
1206
1227
|
type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | `privy:${string}` | 'farcaster' | 'telegram';
|
|
1207
1228
|
type ExternalWalletsConfig = {
|
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, C as Chain } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-VtXkq8Wj.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@solana/wallet-adapter-base';
|
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, C as Chain } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-VtXkq8Wj.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@solana/wallet-adapter-base';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-
|
|
1
|
+
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, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-VtXkq8Wj.js';
|
|
2
2
|
import { MouseEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-
|
|
1
|
+
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, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-VtXkq8Wj.js';
|
|
2
2
|
import { MouseEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{hexToNumber as n,createWalletClient as r,custom as a,http as t}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{r as o,E as c,u as l,ac as d,M as p}from"./useWallets-
|
|
1
|
+
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{hexToNumber as n,createWalletClient as r,custom as a,http as t}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{r as o,E as c,u as l,ac as d,M as p}from"./useWallets-DlJamWit.mjs";import{u as m}from"./internal-context-DBDJ7qsa.mjs";import{a as E}from"./getPublicClient-BghjDv1y.mjs";import{g as u}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as y}from"./smart-wallets-DodujIvL.mjs";import"viem/utils";import"react/jsx-runtime";import"react";import"tinycolor2";import"ofetch";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";import"@privy-io/js-sdk-core";function g(){let{user:g}=o(),{hideWalletUIs:f,openPrivyModal:I,chains:T,appId:C,rpcConfig:N}=m(),{wallets:D}=c(),{setModalData:_}=l(),h=async(o=s.id)=>{let c=u(D);if(!c)throw Error("No connected wallet found");let l="string"==typeof o?n(o):o;if(![s.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let d=T.find((e=>e.id===l));if(!d)throw Error("Chain not configured");await c.switchChain(d.id);let p=await c.getEthereumProvider(),m=r({account:c.address,transport:a(p)}),y=i({address:c.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:d,transport:t(E(d,N,C)),publicTransport:t(E(d,N,C)),signer:y})};return{signMessage:async({message:e},n)=>{let r=await h(n);return new Promise((async(n,a)=>{let{entropyId:t,entropyIdVerifier:i}=d(g);f.current=!0,_({connectWallet:{entropyId:t,entropyIdVerifier:i,onCompleteNavigateTo:p.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>n(e),onFailure:a,uiOptions:{isCancellable:!0}}}),I(p.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{f.current=!1}))},signTypedData:async(e,n)=>{let r=await h(n);return new Promise((async(n,a)=>{f.current=!0;let{entropyId:t,entropyIdVerifier:i}=d(g);_({connectWallet:{entropyId:t,entropyIdVerifier:i,onCompleteNavigateTo:p.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>n(e),onFailure:a,uiOptions:{isCancellable:!0}}}),I(p.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{f.current=!1}))},sendTransaction:async e=>{let n=await h(e.chainId),r=[],a="calls"in e&&void 0!==e.calls;return r=a?[...e.calls]:[e],new Promise((async(t,i)=>{f.current=!0;let{entropyId:s,entropyIdVerifier:o}=d(g);_({connectWallet:{entropyId:s,entropyIdVerifier:o,onCompleteNavigateTo:p.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:y({calls:r,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:o,transactingWallet:{address:n.account.address,walletIndex:null},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>a?n.sendTransactionBatch(e):n.sendTransaction(e),onSuccess:e=>t(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),I(p.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{f.current=!1}))},signTransaction:async e=>{let n=await h(e.chainId),r=[],a="calls"in e&&void 0!==e.calls;return r=a?[...e.calls]:[e],new Promise((async(t,i)=>{f.current=!0;let{entropyId:s,entropyIdVerifier:o}=d(g);_({connectWallet:{entropyId:s,entropyIdVerifier:o,onCompleteNavigateTo:p.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:y({calls:r,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:o,transactingWallet:{address:n.account.address,walletIndex:null},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>{if(!a)return n.signTransaction(e);throw Error("Batch transactions not supported for signing")},onSuccess:e=>t(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),I(p.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{f.current=!1}))}}}export{g as useAbstractSmartWallets};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as e,a6 as t}from"./useWallets-
|
|
1
|
+
import{a0 as e,a6 as t}from"./useWallets-DlJamWit.mjs";import{a,P as r}from"./internal-context-DBDJ7qsa.mjs";const i=async({emitPrivyEvent:i,getAccessToken:n,initializeWalletProxy:o,refreshSessionAndUser:s,user:l},{privateKey:c,chainType:E})=>{if(!l)throw i("linkAccount","onError",a.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new r("User must be authenticated before linking an account.");let[T,m]=await Promise.all([n(),o(15e3)]);if(!m||!T)throw i("linkAccount","onError",a.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new r("User must be authenticated before linking an account.");await m.importWallet({privateKey:c,accessToken:T,chainType:E});let u=await s(),w="solana"===E?e(u):t(u);if(!w)throw i("createWallet","onError",a.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return i("createWallet","onSuccess",{wallet:w}),w};export{i};
|