@privy-io/js-sdk-core 0.46.2 → 0.46.3
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/client/PrivyInternal.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/wallet-api/create.js +1 -0
- package/dist/dts/index.d.mts +14 -2
- package/dist/dts/index.d.ts +14 -2
- package/dist/esm/client/PrivyInternal.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/wallet-api/create.mjs +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("fetch-retry"),t=require("uuid"),s=require("@privy-io/api-base"),i=require("@privy-io/public-api"),r=require("../Error.js"),a=require("../Session.js"),n=require("../toAbortSignalTimeout.js"),o=require("../utils/toSearchParams.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("eventemitter3"),require("jose"),require("js-cookie"),require("../Token.js"),require("../utils/allSettled.js");var c=/*#__PURE__*/h(e);let l="privy:caid";exports.PrivyInternal=class{setCallbacks(e){this.callbacks={...this.callbacks,...e}}get isReady(){return!!this._config}get config(){return this._config}get caid(){return this._analyticsId}async _initialize(){if(this.isReady)this.callbacks?.setIsReady?.(!0);else{if(!await this.isStorageAccessible())throw new r.PrivyClientError({code:"storage_error",error:"Unable to access storage"});this._config=await this.getAppConfig(),this._config?.custom_api_url&&(this.baseUrl=this._config.custom_api_url,this.session.isUsingServerCookies=!0),this.callbacks?.setIsReady?.(!0),this._sdkVersion.startsWith("react-auth:")||this.createAnalyticsEvent("sdk_initialize",{})}}getPath(e,{params:t,query:s}){return`${this.baseUrl}${i.getPathWithParams(e.path,t)}${o.toSearchParams(s)}`}async fetch(e,{body:t,params:s,query:i,headers:a,onRequest:n=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:s,query:i}),{method:e.method,body:JSON.stringify(t),headers:a}),h=await n(o),c=await this._fetch(o,h),l=await c.json();if(c.status>299)throw new r.PrivyApiError(l);return l}async _beforeRequestWithoutInitialize(e){let t=await this.session.getToken(),s=new Headers(e.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-client",this._sdkVersion),t&&s.set("Authorization",`Bearer ${t}`),s.set("Content-Type","application/json"),s.set("Accept","application/json");let i=await this._getOrGenerateClientAnalyticsId();return i&&s.set("privy-ca-id",i),this.nativeAppIdentifier&&s.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:n.default(2e4),headers:s,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequest(e){return await this._initialize(),await this.getAccessToken(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(i.AppConfig,{params:{app_id:this.appId},onRequest:this._beforeRequestWithoutInitialize.bind(this)})}async _getOrGenerateClientAnalyticsId(){if(this._analyticsId)return this._analyticsId;try{let e=await this._storage.get(l);if("string"==typeof e&&e.length>0)return this._analyticsId=e,e}catch(e){console.error("Unable to load clientId",e)}try{this._analyticsId=t.v4()}catch(e){console.error("Unable to generate uuidv4",e)}if(!this._analyticsId)return null;try{await this._storage.put(l,this._analyticsId)}catch(e){console.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}async destroyClientAnalyticsId(){try{return await this._storage.del(l)}catch(e){console.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(i.AnalyticsEvent,{body:{event_name:e,client_id:await this._getOrGenerateClientAnalyticsId(),payload:t},onRequest:this.beforeRequestWithoutRefresh.bind(this)})}catch(e){}}async refreshSession(e=!1){if(!await this.isStorageAccessible())throw new r.PrivyClientError({code:"storage_error",error:"Unable to access storage"});let t=await this.session.getRefreshToken()??void 0,s=t??"key",i=this._cache.get(s);if(i)return console.debug("Found in-flight session refresh request, deduping"),await i;let a=this._refreshSession(t,e);this._cache.set(s,a);try{return await a}finally{this._cache.delete(s)}}async _refreshSession(e,t){let a=await this.session.getToken();if(!this.session.hasRefreshCredentials(a,e??null))throw this.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new r.PrivyApiError({code:s.PrivyErrorCode.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage"});try{this.debug(`[privy:refresh] fetching: ${i.RefreshSession.path}`);let s=await this.fetch(i.RefreshSession,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),r=s.session_update_action;return this.debug(`[privy:refresh] response: ${r}`),t||this.callbacks?.setUser?.(s.user),"set"===r&&(await this.session.updateWithTokensResponse(s),this.debug("[privy:refresh] tokens stored")),"clear"===r&&(await this.session.destroyLocalState(),this.debug("[privy:refresh] tokens cleared"),t||this.callbacks?.setUser?.(null)),"ignore"===r&&s.token&&(await this.session.storeToken(s.token),this.debug("[privy:refresh] access token stored"),s.identity_token&&(this.debug("[privy:refresh] identity token stored"),await this.session.storeIdentityToken(s.identity_token))),this.debug("[privy:refresh] returning response"),s}catch(e){throw this.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof r.PrivyApiError&&e.code===s.PrivyErrorCode.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),t||this.callbacks?.setUser?.(null)),e}}async getAccessToken(){let[e,t]=await Promise.all([this.session.getToken(),this.session.getRefreshToken()]);if(!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),s=await this.session.getToken();return t.token||this.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.debug("[privy:getAccessToken] expected new token in response received existing"),s===e&&this.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??s}return e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${t.v4()}`,s="blobby";await this._storage.put(e,s);let i=await this._storage.get(e);return await this._storage.del(e),i===s}catch(e){return console.error(e),!1}}debug(e){"DEBUG"===this._logLevel&&console.debug(e)}constructor(e){this._sdkVersion="js-sdk-core:0.46.
|
|
1
|
+
"use strict";var e=require("fetch-retry"),t=require("uuid"),s=require("@privy-io/api-base"),i=require("@privy-io/public-api"),r=require("../Error.js"),a=require("../Session.js"),n=require("../toAbortSignalTimeout.js"),o=require("../utils/toSearchParams.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("eventemitter3"),require("jose"),require("js-cookie"),require("../Token.js"),require("../utils/allSettled.js");var c=/*#__PURE__*/h(e);let l="privy:caid";exports.PrivyInternal=class{setCallbacks(e){this.callbacks={...this.callbacks,...e}}get isReady(){return!!this._config}get config(){return this._config}get caid(){return this._analyticsId}async _initialize(){if(this.isReady)this.callbacks?.setIsReady?.(!0);else{if(!await this.isStorageAccessible())throw new r.PrivyClientError({code:"storage_error",error:"Unable to access storage"});this._config=await this.getAppConfig(),this._config?.custom_api_url&&(this.baseUrl=this._config.custom_api_url,this.session.isUsingServerCookies=!0),this.callbacks?.setIsReady?.(!0),this._sdkVersion.startsWith("react-auth:")||this.createAnalyticsEvent("sdk_initialize",{})}}getPath(e,{params:t,query:s}){return`${this.baseUrl}${i.getPathWithParams(e.path,t)}${o.toSearchParams(s)}`}async fetch(e,{body:t,params:s,query:i,headers:a,onRequest:n=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:s,query:i}),{method:e.method,body:JSON.stringify(t),headers:a}),h=await n(o),c=await this._fetch(o,h),l=await c.json();if(c.status>299)throw new r.PrivyApiError(l);return l}async _beforeRequestWithoutInitialize(e){let t=await this.session.getToken(),s=new Headers(e.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-client",this._sdkVersion),t&&s.set("Authorization",`Bearer ${t}`),s.set("Content-Type","application/json"),s.set("Accept","application/json");let i=await this._getOrGenerateClientAnalyticsId();return i&&s.set("privy-ca-id",i),this.nativeAppIdentifier&&s.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:n.default(2e4),headers:s,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequest(e){return await this._initialize(),await this.getAccessToken(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(i.AppConfig,{params:{app_id:this.appId},onRequest:this._beforeRequestWithoutInitialize.bind(this)})}async _getOrGenerateClientAnalyticsId(){if(this._analyticsId)return this._analyticsId;try{let e=await this._storage.get(l);if("string"==typeof e&&e.length>0)return this._analyticsId=e,e}catch(e){console.error("Unable to load clientId",e)}try{this._analyticsId=t.v4()}catch(e){console.error("Unable to generate uuidv4",e)}if(!this._analyticsId)return null;try{await this._storage.put(l,this._analyticsId)}catch(e){console.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}async destroyClientAnalyticsId(){try{return await this._storage.del(l)}catch(e){console.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(i.AnalyticsEvent,{body:{event_name:e,client_id:await this._getOrGenerateClientAnalyticsId(),payload:t},onRequest:this.beforeRequestWithoutRefresh.bind(this)})}catch(e){}}async refreshSession(e=!1){if(!await this.isStorageAccessible())throw new r.PrivyClientError({code:"storage_error",error:"Unable to access storage"});let t=await this.session.getRefreshToken()??void 0,s=t??"key",i=this._cache.get(s);if(i)return console.debug("Found in-flight session refresh request, deduping"),await i;let a=this._refreshSession(t,e);this._cache.set(s,a);try{return await a}finally{this._cache.delete(s)}}async _refreshSession(e,t){let a=await this.session.getToken();if(!this.session.hasRefreshCredentials(a,e??null))throw this.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new r.PrivyApiError({code:s.PrivyErrorCode.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage"});try{this.debug(`[privy:refresh] fetching: ${i.RefreshSession.path}`);let s=await this.fetch(i.RefreshSession,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),r=s.session_update_action;return this.debug(`[privy:refresh] response: ${r}`),t||this.callbacks?.setUser?.(s.user),"set"===r&&(await this.session.updateWithTokensResponse(s),this.debug("[privy:refresh] tokens stored")),"clear"===r&&(await this.session.destroyLocalState(),this.debug("[privy:refresh] tokens cleared"),t||this.callbacks?.setUser?.(null)),"ignore"===r&&s.token&&(await this.session.storeToken(s.token),this.debug("[privy:refresh] access token stored"),s.identity_token&&(this.debug("[privy:refresh] identity token stored"),await this.session.storeIdentityToken(s.identity_token))),this.debug("[privy:refresh] returning response"),s}catch(e){throw this.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof r.PrivyApiError&&e.code===s.PrivyErrorCode.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),t||this.callbacks?.setUser?.(null)),e}}async getAccessToken(){let[e,t]=await Promise.all([this.session.getToken(),this.session.getRefreshToken()]);if(!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),s=await this.session.getToken();return t.token||this.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.debug("[privy:getAccessToken] expected new token in response received existing"),s===e&&this.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??s}return e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${t.v4()}`,s="blobby";await this._storage.put(e,s);let i=await this._storage.get(e);return await this._storage.del(e),i===s}catch(e){return console.error(e),!1}}debug(e){"DEBUG"===this._logLevel&&console.debug(e)}constructor(e){this._sdkVersion="js-sdk-core:0.46.3",this._cache=new Map,this._storage=e.storage,this._analyticsId=null,this._getOrGenerateClientAnalyticsId(),this.baseUrl=e.baseUrl??"https://auth.privy.io",this.appId=e.appId,this.appClientId=e.appClientId,this._sdkVersion=e.sdkVersion??this._sdkVersion,this._logLevel=e.logLevel,this.callbacks=e.callbacks,this.nativeAppIdentifier=e.nativeAppIdentifier,this.session=new a.Session({storage:this._storage,isUsingServerCookies:!1,appId:e.appId}),this._fetch=c.default(globalThis.fetch,{retries:3,retryDelay:e=>3**e*500,retryOn:[408,409,425,500,502,503,504]}),this.session.on("error_storing_tokens",(e=>{this.createAnalyticsEvent("error_updating_tokens_in_storage",{reason:e})}))}};
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./client/Privy.js"),r=require("@privy-io/public-api"),t=require("./storage/LocalStorage.js"),s=require("./storage/InMemoryStorage.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./client/Privy.js"),r=require("@privy-io/public-api"),t=require("./storage/LocalStorage.js"),s=require("./storage/InMemoryStorage.js"),i=require("./Error.js"),o=require("./embedded/errors.js"),a=require("./utils/getUserEmbeddedEthereumWallet.js"),n=require("./utils/getAllUserEmbeddedEthereumWallets.js"),l=require("./utils/getAllUserEmbeddedSolanaWallets.js"),u=require("./utils/getAllUserEmbeddedBitcoinWallets.js"),d=require("./utils/getEntropyDetailsFromUser.js"),p=require("./utils/getEntropyDetailsFromAccount.js"),c=require("./utils/getUserSmartWallet.js"),m=require("./embedded/utils/index.js"),j=require("./utils/phoneNumberUtils.js"),q=require("./utils/getUserEmbeddedSolanaWallet.js"),g=require("./utils/toObjectKeys.js"),b=require("./embedded/utils/gas.js"),A=require("./embedded/utils/ethers.js"),E=require("./utils/getIsTokenUsdc.js"),y=require("./funding/moonpay.js"),h=require("./funding/coinbase.js"),x=require("./solana/client.js"),C=require("./solana/createSiwsMessage.js"),f=require("./solana/getSolanaRpcEndpointForCluster.js"),P=require("./solana/getSolanaUsdcMintAddressForCluster.js"),S=require("./solana/getSolanaClusterDisplayName.js"),T=require("./types.js"),v=require("@privy-io/chains"),W=require("./utils/formatters.js"),M=require("./wallet-api/create.js"),I=require("./wallet-api/rpc.js"),U=require("libphonenumber-js/min"),O=require("./index-BDWdfIuK.js"),N=require("./index-DzfqDJJ9.js");require("./client/AppApi.js"),require("./client/CrossAppApi.js"),require("./Token.js"),require("jose"),require("./client/DelegatedWalletsApi.js"),require("./client/EmbeddedWalletApi.js"),require("./embedded/EmbeddedBitcoinWalletProvider.js"),require("./embedded/EmbeddedWalletProxy.js"),require("./utils/sleep.js"),require("./embedded/EventCallbackQueue.js"),require("./embedded/withMfa.js"),require("./embedded/EmbeddedWalletProvider.js"),require("eventemitter3"),require("./embedded/methods.js"),require("./embedded/EmbeddedSolanaWalletProvider.js"),require("./solana/getWalletPublicKeyFromTransaction.js"),require("./solana/isVersionedTransaction.js"),require("./client/MfaPromises.js"),require("./client/PrivyInternal.js"),require("fetch-retry"),require("uuid"),require("@privy-io/api-base"),require("./Session.js"),require("js-cookie"),require("./utils/allSettled.js"),require("./toAbortSignalTimeout.js"),require("./utils/toSearchParams.js"),require("./client/UserApi.js"),require("./client/auth/AuthApi.js"),require("./client/auth/CustomProviderApi.js"),require("./client/auth/maybeCreateWalletOnLogin.js"),require("./utils/shouldCreateEmbeddedEthWallet.js"),require("./utils/shouldCreateEmbeddedSolWallet.js"),require("./client/auth/EmailApi.js"),require("./client/auth/FarcasterApi.js"),require("./client/auth/FarcasterV2Api.js"),require("./client/auth/GuestApi.js"),require("./client/auth/OAuthApi.js"),require("./pkce.js"),require("./client/auth/PasskeyApi.js"),require("./client/auth/PhoneApi.js"),require("./client/auth/SiweApi.js"),require("./client/auth/SiwsApi.js"),require("./client/auth/SmartWalletApi.js"),require("./client/funding/FundingApi.js"),require("./client/funding/CoinbaseOnRampApi.js"),require("./client/funding/MoonpayOnRampApi.js"),require("./client/mfa/MfaApi.js"),require("./client/mfa/MfaPasskeyApi.js"),require("./client/mfa/MfaSmsApi.js"),require("./client/recovery/RecoveryApi.js"),require("./client/recovery/RecoveryICloudApi.js"),require("./client/recovery/RecoveryOAuthApi.js"),require("./embedded/types.js"),require("@ethersproject/abstract-signer"),require("@ethersproject/providers"),require("./embedded/gas/arbitrum.js"),require("@ethersproject/bignumber"),require("./embedded/gas/bsc.js"),require("./embedded/gas/op-stack.js"),require("@ethersproject/contracts"),require("@ethersproject/transactions"),require("./embedded/gas/polygon.js"),require("@ethersproject/units"),require("libphonenumber-js/examples.mobile.json"),require("viem"),require("canonicalize"),require("./action/delegatedActions/delegateWallet.js"),require("./action/delegatedActions/utils.js"),require("./action/delegatedActions/revokeWallets.js"),require("./action/crossApp/loginWithCrossAppAuth.js"),require("./action/crossApp/linkWithCrossAppAuth.js"),require("./index-CARkJvRM.js"),require("./action/crossApp/wallet/signMessage.js"),require("./action/crossApp/wallet/utils/isCrossAppWalletSmart.js"),require("./action/crossApp/wallet/utils/sendCrossAppRequest.js"),require("./action/crossApp/wallet/utils/getCrossAppAccountByWalletAddress.js"),require("./action/crossApp/wallet/utils/getProviderAccessTokenOrRelink.js"),require("./action/crossApp/wallet/utils/throwIfNotLoggedIn.js"),require("./action/crossApp/wallet/signTypedData.js"),require("./utils/typedData/generateDomainType.js"),require("./action/crossApp/wallet/sendTransaction.js"),exports.default=e.default,Object.defineProperty(exports,"BICONOMY",{enumerable:!0,get:function(){return r.BICONOMY}}),Object.defineProperty(exports,"COINBASE_SMART_WALLET",{enumerable:!0,get:function(){return r.COINBASE_SMART_WALLET}}),Object.defineProperty(exports,"KERNEL",{enumerable:!0,get:function(){return r.KERNEL}}),Object.defineProperty(exports,"LIGHT_ACCOUNT",{enumerable:!0,get:function(){return r.LIGHT_ACCOUNT}}),Object.defineProperty(exports,"SAFE",{enumerable:!0,get:function(){return r.SAFE}}),Object.defineProperty(exports,"THIRDWEB",{enumerable:!0,get:function(){return r.THIRDWEB}}),exports.LocalStorage=t.LocalStorage,exports.InMemoryCache=s.InMemoryCache,exports.MoonpayApiError=i.MoonpayApiError,exports.PrivyApiError=i.PrivyApiError,exports.PrivyClientError=i.PrivyClientError,exports.createErrorFormatter=i.createErrorFormatter,exports.errorIndicatesMfaCanceled=i.errorIndicatesMfaCanceled,exports.EmbeddedProviderError=o.EmbeddedProviderError,exports.PrivyConnectorError=o.PrivyConnectorError,exports.PrivyEmbeddedWalletErrorCode=o.PrivyEmbeddedWalletErrorCode,exports.PrivyProviderRpcError=o.PrivyProviderRpcError,exports.ProviderErrors=o.ProviderErrors,exports.errorIndicatesMaxMfaRetries=o.errorIndicatesMaxMfaRetries,exports.errorIndicatesMfaRateLimit=o.errorIndicatesMfaRateLimit,exports.errorIndicatesMfaTimeout=o.errorIndicatesMfaTimeout,exports.errorIndicatesMfaVerificationFailed=o.errorIndicatesMfaVerificationFailed,exports.errorIndicatesRecoveryIsNeeded=o.errorIndicatesRecoveryIsNeeded,exports.getUserEmbeddedEthereumWallet=a.getUserEmbeddedEthereumWallet,exports.getUserEmbeddedWallet=a.getUserEmbeddedWallet,exports.getAllUserEmbeddedEthereumWallets=n.getAllUserEmbeddedEthereumWallets,exports.getAllUserEmbeddedSolanaWallets=l.getAllUserEmbeddedSolanaWallets,exports.getAllUserEmbeddedBitcoinWallets=u.getAllUserEmbeddedBitcoinWallets,exports.getEntropyDetailsFromUser=d.getEntropyDetailsFromUser,exports.getEntropyDetailsFromAccount=p.getEntropyDetailsFromAccount,exports.getUserSmartWallet=c.getUserSmartWallet,exports.getJsonRpcEndpointFromChain=m.getJsonRpcEndpointFromChain,exports.populateTransactionRequest=m.populateTransactionRequest,exports.throwIfInvalidRecoveryUpgradePath=m.throwIfInvalidRecoveryUpgradePath,exports.countryCodesAndNumbers=j.countryCodesAndNumbers,exports.formatPhoneNumber=j.formatPhoneNumber,exports.getPhoneCountryCodeAndNumber=j.getPhoneCountryCodeAndNumber,exports.getPlaceholderPhoneNumber=j.getPlaceholderPhoneNumber,exports.lastFourDigits=j.lastFourDigits,exports.phoneNumberTypingFormatter=j.phoneNumberTypingFormatter,exports.validatePhoneNumber=j.validatePhoneNumber,exports.getUserEmbeddedSolanaWallet=q.getUserEmbeddedSolanaWallet,exports.toObjectKeys=g.toObjectKeys,exports.calculateTotalGasEstimate=b.calculateTotalGasEstimate,exports.QuantityToBigNumber=A.QuantityToBigNumber,exports.convertBigNumberish=A.convertBigNumberish,exports.toEthersUnsignedTransaction=A.toEthersUnsignedTransaction,exports.UsdcAddressMap=E.UsdcAddressMap,exports.getIsTokenUsdc=E.getIsTokenUsdc,exports.chainToMoonpayCurrency=y.chainToMoonpayCurrency,exports.fundingMethodToMoonpayPaymentMethod=y.fundingMethodToMoonpayPaymentMethod,exports.isSupportedChainIdForMoonpay=y.isSupportedChainIdForMoonpay,exports.getCoinbaseOnRampUrl=h.getCoinbaseOnRampUrl,exports.isSupportedChainIdForCoinbaseOnramp=h.isSupportedChainIdForCoinbaseOnramp,exports.toCoinbaseAssetId=h.toCoinbaseAssetId,exports.toCoinbaseBlockchainFromChainId=h.toCoinbaseBlockchainFromChainId,exports.SolanaClient=x.SolanaClient,exports.createSiwsMessage=C.createSiwsMessage,exports.getSolanaRpcEndpointForCluster=f.getSolanaRpcEndpointForCluster,exports.getSolanaUsdcMintAddressForCluster=P.getSolanaUsdcMintAddressForCluster,exports.getSolanaClusterDisplayName=S.getSolanaClusterDisplayName,exports.ALL_WALLET_CLIENT_TYPES=T.ALL_WALLET_CLIENT_TYPES,exports.SUPPORTED_CONNECTOR_TYPES=T.SUPPORTED_CONNECTOR_TYPES,exports.formatLamportsAmount=W.formatLamportsAmount,exports.formatTokenAmount=W.formatTokenAmount,exports.formatWalletAddress=W.formatWalletAddress,exports.formatWeiAmount=W.formatWeiAmount,exports.create=M.create,exports.rpc=I.rpc,Object.defineProperty(exports,"getCountryCallingCode",{enumerable:!0,get:function(){return U.getCountryCallingCode}}),exports.delegatedActions=O.index,exports.crossApp=N.index,Object.keys(v).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return v[e]}})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";let t={method:"POST",path:"/v1/wallets"};exports.create=async function(e,{request:r}){return await e.fetchPrivyRoute(t,{body:r})};
|
package/dist/dts/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Chain, RpcConfig } from '@privy-io/chains';
|
|
2
2
|
export * from '@privy-io/chains';
|
|
3
3
|
import * as _privy_io_public_api from '@privy-io/public-api';
|
|
4
|
-
import { PasskeyAuthenticateInputType, PrivyEthereumEmbeddedWalletAccount, PrivySolanaEmbeddedWalletAccount, PrivyUser, PrivySmartWalletConfigurationResponse, PrivyAuthenticatedUser, OAuthProviderType, SmartWalletType, CoinbaseOnRampInitInput, PrivyMoonpayOnRampSignInput, MfaPasskeyInitInputType, MfaSmsInitInputType, Route, PrivyBitcoinSegwitEmbeddedWalletAccount as PrivyBitcoinSegwitEmbeddedWalletAccount$1, PrivyBitcoinTaprootEmbeddedWalletAccount as PrivyBitcoinTaprootEmbeddedWalletAccount$1, PrivySmartWalletAccount, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampInitInput, WalletApiRpcResponseType, WalletApiRpcInputType } from '@privy-io/public-api';
|
|
4
|
+
import { PasskeyAuthenticateInputType, PrivyEthereumEmbeddedWalletAccount, PrivySolanaEmbeddedWalletAccount, PrivyUser, PrivySmartWalletConfigurationResponse, PrivyAuthenticatedUser, OAuthProviderType, SmartWalletType, CoinbaseOnRampInitInput, PrivyMoonpayOnRampSignInput, MfaPasskeyInitInputType, MfaSmsInitInputType, Route, PrivyBitcoinSegwitEmbeddedWalletAccount as PrivyBitcoinSegwitEmbeddedWalletAccount$1, PrivyBitcoinTaprootEmbeddedWalletAccount as PrivyBitcoinTaprootEmbeddedWalletAccount$1, PrivySmartWalletAccount, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampInitInput, WalletApiCreateResponseType, WalletApiCreateInputType, WalletApiRpcResponseType, WalletApiRpcInputType } from '@privy-io/public-api';
|
|
5
5
|
export { BICONOMY, COINBASE_SMART_WALLET, KERNEL, LIGHT_ACCOUNT, OAuthProviderType, SAFE, SmartWalletType, THIRDWEB } from '@privy-io/public-api';
|
|
6
6
|
import EventEmitter from 'eventemitter3';
|
|
7
7
|
import { PrivyErrorCode } from '@privy-io/api-base';
|
|
@@ -777,6 +777,7 @@ declare class AppApi {
|
|
|
777
777
|
wallet_connect_cloud_project_id: string | null;
|
|
778
778
|
custom_api_url: string | null;
|
|
779
779
|
embedded_wallet_config: {
|
|
780
|
+
mode: "legacy-embedded-wallets-only" | "user-controlled-server-wallets-only";
|
|
780
781
|
solana: {
|
|
781
782
|
create_on_login: "users-without-wallets" | "all-users" | "off";
|
|
782
783
|
};
|
|
@@ -7792,6 +7793,17 @@ declare namespace index {
|
|
|
7792
7793
|
export { type index_LinkWithCrossAppAuthDependencies as LinkWithCrossAppAuthDependencies, type index_LinkWithCrossAppAuthInput as LinkWithCrossAppAuthInput, type index_LinkWithCrossAppAuthOutput as LinkWithCrossAppAuthOutput, type index_LoginWithCrossAppAuthDependencies as LoginWithCrossAppAuthDependencies, type index_LoginWithCrossAppAuthInput as LoginWithCrossAppAuthInput, type index_LoginWithCrossAppAuthOutput as LoginWithCrossAppAuthOutput, index_linkWithCrossAppAuth as linkWithCrossAppAuth, index_loginWithCrossAppAuth as loginWithCrossAppAuth, index$1 as wallet };
|
|
7793
7794
|
}
|
|
7794
7795
|
|
|
7796
|
+
type Input$1 = {
|
|
7797
|
+
request: WalletApiCreateInputType & {
|
|
7798
|
+
owner_id: string;
|
|
7799
|
+
};
|
|
7800
|
+
};
|
|
7801
|
+
declare function create(
|
|
7802
|
+
/** A instance of the Privy client */
|
|
7803
|
+
client: Privy,
|
|
7804
|
+
/** Request input */
|
|
7805
|
+
{ request }: Input$1): Promise<WalletApiCreateResponseType>;
|
|
7806
|
+
|
|
7795
7807
|
type Input = WalletApiRpcInputType & {
|
|
7796
7808
|
wallet_id: string;
|
|
7797
7809
|
};
|
|
@@ -7809,4 +7821,4 @@ declare function rpc(client: Privy, sign: (o: {
|
|
|
7809
7821
|
signature: string;
|
|
7810
7822
|
}>, { wallet_id, ...request }: Input): Promise<WalletApiRpcResponseType>;
|
|
7811
7823
|
|
|
7812
|
-
export { ALL_WALLET_CLIENT_TYPES, type Cluster, type CoinbaseAssetId, type CoinbaseWalletClientType, type ConnectorType, type CreateSiwsMessageOpts, type EIP1193Provider, EmbeddedBitcoinWalletProvider, EmbeddedProviderError, type EmbeddedWalletClientType, type EmbeddedWalletConfig, type EmbeddedWalletRecoveryOptions, type EntropyIdVerifier, type ErrorMessageMap, type ExternalWallet, type ExternalWalletMetadata, type FundingMethod, type FundingProvider, InMemoryCache, type InjectedWalletClientType, LocalStorage, type LogLevel, type MfaMethod, type MfaPromise, type MfaSubmitArgs, type MfaSubmitPromise, MoonpayApiError, type MoonpayTransactionStatus, type MoonpayTransactionStatusResponse, type OnNeedsRecovery, type PaymentOption, type PreparedTransactionRequest, PrivyApiError, PrivyClientError, PrivyConnectorError, type PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletErrorCode, type PrivyEmbeddedWalletProvider, PrivyProviderRpcError, ProviderErrors, type Quantity, QuantityToBigNumber, SUPPORTED_CONNECTOR_TYPES, type SetRecoveryInput, SolanaClient, type SolanaCluster, type Storage, type UnknownWalletClientType, type UnsignedTransactionRequest, type UnsignedTransactionRequestWithChainId, UsdcAddressMap, type WalletBranding, type WalletClientType, type WalletConnectWalletClientType, calculateTotalGasEstimate, chainToMoonpayCurrency, convertBigNumberish, countryCodesAndNumbers, createErrorFormatter, createSiwsMessage, index as crossApp, Privy as default, index$2 as delegatedActions, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCoinbaseOnRampUrl, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getIsTokenUsdc, getJsonRpcEndpointFromChain, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, lastFourDigits, phoneNumberTypingFormatter, populateTransactionRequest, rpc, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toEthersUnsignedTransaction, toObjectKeys, validatePhoneNumber };
|
|
7824
|
+
export { ALL_WALLET_CLIENT_TYPES, type Cluster, type CoinbaseAssetId, type CoinbaseWalletClientType, type ConnectorType, type CreateSiwsMessageOpts, type EIP1193Provider, EmbeddedBitcoinWalletProvider, EmbeddedProviderError, type EmbeddedWalletClientType, type EmbeddedWalletConfig, type EmbeddedWalletRecoveryOptions, type EntropyIdVerifier, type ErrorMessageMap, type ExternalWallet, type ExternalWalletMetadata, type FundingMethod, type FundingProvider, InMemoryCache, type InjectedWalletClientType, LocalStorage, type LogLevel, type MfaMethod, type MfaPromise, type MfaSubmitArgs, type MfaSubmitPromise, MoonpayApiError, type MoonpayTransactionStatus, type MoonpayTransactionStatusResponse, type OnNeedsRecovery, type PaymentOption, type PreparedTransactionRequest, PrivyApiError, PrivyClientError, PrivyConnectorError, type PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletErrorCode, type PrivyEmbeddedWalletProvider, PrivyProviderRpcError, ProviderErrors, type Quantity, QuantityToBigNumber, SUPPORTED_CONNECTOR_TYPES, type SetRecoveryInput, SolanaClient, type SolanaCluster, type Storage, type UnknownWalletClientType, type UnsignedTransactionRequest, type UnsignedTransactionRequestWithChainId, UsdcAddressMap, type WalletBranding, type WalletClientType, type WalletConnectWalletClientType, calculateTotalGasEstimate, chainToMoonpayCurrency, convertBigNumberish, countryCodesAndNumbers, create, createErrorFormatter, createSiwsMessage, index as crossApp, Privy as default, index$2 as delegatedActions, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCoinbaseOnRampUrl, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getIsTokenUsdc, getJsonRpcEndpointFromChain, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, lastFourDigits, phoneNumberTypingFormatter, populateTransactionRequest, rpc, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toEthersUnsignedTransaction, toObjectKeys, validatePhoneNumber };
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Chain, RpcConfig } from '@privy-io/chains';
|
|
2
2
|
export * from '@privy-io/chains';
|
|
3
3
|
import * as _privy_io_public_api from '@privy-io/public-api';
|
|
4
|
-
import { PasskeyAuthenticateInputType, PrivyEthereumEmbeddedWalletAccount, PrivySolanaEmbeddedWalletAccount, PrivyUser, PrivySmartWalletConfigurationResponse, PrivyAuthenticatedUser, OAuthProviderType, SmartWalletType, CoinbaseOnRampInitInput, PrivyMoonpayOnRampSignInput, MfaPasskeyInitInputType, MfaSmsInitInputType, Route, PrivyBitcoinSegwitEmbeddedWalletAccount as PrivyBitcoinSegwitEmbeddedWalletAccount$1, PrivyBitcoinTaprootEmbeddedWalletAccount as PrivyBitcoinTaprootEmbeddedWalletAccount$1, PrivySmartWalletAccount, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampInitInput, WalletApiRpcResponseType, WalletApiRpcInputType } from '@privy-io/public-api';
|
|
4
|
+
import { PasskeyAuthenticateInputType, PrivyEthereumEmbeddedWalletAccount, PrivySolanaEmbeddedWalletAccount, PrivyUser, PrivySmartWalletConfigurationResponse, PrivyAuthenticatedUser, OAuthProviderType, SmartWalletType, CoinbaseOnRampInitInput, PrivyMoonpayOnRampSignInput, MfaPasskeyInitInputType, MfaSmsInitInputType, Route, PrivyBitcoinSegwitEmbeddedWalletAccount as PrivyBitcoinSegwitEmbeddedWalletAccount$1, PrivyBitcoinTaprootEmbeddedWalletAccount as PrivyBitcoinTaprootEmbeddedWalletAccount$1, PrivySmartWalletAccount, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampInitInput, WalletApiCreateResponseType, WalletApiCreateInputType, WalletApiRpcResponseType, WalletApiRpcInputType } from '@privy-io/public-api';
|
|
5
5
|
export { BICONOMY, COINBASE_SMART_WALLET, KERNEL, LIGHT_ACCOUNT, OAuthProviderType, SAFE, SmartWalletType, THIRDWEB } from '@privy-io/public-api';
|
|
6
6
|
import EventEmitter from 'eventemitter3';
|
|
7
7
|
import { PrivyErrorCode } from '@privy-io/api-base';
|
|
@@ -777,6 +777,7 @@ declare class AppApi {
|
|
|
777
777
|
wallet_connect_cloud_project_id: string | null;
|
|
778
778
|
custom_api_url: string | null;
|
|
779
779
|
embedded_wallet_config: {
|
|
780
|
+
mode: "legacy-embedded-wallets-only" | "user-controlled-server-wallets-only";
|
|
780
781
|
solana: {
|
|
781
782
|
create_on_login: "users-without-wallets" | "all-users" | "off";
|
|
782
783
|
};
|
|
@@ -7792,6 +7793,17 @@ declare namespace index {
|
|
|
7792
7793
|
export { type index_LinkWithCrossAppAuthDependencies as LinkWithCrossAppAuthDependencies, type index_LinkWithCrossAppAuthInput as LinkWithCrossAppAuthInput, type index_LinkWithCrossAppAuthOutput as LinkWithCrossAppAuthOutput, type index_LoginWithCrossAppAuthDependencies as LoginWithCrossAppAuthDependencies, type index_LoginWithCrossAppAuthInput as LoginWithCrossAppAuthInput, type index_LoginWithCrossAppAuthOutput as LoginWithCrossAppAuthOutput, index_linkWithCrossAppAuth as linkWithCrossAppAuth, index_loginWithCrossAppAuth as loginWithCrossAppAuth, index$1 as wallet };
|
|
7793
7794
|
}
|
|
7794
7795
|
|
|
7796
|
+
type Input$1 = {
|
|
7797
|
+
request: WalletApiCreateInputType & {
|
|
7798
|
+
owner_id: string;
|
|
7799
|
+
};
|
|
7800
|
+
};
|
|
7801
|
+
declare function create(
|
|
7802
|
+
/** A instance of the Privy client */
|
|
7803
|
+
client: Privy,
|
|
7804
|
+
/** Request input */
|
|
7805
|
+
{ request }: Input$1): Promise<WalletApiCreateResponseType>;
|
|
7806
|
+
|
|
7795
7807
|
type Input = WalletApiRpcInputType & {
|
|
7796
7808
|
wallet_id: string;
|
|
7797
7809
|
};
|
|
@@ -7809,4 +7821,4 @@ declare function rpc(client: Privy, sign: (o: {
|
|
|
7809
7821
|
signature: string;
|
|
7810
7822
|
}>, { wallet_id, ...request }: Input): Promise<WalletApiRpcResponseType>;
|
|
7811
7823
|
|
|
7812
|
-
export { ALL_WALLET_CLIENT_TYPES, type Cluster, type CoinbaseAssetId, type CoinbaseWalletClientType, type ConnectorType, type CreateSiwsMessageOpts, type EIP1193Provider, EmbeddedBitcoinWalletProvider, EmbeddedProviderError, type EmbeddedWalletClientType, type EmbeddedWalletConfig, type EmbeddedWalletRecoveryOptions, type EntropyIdVerifier, type ErrorMessageMap, type ExternalWallet, type ExternalWalletMetadata, type FundingMethod, type FundingProvider, InMemoryCache, type InjectedWalletClientType, LocalStorage, type LogLevel, type MfaMethod, type MfaPromise, type MfaSubmitArgs, type MfaSubmitPromise, MoonpayApiError, type MoonpayTransactionStatus, type MoonpayTransactionStatusResponse, type OnNeedsRecovery, type PaymentOption, type PreparedTransactionRequest, PrivyApiError, PrivyClientError, PrivyConnectorError, type PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletErrorCode, type PrivyEmbeddedWalletProvider, PrivyProviderRpcError, ProviderErrors, type Quantity, QuantityToBigNumber, SUPPORTED_CONNECTOR_TYPES, type SetRecoveryInput, SolanaClient, type SolanaCluster, type Storage, type UnknownWalletClientType, type UnsignedTransactionRequest, type UnsignedTransactionRequestWithChainId, UsdcAddressMap, type WalletBranding, type WalletClientType, type WalletConnectWalletClientType, calculateTotalGasEstimate, chainToMoonpayCurrency, convertBigNumberish, countryCodesAndNumbers, createErrorFormatter, createSiwsMessage, index as crossApp, Privy as default, index$2 as delegatedActions, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCoinbaseOnRampUrl, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getIsTokenUsdc, getJsonRpcEndpointFromChain, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, lastFourDigits, phoneNumberTypingFormatter, populateTransactionRequest, rpc, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toEthersUnsignedTransaction, toObjectKeys, validatePhoneNumber };
|
|
7824
|
+
export { ALL_WALLET_CLIENT_TYPES, type Cluster, type CoinbaseAssetId, type CoinbaseWalletClientType, type ConnectorType, type CreateSiwsMessageOpts, type EIP1193Provider, EmbeddedBitcoinWalletProvider, EmbeddedProviderError, type EmbeddedWalletClientType, type EmbeddedWalletConfig, type EmbeddedWalletRecoveryOptions, type EntropyIdVerifier, type ErrorMessageMap, type ExternalWallet, type ExternalWalletMetadata, type FundingMethod, type FundingProvider, InMemoryCache, type InjectedWalletClientType, LocalStorage, type LogLevel, type MfaMethod, type MfaPromise, type MfaSubmitArgs, type MfaSubmitPromise, MoonpayApiError, type MoonpayTransactionStatus, type MoonpayTransactionStatusResponse, type OnNeedsRecovery, type PaymentOption, type PreparedTransactionRequest, PrivyApiError, PrivyClientError, PrivyConnectorError, type PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletErrorCode, type PrivyEmbeddedWalletProvider, PrivyProviderRpcError, ProviderErrors, type Quantity, QuantityToBigNumber, SUPPORTED_CONNECTOR_TYPES, type SetRecoveryInput, SolanaClient, type SolanaCluster, type Storage, type UnknownWalletClientType, type UnsignedTransactionRequest, type UnsignedTransactionRequestWithChainId, UsdcAddressMap, type WalletBranding, type WalletClientType, type WalletConnectWalletClientType, calculateTotalGasEstimate, chainToMoonpayCurrency, convertBigNumberish, countryCodesAndNumbers, create, createErrorFormatter, createSiwsMessage, index as crossApp, Privy as default, index$2 as delegatedActions, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCoinbaseOnRampUrl, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getIsTokenUsdc, getJsonRpcEndpointFromChain, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, lastFourDigits, phoneNumberTypingFormatter, populateTransactionRequest, rpc, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toEthersUnsignedTransaction, toObjectKeys, validatePhoneNumber };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"fetch-retry";import{v4 as t}from"uuid";import{PrivyErrorCode as s}from"@privy-io/api-base";import{getPathWithParams as i,AppConfig as r,AnalyticsEvent as a,RefreshSession as n}from"@privy-io/public-api";import{PrivyClientError as o,PrivyApiError as h}from"../Error.mjs";import{Session as c}from"../Session.mjs";import l from"../toAbortSignalTimeout.mjs";import{toSearchParams as d}from"../utils/toSearchParams.mjs";import"eventemitter3";import"jose";import"js-cookie";import"../Token.mjs";import"../utils/allSettled.mjs";let p="privy:caid";class u{setCallbacks(e){this.callbacks={...this.callbacks,...e}}get isReady(){return!!this._config}get config(){return this._config}get caid(){return this._analyticsId}async _initialize(){if(this.isReady)this.callbacks?.setIsReady?.(!0);else{if(!await this.isStorageAccessible())throw new o({code:"storage_error",error:"Unable to access storage"});this._config=await this.getAppConfig(),this._config?.custom_api_url&&(this.baseUrl=this._config.custom_api_url,this.session.isUsingServerCookies=!0),this.callbacks?.setIsReady?.(!0),this._sdkVersion.startsWith("react-auth:")||this.createAnalyticsEvent("sdk_initialize",{})}}getPath(e,{params:t,query:s}){return`${this.baseUrl}${i(e.path,t)}${d(s)}`}async fetch(e,{body:t,params:s,query:i,headers:r,onRequest:a=this._beforeRequest.bind(this)}){let n=new Request(this.getPath(e,{params:s,query:i}),{method:e.method,body:JSON.stringify(t),headers:r}),o=await a(n),c=await this._fetch(n,o),l=await c.json();if(c.status>299)throw new h(l);return l}async _beforeRequestWithoutInitialize(e){let t=await this.session.getToken(),s=new Headers(e.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-client",this._sdkVersion),t&&s.set("Authorization",`Bearer ${t}`),s.set("Content-Type","application/json"),s.set("Accept","application/json");let i=await this._getOrGenerateClientAnalyticsId();return i&&s.set("privy-ca-id",i),this.nativeAppIdentifier&&s.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:l(2e4),headers:s,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequest(e){return await this._initialize(),await this.getAccessToken(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(r,{params:{app_id:this.appId},onRequest:this._beforeRequestWithoutInitialize.bind(this)})}async _getOrGenerateClientAnalyticsId(){if(this._analyticsId)return this._analyticsId;try{let e=await this._storage.get(p);if("string"==typeof e&&e.length>0)return this._analyticsId=e,e}catch(e){console.error("Unable to load clientId",e)}try{this._analyticsId=t()}catch(e){console.error("Unable to generate uuidv4",e)}if(!this._analyticsId)return null;try{await this._storage.put(p,this._analyticsId)}catch(e){console.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}async destroyClientAnalyticsId(){try{return await this._storage.del(p)}catch(e){console.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(a,{body:{event_name:e,client_id:await this._getOrGenerateClientAnalyticsId(),payload:t},onRequest:this.beforeRequestWithoutRefresh.bind(this)})}catch(e){}}async refreshSession(e=!1){if(!await this.isStorageAccessible())throw new o({code:"storage_error",error:"Unable to access storage"});let t=await this.session.getRefreshToken()??void 0,s=t??"key",i=this._cache.get(s);if(i)return console.debug("Found in-flight session refresh request, deduping"),await i;let r=this._refreshSession(t,e);this._cache.set(s,r);try{return await r}finally{this._cache.delete(s)}}async _refreshSession(e,t){let i=await this.session.getToken();if(!this.session.hasRefreshCredentials(i,e??null))throw this.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new h({code:s.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage"});try{this.debug(`[privy:refresh] fetching: ${n.path}`);let s=await this.fetch(n,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),i=s.session_update_action;return this.debug(`[privy:refresh] response: ${i}`),t||this.callbacks?.setUser?.(s.user),"set"===i&&(await this.session.updateWithTokensResponse(s),this.debug("[privy:refresh] tokens stored")),"clear"===i&&(await this.session.destroyLocalState(),this.debug("[privy:refresh] tokens cleared"),t||this.callbacks?.setUser?.(null)),"ignore"===i&&s.token&&(await this.session.storeToken(s.token),this.debug("[privy:refresh] access token stored"),s.identity_token&&(this.debug("[privy:refresh] identity token stored"),await this.session.storeIdentityToken(s.identity_token))),this.debug("[privy:refresh] returning response"),s}catch(e){throw this.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof h&&e.code===s.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),t||this.callbacks?.setUser?.(null)),e}}async getAccessToken(){let[e,t]=await Promise.all([this.session.getToken(),this.session.getRefreshToken()]);if(!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),s=await this.session.getToken();return t.token||this.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.debug("[privy:getAccessToken] expected new token in response received existing"),s===e&&this.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??s}return e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${t()}`,s="blobby";await this._storage.put(e,s);let i=await this._storage.get(e);return await this._storage.del(e),i===s}catch(e){return console.error(e),!1}}debug(e){"DEBUG"===this._logLevel&&console.debug(e)}constructor(t){this._sdkVersion="js-sdk-core:0.46.
|
|
1
|
+
import e from"fetch-retry";import{v4 as t}from"uuid";import{PrivyErrorCode as s}from"@privy-io/api-base";import{getPathWithParams as i,AppConfig as r,AnalyticsEvent as a,RefreshSession as n}from"@privy-io/public-api";import{PrivyClientError as o,PrivyApiError as h}from"../Error.mjs";import{Session as c}from"../Session.mjs";import l from"../toAbortSignalTimeout.mjs";import{toSearchParams as d}from"../utils/toSearchParams.mjs";import"eventemitter3";import"jose";import"js-cookie";import"../Token.mjs";import"../utils/allSettled.mjs";let p="privy:caid";class u{setCallbacks(e){this.callbacks={...this.callbacks,...e}}get isReady(){return!!this._config}get config(){return this._config}get caid(){return this._analyticsId}async _initialize(){if(this.isReady)this.callbacks?.setIsReady?.(!0);else{if(!await this.isStorageAccessible())throw new o({code:"storage_error",error:"Unable to access storage"});this._config=await this.getAppConfig(),this._config?.custom_api_url&&(this.baseUrl=this._config.custom_api_url,this.session.isUsingServerCookies=!0),this.callbacks?.setIsReady?.(!0),this._sdkVersion.startsWith("react-auth:")||this.createAnalyticsEvent("sdk_initialize",{})}}getPath(e,{params:t,query:s}){return`${this.baseUrl}${i(e.path,t)}${d(s)}`}async fetch(e,{body:t,params:s,query:i,headers:r,onRequest:a=this._beforeRequest.bind(this)}){let n=new Request(this.getPath(e,{params:s,query:i}),{method:e.method,body:JSON.stringify(t),headers:r}),o=await a(n),c=await this._fetch(n,o),l=await c.json();if(c.status>299)throw new h(l);return l}async _beforeRequestWithoutInitialize(e){let t=await this.session.getToken(),s=new Headers(e.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-client",this._sdkVersion),t&&s.set("Authorization",`Bearer ${t}`),s.set("Content-Type","application/json"),s.set("Accept","application/json");let i=await this._getOrGenerateClientAnalyticsId();return i&&s.set("privy-ca-id",i),this.nativeAppIdentifier&&s.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:l(2e4),headers:s,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequest(e){return await this._initialize(),await this.getAccessToken(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(r,{params:{app_id:this.appId},onRequest:this._beforeRequestWithoutInitialize.bind(this)})}async _getOrGenerateClientAnalyticsId(){if(this._analyticsId)return this._analyticsId;try{let e=await this._storage.get(p);if("string"==typeof e&&e.length>0)return this._analyticsId=e,e}catch(e){console.error("Unable to load clientId",e)}try{this._analyticsId=t()}catch(e){console.error("Unable to generate uuidv4",e)}if(!this._analyticsId)return null;try{await this._storage.put(p,this._analyticsId)}catch(e){console.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}async destroyClientAnalyticsId(){try{return await this._storage.del(p)}catch(e){console.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(a,{body:{event_name:e,client_id:await this._getOrGenerateClientAnalyticsId(),payload:t},onRequest:this.beforeRequestWithoutRefresh.bind(this)})}catch(e){}}async refreshSession(e=!1){if(!await this.isStorageAccessible())throw new o({code:"storage_error",error:"Unable to access storage"});let t=await this.session.getRefreshToken()??void 0,s=t??"key",i=this._cache.get(s);if(i)return console.debug("Found in-flight session refresh request, deduping"),await i;let r=this._refreshSession(t,e);this._cache.set(s,r);try{return await r}finally{this._cache.delete(s)}}async _refreshSession(e,t){let i=await this.session.getToken();if(!this.session.hasRefreshCredentials(i,e??null))throw this.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new h({code:s.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage"});try{this.debug(`[privy:refresh] fetching: ${n.path}`);let s=await this.fetch(n,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),i=s.session_update_action;return this.debug(`[privy:refresh] response: ${i}`),t||this.callbacks?.setUser?.(s.user),"set"===i&&(await this.session.updateWithTokensResponse(s),this.debug("[privy:refresh] tokens stored")),"clear"===i&&(await this.session.destroyLocalState(),this.debug("[privy:refresh] tokens cleared"),t||this.callbacks?.setUser?.(null)),"ignore"===i&&s.token&&(await this.session.storeToken(s.token),this.debug("[privy:refresh] access token stored"),s.identity_token&&(this.debug("[privy:refresh] identity token stored"),await this.session.storeIdentityToken(s.identity_token))),this.debug("[privy:refresh] returning response"),s}catch(e){throw this.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof h&&e.code===s.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),t||this.callbacks?.setUser?.(null)),e}}async getAccessToken(){let[e,t]=await Promise.all([this.session.getToken(),this.session.getRefreshToken()]);if(!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),s=await this.session.getToken();return t.token||this.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.debug("[privy:getAccessToken] expected new token in response received existing"),s===e&&this.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??s}return e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${t()}`,s="blobby";await this._storage.put(e,s);let i=await this._storage.get(e);return await this._storage.del(e),i===s}catch(e){return console.error(e),!1}}debug(e){"DEBUG"===this._logLevel&&console.debug(e)}constructor(t){this._sdkVersion="js-sdk-core:0.46.3",this._cache=new Map,this._storage=t.storage,this._analyticsId=null,this._getOrGenerateClientAnalyticsId(),this.baseUrl=t.baseUrl??"https://auth.privy.io",this.appId=t.appId,this.appClientId=t.appClientId,this._sdkVersion=t.sdkVersion??this._sdkVersion,this._logLevel=t.logLevel,this.callbacks=t.callbacks,this.nativeAppIdentifier=t.nativeAppIdentifier,this.session=new c({storage:this._storage,isUsingServerCookies:!1,appId:t.appId}),this._fetch=e(globalThis.fetch,{retries:3,retryDelay:e=>3**e*500,retryOn:[408,409,425,500,502,503,504]}),this.session.on("error_storing_tokens",(e=>{this.createAnalyticsEvent("error_updating_tokens_in_storage",{reason:e})}))}}export{u as PrivyInternal};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./client/Privy.mjs";export{BICONOMY,COINBASE_SMART_WALLET,KERNEL,LIGHT_ACCOUNT,SAFE,THIRDWEB}from"@privy-io/public-api";export{LocalStorage}from"./storage/LocalStorage.mjs";export{InMemoryCache}from"./storage/InMemoryStorage.mjs";export{MoonpayApiError,PrivyApiError,PrivyClientError,createErrorFormatter,errorIndicatesMfaCanceled}from"./Error.mjs";export{EmbeddedProviderError,PrivyConnectorError,PrivyEmbeddedWalletErrorCode,PrivyProviderRpcError,ProviderErrors,errorIndicatesMaxMfaRetries,errorIndicatesMfaRateLimit,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,errorIndicatesRecoveryIsNeeded}from"./embedded/errors.mjs";export{getUserEmbeddedEthereumWallet,getUserEmbeddedWallet}from"./utils/getUserEmbeddedEthereumWallet.mjs";export{getAllUserEmbeddedEthereumWallets}from"./utils/getAllUserEmbeddedEthereumWallets.mjs";export{getAllUserEmbeddedSolanaWallets}from"./utils/getAllUserEmbeddedSolanaWallets.mjs";export{getAllUserEmbeddedBitcoinWallets}from"./utils/getAllUserEmbeddedBitcoinWallets.mjs";export{getEntropyDetailsFromUser}from"./utils/getEntropyDetailsFromUser.mjs";export{getEntropyDetailsFromAccount}from"./utils/getEntropyDetailsFromAccount.mjs";export{getUserSmartWallet}from"./utils/getUserSmartWallet.mjs";export{getJsonRpcEndpointFromChain,populateTransactionRequest,throwIfInvalidRecoveryUpgradePath}from"./embedded/utils/index.mjs";export{countryCodesAndNumbers,formatPhoneNumber,getPhoneCountryCodeAndNumber,getPlaceholderPhoneNumber,lastFourDigits,phoneNumberTypingFormatter,validatePhoneNumber}from"./utils/phoneNumberUtils.mjs";export{getUserEmbeddedSolanaWallet}from"./utils/getUserEmbeddedSolanaWallet.mjs";export{toObjectKeys}from"./utils/toObjectKeys.mjs";export{calculateTotalGasEstimate}from"./embedded/utils/gas.mjs";export{QuantityToBigNumber,convertBigNumberish,toEthersUnsignedTransaction}from"./embedded/utils/ethers.mjs";export{UsdcAddressMap,getIsTokenUsdc}from"./utils/getIsTokenUsdc.mjs";export{chainToMoonpayCurrency,fundingMethodToMoonpayPaymentMethod,isSupportedChainIdForMoonpay}from"./funding/moonpay.mjs";export{getCoinbaseOnRampUrl,isSupportedChainIdForCoinbaseOnramp,toCoinbaseAssetId,toCoinbaseBlockchainFromChainId}from"./funding/coinbase.mjs";export{SolanaClient}from"./solana/client.mjs";export{createSiwsMessage}from"./solana/createSiwsMessage.mjs";export{getSolanaRpcEndpointForCluster}from"./solana/getSolanaRpcEndpointForCluster.mjs";export{getSolanaUsdcMintAddressForCluster}from"./solana/getSolanaUsdcMintAddressForCluster.mjs";export{getSolanaClusterDisplayName}from"./solana/getSolanaClusterDisplayName.mjs";export{ALL_WALLET_CLIENT_TYPES,SUPPORTED_CONNECTOR_TYPES}from"./types.mjs";export*from"@privy-io/chains";export{formatLamportsAmount,formatTokenAmount,formatWalletAddress,formatWeiAmount}from"./utils/formatters.mjs";export{rpc}from"./wallet-api/rpc.mjs";export{getCountryCallingCode}from"libphonenumber-js/min";export{i as delegatedActions}from"./index-g0cxoRWQ.mjs";export{i as crossApp}from"./index-Bu3ySxLM.mjs";import"./client/AppApi.mjs";import"./client/CrossAppApi.mjs";import"./Token.mjs";import"jose";import"./client/DelegatedWalletsApi.mjs";import"./client/EmbeddedWalletApi.mjs";import"./embedded/EmbeddedBitcoinWalletProvider.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/EmbeddedSolanaWalletProvider.mjs";import"./solana/getWalletPublicKeyFromTransaction.mjs";import"./solana/isVersionedTransaction.mjs";import"./client/MfaPromises.mjs";import"./client/PrivyInternal.mjs";import"fetch-retry";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"./client/UserApi.mjs";import"./client/auth/AuthApi.mjs";import"./client/auth/CustomProviderApi.mjs";import"./client/auth/maybeCreateWalletOnLogin.mjs";import"./utils/shouldCreateEmbeddedEthWallet.mjs";import"./utils/shouldCreateEmbeddedSolWallet.mjs";import"./client/auth/EmailApi.mjs";import"./client/auth/FarcasterApi.mjs";import"./client/auth/FarcasterV2Api.mjs";import"./client/auth/GuestApi.mjs";import"./client/auth/OAuthApi.mjs";import"./pkce.mjs";import"./client/auth/PasskeyApi.mjs";import"./client/auth/PhoneApi.mjs";import"./client/auth/SiweApi.mjs";import"./client/auth/SiwsApi.mjs";import"./client/auth/SmartWalletApi.mjs";import"./client/funding/FundingApi.mjs";import"./client/funding/CoinbaseOnRampApi.mjs";import"./client/funding/MoonpayOnRampApi.mjs";import"./client/mfa/MfaApi.mjs";import"./client/mfa/MfaPasskeyApi.mjs";import"./client/mfa/MfaSmsApi.mjs";import"./client/recovery/RecoveryApi.mjs";import"./client/recovery/RecoveryICloudApi.mjs";import"./client/recovery/RecoveryOAuthApi.mjs";import"./embedded/types.mjs";import"@ethersproject/abstract-signer";import"@ethersproject/providers";import"./embedded/gas/arbitrum.mjs";import"@ethersproject/bignumber";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"libphonenumber-js/examples.mobile.json";import"viem";import"canonicalize";import"./action/delegatedActions/delegateWallet.mjs";import"./action/delegatedActions/utils.mjs";import"./action/delegatedActions/revokeWallets.mjs";import"./action/crossApp/loginWithCrossAppAuth.mjs";import"./action/crossApp/linkWithCrossAppAuth.mjs";import"./index-DTAjYY8z.mjs";import"./action/crossApp/wallet/signMessage.mjs";import"./action/crossApp/wallet/utils/isCrossAppWalletSmart.mjs";import"./action/crossApp/wallet/utils/sendCrossAppRequest.mjs";import"./action/crossApp/wallet/utils/getCrossAppAccountByWalletAddress.mjs";import"./action/crossApp/wallet/utils/getProviderAccessTokenOrRelink.mjs";import"./action/crossApp/wallet/utils/throwIfNotLoggedIn.mjs";import"./action/crossApp/wallet/signTypedData.mjs";import"./utils/typedData/generateDomainType.mjs";import"./action/crossApp/wallet/sendTransaction.mjs";export{e as default};
|
|
1
|
+
import e from"./client/Privy.mjs";export{BICONOMY,COINBASE_SMART_WALLET,KERNEL,LIGHT_ACCOUNT,SAFE,THIRDWEB}from"@privy-io/public-api";export{LocalStorage}from"./storage/LocalStorage.mjs";export{InMemoryCache}from"./storage/InMemoryStorage.mjs";export{MoonpayApiError,PrivyApiError,PrivyClientError,createErrorFormatter,errorIndicatesMfaCanceled}from"./Error.mjs";export{EmbeddedProviderError,PrivyConnectorError,PrivyEmbeddedWalletErrorCode,PrivyProviderRpcError,ProviderErrors,errorIndicatesMaxMfaRetries,errorIndicatesMfaRateLimit,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,errorIndicatesRecoveryIsNeeded}from"./embedded/errors.mjs";export{getUserEmbeddedEthereumWallet,getUserEmbeddedWallet}from"./utils/getUserEmbeddedEthereumWallet.mjs";export{getAllUserEmbeddedEthereumWallets}from"./utils/getAllUserEmbeddedEthereumWallets.mjs";export{getAllUserEmbeddedSolanaWallets}from"./utils/getAllUserEmbeddedSolanaWallets.mjs";export{getAllUserEmbeddedBitcoinWallets}from"./utils/getAllUserEmbeddedBitcoinWallets.mjs";export{getEntropyDetailsFromUser}from"./utils/getEntropyDetailsFromUser.mjs";export{getEntropyDetailsFromAccount}from"./utils/getEntropyDetailsFromAccount.mjs";export{getUserSmartWallet}from"./utils/getUserSmartWallet.mjs";export{getJsonRpcEndpointFromChain,populateTransactionRequest,throwIfInvalidRecoveryUpgradePath}from"./embedded/utils/index.mjs";export{countryCodesAndNumbers,formatPhoneNumber,getPhoneCountryCodeAndNumber,getPlaceholderPhoneNumber,lastFourDigits,phoneNumberTypingFormatter,validatePhoneNumber}from"./utils/phoneNumberUtils.mjs";export{getUserEmbeddedSolanaWallet}from"./utils/getUserEmbeddedSolanaWallet.mjs";export{toObjectKeys}from"./utils/toObjectKeys.mjs";export{calculateTotalGasEstimate}from"./embedded/utils/gas.mjs";export{QuantityToBigNumber,convertBigNumberish,toEthersUnsignedTransaction}from"./embedded/utils/ethers.mjs";export{UsdcAddressMap,getIsTokenUsdc}from"./utils/getIsTokenUsdc.mjs";export{chainToMoonpayCurrency,fundingMethodToMoonpayPaymentMethod,isSupportedChainIdForMoonpay}from"./funding/moonpay.mjs";export{getCoinbaseOnRampUrl,isSupportedChainIdForCoinbaseOnramp,toCoinbaseAssetId,toCoinbaseBlockchainFromChainId}from"./funding/coinbase.mjs";export{SolanaClient}from"./solana/client.mjs";export{createSiwsMessage}from"./solana/createSiwsMessage.mjs";export{getSolanaRpcEndpointForCluster}from"./solana/getSolanaRpcEndpointForCluster.mjs";export{getSolanaUsdcMintAddressForCluster}from"./solana/getSolanaUsdcMintAddressForCluster.mjs";export{getSolanaClusterDisplayName}from"./solana/getSolanaClusterDisplayName.mjs";export{ALL_WALLET_CLIENT_TYPES,SUPPORTED_CONNECTOR_TYPES}from"./types.mjs";export*from"@privy-io/chains";export{formatLamportsAmount,formatTokenAmount,formatWalletAddress,formatWeiAmount}from"./utils/formatters.mjs";export{create}from"./wallet-api/create.mjs";export{rpc}from"./wallet-api/rpc.mjs";export{getCountryCallingCode}from"libphonenumber-js/min";export{i as delegatedActions}from"./index-g0cxoRWQ.mjs";export{i as crossApp}from"./index-Bu3ySxLM.mjs";import"./client/AppApi.mjs";import"./client/CrossAppApi.mjs";import"./Token.mjs";import"jose";import"./client/DelegatedWalletsApi.mjs";import"./client/EmbeddedWalletApi.mjs";import"./embedded/EmbeddedBitcoinWalletProvider.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/EmbeddedSolanaWalletProvider.mjs";import"./solana/getWalletPublicKeyFromTransaction.mjs";import"./solana/isVersionedTransaction.mjs";import"./client/MfaPromises.mjs";import"./client/PrivyInternal.mjs";import"fetch-retry";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"./client/UserApi.mjs";import"./client/auth/AuthApi.mjs";import"./client/auth/CustomProviderApi.mjs";import"./client/auth/maybeCreateWalletOnLogin.mjs";import"./utils/shouldCreateEmbeddedEthWallet.mjs";import"./utils/shouldCreateEmbeddedSolWallet.mjs";import"./client/auth/EmailApi.mjs";import"./client/auth/FarcasterApi.mjs";import"./client/auth/FarcasterV2Api.mjs";import"./client/auth/GuestApi.mjs";import"./client/auth/OAuthApi.mjs";import"./pkce.mjs";import"./client/auth/PasskeyApi.mjs";import"./client/auth/PhoneApi.mjs";import"./client/auth/SiweApi.mjs";import"./client/auth/SiwsApi.mjs";import"./client/auth/SmartWalletApi.mjs";import"./client/funding/FundingApi.mjs";import"./client/funding/CoinbaseOnRampApi.mjs";import"./client/funding/MoonpayOnRampApi.mjs";import"./client/mfa/MfaApi.mjs";import"./client/mfa/MfaPasskeyApi.mjs";import"./client/mfa/MfaSmsApi.mjs";import"./client/recovery/RecoveryApi.mjs";import"./client/recovery/RecoveryICloudApi.mjs";import"./client/recovery/RecoveryOAuthApi.mjs";import"./embedded/types.mjs";import"@ethersproject/abstract-signer";import"@ethersproject/providers";import"./embedded/gas/arbitrum.mjs";import"@ethersproject/bignumber";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"libphonenumber-js/examples.mobile.json";import"viem";import"canonicalize";import"./action/delegatedActions/delegateWallet.mjs";import"./action/delegatedActions/utils.mjs";import"./action/delegatedActions/revokeWallets.mjs";import"./action/crossApp/loginWithCrossAppAuth.mjs";import"./action/crossApp/linkWithCrossAppAuth.mjs";import"./index-DTAjYY8z.mjs";import"./action/crossApp/wallet/signMessage.mjs";import"./action/crossApp/wallet/utils/isCrossAppWalletSmart.mjs";import"./action/crossApp/wallet/utils/sendCrossAppRequest.mjs";import"./action/crossApp/wallet/utils/getCrossAppAccountByWalletAddress.mjs";import"./action/crossApp/wallet/utils/getProviderAccessTokenOrRelink.mjs";import"./action/crossApp/wallet/utils/throwIfNotLoggedIn.mjs";import"./action/crossApp/wallet/signTypedData.mjs";import"./utils/typedData/generateDomainType.mjs";import"./action/crossApp/wallet/sendTransaction.mjs";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function t(t,{request:a}){return await t.fetchPrivyRoute(e,{body:a})}let e={method:"POST",path:"/v1/wallets"};export{t as create};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@privy-io/js-sdk-core",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.3",
|
|
4
4
|
"description": "Vanilla JS client for the Privy Auth API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@ethersproject/transactions": "^5.7.0",
|
|
69
69
|
"@ethersproject/units": "^5.7.0",
|
|
70
70
|
"@privy-io/api-base": "1.4.5",
|
|
71
|
-
"@privy-io/public-api": "2.20.
|
|
71
|
+
"@privy-io/public-api": "2.20.3",
|
|
72
72
|
"canonicalize": "^2.0.0",
|
|
73
73
|
"@privy-io/chains": "0.0.1",
|
|
74
74
|
"eventemitter3": "^5.0.1",
|