@privy-io/react-auth 2.4.3 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{importWallet-BvzASqsr.js → importWallet-DbohmIiw.js} +1 -1
- package/dist/cjs/index.js +21 -21
- package/dist/cjs/{prepareFundingModalData-C8wPeHar.js → prepareFundingModalData-BdtVxCug.js} +1 -1
- package/dist/cjs/{smart-wallets-DlC_5Y5l.js → smart-wallets-DR6SCvrN.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-BmSLq25D.js +5 -0
- package/dist/cjs/{useFundWallet-2Ezrz28N.js → useFundWallet-DNBXOQPj.js} +1 -1
- package/dist/cjs/useWallets-C7Zst89H.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 +8 -9
- package/dist/dts/index.d.ts +8 -9
- 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-CjeWF_LJ.d.mts → types-BKBPK3tN.d.mts} +4 -2
- package/dist/dts/{types-CjeWF_LJ.d.ts → types-BKBPK3tN.d.ts} +4 -2
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{useSolanaWallets-CXnYSqQR.d.mts → useSolanaWallets-BkzftCx7.d.mts} +1 -1
- package/dist/dts/{useSolanaWallets-CXnYSqQR.d.ts → useSolanaWallets-BkzftCx7.d.ts} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/{importWallet-DfwAobLp.mjs → importWallet-ylHVDCXz.mjs} +1 -1
- package/dist/esm/index.mjs +21 -21
- package/dist/esm/{prepareFundingModalData-R09VUVWm.mjs → prepareFundingModalData-CsN1TYQy.mjs} +1 -1
- package/dist/esm/{smart-wallets-BKO_VzqX.mjs → smart-wallets-gIJUc6-6.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-DvvTjRH_.mjs +5 -0
- package/dist/esm/{useFundWallet-vjrQZZWa.mjs → useFundWallet-DS1kytse.mjs} +1 -1
- package/dist/esm/useWallets-8w3LVxdW.mjs +1 -0
- package/package.json +6 -6
- package/dist/cjs/useActiveWallet-DUvjidjw.js +0 -5
- package/dist/cjs/useWallets-DobnZGpT.js +0 -1
- package/dist/esm/useActiveWallet-CRQOoJef.mjs +0 -5
- package/dist/esm/useWallets-Bm3b-V02.mjs +0 -1
package/dist/dts/solana.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-
|
|
2
|
-
export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-BKBPK3tN.js';
|
|
2
|
+
export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-BKBPK3tN.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-BkzftCx7.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BkzftCx7.js';
|
|
5
5
|
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
6
6
|
import { Connection } from '@solana/web3.js';
|
|
7
7
|
import 'react';
|
|
@@ -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];
|
|
@@ -601,6 +601,8 @@ type UserRecoveryMethod = 'user-passcode' | RecoveryProviderType;
|
|
|
601
601
|
* Object representation of a user's wallet.
|
|
602
602
|
*/
|
|
603
603
|
interface Wallet {
|
|
604
|
+
/** The server wallet ID of the wallet. Null if the wallet is not delegated. Only applies to embedded wallets (`walletClientType === 'privy'`). */
|
|
605
|
+
id?: string | null;
|
|
604
606
|
/** The wallet address. */
|
|
605
607
|
address: string;
|
|
606
608
|
/**
|
|
@@ -1199,7 +1201,7 @@ type PriceDisplayOptions = {
|
|
|
1199
1201
|
};
|
|
1200
1202
|
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1201
1203
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1202
|
-
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1204
|
+
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1203
1205
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
1204
1206
|
type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | `privy:${string}` | 'farcaster' | 'telegram';
|
|
1205
1207
|
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];
|
|
@@ -601,6 +601,8 @@ type UserRecoveryMethod = 'user-passcode' | RecoveryProviderType;
|
|
|
601
601
|
* Object representation of a user's wallet.
|
|
602
602
|
*/
|
|
603
603
|
interface Wallet {
|
|
604
|
+
/** The server wallet ID of the wallet. Null if the wallet is not delegated. Only applies to embedded wallets (`walletClientType === 'privy'`). */
|
|
605
|
+
id?: string | null;
|
|
604
606
|
/** The wallet address. */
|
|
605
607
|
address: string;
|
|
606
608
|
/**
|
|
@@ -1199,7 +1201,7 @@ type PriceDisplayOptions = {
|
|
|
1199
1201
|
};
|
|
1200
1202
|
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1201
1203
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1202
|
-
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1204
|
+
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1203
1205
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
1204
1206
|
type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | `privy:${string}` | 'farcaster' | 'telegram';
|
|
1205
1207
|
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-BKBPK3tN.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-BKBPK3tN.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-BKBPK3tN.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-BKBPK3tN.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-8w3LVxdW.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-gIJUc6-6.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-8w3LVxdW.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};
|