@privy-io/js-sdk-core
Version:
Vanilla JS client for the Privy Auth API
2 lines (1 loc) • 4.43 kB
JavaScript
import e from"./AppApi.mjs";import t from"./CrossAppApi.mjs";import i from"./DelegatedWalletsApi.mjs";import r from"./EmbeddedWalletApi.mjs";import s from"./MfaPromises.mjs";import{PrivyInternal as m}from"./PrivyInternal.mjs";import o from"./UserApi.mjs";import p from"./auth/AuthApi.mjs";import a from"./funding/FundingApi.mjs";import d from"./mfa/MfaApi.mjs";import n from"./recovery/RecoveryApi.mjs";import"@privy-io/public-api";import"../Token.mjs";import"jose";import"@privy-io/chains";import"../Error.mjs";import"../embedded/EmbeddedBitcoinWalletProvider.mjs";import"../wallet-api/unified-wallet.mjs";import"../embedded/errors.mjs";import"../embedded/types.mjs";import"../embedded/stack/walletCreate.mjs";import"../wallet-api/create.mjs";import"../embedded/utils/index.mjs";import"@ethersproject/abstract-signer";import"@ethersproject/providers";import"../embedded/gas/arbitrum.mjs";import"@ethersproject/bignumber";import"../embedded/utils/ethers.mjs";import"../embedded/gas/bsc.mjs";import"../embedded/gas/op-stack.mjs";import"@ethersproject/contracts";import"@ethersproject/transactions";import"../embedded/gas/polygon.mjs";import"@ethersproject/units";import"fetch-retry";import"../embedded/utils/gas.mjs";import"../embedded/EmbeddedWalletProxy.mjs";import"../utils/sleep.mjs";import"../embedded/EventCallbackQueue.mjs";import"../embedded/withMfa.mjs";import"../embedded/EmbeddedWalletProvider.mjs";import"eventemitter3";import"../embedded/methods.mjs";import"../embedded/stack/walletRpc.mjs";import"../utils/encodings.mjs";import"../wallet-api/rpc.mjs";import"../wallet-api/generate-authorization-signature.mjs";import"canonicalize";import"../embedded/stack/wallet-api-eth-transaction.mjs";import"../embedded/stack/wallet-api-eth-typed-data.mjs";import"../embedded/EmbeddedSolanaWalletProvider.mjs";import"../solana/getWalletPublicKeyFromTransaction.mjs";import"../solana/isVersionedTransaction.mjs";import"uuid";import"@privy-io/api-base";import"../Session.mjs";import"js-cookie";import"../utils/allSettled.mjs";import"../toAbortSignalTimeout.mjs";import"../utils/toSearchParams.mjs";import"./logger.mjs";import"../utils/noop.mjs";import"./auth/CustomProviderApi.mjs";import"./auth/maybeCreateWalletOnLogin.mjs";import"../utils/getUserEmbeddedEthereumWallet.mjs";import"../utils/getAllUserEmbeddedEthereumWallets.mjs";import"../utils/embedded-wallets.mjs";import"../utils/getUserEmbeddedSolanaWallet.mjs";import"../utils/getAllUserEmbeddedSolanaWallets.mjs";import"../utils/shouldCreateEmbeddedEthWallet.mjs";import"../utils/shouldCreateEmbeddedSolWallet.mjs";import"./auth/EmailApi.mjs";import"./auth/FarcasterApi.mjs";import"./auth/FarcasterV2Api.mjs";import"./auth/GuestApi.mjs";import"./auth/OAuthApi.mjs";import"../pkce.mjs";import"./auth/PasskeyApi.mjs";import"./auth/PhoneApi.mjs";import"./auth/SiweApi.mjs";import"./auth/SiwsApi.mjs";import"./auth/SmartWalletApi.mjs";import"./funding/CoinbaseOnRampApi.mjs";import"./funding/MoonpayOnRampApi.mjs";import"../funding/moonpay.mjs";import"./mfa/MfaPasskeyApi.mjs";import"./mfa/MfaSmsApi.mjs";import"./recovery/RecoveryICloudApi.mjs";import"./recovery/RecoveryOAuthApi.mjs";class l{async initialize(){await this._privyInternal._initialize()}setMessagePoster(e){this.embeddedWallet.setMessagePoster(e)}addOAuthTokensListener(e){return this._privyInternal.session.on("oauth_tokens_granted",e),{unsubscribe:()=>{this._privyInternal.session.removeListener("oauth_tokens_granted",e)}}}setCallbacks(e){this._privyInternal.setCallbacks(e)}getAccessToken(){return this._privyInternal.getAccessToken()}getIdentityToken(){return this._privyInternal.getIdentityToken()}getCompiledPath(e,t){return this._privyInternal.getPath(e,t)}async fetchPrivyRoute(e,t){return this._privyInternal.fetch(e,t)}get logger(){return this._privyInternal.logger}constructor({clientId:l,...j}){this._privyInternal=new m({...j,appClientId:l}),this.mfa=new d(this._privyInternal),this.mfaPromises=new s,this.app=new e(this._privyInternal),this.embeddedWallet=new r(this._privyInternal,j.embeddedWalletMessagePoster,j.supportedChains,this.mfa,this.mfaPromises,this.app),this.user=new o(this._privyInternal),this.auth=new p(this._privyInternal,this.embeddedWallet,j.storage,j.crypto),this.recovery=new n(this._privyInternal,j.storage,j.crypto),this.funding=new a(this._privyInternal),this.delegated=new i(this._privyInternal),this.crossApp=new t(this._privyInternal,j.storage)}}export{l as default};