@privy-io/react-auth 1.95.0 → 1.95.1-beta-20241126141647
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/getEmbeddedConnectedWallet-DTU4T9TJ.js +1 -0
- package/dist/cjs/index.js +303 -297
- package/dist/cjs/modal-context-B_8w7Elw.js +1 -0
- package/dist/cjs/prepareFundingModalData-CZXplSt1.js +1 -0
- package/dist/cjs/privy-context-0bw-jknu.js +1 -0
- package/dist/cjs/smart-wallets-CxFh-TEr.js +1 -0
- 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/{useFundWallet-BB3gPFUC.js → useFundWallet-CIzNyAop.js} +3 -3
- package/dist/cjs/useWallets-DxTjIdHp.js +1 -0
- package/dist/dts/index.d.mts +4 -4
- package/dist/dts/index.d.ts +4 -4
- package/dist/dts/solana.d.mts +79 -4
- package/dist/dts/solana.d.ts +79 -4
- package/dist/dts/{types-BwcPm4mZ.d.mts → types-CIYA8UPe.d.mts} +1 -1
- package/dist/dts/{types-BwcPm4mZ.d.ts → types-CIYA8UPe.d.ts} +1 -1
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{solana-D5xAHDt7.d.mts → useFundSolanaWallet-B_Whp-i8.d.mts} +1 -1
- package/dist/dts/{solana-D5xAHDt7.d.ts → useFundSolanaWallet-B_Whp-i8.d.ts} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/getEmbeddedConnectedWallet-CSSBWE2p.mjs +1 -0
- package/dist/esm/index.mjs +309 -303
- package/dist/esm/modal-context-BcAxRsKM.mjs +1 -0
- package/dist/esm/prepareFundingModalData-DLNUPmxV.mjs +1 -0
- package/dist/esm/privy-context-ClSNNrGx.mjs +1 -0
- package/dist/esm/smart-wallets-gB49DQ_8.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +8 -8
- package/dist/esm/{useFundWallet-6H7b2rIK.mjs → useFundWallet-CIiK2SOL.mjs} +6 -6
- package/dist/esm/useWallets-iokhh9fd.mjs +1 -0
- package/package.json +1 -1
- package/dist/cjs/getEmbeddedConnectedWallet-Tuk9bnmY.js +0 -1
- package/dist/cjs/privy-context-Cyf8aoOj.js +0 -1
- package/dist/cjs/smart-wallets-BL937Da7.js +0 -1
- package/dist/cjs/useSolanaWallets-X3yIJO4K.js +0 -1
- package/dist/cjs/useWallets-D4nE-6sP.js +0 -1
- package/dist/esm/getEmbeddedConnectedWallet-DqeO4I_G.mjs +0 -1
- package/dist/esm/privy-context-CrcnzDDK.mjs +0 -1
- package/dist/esm/smart-wallets-kNpmh5jl.mjs +0 -1
- package/dist/esm/useSolanaWallets-ByOYtyDO.mjs +0 -1
- package/dist/esm/useWallets-jsxF_Rfe.mjs +0 -1
package/dist/dts/solana.d.mts
CHANGED
|
@@ -1,12 +1,87 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './
|
|
1
|
+
export { e as ConnectedSolanaWallet, g as SolanaAdapterConnector, S as SolanaTransactionReceipt, h as SupportedSolanaTransaction, t as toSolanaWalletConnectors } from './types-CIYA8UPe.js';
|
|
2
|
+
export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './useFundSolanaWallet-B_Whp-i8.js';
|
|
3
|
+
import { Connection, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
4
|
+
import { SolanaCluster } from '@privy-io/js-sdk-core';
|
|
3
5
|
import '@ethersproject/providers';
|
|
4
6
|
import '@solana/wallet-adapter-base';
|
|
5
7
|
import 'react';
|
|
6
8
|
import 'viem';
|
|
7
9
|
import 'web3-core';
|
|
8
|
-
import '@privy-io/js-sdk-core';
|
|
9
10
|
import '@privy-io/public-api';
|
|
10
11
|
import 'eventemitter3';
|
|
11
12
|
import '@metamask/eth-sig-util';
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Response body for swap and bridge quotes from the Reservoir Relay API.
|
|
16
|
+
*
|
|
17
|
+
* Some properties have been omitted for brevity/we don't use them. Full shape was pulled from
|
|
18
|
+
* https://github.com/reservoirprotocol/relay-kit/blob/a0bfcd6e48746bdecc471123bde5951f60975136/packages/sdk/src/types/Execute.ts#L25
|
|
19
|
+
*/
|
|
20
|
+
type EvmTransactionData = {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
data: string;
|
|
24
|
+
value: string;
|
|
25
|
+
maxFeePerGas: string;
|
|
26
|
+
maxPriorityFeePerGas: string;
|
|
27
|
+
chainId: number;
|
|
28
|
+
};
|
|
29
|
+
type SolanaTransactionData = {
|
|
30
|
+
instructions: Array<{
|
|
31
|
+
keys: Array<{
|
|
32
|
+
pubkey: string;
|
|
33
|
+
isSigner: boolean;
|
|
34
|
+
isWritable: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
programId: string;
|
|
37
|
+
data: string;
|
|
38
|
+
}>;
|
|
39
|
+
addressLookupTableAddresses?: string[];
|
|
40
|
+
};
|
|
41
|
+
type Quote<Data extends EvmTransactionData | SolanaTransactionData> = {
|
|
42
|
+
steps: Array<{
|
|
43
|
+
id: string;
|
|
44
|
+
action: string;
|
|
45
|
+
description: string;
|
|
46
|
+
kind: 'transaction' | 'signature';
|
|
47
|
+
requestId: string;
|
|
48
|
+
items?: Array<{
|
|
49
|
+
status: 'complete' | 'incomplete';
|
|
50
|
+
data: Data;
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare const SOLANA_FUNDING_PLUGIN_ID: unique symbol;
|
|
56
|
+
|
|
57
|
+
type SolanaFundingPlugin = {
|
|
58
|
+
id: typeof SOLANA_FUNDING_PLUGIN_ID;
|
|
59
|
+
type: 'solana-funding';
|
|
60
|
+
getBalannce: (o: {
|
|
61
|
+
address: string;
|
|
62
|
+
cluster: SolanaCluster;
|
|
63
|
+
}) => Promise<number>;
|
|
64
|
+
initTransfer: ({ from, to, amount, cluster, }: {
|
|
65
|
+
to: string;
|
|
66
|
+
from: string;
|
|
67
|
+
amount: bigint;
|
|
68
|
+
cluster: SolanaCluster;
|
|
69
|
+
}) => Promise<{
|
|
70
|
+
connection: Connection;
|
|
71
|
+
transaction: Transaction;
|
|
72
|
+
}>;
|
|
73
|
+
initBridge: ({ quote, from, cluster, }: {
|
|
74
|
+
quote: Quote<SolanaTransactionData>;
|
|
75
|
+
from: string;
|
|
76
|
+
cluster: SolanaCluster;
|
|
77
|
+
}) => Promise<{
|
|
78
|
+
connection: Connection;
|
|
79
|
+
transaction: VersionedTransaction;
|
|
80
|
+
} | undefined>;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
declare const plugin: SolanaFundingPlugin;
|
|
84
|
+
|
|
85
|
+
declare const useSolanaPlugin: () => void;
|
|
86
|
+
|
|
87
|
+
export { plugin, useSolanaPlugin };
|
package/dist/dts/solana.d.ts
CHANGED
|
@@ -1,12 +1,87 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './
|
|
1
|
+
export { e as ConnectedSolanaWallet, g as SolanaAdapterConnector, S as SolanaTransactionReceipt, h as SupportedSolanaTransaction, t as toSolanaWalletConnectors } from './types-CIYA8UPe.js';
|
|
2
|
+
export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './useFundSolanaWallet-B_Whp-i8.js';
|
|
3
|
+
import { Connection, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
4
|
+
import { SolanaCluster } from '@privy-io/js-sdk-core';
|
|
3
5
|
import '@ethersproject/providers';
|
|
4
6
|
import '@solana/wallet-adapter-base';
|
|
5
7
|
import 'react';
|
|
6
8
|
import 'viem';
|
|
7
9
|
import 'web3-core';
|
|
8
|
-
import '@privy-io/js-sdk-core';
|
|
9
10
|
import '@privy-io/public-api';
|
|
10
11
|
import 'eventemitter3';
|
|
11
12
|
import '@metamask/eth-sig-util';
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Response body for swap and bridge quotes from the Reservoir Relay API.
|
|
16
|
+
*
|
|
17
|
+
* Some properties have been omitted for brevity/we don't use them. Full shape was pulled from
|
|
18
|
+
* https://github.com/reservoirprotocol/relay-kit/blob/a0bfcd6e48746bdecc471123bde5951f60975136/packages/sdk/src/types/Execute.ts#L25
|
|
19
|
+
*/
|
|
20
|
+
type EvmTransactionData = {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
data: string;
|
|
24
|
+
value: string;
|
|
25
|
+
maxFeePerGas: string;
|
|
26
|
+
maxPriorityFeePerGas: string;
|
|
27
|
+
chainId: number;
|
|
28
|
+
};
|
|
29
|
+
type SolanaTransactionData = {
|
|
30
|
+
instructions: Array<{
|
|
31
|
+
keys: Array<{
|
|
32
|
+
pubkey: string;
|
|
33
|
+
isSigner: boolean;
|
|
34
|
+
isWritable: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
programId: string;
|
|
37
|
+
data: string;
|
|
38
|
+
}>;
|
|
39
|
+
addressLookupTableAddresses?: string[];
|
|
40
|
+
};
|
|
41
|
+
type Quote<Data extends EvmTransactionData | SolanaTransactionData> = {
|
|
42
|
+
steps: Array<{
|
|
43
|
+
id: string;
|
|
44
|
+
action: string;
|
|
45
|
+
description: string;
|
|
46
|
+
kind: 'transaction' | 'signature';
|
|
47
|
+
requestId: string;
|
|
48
|
+
items?: Array<{
|
|
49
|
+
status: 'complete' | 'incomplete';
|
|
50
|
+
data: Data;
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare const SOLANA_FUNDING_PLUGIN_ID: unique symbol;
|
|
56
|
+
|
|
57
|
+
type SolanaFundingPlugin = {
|
|
58
|
+
id: typeof SOLANA_FUNDING_PLUGIN_ID;
|
|
59
|
+
type: 'solana-funding';
|
|
60
|
+
getBalannce: (o: {
|
|
61
|
+
address: string;
|
|
62
|
+
cluster: SolanaCluster;
|
|
63
|
+
}) => Promise<number>;
|
|
64
|
+
initTransfer: ({ from, to, amount, cluster, }: {
|
|
65
|
+
to: string;
|
|
66
|
+
from: string;
|
|
67
|
+
amount: bigint;
|
|
68
|
+
cluster: SolanaCluster;
|
|
69
|
+
}) => Promise<{
|
|
70
|
+
connection: Connection;
|
|
71
|
+
transaction: Transaction;
|
|
72
|
+
}>;
|
|
73
|
+
initBridge: ({ quote, from, cluster, }: {
|
|
74
|
+
quote: Quote<SolanaTransactionData>;
|
|
75
|
+
from: string;
|
|
76
|
+
cluster: SolanaCluster;
|
|
77
|
+
}) => Promise<{
|
|
78
|
+
connection: Connection;
|
|
79
|
+
transaction: VersionedTransaction;
|
|
80
|
+
} | undefined>;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
declare const plugin: SolanaFundingPlugin;
|
|
84
|
+
|
|
85
|
+
declare const useSolanaPlugin: () => void;
|
|
86
|
+
|
|
87
|
+
export { plugin, useSolanaPlugin };
|
|
@@ -2091,4 +2091,4 @@ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransac
|
|
|
2091
2091
|
type SolanaRpcRequestType = solana_signMessage;
|
|
2092
2092
|
type SolanaRpcResponseType = solana_signMessageResponse;
|
|
2093
2093
|
|
|
2094
|
-
export { type
|
|
2094
|
+
export { type MoonpaySignResponse as $, type BaseConnectedWallet as A, type BaseConnectedEthereumWallet as B, type Chain as C, type ConnectWalletModalOptions as D, type EthereumRpcRequestType as E, type FundingMethod as F, type LoginModalOptions as G, type CreateWalletOptions as H, type SetWalletRecoveryOptions as I, type SignMessageModalUIOptions as J, type SignTypedDataParams as K, type LoginMethod as L, type MfaMethod as M, type UnsignedTransactionRequest as N, type OAuthTokens as O, PrivyErrorCode as P, type SendTransactionModalUIOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type FundWalletConfig as T, type User as U, type TransactionReceipt as V, type Wallet as W, type ConnectedWallet as X, type CrossAppProviderDetails as Y, type OAuthProviderType as Z, type MoonpaySignRequest as _, type LinkedAccountWithMetadata as a, type SmartWalletConfig as a0, type PrivyServerConfig as a1, type SiweWalletMetadata as a2, type TelegramAuthResult as a3, type OAuthUserInfo as a4, type OAuthFlowState as a5, type LoginWithCode as a6, type OtpFlowState as a7, type PasskeyFlowState as a8, type SiweFlowState as a9, type TiktokOAuthWithMetadata as aA, type LinkedInOAuthWithMetadata as aB, type AppleOAuthWithMetadata as aC, type FarcasterWithMetadata as aD, type TelegramWithMetadata as aE, type CrossAppAccountWithMetadata as aF, type PasskeyWithMetadata as aG, type Email as aH, type Phone as aI, type TransactionUIOptions as aJ, type ContractUIOptions as aK, type NativeFundingConfig as aL, type MoonpayFundingConfig as aM, type PriceDisplayOptions as aN, type Farcaster as aO, type Passkey as aP, type LoginMethodOrderOption as aQ, type UnsignedTransactionRequestWithChainId as aa, type CustomAuthFlowState as ab, type TypedMessage as ac, type MessageTypes as ad, type MoonpayConfig as ae, type MoonpayCurrencyCode as af, type MoonpayPaymentMethod as ag, type Quantity as ah, type TransactionLog as ai, type NonEmptyArray as aj, type EmailWithMetadata as ak, type PhoneWithMetadata as al, type WalletWithMetadata as am, type Google as an, type Twitter as ao, type Discord as ap, type Github as aq, type LinkedIn as ar, type Apple as as, type Tiktok as at, type Telegram as au, type CrossAppAccount as av, type GoogleOAuthWithMetadata as aw, type TwitterOAuthWithMetadata as ax, type DiscordOAuthWithMetadata as ay, type GithubOAuthWithMetadata as az, type BaseConnectedSolanaWallet as b, type UserRecoveryMethod as c, type SolanaCluster as d, type ConnectedSolanaWallet as e, type SolanaFundingConfig as f, SolanaWalletConnector as g, type SupportedSolanaTransaction as h, type PrivyFarcasterSignerInitResponse as i, type MfaSubmitArgs as j, type SolanaRpcRequestType as k, type EthereumRpcResponseType as l, type SolanaRpcResponseType as m, type PrivyClientConfig as n, type EIP1193Provider as o, WalletTimeoutError as p, type RpcConfig as q, type EntropyIdVerifier as r, type RequestArguments as s, toSolanaWalletConnectors as t, WalletConnector as u, type WalletClientType as v, type ConnectedWalletMetadata as w, type ConnectorType as x, type WalletListEntry as y, type ExternalWalletsConfig as z };
|
|
@@ -2091,4 +2091,4 @@ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransac
|
|
|
2091
2091
|
type SolanaRpcRequestType = solana_signMessage;
|
|
2092
2092
|
type SolanaRpcResponseType = solana_signMessageResponse;
|
|
2093
2093
|
|
|
2094
|
-
export { type
|
|
2094
|
+
export { type MoonpaySignResponse as $, type BaseConnectedWallet as A, type BaseConnectedEthereumWallet as B, type Chain as C, type ConnectWalletModalOptions as D, type EthereumRpcRequestType as E, type FundingMethod as F, type LoginModalOptions as G, type CreateWalletOptions as H, type SetWalletRecoveryOptions as I, type SignMessageModalUIOptions as J, type SignTypedDataParams as K, type LoginMethod as L, type MfaMethod as M, type UnsignedTransactionRequest as N, type OAuthTokens as O, PrivyErrorCode as P, type SendTransactionModalUIOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type FundWalletConfig as T, type User as U, type TransactionReceipt as V, type Wallet as W, type ConnectedWallet as X, type CrossAppProviderDetails as Y, type OAuthProviderType as Z, type MoonpaySignRequest as _, type LinkedAccountWithMetadata as a, type SmartWalletConfig as a0, type PrivyServerConfig as a1, type SiweWalletMetadata as a2, type TelegramAuthResult as a3, type OAuthUserInfo as a4, type OAuthFlowState as a5, type LoginWithCode as a6, type OtpFlowState as a7, type PasskeyFlowState as a8, type SiweFlowState as a9, type TiktokOAuthWithMetadata as aA, type LinkedInOAuthWithMetadata as aB, type AppleOAuthWithMetadata as aC, type FarcasterWithMetadata as aD, type TelegramWithMetadata as aE, type CrossAppAccountWithMetadata as aF, type PasskeyWithMetadata as aG, type Email as aH, type Phone as aI, type TransactionUIOptions as aJ, type ContractUIOptions as aK, type NativeFundingConfig as aL, type MoonpayFundingConfig as aM, type PriceDisplayOptions as aN, type Farcaster as aO, type Passkey as aP, type LoginMethodOrderOption as aQ, type UnsignedTransactionRequestWithChainId as aa, type CustomAuthFlowState as ab, type TypedMessage as ac, type MessageTypes as ad, type MoonpayConfig as ae, type MoonpayCurrencyCode as af, type MoonpayPaymentMethod as ag, type Quantity as ah, type TransactionLog as ai, type NonEmptyArray as aj, type EmailWithMetadata as ak, type PhoneWithMetadata as al, type WalletWithMetadata as am, type Google as an, type Twitter as ao, type Discord as ap, type Github as aq, type LinkedIn as ar, type Apple as as, type Tiktok as at, type Telegram as au, type CrossAppAccount as av, type GoogleOAuthWithMetadata as aw, type TwitterOAuthWithMetadata as ax, type DiscordOAuthWithMetadata as ay, type GithubOAuthWithMetadata as az, type BaseConnectedSolanaWallet as b, type UserRecoveryMethod as c, type SolanaCluster as d, type ConnectedSolanaWallet as e, type SolanaFundingConfig as f, SolanaWalletConnector as g, type SupportedSolanaTransaction as h, type PrivyFarcasterSignerInitResponse as i, type MfaSubmitArgs as j, type SolanaRpcRequestType as k, type EthereumRpcResponseType as l, type SolanaRpcResponseType as m, type PrivyClientConfig as n, type EIP1193Provider as o, WalletTimeoutError as p, type RpcConfig as q, type EntropyIdVerifier as r, type RequestArguments as s, toSolanaWalletConnectors as t, WalletConnector as u, type WalletClientType as v, type ConnectedWalletMetadata as w, type ConnectorType as x, type WalletListEntry as y, type ExternalWalletsConfig as z };
|
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-CIYA8UPe.js';
|
|
3
3
|
import '@ethersproject/providers';
|
|
4
4
|
import '@solana/wallet-adapter-base';
|
|
5
5
|
import 'react';
|
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-CIYA8UPe.js';
|
|
3
3
|
import '@ethersproject/providers';
|
|
4
4
|
import '@solana/wallet-adapter-base';
|
|
5
5
|
import 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, O as OAuthTokens, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, C as Chain, F as FundingMethod, d as SolanaCluster, e as ConnectedSolanaWallet, f as SolanaFundingConfig } from './types-CIYA8UPe.js';
|
|
2
2
|
import { TransactionResponse } from '@ethersproject/providers';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, O as OAuthTokens, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, C as Chain, F as FundingMethod, d as SolanaCluster, e as ConnectedSolanaWallet, f as SolanaFundingConfig } from './types-CIYA8UPe.js';
|
|
2
2
|
import { TransactionResponse } from '@ethersproject/providers';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{createWalletClient as
|
|
1
|
+
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{createWalletClient as t,custom as r}from"viem";import{toAccount as n}from"viem/accounts";import{abstractTestnet as a}from"viem/chains";import{G as i,B as o,ad as s}from"./privy-context-ClSNNrGx.mjs";import{u as c,M as m}from"./modal-context-BcAxRsKM.mjs";import{u as p,n as l}from"./useWallets-iokhh9fd.mjs";import{g as d}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as E}from"./smart-wallets-gB49DQ_8.mjs";import"ofetch";import"@ethersproject/address";import"react/jsx-runtime";import"react";import"tinycolor2";import"@ethersproject/providers";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";import"zod";import"bs58";import"ethers";import"libphonenumber-js/max";function u(){let{user:u}=i(),{noPromptOnSignature:g,openPrivyModal:y,chains:f,appId:T,rpcConfig:D}=o(),{wallets:I}=p(),{setModalData:h}=c(),N=async()=>{let i=d(I);if(!i)throw Error("No connected wallet found");let o=f.find((e=>e.id===a.id));if(!o)throw Error("Chain not configured");await i.switchChain(o.id);let s=await i.getEthereumProvider(),c=t({account:i.address,transport:r(s)}),m=n({address:i.address,signMessage:c.signMessage,signTransaction:c.signTransaction,signTypedData:c.signTypedData});return await e({chain:{...o,rpcUrls:{default:{http:[l(o,D,T)]}}},signer:m})};return{signMessage:async({message:e})=>{let t=await N();return new Promise((async(r,n)=>{let{entropyId:a,entropyIdVerifier:i}=s(u);g.current=!0,h({connectWallet:{entropyId:a,entropyIdVerifier:i,onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>t.signMessage({message:e}),onSuccess:e=>r(e),onFailure:n,uiOptions:{}}}),y(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))},signTypedData:async e=>{let t=await N();return new Promise((async(r,n)=>{g.current=!0;let{entropyId:a,entropyIdVerifier:i}=s(u);h({connectWallet:{entropyId:a,entropyIdVerifier:i,onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>t.signTypedData(e),onSuccess:e=>r(e),onFailure:n,uiOptions:{}}}),y(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))},sendTransaction:async e=>{let t=await N(),r=[];return r="calls"in e&&void 0!==e.calls?[...e.calls]:[e],new Promise((async(n,a)=>{g.current=!0;let{entropyId:i,entropyIdVerifier:o}=s(u);h({connectWallet:{entropyId:i,entropyIdVerifier:o,onCompleteNavigateTo:m.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:E({calls:r,chain:t.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:i,entropyIdVerifier:o,transactingWallet:{address:t.account.address,walletIndex:null},getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>r.length>1?t.sendTransactionBatch(e):t.sendTransaction(e),onSuccess:e=>n(e.hash),onFailure:a,uiOptions:{}}}),y(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))}}}export{u as useAbstractSmartWallets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e.find((e=>"privy"===e.walletClientType&&"embedded"===e.connectorType&&!e.imported))??null}export{e as g};
|