@privy-io/expo 0.78.2 → 0.79.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.
- package/dist/cards.js +11 -11
- package/dist/{chunk-DBIA42HB.js → chunk-CAF26OMV.js} +1 -1
- package/dist/chunk-SNODJ7VS.js +12 -0
- package/dist/{chunk-QAUM76HK.js → chunk-VZ7MMAEX.js} +1 -1
- package/dist/esm/cards.js +11 -11
- package/dist/esm/{chunk-DBIA42HB.js → chunk-CAF26OMV.js} +1 -1
- package/dist/esm/chunk-SNODJ7VS.js +12 -0
- package/dist/esm/{chunk-QAUM76HK.js → chunk-VZ7MMAEX.js} +1 -1
- package/dist/esm/extended-chains.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/passkey.js +1 -1
- package/dist/esm/smart-wallets.js +1 -1
- package/dist/esm/ui.js +1 -1
- package/dist/extended-chains.js +1 -1
- package/dist/index.d.ts +48 -3
- package/dist/index.js +1 -1
- package/dist/passkey.js +1 -1
- package/dist/smart-wallets.js +1 -1
- package/dist/ui.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-V3WU67WL.js +0 -12
- package/dist/esm/chunk-V3WU67WL.js +0 -12
package/dist/extended-chains.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSNODJ7VSjs = require('./chunk-SNODJ7VS.js');require('./chunk-F7DR7TVR.js');require('./chunk-3HF374LL.js');var _chunkC5WYSLQFjs = require('./chunk-C5WYSLQF.js');var _react = require('react');var _jssdkcore = require('@privy-io/js-sdk-core');var h=()=>{let e=_chunkSNODJ7VSjs.o.call(void 0, );return _react.useMemo.call(void 0, ()=>({createWallet(n){return _chunkC5WYSLQFjs.e.call(void 0, this,null,function*(){let s=yield _jssdkcore.create.call(void 0, e,{request:{chain_type:n.chainType}}),{user:o}=yield e.user.get();return{user:o,wallet:s}})}}),[e])};var W=()=>{let e=_chunkSNODJ7VSjs.o.call(void 0, );return _react.useMemo.call(void 0, ()=>({signRawHash(q){return _chunkC5WYSLQFjs.e.call(void 0, this,arguments,function*({address:n,chainType:s,hash:o}){let l=_chunkSNODJ7VSjs.d.call(void 0, );if(!l)throw new (0, _jssdkcore.PrivyClientError)({code:"embedded_wallet_before_logged_in",error:"User must be authenticated before signing a raw hash"});let p=l.linked_accounts.filter(_jssdkcore.isEmbeddedWalletAccount).filter(_jssdkcore.isUnifiedWallet).filter(t=>t.chain_type===s).find(t=>t.address===n);if(!p)throw new (0, _jssdkcore.PrivyClientError)({code:"embedded_wallet_does_not_exist",error:"No embedded wallet found for the given address and chain type"});let r=yield _chunkSNODJ7VSjs.D.call(void 0, ()=>_jssdkcore.rawSign.call(void 0, e,(...t)=>e.embeddedWallet.signWithUserSigner(...t),{wallet_id:p.id,params:{hash:o}}));if(r.data&&"signature"in r.data&&r.data.encoding==="hex")return{signature:r.data.signature};throw new Error("Failed to sign")})}}),[e])};exports.useCreateWallet = h; exports.useSignRawHash = W;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as Privy from '@privy-io/js-sdk-core';
|
|
2
|
-
import Privy__default, { EmbeddedWalletConfig, DepositConfig, GenerateDepositAddressInput, DepositAddressQuote, GetDepositInput, DepositAddressOrder, WaitForDepositInput, DepositAddressPollingResult, WaitForCompletionInput, CreateCryptoDepositAccountInput, CreateCryptoDepositAccountResponse, CryptoDepositAccountQuoteInput, CryptoDepositAccountQuote, GetCryptoDepositAccountOrderInput, GetCryptoDepositAccountOrderResponse, GetCryptoDepositAccountNextOrderInput, GetCryptoDepositAccountNextOrderResponse, UnsignedTransactionRequest, OnNeedsRecovery, MfaMethod, OnMfaEnrollmentRequired, OnMfaVerificationRequired, SessionSignerInput, PrivyEmbeddedWalletProvider, PrivyEmbeddedSolanaWalletProvider, EmbeddedBitcoinWalletProvider, GenerateAuthorizationSignatureInput, GenerateAuthorizationSignatureOutput, UpdateWalletInput, Storage, Chain, OAuthProviderID, PrivyPlugin, Logger } from '@privy-io/js-sdk-core';
|
|
2
|
+
import Privy__default, { EmbeddedWalletConfig, CreateSiwsMessageOpts, DepositConfig, GenerateDepositAddressInput, DepositAddressQuote, GetDepositInput, DepositAddressOrder, WaitForDepositInput, DepositAddressPollingResult, WaitForCompletionInput, CreateCryptoDepositAccountInput, CreateCryptoDepositAccountResponse, CryptoDepositAccountQuoteInput, CryptoDepositAccountQuote, GetCryptoDepositAccountOrderInput, GetCryptoDepositAccountOrderResponse, GetCryptoDepositAccountNextOrderInput, GetCryptoDepositAccountNextOrderResponse, UnsignedTransactionRequest, OnNeedsRecovery, MfaMethod, OnMfaEnrollmentRequired, OnMfaVerificationRequired, SessionSignerInput, PrivyEmbeddedWalletProvider, PrivyEmbeddedSolanaWalletProvider, EmbeddedBitcoinWalletProvider, GenerateAuthorizationSignatureInput, GenerateAuthorizationSignatureOutput, UpdateWalletInput, Storage, Chain, OAuthProviderID, PrivyPlugin, Logger } from '@privy-io/js-sdk-core';
|
|
3
3
|
export * from '@privy-io/js-sdk-core';
|
|
4
4
|
export { CreateCryptoDepositAccountInput, CreateCryptoDepositAccountResponse, CryptoDepositAccountQuote, CryptoDepositAccountQuoteInput, DataSuffixPlugin, DepositAddressOrder, DepositAddressPollingResult, DepositAddressQuote, DepositConfig, GenerateDepositAddressInput, GetCryptoDepositAccountNextOrderInput, GetCryptoDepositAccountNextOrderResponse, GetCryptoDepositAccountOrderInput, GetCryptoDepositAccountOrderResponse, GetDepositInput, WaitForCompletionInput, WaitForDepositInput, createDataSuffixPlugin as dataSuffix } from '@privy-io/js-sdk-core';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { E as ErrorCallback, a6 as AuthLinkSuccessCallback, a7 as GenerateSiweMessage, a8 as SiweFlowState, A as AuthSuccessCallback, a9 as OtpLinkHookOptions, aa as OtpLinkHookResult, ab as OtpLoginHookOptions, ac as OtpLoginHookResult, ad as FarcasterFlowState, ae as LinkFarcasterInput, af as SubmitFarcasterOptions, ag as LoginWithFarcasterInput, V as EmbeddedWalletState, d as PublicKeyCredentialRequestOptionsJSON, Y as EmbeddedSolanaWalletState, ah as OtpFlowState, O as OAuthFlowState, ai as WalletRecoveryCallbacks, aj as SolanaWalletRecoveryCallbacks, N as RecoveryFlowState, c as PasskeyFlowState } from './types-6515eff0.js';
|
|
7
7
|
export { I as CreateEthereumEmbeddedWalletOpts, H as CreateOrRecoverEmbeddedWalletProps, J as CreateSolanaEmbeddedWalletOpts, Q as CustomAuthFlowState, X as EmbeddedSolanaWalletActions, Z as EmbeddedSolanaWalletStatus, h as EmbeddedWallet, U as EmbeddedWalletActions, W as EmbeddedWalletStatus, L as LinkedAccountWithMetadata, T as MfaConfig, z as PrivyAppleOauthAccount, k as PrivyBitcoinSegwitEmbeddedWalletAccount, l as PrivyBitcoinTaprootEmbeddedWalletAccount, G as PrivyCrossAppWalletAccount, B as PrivyCustomJwtAccount, t as PrivyDiscordOauthAccount, n as PrivyEmailAccount, g as PrivyEmbeddedWalletAccount, p as PrivyEthereumAccount, i as PrivyEthereumEmbeddedWalletAccount, C as PrivyFarcasterAccount, u as PrivyGithubOauthAccount, r as PrivyGoogleOauthAccount, w as PrivyInstagramOauthAccount, f as PrivyLinkedAccount, y as PrivyLinkedInOauthAccount, D as PrivyPasskeyAccount, o as PrivyPhoneAccount, m as PrivySmartWalletAccount, q as PrivySolanaAccount, j as PrivySolanaEmbeddedWalletAccount, v as PrivySpotifyOauthAccount, F as PrivyTelegramAccount, x as PrivyTiktokOauthAccount, s as PrivyTwitterOauthAccount, e as PrivyUser, R as RecoverEthereumEmbeddedWalletOpts, K as RecoverSolanaEmbeddedWalletOpts, M as SetRecoveryProps, a4 as hasError, _ as isConnected, a0 as isConnecting, a3 as isCreating, a1 as isDisconnected, a2 as isNotCreated, $ as isReconnecting, a5 as needsRecovery } from './types-6515eff0.js';
|
|
8
8
|
import * as _privy_io_api_types from '@privy-io/api-types';
|
|
9
|
-
import { User, LinkedAccountEthereumEmbeddedWallet, LinkedAccountSolanaEmbeddedWallet, TransferRequestBody, Wallets, LinkedAccountEmbeddedWallet, AuthenticatedUser } from '@privy-io/api-types';
|
|
9
|
+
import { User, LinkedAccountEthereumEmbeddedWallet, LinkedAccountSolanaEmbeddedWallet, TransferRequestBody, Wallets, SwapRequestBody, LinkedAccountEmbeddedWallet, AuthenticatedUser } from '@privy-io/api-types';
|
|
10
10
|
export { LinkedAccount, LinkedAccountBitcoinSegwitEmbeddedWallet, LinkedAccountBitcoinTaprootEmbeddedWallet, LinkedAccountEmbeddedWallet, LinkedAccountEthereumEmbeddedWallet, LinkedAccountSmartWallet, LinkedAccountSolanaEmbeddedWallet, User } from '@privy-io/api-types';
|
|
11
11
|
import { TypedDataDefinition, SignedAuthorization } from 'viem';
|
|
12
12
|
import { EncryptedAuthorizationKeyResponse } from '@privy-io/routes';
|
|
@@ -137,6 +137,11 @@ interface UseLinkWithSiwsInterface {
|
|
|
137
137
|
*/
|
|
138
138
|
uri: string;
|
|
139
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* Solana chain the wallet is connected to. Must match the wallet's chain, or wallets like
|
|
142
|
+
* Phantom reject the message. Defaults to `'solana:mainnet'`.
|
|
143
|
+
*/
|
|
144
|
+
chain?: CreateSiwsMessageOpts['chain'];
|
|
140
145
|
}) => Promise<{
|
|
141
146
|
message: string;
|
|
142
147
|
}>;
|
|
@@ -177,6 +182,11 @@ interface UseLoginWithSiwsInterface {
|
|
|
177
182
|
*/
|
|
178
183
|
uri: string;
|
|
179
184
|
};
|
|
185
|
+
/**
|
|
186
|
+
* Solana chain the wallet is connected to. Must match the wallet's chain, or wallets like
|
|
187
|
+
* Phantom reject the message. Defaults to `'solana:mainnet'`.
|
|
188
|
+
*/
|
|
189
|
+
chain?: CreateSiwsMessageOpts['chain'];
|
|
180
190
|
}) => Promise<{
|
|
181
191
|
message: string;
|
|
182
192
|
}>;
|
|
@@ -1429,6 +1439,41 @@ interface UseTransferInterface {
|
|
|
1429
1439
|
}
|
|
1430
1440
|
declare const useTransfer: () => UseTransferInterface;
|
|
1431
1441
|
|
|
1442
|
+
interface UseSwapInterface {
|
|
1443
|
+
/**
|
|
1444
|
+
* Initiates a Wallet API token swap. Resolves as soon as the swap action is
|
|
1445
|
+
* created — the returned action's `status` is `'pending'`. This does not wait for the
|
|
1446
|
+
* swap to reach a terminal status.
|
|
1447
|
+
* @param walletId The ID of the wallet to swap from.
|
|
1448
|
+
* @param params The swap request parameters.
|
|
1449
|
+
* @returns The created swap action.
|
|
1450
|
+
*/
|
|
1451
|
+
swap: (walletId: string, params: SwapRequestBody) => Promise<Wallets.Actions.SwapActionResponse>;
|
|
1452
|
+
}
|
|
1453
|
+
declare const useSwap: () => UseSwapInterface;
|
|
1454
|
+
|
|
1455
|
+
interface UseEarnInterface {
|
|
1456
|
+
/**
|
|
1457
|
+
* Initiates a Wallet API earn deposit. Resolves as soon as the deposit action is
|
|
1458
|
+
* created — the returned action's `status` is `'pending'`. This does not wait for the
|
|
1459
|
+
* deposit to reach a terminal status.
|
|
1460
|
+
* @param walletId The ID of the wallet to deposit from.
|
|
1461
|
+
* @param params The earn deposit request parameters.
|
|
1462
|
+
* @returns The created earn deposit action.
|
|
1463
|
+
*/
|
|
1464
|
+
deposit: (walletId: string, params: Wallets.Actions.EarnDepositRequestBody) => Promise<Wallets.Actions.EarnDepositActionResponse>;
|
|
1465
|
+
/**
|
|
1466
|
+
* Initiates a Wallet API earn withdrawal. Resolves as soon as the withdraw action is
|
|
1467
|
+
* created — the returned action's `status` is `'pending'`. This does not wait for the
|
|
1468
|
+
* withdrawal to reach a terminal status.
|
|
1469
|
+
* @param walletId The ID of the wallet to withdraw to.
|
|
1470
|
+
* @param params The earn withdraw request parameters.
|
|
1471
|
+
* @returns The created earn withdraw action.
|
|
1472
|
+
*/
|
|
1473
|
+
withdraw: (walletId: string, params: Wallets.Actions.EarnWithdrawRequestBody) => Promise<Wallets.Actions.EarnWithdrawActionResponse>;
|
|
1474
|
+
}
|
|
1475
|
+
declare const useEarn: () => UseEarnInterface;
|
|
1476
|
+
|
|
1432
1477
|
/** Methods for updating a wallet through the Wallet API. */
|
|
1433
1478
|
interface UseUpdateWalletInterface {
|
|
1434
1479
|
/**
|
|
@@ -1899,4 +1944,4 @@ declare const useMigrateWallets: () => {
|
|
|
1899
1944
|
}>;
|
|
1900
1945
|
};
|
|
1901
1946
|
|
|
1902
|
-
export { AddSessionSignersInput, AddSessionSignersOutput, AddSignersInput, AddSignersOutput, AuthBoundary, ConnectedEthereumWallet, CustomAuthProviderConfig, EmbeddedSolanaWalletState, EmbeddedWalletState, FarcasterV2State, LinkWithCrossAppInput, LinkWithCrossAppOutput, LinkWithEmailHookResult, LinkWithEmailOptions, LinkWithOAuthInput, LinkWithSMSHookResult, LinkWithSMSOptions, LoginWithCrossAppInput, LoginWithCrossAppOutput, LoginWithEmailHookResult, LoginWithEmailOptions, LoginWithFarcasterV2Input, LoginWithOAuthInput, LoginWithSMSHookResult, LoginWithSMSOptions, OAuthFlowHookResult, OAuthFlowState, OAuthTokens, OtpFlowState, PrivyAuthGuardProps, PrivyConfig, PrivyContext, PrivyOptions, PrivyProvider, PrivyProviderProps, RecoveryFlowState, RemoveSessionSignersInput, RemoveSessionSignersOutput, RemoveSignersInput, RemoveSignersOutput, SecureStorageAdapter, SendEmailCodeInput, SendPhoneCodeInput, SendTransactionWithCrossAppInput, SendTransactionWithCrossAppOutput, SignMessageWithCrossAppInput, SignMessageWithCrossAppOutput, SignTypedDataWithCrossAppInput, SignTypedDataWithCrossAppOutput, UnlinkOAuthInput, UpdateEmailInput, UpdatePhoneInput, UseCreateGuestAccount, UseCreateGuestAccountOptions, UseDepositAddressInterface, UseGetEncryptedAuthorizationKeyInterface, UseHeadlessCryptoDepositInterface, UseHeadlessDelegatedActionsInterface, UseImportWallet, UseLinkWithCrossAppInterface, UseLinkWithFarcaster, UseLinkWithFarcasterOptions, UseLinkWithOAuth, UseLinkWithSiwe, UseLinkWithSiweOptions, UseLinkWithSiwsInterface, UseLoginWithCrossAppInterface, UseLoginWithFarcaster, UseLoginWithFarcasterOptions, UseLoginWithFarcasterV2, UseLoginWithOAuth, UseLoginWithSiwe, UseLoginWithSiweOptions, UseLoginWithSiwsInterface, UseMfa, UseMfaEnrollment, UseOAuthTokens, UseOAuthTokensOptions, UseOnEmbeddedWalletStateChange, UseRecoverEmbeddedWallet, UseSendTransactionWithCrossAppInterface, UseSessionSignersInterface, UseSetEmbeddedWalletRecovery, UseSignMessageWithCrossAppInterface, UseSignTypedDataWithCrossAppInterface, UseSignersInterface, UseStoredUsers, UseSwitchUser, UseTransferInterface, UseUnlinkEmailOptions, UseUnlinkFarcaster, UseUnlinkFarcasterOptions, UseUnlinkOAuth, UseUnlinkPasskey, UseUnlinkWallet, UseUnlinkWalletOptions, UseUpdateEmailInterface, UseUpdatePhoneInterface, UseUpdateWalletInterface, UseWalletActionsInterface, createPrivyClient, getAccessToken, useAcceptTerms, useAuthorizationSignature, useCreateGuestAccount, useDepositAddress, useEmbeddedBitcoinWallet, useEmbeddedEthereumWallet, useEmbeddedSolanaWallet, useEmbeddedWallet, useEmbeddedWalletStateChange, useGetEncryptedAuthorizationKey, useHeadlessCryptoDeposit, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkEmail, useLinkSMS, useLinkWithCrossApp, useLinkWithFarcaster, useLinkWithOAuth, useLinkWithSiwe, useLinkWithSiws, useLoginWithCrossApp, useLoginWithEmail, useLoginWithFarcaster, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithSMS, useLoginWithSiwe, useLoginWithSiws, useMfa, useMfaEnrollment, useMigrateWallets, useOAuthFlow, useOAuthTokens, useOnNeedsRecovery, usePrivy, usePrivyClient, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransactionWithCrossApp, useSessionSigners, useSetEmbeddedWalletRecovery, useSign7702Authorization, useSignMessageWithCrossApp, useSignTypedDataWithCrossApp, useSigners, useStoredUsers, useSwitchUser, useTransfer, useUnlinkEmail, useUnlinkFarcaster, useUnlinkOAuth, useUnlinkPasskey, useUnlinkWallet, useUpdateEmail, useUpdatePhone, useUpdateWallet, useWalletActions };
|
|
1947
|
+
export { AddSessionSignersInput, AddSessionSignersOutput, AddSignersInput, AddSignersOutput, AuthBoundary, ConnectedEthereumWallet, CustomAuthProviderConfig, EmbeddedSolanaWalletState, EmbeddedWalletState, FarcasterV2State, LinkWithCrossAppInput, LinkWithCrossAppOutput, LinkWithEmailHookResult, LinkWithEmailOptions, LinkWithOAuthInput, LinkWithSMSHookResult, LinkWithSMSOptions, LoginWithCrossAppInput, LoginWithCrossAppOutput, LoginWithEmailHookResult, LoginWithEmailOptions, LoginWithFarcasterV2Input, LoginWithOAuthInput, LoginWithSMSHookResult, LoginWithSMSOptions, OAuthFlowHookResult, OAuthFlowState, OAuthTokens, OtpFlowState, PrivyAuthGuardProps, PrivyConfig, PrivyContext, PrivyOptions, PrivyProvider, PrivyProviderProps, RecoveryFlowState, RemoveSessionSignersInput, RemoveSessionSignersOutput, RemoveSignersInput, RemoveSignersOutput, SecureStorageAdapter, SendEmailCodeInput, SendPhoneCodeInput, SendTransactionWithCrossAppInput, SendTransactionWithCrossAppOutput, SignMessageWithCrossAppInput, SignMessageWithCrossAppOutput, SignTypedDataWithCrossAppInput, SignTypedDataWithCrossAppOutput, UnlinkOAuthInput, UpdateEmailInput, UpdatePhoneInput, UseCreateGuestAccount, UseCreateGuestAccountOptions, UseDepositAddressInterface, UseEarnInterface, UseGetEncryptedAuthorizationKeyInterface, UseHeadlessCryptoDepositInterface, UseHeadlessDelegatedActionsInterface, UseImportWallet, UseLinkWithCrossAppInterface, UseLinkWithFarcaster, UseLinkWithFarcasterOptions, UseLinkWithOAuth, UseLinkWithSiwe, UseLinkWithSiweOptions, UseLinkWithSiwsInterface, UseLoginWithCrossAppInterface, UseLoginWithFarcaster, UseLoginWithFarcasterOptions, UseLoginWithFarcasterV2, UseLoginWithOAuth, UseLoginWithSiwe, UseLoginWithSiweOptions, UseLoginWithSiwsInterface, UseMfa, UseMfaEnrollment, UseOAuthTokens, UseOAuthTokensOptions, UseOnEmbeddedWalletStateChange, UseRecoverEmbeddedWallet, UseSendTransactionWithCrossAppInterface, UseSessionSignersInterface, UseSetEmbeddedWalletRecovery, UseSignMessageWithCrossAppInterface, UseSignTypedDataWithCrossAppInterface, UseSignersInterface, UseStoredUsers, UseSwapInterface, UseSwitchUser, UseTransferInterface, UseUnlinkEmailOptions, UseUnlinkFarcaster, UseUnlinkFarcasterOptions, UseUnlinkOAuth, UseUnlinkPasskey, UseUnlinkWallet, UseUnlinkWalletOptions, UseUpdateEmailInterface, UseUpdatePhoneInterface, UseUpdateWalletInterface, UseWalletActionsInterface, createPrivyClient, getAccessToken, useAcceptTerms, useAuthorizationSignature, useCreateGuestAccount, useDepositAddress, useEarn, useEmbeddedBitcoinWallet, useEmbeddedEthereumWallet, useEmbeddedSolanaWallet, useEmbeddedWallet, useEmbeddedWalletStateChange, useGetEncryptedAuthorizationKey, useHeadlessCryptoDeposit, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkEmail, useLinkSMS, useLinkWithCrossApp, useLinkWithFarcaster, useLinkWithOAuth, useLinkWithSiwe, useLinkWithSiws, useLoginWithCrossApp, useLoginWithEmail, useLoginWithFarcaster, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithSMS, useLoginWithSiwe, useLoginWithSiws, useMfa, useMfaEnrollment, useMigrateWallets, useOAuthFlow, useOAuthTokens, useOnNeedsRecovery, usePrivy, usePrivyClient, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransactionWithCrossApp, useSessionSigners, useSetEmbeddedWalletRecovery, useSign7702Authorization, useSignMessageWithCrossApp, useSignTypedDataWithCrossApp, useSigners, useStoredUsers, useSwap, useSwitchUser, useTransfer, useUnlinkEmail, useUnlinkFarcaster, useUnlinkOAuth, useUnlinkPasskey, useUnlinkWallet, useUpdateEmail, useUpdatePhone, useUpdateWallet, useWalletActions };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunkVZ7MMAEXjs = require('./chunk-VZ7MMAEX.js');var _chunkSNODJ7VSjs = require('./chunk-SNODJ7VS.js');var _chunkF7DR7TVRjs = require('./chunk-F7DR7TVR.js');require('./chunk-3HF374LL.js');var _chunkC5WYSLQFjs = require('./chunk-C5WYSLQF.js');var _jssdkcore = require('@privy-io/js-sdk-core'); _createStarExport(_jssdkcore);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var Xt=({loading:t,error:e,unauthenticated:o,children:i})=>{let{isReady:u,error:p}=_chunkSNODJ7VSjs.da.call(void 0, ),U=_chunkSNODJ7VSjs.g.call(void 0, );if(!u)return _react2.default.createElement(_react2.default.Fragment,null,t);if(p&&e){let n=typeof e=="function"?e(p):e;return _react2.default.createElement(_react2.default.Fragment,null,n)}return U?_react2.default.createElement(_react2.default.Fragment,null,i):_react2.default.createElement(_react2.default.Fragment,null,o)};function g(t){return _chunkVZ7MMAEXjs.a.call(void 0, t)}function F(t){let{state:e,start:o}=_chunkVZ7MMAEXjs.a.call(void 0, _chunkC5WYSLQFjs.c.call(void 0, _chunkC5WYSLQFjs.b.call(void 0, {},t),{action:"link"}));return{state:e,link:o}}var H=t=>{let{client:e}=_react.useContext.call(void 0, _chunkSNODJ7VSjs.qa),o=_react.useRef.call(void 0, t);return _react.useEffect.call(void 0, ()=>{o.current=t},[t]),{unlinkOAuth:_react.useCallback.call(void 0, U=>_chunkC5WYSLQFjs.e.call(void 0, void 0,[U],function*({provider:u,subject:p}){var n,A,s,O;try{let{user:h}=yield e.auth.oauth.unlink(u,p);return(A=(n=o.current)==null?void 0:n.onSuccess)==null||A.call(n,h),h}catch(h){let c=_chunkSNODJ7VSjs.h.call(void 0, h);throw(O=(s=o.current)==null?void 0:s.onError)==null||O.call(s,c),c}}),[e.auth.oauth])}};var D=t=>{let{client:e}=_react.useContext.call(void 0, _chunkSNODJ7VSjs.qa),o=_react.useRef.call(void 0, t.onOAuthTokenGrant);o.current=t.onOAuthTokenGrant,_react.useEffect.call(void 0, ()=>{let{unsubscribe:i}=e.addOAuthTokensListener(u=>{o.current(u)});return i},[e])};exports.AuthBoundary = Xt; exports.PrivyContext = _chunkSNODJ7VSjs.qa; exports.PrivyProvider = _chunkSNODJ7VSjs.sa; exports.SecureStorageAdapter = _chunkF7DR7TVRjs.c; exports.createPrivyClient = _chunkSNODJ7VSjs.l; exports.dataSuffix = _jssdkcore.createDataSuffixPlugin; exports.getAccessToken = _chunkSNODJ7VSjs.ra; exports.hasError = _chunkQSWCX5XIjs.g; exports.isConnected = _chunkQSWCX5XIjs.a; exports.isConnecting = _chunkQSWCX5XIjs.c; exports.isCreating = _chunkQSWCX5XIjs.f; exports.isDisconnected = _chunkQSWCX5XIjs.d; exports.isNotCreated = _chunkQSWCX5XIjs.e; exports.isReconnecting = _chunkQSWCX5XIjs.b; exports.needsRecovery = _chunkQSWCX5XIjs.h; exports.useAcceptTerms = _chunkSNODJ7VSjs.ea; exports.useAuthorizationSignature = _chunkSNODJ7VSjs.fa; exports.useCreateGuestAccount = _chunkSNODJ7VSjs.T; exports.useDepositAddress = _chunkSNODJ7VSjs.C; exports.useEarn = _chunkSNODJ7VSjs.ka; exports.useEmbeddedBitcoinWallet = _chunkSNODJ7VSjs.ca; exports.useEmbeddedEthereumWallet = _chunkSNODJ7VSjs.aa; exports.useEmbeddedSolanaWallet = _chunkSNODJ7VSjs.ba; exports.useEmbeddedWallet = _chunkSNODJ7VSjs.Q; exports.useEmbeddedWalletStateChange = _chunkSNODJ7VSjs.R; exports.useGetEncryptedAuthorizationKey = _chunkSNODJ7VSjs.ga; exports.useHeadlessCryptoDeposit = _chunkSNODJ7VSjs.E; exports.useHeadlessDelegatedActions = _chunkSNODJ7VSjs.B; exports.useIdentityToken = _chunkSNODJ7VSjs.S; exports.useImportWallet = _chunkSNODJ7VSjs.$; exports.useLinkEmail = _chunkSNODJ7VSjs.s; exports.useLinkSMS = _chunkSNODJ7VSjs.v; exports.useLinkWithCrossApp = _chunkSNODJ7VSjs.K; exports.useLinkWithFarcaster = _chunkSNODJ7VSjs.x; exports.useLinkWithOAuth = F; exports.useLinkWithSiwe = _chunkSNODJ7VSjs.m; exports.useLinkWithSiws = _chunkSNODJ7VSjs.p; exports.useLoginWithCrossApp = _chunkSNODJ7VSjs.J; exports.useLoginWithEmail = _chunkSNODJ7VSjs.u; exports.useLoginWithFarcaster = _chunkSNODJ7VSjs.z; exports.useLoginWithFarcasterV2 = _chunkSNODJ7VSjs.A; exports.useLoginWithOAuth = _chunkVZ7MMAEXjs.b; exports.useLoginWithSMS = _chunkSNODJ7VSjs.w; exports.useLoginWithSiwe = _chunkSNODJ7VSjs.n; exports.useLoginWithSiws = _chunkSNODJ7VSjs.q; exports.useMfa = _chunkSNODJ7VSjs.Y; exports.useMfaEnrollment = _chunkSNODJ7VSjs.Z; exports.useMigrateWallets = _chunkSNODJ7VSjs.pa; exports.useOAuthFlow = g; exports.useOAuthTokens = D; exports.useOnNeedsRecovery = _chunkSNODJ7VSjs.i; exports.usePrivy = _chunkSNODJ7VSjs.da; exports.usePrivyClient = _chunkSNODJ7VSjs.o; exports.useRecoverEmbeddedWallet = _chunkSNODJ7VSjs.P; exports.useRegisterMfaListener = _chunkSNODJ7VSjs.U; exports.useSendTransactionWithCrossApp = _chunkSNODJ7VSjs.N; exports.useSessionSigners = _chunkSNODJ7VSjs.G; exports.useSetEmbeddedWalletRecovery = _chunkSNODJ7VSjs.O; exports.useSign7702Authorization = _chunkSNODJ7VSjs.ha; exports.useSignMessageWithCrossApp = _chunkSNODJ7VSjs.L; exports.useSignTypedDataWithCrossApp = _chunkSNODJ7VSjs.M; exports.useSigners = _chunkSNODJ7VSjs.F; exports.useStoredUsers = _chunkSNODJ7VSjs.na; exports.useSwap = _chunkSNODJ7VSjs.ja; exports.useSwitchUser = _chunkSNODJ7VSjs.oa; exports.useTransfer = _chunkSNODJ7VSjs.ia; exports.useUnlinkEmail = _chunkSNODJ7VSjs.t; exports.useUnlinkFarcaster = _chunkSNODJ7VSjs.y; exports.useUnlinkOAuth = H; exports.useUnlinkPasskey = _chunkSNODJ7VSjs._; exports.useUnlinkWallet = _chunkSNODJ7VSjs.r; exports.useUpdateEmail = _chunkSNODJ7VSjs.H; exports.useUpdatePhone = _chunkSNODJ7VSjs.I; exports.useUpdateWallet = _chunkSNODJ7VSjs.la; exports.useWalletActions = _chunkSNODJ7VSjs.ma;
|
package/dist/passkey.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunkSNODJ7VSjs = require('./chunk-SNODJ7VS.js');require('./chunk-F7DR7TVR.js');require('./chunk-3HF374LL.js');var _chunkC5WYSLQFjs = require('./chunk-C5WYSLQF.js');var _react = require('react');var _jssdkcore = require('@privy-io/js-sdk-core');var Y=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunkSNODJ7VSjs.qa),c=_react.useCallback.call(void 0, o=>{var n;let t=_chunkSNODJ7VSjs.h.call(void 0, o);return s({status:"error",error:t}),(n=e==null?void 0:e.onError)==null||n.call(e,t),t},[e==null?void 0:e.onError]);return{linkWithPasskey:_react.useCallback.call(void 0, n=>_chunkC5WYSLQFjs.e.call(void 0, void 0,[n],function*({relyingParty:o,extra_options:t}){var u;try{if(!_chunkSNODJ7VSjs.d.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_link_passkey_before_logged_in",error:"Must be logged in to link a passkey."});s({status:"generating-challenege"});let{options:k}=yield a.auth.passkey.generateRegistrationOptions(o);s({status:"awaiting-passkey"});let y=yield _chunkSNODJ7VSjs.V.call(void 0, _chunkSNODJ7VSjs.X.call(void 0, k),t);s({status:"submitting-response"});let{user:m}=yield a.auth.passkey.linkWithPasskey(y,o);return s({status:"done"}),(u=e==null?void 0:e.onSuccess)==null||u.call(e,m),m}catch(r){throw c(r)}}),[a,c,e==null?void 0:e.onSuccess]),state:d}};var ie=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunkSNODJ7VSjs.qa),c=_react.useCallback.call(void 0, o=>{var n;let t=_chunkSNODJ7VSjs.h.call(void 0, o);return s({status:"error",error:t}),(n=e==null?void 0:e.onError)==null||n.call(e,t),t},[e==null?void 0:e.onError]);return{loginWithPasskey:_react.useCallback.call(void 0, n=>_chunkC5WYSLQFjs.e.call(void 0, void 0,[n],function*({relyingParty:o,extra_options:t}){var u,r,k,y;try{if(_chunkSNODJ7VSjs.d.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_login_with_passkey_while_already_logged_in",error:"Already logged in, use `useLinkWithPasskey` if you are trying to link a passkey to an existing account"});s({status:"generating-challenege"});let{options:i}=yield a.auth.passkey.generateAuthenticationOptions(o);s({status:"awaiting-passkey"});let f=yield _chunkSNODJ7VSjs.W.call(void 0, {challenge:i.challenge,rpId:i.rp_id,extensions:{appid:(u=i.extensions)==null?void 0:u.app_id,credProps:(r=i.extensions)==null?void 0:r.cred_props,hmacCreateSecret:(k=i.extensions)==null?void 0:k.hmac_create_secret},timeout:i.timeout,allowCredentials:i.allow_credentials,userVerification:i.user_verification},t);s({status:"submitting-response"});let l=_chunkSNODJ7VSjs.a.call(void 0, ),C=yield a.auth.passkey.loginWithPasskey(f,i.challenge,o,{embedded:l==null?void 0:l.embedded});return s({status:"done"}),(y=e==null?void 0:e.onSuccess)==null||y.call(e,C.user,C.is_new_user),C.user}catch(m){throw c(m)}}),[a,c,e==null?void 0:e.onSuccess]),state:d}};var ge=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunkSNODJ7VSjs.qa),c=_react.useRef.call(void 0, e);_react.useEffect.call(void 0, ()=>{c.current=e},[e]);let S=_react.useCallback.call(void 0, t=>{var u,r;let n=_chunkSNODJ7VSjs.h.call(void 0, t);return s({status:"error",error:n}),(r=(u=c.current)==null?void 0:u.onError)==null||r.call(u,n),n},[s]);return{signupWithPasskey:_react.useCallback.call(void 0, u=>_chunkC5WYSLQFjs.e.call(void 0, void 0,[u],function*({relyingParty:t,extra_options:n}){var r,k;try{if(_chunkSNODJ7VSjs.d.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_login_with_passkey_while_already_logged_in",error:"Already logged in, use `useLinkWithPasskey` if you are trying to link a passkey to an existing account"});s({status:"generating-challenege"});let{options:m}=yield a.auth.passkey.generateSignupOptions(t);s({status:"awaiting-passkey"});let i=yield _chunkSNODJ7VSjs.V.call(void 0, _chunkSNODJ7VSjs.X.call(void 0, m),n);s({status:"submitting-response"});let f=_chunkSNODJ7VSjs.a.call(void 0, ),l=yield a.auth.passkey.signupWithPasskey(i,t,{embedded:f==null?void 0:f.embedded});return s({status:"done"}),(k=(r=c.current)==null?void 0:r.onSuccess)==null||k.call(r,l.user,l.is_new_user),{user:l.user}}catch(y){throw S(y)}}),[a.auth.passkey,S,s]),state:d}};exports.hasError = _chunkQSWCX5XIjs.g; exports.isConnected = _chunkQSWCX5XIjs.a; exports.isConnecting = _chunkQSWCX5XIjs.c; exports.isCreating = _chunkQSWCX5XIjs.f; exports.isDisconnected = _chunkQSWCX5XIjs.d; exports.isNotCreated = _chunkQSWCX5XIjs.e; exports.isReconnecting = _chunkQSWCX5XIjs.b; exports.needsRecovery = _chunkQSWCX5XIjs.h; exports.useLinkWithPasskey = Y; exports.useLoginWithPasskey = ie; exports.useSignupWithPasskey = ge;
|
package/dist/smart-wallets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunkSNODJ7VSjs = require('./chunk-SNODJ7VS.js');require('./chunk-F7DR7TVR.js');require('./chunk-3HF374LL.js');var _chunkC5WYSLQFjs = require('./chunk-C5WYSLQF.js');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _jssdkcore = require('@privy-io/js-sdk-core');var _viem = require('viem');var _smartwallets = require('@privy-io/js-sdk-core/smart-wallets');var x=w=>_chunkC5WYSLQFjs.e.call(void 0, void 0,[w],function*({chain:t,privyAppId:e,user:a,embeddedWallet:r,smartWalletsConfig:n,client:i,dataSuffix:c}){if(!(n!=null&&n.enabled)||!r||!_chunkQSWCX5XIjs.a.call(void 0, r))return;let s=yield i.embeddedWallet.getEthereumProvider({wallet:r.account,entropyId:r.account.address,entropyIdVerifier:"ethereum-address-verifier",onMfaEnrollmentRequired:y=>_chunkC5WYSLQFjs.e.call(void 0, void 0,null,function*(){return yield _chunkSNODJ7VSjs.b.call(void 0, )(y)}),onMfaVerificationRequired:y=>_chunkC5WYSLQFjs.e.call(void 0, void 0,null,function*(){return yield _chunkSNODJ7VSjs.c.call(void 0, )(y)})}),o=n==null?void 0:n.configured_networks.find(y=>y.chain_id===`eip155:${t.id}`);if(!o)throw new (0, _jssdkcore.PrivyClientError)({code:"chain_not_supported",error:`The chain ${t.name} (eip155:${t.id}) must be configured in the smart wallet configuration in your dashboard`});let l=_jssdkcore.getUserSmartWallet.call(void 0, a),C=l?l.smart_wallet_type:n.smart_wallet_type,W=l?l.smart_wallet_version:n.smart_wallet_version,V=_jssdkcore.getJsonRpcEndpointFromChain.call(void 0, t,{rpcUrls:[]},e),Y=_viem.createPublicClient.call(void 0, {chain:t,transport:_viem.http.call(void 0, V)}),A=yield _smartwallets.signerToSmartAccountClient.call(void 0, {owner:s,smartWalletType:C,smartWalletVersion:W,chain:t,publicClient:Y,paymasterContext:tt(o.paymaster_url,o.paymaster_context),bundlerUrl:o.bundler_url,paymasterUrl:o.paymaster_url});if(!A)throw new (0, _jssdkcore.PrivyClientError)({code:"smart_wallet_client_error",error:`Failed to create smart wallet client for chain ${t.name} (eip155:${t.id})`});return K(A,c)});function K(t,e){return e?t.extend(a=>({sendTransaction:r=>a.sendTransaction(_chunkC5WYSLQFjs.c.call(void 0, _chunkC5WYSLQFjs.b.call(void 0, {},r),{dataSuffix:e}))})):t}var z=/paymaster\.biconomy\.io\/api/i;function Q(t){return z.test(t)}var Z={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}},tt=(t,e)=>{if(t&&Q(t))return Z;if(e&&e.policy_id)return{policyId:e.policy_id}};var R=3,rt=500,nt= exports.SmartWalletsProvider =({children:t})=>_react2.default.createElement(lt,null,_react2.default.createElement(ot,null,_react2.default.createElement(st,null,t))),$=_react.createContext.call(void 0, {config:void 0}),b=()=>{let{config:t}=_react.useContext.call(void 0, $);return{config:t}},G=_react.createContext.call(void 0, {smartWalletClient:void 0}),at=()=>{let{smartWalletClient:t}=_react.useContext.call(void 0, G);return{smartWalletClient:t}},B=_react.createContext.call(void 0, {client:void 0}),it= exports.useSmartWallets =()=>{let{client:t}=_react.useContext.call(void 0, B),e=ct();return{client:t,getClientForChain:e}},lt=({children:t})=>{let[e,a]=_react.useState.call(void 0, void 0),r=_chunkSNODJ7VSjs.o.call(void 0, );return _react.useEffect.call(void 0, ()=>{!e&&r&&(()=>_chunkC5WYSLQFjs.e.call(void 0, void 0,null,function*(){try{if(!r){console.warn("No client found");return}let i=yield r.app.getSmartWalletConfig();a(i)}catch(i){console.warn("Error generating smart wallet config: ",i)}}))()},[r,e]),_react2.default.createElement($.Provider,{value:{config:e}},t)},ot=({children:t})=>{let{config:e}=b(),{client:a,wallet:r}=_react.useContext.call(void 0, _chunkSNODJ7VSjs.qa),n=_chunkSNODJ7VSjs.f.call(void 0, ),[i,c]=_react.useState.call(void 0, );return _react.useEffect.call(void 0, ()=>{(()=>_chunkC5WYSLQFjs.e.call(void 0, void 0,null,function*(){var l;if(!n&&i&&c(void 0),!(e!=null&&e.enabled)||!n||r.status!=="connected"||n&&i&&r.status==="connected")return;let s=a.embeddedWallet.chains.find(C=>e.configured_networks.map(W=>W.chain_id).includes(`eip155:${C.id}`));if(!s)throw new (0, _jssdkcore.PrivyClientError)({error:"Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.",code:"chain_not_supported"});let o=yield x({chain:s,privyAppId:a.app.appId,user:n,embeddedWallet:r,smartWalletsConfig:e,client:a,dataSuffix:(l=_jssdkcore.getDataSuffixPlugin.call(void 0, a.plugins))==null?void 0:l.suffix});if(!o)throw new (0, _jssdkcore.PrivyClientError)({error:"Could not create smart wallet client",code:"smart_wallet_client_error"});c(o)}))()},[!!(e!=null&&e.enabled),!!a,!!n,r.status]),_react2.default.createElement(G.Provider,{value:{smartWalletClient:i}},t)},st=({children:t})=>{let{client:e,wallet:a}=_react.useContext.call(void 0, _chunkSNODJ7VSjs.qa),r=_chunkSNODJ7VSjs.f.call(void 0, ),{smartWalletClient:n}=at(),{config:i}=b();return _react.useEffect.call(void 0, ()=>{let c=!1;return(()=>_chunkC5WYSLQFjs.e.call(void 0, void 0,null,function*(){var m;if(!(!n||!r||_jssdkcore.getUserSmartWallet.call(void 0, r)||!(i!=null&&i.enabled)||a.status!=="connected"))for(let s=0;s<R;s++){if(c||_jssdkcore.getUserSmartWallet.call(void 0, (m=_chunkSNODJ7VSjs.d.call(void 0, ))!=null?m:r))return;let o=!1;for(let l=0;l<5;l++){if(c)return;if(yield e.embeddedWallet.ping(rt)){o=!0;break}yield _chunkSNODJ7VSjs.k.call(void 0, 200*_chunkC5WYSLQFjs.a.call(void 0, 2,l))}if(o)try{let{message:l}=yield e.auth.smartWallet.init({address:n.account.address,chainId:`eip155:${n.chain.id}`}),C=yield n.signMessage({message:l});yield e.auth.smartWallet.link(l,C,i.smart_wallet_type,i.smart_wallet_version);return}catch(l){s===R-1?console.error("Error creating smart wallet:",l):yield _chunkSNODJ7VSjs.k.call(void 0, 500*_chunkC5WYSLQFjs.a.call(void 0, 2,s))}}}))(),()=>{c=!0}},[!!n,!!r,!!_jssdkcore.getUserSmartWallet.call(void 0, r),i,a.status]),_react2.default.createElement(B.Provider,{value:{client:_jssdkcore.getUserSmartWallet.call(void 0, r)?n:void 0}},t)},ct=()=>{let{client:t,wallet:e}=_react.useContext.call(void 0, _chunkSNODJ7VSjs.qa),{config:a}=b();return _react.useCallback.call(void 0, n=>_chunkC5WYSLQFjs.e.call(void 0, void 0,[n],function*({chainId:r}){var s;let i=_chunkSNODJ7VSjs.d.call(void 0, );if(!i)throw new (0, _jssdkcore.PrivyClientError)({error:"Must be logged in to get a smart wallet client",code:"smart_wallet_client_error"});if(!a||!a.enabled)throw new (0, _jssdkcore.PrivyClientError)({error:"Must have smart wallets enabled to get a smart wallet client",code:"smart_wallet_client_error"});let w=t.embeddedWallet.chains.find(o=>o.id===r);if(!w)throw new (0, _jssdkcore.PrivyClientError)({error:`Could not find chain with id: ${r}`,code:"chain_not_supported"});let m=yield x({chain:w,privyAppId:t.app.appId,user:i,embeddedWallet:e,smartWalletsConfig:a,client:t,dataSuffix:(s=_jssdkcore.getDataSuffixPlugin.call(void 0, t.plugins))==null?void 0:s.suffix});if(!m)throw new (0, _jssdkcore.PrivyClientError)({error:`Could not create smart wallet client for chain ${r}`,code:"smart_wallet_client_error"});return m}),[a,e,t])};exports.SmartWalletsProvider = nt; exports.useSmartWallets = it;
|