@privy-io/js-sdk-core 0.65.4 → 0.66.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/cjs/action/depositAddress/index.js +2 -0
- package/dist/cjs/action/depositAddress/index.js.map +1 -0
- package/dist/cjs/action/depositAddress/types.js +2 -0
- package/dist/cjs/action/depositAddress/types.js.map +1 -0
- package/dist/cjs/action/index.js +1 -1
- package/dist/cjs/client/PrivyInternal.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/index.d.mts +150 -34
- package/dist/dts/index.d.ts +150 -34
- package/dist/esm/action/depositAddress/index.mjs +2 -0
- package/dist/esm/action/depositAddress/index.mjs.map +1 -0
- package/dist/esm/action/depositAddress/types.mjs +2 -0
- package/dist/esm/action/depositAddress/types.mjs.map +1 -0
- package/dist/esm/action/index.mjs +1 -1
- package/dist/esm/client/PrivyInternal.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"names":[],"mappings":""}
|
package/dist/cjs/action/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../index-BDWdfIuK.js"),s=require("../index-DzfqDJJ9.js");require("./delegatedActions/delegateWallet.js"),require("../Error.js"),require("../wallet-api/unified-wallet.js"),require("./delegatedActions/utils.js"),require("../utils/getAllUserEmbeddedEthereumWallets.js"),require("../utils/embedded-wallets.js"),require("../utils/getAllUserEmbeddedSolanaWallets.js"),require("../utils/getUserEmbeddedEthereumWallet.js"),require("../utils/getUserEmbeddedSolanaWallet.js"),require("./delegatedActions/revokeWallets.js"),require("./crossApp/loginWithCrossAppAuth.js"),require("./crossApp/linkWithCrossAppAuth.js"),require("../index-CARkJvRM.js"),require("./crossApp/wallet/signMessage.js"),require("./crossApp/wallet/utils/isCrossAppWalletSmart.js"),require("./crossApp/wallet/utils/sendCrossAppRequest.js"),require("./crossApp/wallet/utils/getCrossAppAccountByWalletAddress.js"),require("./crossApp/wallet/utils/getProviderAccessTokenOrRelink.js"),require("./crossApp/wallet/utils/throwIfNotLoggedIn.js"),require("./crossApp/wallet/signTypedData.js"),require("../utils/typedData/generateDomainType.js"),require("./crossApp/wallet/sendTransaction.js"),exports.delegatedActions=e.index,exports.crossApp=s.index;
|
|
1
|
+
"use strict";var e=require("../index-BDWdfIuK.js"),s=require("../index-DzfqDJJ9.js"),r=require("./depositAddress/index.js");require("./delegatedActions/delegateWallet.js"),require("../Error.js"),require("../wallet-api/unified-wallet.js"),require("./delegatedActions/utils.js"),require("../utils/getAllUserEmbeddedEthereumWallets.js"),require("../utils/embedded-wallets.js"),require("../utils/getAllUserEmbeddedSolanaWallets.js"),require("../utils/getUserEmbeddedEthereumWallet.js"),require("../utils/getUserEmbeddedSolanaWallet.js"),require("./delegatedActions/revokeWallets.js"),require("./crossApp/loginWithCrossAppAuth.js"),require("./crossApp/linkWithCrossAppAuth.js"),require("../index-CARkJvRM.js"),require("./crossApp/wallet/signMessage.js"),require("./crossApp/wallet/utils/isCrossAppWalletSmart.js"),require("./crossApp/wallet/utils/sendCrossAppRequest.js"),require("./crossApp/wallet/utils/getCrossAppAccountByWalletAddress.js"),require("./crossApp/wallet/utils/getProviderAccessTokenOrRelink.js"),require("./crossApp/wallet/utils/throwIfNotLoggedIn.js"),require("./crossApp/wallet/signTypedData.js"),require("../utils/typedData/generateDomainType.js"),require("./crossApp/wallet/sendTransaction.js"),exports.delegatedActions=e.index,exports.crossApp=s.index,exports.depositAddress=r.index;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("fetch-retry"),t=require("@privy-io/api-base"),s=require("@privy-io/routes"),i=require("../Error.js"),r=require("../Session.js"),a=require("../toAbortSignalTimeout.js"),n=require("../utils/toSearchParams.js"),o=require("./logger.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"),require("../utils/noop.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 i.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:i}){return`${this.baseUrl}${s.getPathWithParams(e.path,t)}${n.toSearchParams(i)}`}async fetch(e,{body:t,params:s,query:r,headers:a,onRequest:n=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:s,query:r}),{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 i.PrivyApiError({...l,status:c.status});return l}async _beforeRequestWithoutInitialize(e){let t=await this.session.getPrivyAccessToken()??await this.session.getCustomerAccessToken(),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:a.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.getAccessTokenInternal(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(s.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){this.logger.error("Unable to load clientId",e)}try{this._analyticsId=this._crypto.randomUUID()}catch(e){this.logger.error("Unable to generate uuidv4",e)}if(this._analyticsId){try{await this._storage.put(l,this._analyticsId)}catch(e){this.logger.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}}async destroyClientAnalyticsId(){try{return await this._storage.del(l)}catch(e){this.logger.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(s.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 i.PrivyClientError({code:"storage_error",error:"Unable to access storage"});let t=await this.session.getRefreshToken()??void 0,s=t??"key",r=this._cache.get(s);if(r)return this.logger.debug("[privy:refresh] found in-flight session refresh request, deduping"),await r;let a=this._refreshSession(t,e);this._cache.set(s,a);try{return await a}finally{this._cache.delete(s)}}async _refreshSession(e,r){let a=await this.session.getCustomerAccessToken();if(!this.session.hasRefreshCredentials(a,e??null))throw this.logger.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new i.PrivyApiError({code:t.PrivyErrorCode.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage",status:401});try{this.logger.debug(`[privy:refresh] fetching: ${s.RefreshSession.path}`);let t=await this.fetch(s.RefreshSession,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),i=t.session_update_action;return this.logger.debug(`[privy:refresh] response: ${i}`),"set"===i&&(await this.session.updateWithTokensResponse(t),this.logger.debug("[privy:refresh] tokens stored")),"clear"===i&&(await this.session.destroyLocalState(),this.logger.debug("[privy:refresh] tokens cleared"),r||this.callbacks?.setUser?.(null)),"ignore"===i&&(t.token&&(await this.session.storeCustomerAccessToken(t.token),this.logger.debug("[privy:refresh] token stored (CAT)")),t.privy_access_token&&(await this.session.storePrivyAccessToken(t.privy_access_token),this.logger.debug("[privy:refresh] token stored (PAT)")),t.identity_token&&(this.logger.debug("[privy:refresh] token stored (IDT)"),await this.session.storeIdentityToken(t.identity_token))),this.logger.debug("[privy:refresh] returning response"),r||this.callbacks?.setUser?.(t.user),t}catch(e){throw this.logger.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof i.PrivyApiError&&e.code===t.PrivyErrorCode.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),r||this.callbacks?.setUser?.(null)),e}}async getAccessToken(){let[e,t]=await Promise.all([this.session.getCustomerAccessToken(),this.session.getRefreshToken()]);if(e&&!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),s=await this.session.getCustomerAccessToken();return t.token||this.logger.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.logger.debug("[privy:getAccessToken] expected new token in response received existing"),s===e&&this.logger.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??s}return e&&!this.session.tokenIsActive(e)?(this.logger.debug("[privy:getAccessToken] unable to refresh inactive token"),this.callbacks?.setUser?.(null),await this.session.destroyLocalState(),null):e}async getAccessTokenInternal(){let e=await this.getAccessToken();return await this.session.getPrivyAccessToken()??e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${this._crypto.randomUUID()}`,t="blobby";await this._storage.put(e,t);let s=await this._storage.get(e);return await this._storage.del(e),s===t}catch(e){return this.logger.error(e),!1}}constructor(e){this._sdkVersion="js-sdk-core:0.
|
|
1
|
+
"use strict";var e=require("fetch-retry"),t=require("@privy-io/api-base"),s=require("@privy-io/routes"),i=require("../Error.js"),r=require("../Session.js"),a=require("../toAbortSignalTimeout.js"),n=require("../utils/toSearchParams.js"),o=require("./logger.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"),require("../utils/noop.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 i.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:i}){return`${this.baseUrl}${s.getPathWithParams(e.path,t)}${n.toSearchParams(i)}`}async fetch(e,{body:t,params:s,query:r,headers:a,onRequest:n=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:s,query:r}),{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 i.PrivyApiError({...l,status:c.status});return l}async _beforeRequestWithoutInitialize(e){let t=await this.session.getPrivyAccessToken()??await this.session.getCustomerAccessToken(),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:a.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.getAccessTokenInternal(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(s.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){this.logger.error("Unable to load clientId",e)}try{this._analyticsId=this._crypto.randomUUID()}catch(e){this.logger.error("Unable to generate uuidv4",e)}if(this._analyticsId){try{await this._storage.put(l,this._analyticsId)}catch(e){this.logger.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}}async destroyClientAnalyticsId(){try{return await this._storage.del(l)}catch(e){this.logger.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(s.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 i.PrivyClientError({code:"storage_error",error:"Unable to access storage"});let t=await this.session.getRefreshToken()??void 0,s=t??"key",r=this._cache.get(s);if(r)return this.logger.debug("[privy:refresh] found in-flight session refresh request, deduping"),await r;let a=this._refreshSession(t,e);this._cache.set(s,a);try{return await a}finally{this._cache.delete(s)}}async _refreshSession(e,r){let a=await this.session.getCustomerAccessToken();if(!this.session.hasRefreshCredentials(a,e??null))throw this.logger.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new i.PrivyApiError({code:t.PrivyErrorCode.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage",status:401});try{this.logger.debug(`[privy:refresh] fetching: ${s.RefreshSession.path}`);let t=await this.fetch(s.RefreshSession,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),i=t.session_update_action;return this.logger.debug(`[privy:refresh] response: ${i}`),"set"===i&&(await this.session.updateWithTokensResponse(t),this.logger.debug("[privy:refresh] tokens stored")),"clear"===i&&(await this.session.destroyLocalState(),this.logger.debug("[privy:refresh] tokens cleared"),r||this.callbacks?.setUser?.(null)),"ignore"===i&&(t.token&&(await this.session.storeCustomerAccessToken(t.token),this.logger.debug("[privy:refresh] token stored (CAT)")),t.privy_access_token&&(await this.session.storePrivyAccessToken(t.privy_access_token),this.logger.debug("[privy:refresh] token stored (PAT)")),t.identity_token&&(this.logger.debug("[privy:refresh] token stored (IDT)"),await this.session.storeIdentityToken(t.identity_token))),this.logger.debug("[privy:refresh] returning response"),r||this.callbacks?.setUser?.(t.user),t}catch(e){throw this.logger.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof i.PrivyApiError&&e.code===t.PrivyErrorCode.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),r||this.callbacks?.setUser?.(null)),e}}async getAccessToken(){let[e,t]=await Promise.all([this.session.getCustomerAccessToken(),this.session.getRefreshToken()]);if(e&&!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),s=await this.session.getCustomerAccessToken();return t.token||this.logger.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.logger.debug("[privy:getAccessToken] expected new token in response received existing"),s===e&&this.logger.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??s}return e&&!this.session.tokenIsActive(e)?(this.logger.debug("[privy:getAccessToken] unable to refresh inactive token"),this.callbacks?.setUser?.(null),await this.session.destroyLocalState(),null):e}async getAccessTokenInternal(){let e=await this.getAccessToken();return await this.session.getPrivyAccessToken()??e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${this._crypto.randomUUID()}`,t="blobby";await this._storage.put(e,t);let s=await this._storage.get(e);return await this._storage.del(e),s===t}catch(e){return this.logger.error(e),!1}}constructor(e){this._sdkVersion="js-sdk-core:0.66.0",this._cache=new Map,this.logger=o.toLoggerWithLevel({level:e.logger?.level??e.logLevel??"ERROR",logger:e.logger??console}),this._storage=e.storage,this._crypto=e.crypto,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.callbacks=e.callbacks,this.nativeAppIdentifier=e.nativeAppIdentifier,this.session=new r.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})}))}};
|
|
2
2
|
//# sourceMappingURL=PrivyInternal.js.map
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./client/Privy.js"),r=require("./storage/LocalStorage.js"),t=require("./storage/InMemoryStorage.js"),s=require("./Error.js"),i=require("./embedded/errors.js"),o=require("./utils/getUserEmbeddedEthereumWallet.js"),a=require("./utils/getAllUserEmbeddedEthereumWallets.js"),l=require("./utils/getAllUserEmbeddedSolanaWallets.js"),n=require("./utils/getAllUserEmbeddedBitcoinWallets.js"),d=require("./utils/embedded-wallets.js"),u=require("./utils/entropy.js"),p=require("./utils/getUserSmartWallet.js"),c=require("./embedded/utils/index.js"),m=require("./embedded/stack/wallet-api-eth-transaction.js"),q=require("./utils/phoneNumberUtils.js"),j=require("./utils/getUserEmbeddedSolanaWallet.js"),g=require("./utils/toObjectKeys.js"),A=require("./utils/getIsTokenUsdc.js"),x=require("./utils/generateWalletIdempotencyKey.js"),b=require("./funding/moonpay.js"),y=require("./funding/coinbase.js"),E=require("./solana/client.js"),h=require("./solana/createSiwsMessage.js"),C=require("./solana/getSolanaRpcEndpointForCluster.js"),S=require("./solana/getSolanaUsdcMintAddressForCluster.js"),W=require("./solana/getSolanaClusterDisplayName.js"),f=require("./types.js"),P=require("@privy-io/chains"),v=require("./utils/formatters.js"),M=require("./wallet-api/generate-authorization-signature.js"),U=require("./wallet-api/create.js"),I=require("./wallet-api/rpc.js"),T=require("./wallet-api/raw-sign.js"),w=require("./wallet-api/get-wallet.js"),R=require("./wallet-api/update-wallet.js"),F=require("./wallet-api/unified-wallet.js"),N=require("./embedded/stack/session-signers.js"),O=require("./solana/ConnectedStandardSolanaWallet.js"),k=require("./utils/poll.js"),L=require("./index-DzfqDJJ9.js"),_=require("./index-BDWdfIuK.js"),D=require("libphonenumber-js/min");require("./crypto/resolve.js"),require("./client/AppApi.js"),require("@privy-io/routes"),require("./client/CrossAppApi.js"),require("./Token.js"),require("jose"),require("./client/DelegatedWalletsApi.js"),require("./client/EmbeddedWalletApi.js"),require("./embedded/EmbeddedBitcoinWalletProvider.js"),require("./embedded/stack/walletCreate.js"),require("./embedded/EmbeddedWalletProxy.js"),require("./utils/sleep.js"),require("./embedded/EventCallbackQueue.js"),require("./embedded/withMfa.js"),require("./embedded/EmbeddedWalletProvider.js"),require("eventemitter3"),require("viem"),require("@privy-io/ethereum"),require("./embedded/stack/walletRpc.js"),require("./utils/encodings.js"),require("./embedded/stack/wallet-api-eth-typed-data.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("@privy-io/api-base"),require("./Session.js"),require("js-cookie"),require("./utils/allSettled.js"),require("./toAbortSignalTimeout.js"),require("./utils/toSearchParams.js"),require("./client/logger.js"),require("./utils/noop.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("viem/chains"),require("libphonenumber-js/examples.mobile.json"),require("canonicalize"),require("@privy-io/encoding"),require("./wallet-api/types.js"),require("./action/delegatedActions/utils.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"),require("./action/delegatedActions/delegateWallet.js"),require("./action/delegatedActions/revokeWallets.js");exports.default=e.default,exports.LocalStorage=r.LocalStorage,exports.InMemoryCache=t.InMemoryCache,exports.MoonpayApiError=s.MoonpayApiError,exports.PrivyApiError=s.PrivyApiError,exports.PrivyClientError=s.PrivyClientError,exports.createErrorFormatter=s.createErrorFormatter,exports.errorIndicatesMfaCanceled=s.errorIndicatesMfaCanceled,exports.EmbeddedProviderError=i.EmbeddedProviderError,exports.PrivyConnectorError=i.PrivyConnectorError,exports.PrivyEmbeddedWalletErrorCode=i.PrivyEmbeddedWalletErrorCode,exports.PrivyProviderRpcError=i.PrivyProviderRpcError,exports.ProviderErrors=i.ProviderErrors,exports.errorIndicatesMaxMfaRetries=i.errorIndicatesMaxMfaRetries,exports.errorIndicatesMfaRateLimit=i.errorIndicatesMfaRateLimit,exports.errorIndicatesMfaTimeout=i.errorIndicatesMfaTimeout,exports.errorIndicatesMfaVerificationFailed=i.errorIndicatesMfaVerificationFailed,exports.errorIndicatesRecoveryIsNeeded=i.errorIndicatesRecoveryIsNeeded,exports.getUserEmbeddedEthereumWallet=o.getUserEmbeddedEthereumWallet,exports.getUserEmbeddedWallet=o.getUserEmbeddedWallet,exports.getAllUserEmbeddedEthereumWallets=a.getAllUserEmbeddedEthereumWallets,exports.getAllUserEmbeddedSolanaWallets=l.getAllUserEmbeddedSolanaWallets,exports.getAllUserEmbeddedBitcoinWallets=n.getAllUserEmbeddedBitcoinWallets,exports.isEmbeddedWalletAccount=d.isEmbeddedWalletAccount,exports.getEntropyDetailsFromAccount=u.getEntropyDetailsFromAccount,exports.getEntropyDetailsFromUser=u.getEntropyDetailsFromUser,exports.getUserSmartWallet=p.getUserSmartWallet,exports.getJsonRpcEndpointFromChain=c.getJsonRpcEndpointFromChain,exports.throwIfInvalidRecoveryUpgradePath=c.throwIfInvalidRecoveryUpgradePath,exports.toWalletApiUnsignedEthTransaction=m.toWalletApiUnsignedEthTransaction,exports.countryCodesAndNumbers=q.countryCodesAndNumbers,exports.formatPhoneNumber=q.formatPhoneNumber,exports.getPhoneCountryCodeAndNumber=q.getPhoneCountryCodeAndNumber,exports.getPlaceholderPhoneNumber=q.getPlaceholderPhoneNumber,exports.lastFourDigits=q.lastFourDigits,exports.phoneNumberTypingFormatter=q.phoneNumberTypingFormatter,exports.validatePhoneNumber=q.validatePhoneNumber,exports.getUserEmbeddedSolanaWallet=j.getUserEmbeddedSolanaWallet,exports.toObjectKeys=g.toObjectKeys,exports.SolanaUsdcAddressMap=A.SolanaUsdcAddressMap,exports.UsdcAddressMap=A.UsdcAddressMap,exports.getIsTokenUsdc=A.getIsTokenUsdc,exports.generateWalletIdempotencyKey=x.generateWalletIdempotencyKey,exports.chainToMoonpayCurrency=b.chainToMoonpayCurrency,exports.fundingMethodToMoonpayPaymentMethod=b.fundingMethodToMoonpayPaymentMethod,exports.isSupportedChainIdForMoonpay=b.isSupportedChainIdForMoonpay,exports.getCoinbaseOnRampUrl=y.getCoinbaseOnRampUrl,exports.isSupportedChainIdForCoinbaseOnramp=y.isSupportedChainIdForCoinbaseOnramp,exports.toCoinbaseAssetId=y.toCoinbaseAssetId,exports.toCoinbaseBlockchainFromChainId=y.toCoinbaseBlockchainFromChainId,exports.SolanaClient=E.SolanaClient,exports.createSiwsMessage=h.createSiwsMessage,exports.getSolanaRpcEndpointForCluster=C.getSolanaRpcEndpointForCluster,exports.getSolanaUsdcMintAddressForCluster=S.getSolanaUsdcMintAddressForCluster,exports.getSolanaClusterDisplayName=W.getSolanaClusterDisplayName,exports.ALL_WALLET_CLIENT_TYPES=f.ALL_WALLET_CLIENT_TYPES,exports.SUPPORTED_CONNECTOR_TYPES=f.SUPPORTED_CONNECTOR_TYPES,exports.formatLamportsAmount=v.formatLamportsAmount,exports.formatTokenAmount=v.formatTokenAmount,exports.formatWalletAddress=v.formatWalletAddress,exports.formatWeiAmount=v.formatWeiAmount,exports.generateAuthorizationSignature=M.generateAuthorizationSignature,exports.create=U.create,exports.rpc=I.rpc,exports.rawSign=T.rawSign,exports.getWallet=w.getWallet,exports.updateWallet=R.updateWallet,exports.isUnifiedWallet=F.isUnifiedWallet,exports.addSessionSigners=N.addSessionSigners,exports.removeSessionSigners=N.removeSessionSigners,exports.ConnectedStandardSolanaWallet=O.ConnectedStandardSolanaWallet,exports.poll=k.poll,exports.crossApp=L.index,exports.delegatedActions=_.index,Object.defineProperty(exports,"getCountryCallingCode",{enumerable:!0,get:function(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./client/Privy.js"),r=require("./storage/LocalStorage.js"),t=require("./storage/InMemoryStorage.js"),s=require("./Error.js"),i=require("./embedded/errors.js"),o=require("./utils/getUserEmbeddedEthereumWallet.js"),a=require("./utils/getAllUserEmbeddedEthereumWallets.js"),l=require("./utils/getAllUserEmbeddedSolanaWallets.js"),n=require("./utils/getAllUserEmbeddedBitcoinWallets.js"),d=require("./utils/embedded-wallets.js"),u=require("./utils/entropy.js"),p=require("./utils/getUserSmartWallet.js"),c=require("./embedded/utils/index.js"),m=require("./embedded/stack/wallet-api-eth-transaction.js"),q=require("./utils/phoneNumberUtils.js"),j=require("./utils/getUserEmbeddedSolanaWallet.js"),g=require("./utils/toObjectKeys.js"),A=require("./utils/getIsTokenUsdc.js"),x=require("./utils/generateWalletIdempotencyKey.js"),b=require("./funding/moonpay.js"),y=require("./funding/coinbase.js"),E=require("./solana/client.js"),h=require("./solana/createSiwsMessage.js"),C=require("./solana/getSolanaRpcEndpointForCluster.js"),S=require("./solana/getSolanaUsdcMintAddressForCluster.js"),W=require("./solana/getSolanaClusterDisplayName.js"),f=require("./types.js"),P=require("@privy-io/chains"),v=require("./utils/formatters.js"),M=require("./wallet-api/generate-authorization-signature.js"),U=require("./wallet-api/create.js"),I=require("./wallet-api/rpc.js"),T=require("./wallet-api/raw-sign.js"),w=require("./wallet-api/get-wallet.js"),R=require("./wallet-api/update-wallet.js"),F=require("./wallet-api/unified-wallet.js"),N=require("./embedded/stack/session-signers.js"),O=require("./solana/ConnectedStandardSolanaWallet.js"),k=require("./utils/poll.js"),L=require("./index-DzfqDJJ9.js"),_=require("./index-BDWdfIuK.js"),D=require("./action/depositAddress/index.js"),B=require("libphonenumber-js/min");require("./crypto/resolve.js"),require("./client/AppApi.js"),require("@privy-io/routes"),require("./client/CrossAppApi.js"),require("./Token.js"),require("jose"),require("./client/DelegatedWalletsApi.js"),require("./client/EmbeddedWalletApi.js"),require("./embedded/EmbeddedBitcoinWalletProvider.js"),require("./embedded/stack/walletCreate.js"),require("./embedded/EmbeddedWalletProxy.js"),require("./utils/sleep.js"),require("./embedded/EventCallbackQueue.js"),require("./embedded/withMfa.js"),require("./embedded/EmbeddedWalletProvider.js"),require("eventemitter3"),require("viem"),require("@privy-io/ethereum"),require("./embedded/stack/walletRpc.js"),require("./utils/encodings.js"),require("./embedded/stack/wallet-api-eth-typed-data.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("@privy-io/api-base"),require("./Session.js"),require("js-cookie"),require("./utils/allSettled.js"),require("./toAbortSignalTimeout.js"),require("./utils/toSearchParams.js"),require("./client/logger.js"),require("./utils/noop.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("viem/chains"),require("libphonenumber-js/examples.mobile.json"),require("canonicalize"),require("@privy-io/encoding"),require("./wallet-api/types.js"),require("./action/delegatedActions/utils.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"),require("./action/delegatedActions/delegateWallet.js"),require("./action/delegatedActions/revokeWallets.js");exports.default=e.default,exports.LocalStorage=r.LocalStorage,exports.InMemoryCache=t.InMemoryCache,exports.MoonpayApiError=s.MoonpayApiError,exports.PrivyApiError=s.PrivyApiError,exports.PrivyClientError=s.PrivyClientError,exports.createErrorFormatter=s.createErrorFormatter,exports.errorIndicatesMfaCanceled=s.errorIndicatesMfaCanceled,exports.EmbeddedProviderError=i.EmbeddedProviderError,exports.PrivyConnectorError=i.PrivyConnectorError,exports.PrivyEmbeddedWalletErrorCode=i.PrivyEmbeddedWalletErrorCode,exports.PrivyProviderRpcError=i.PrivyProviderRpcError,exports.ProviderErrors=i.ProviderErrors,exports.errorIndicatesMaxMfaRetries=i.errorIndicatesMaxMfaRetries,exports.errorIndicatesMfaRateLimit=i.errorIndicatesMfaRateLimit,exports.errorIndicatesMfaTimeout=i.errorIndicatesMfaTimeout,exports.errorIndicatesMfaVerificationFailed=i.errorIndicatesMfaVerificationFailed,exports.errorIndicatesRecoveryIsNeeded=i.errorIndicatesRecoveryIsNeeded,exports.getUserEmbeddedEthereumWallet=o.getUserEmbeddedEthereumWallet,exports.getUserEmbeddedWallet=o.getUserEmbeddedWallet,exports.getAllUserEmbeddedEthereumWallets=a.getAllUserEmbeddedEthereumWallets,exports.getAllUserEmbeddedSolanaWallets=l.getAllUserEmbeddedSolanaWallets,exports.getAllUserEmbeddedBitcoinWallets=n.getAllUserEmbeddedBitcoinWallets,exports.isEmbeddedWalletAccount=d.isEmbeddedWalletAccount,exports.getEntropyDetailsFromAccount=u.getEntropyDetailsFromAccount,exports.getEntropyDetailsFromUser=u.getEntropyDetailsFromUser,exports.getUserSmartWallet=p.getUserSmartWallet,exports.getJsonRpcEndpointFromChain=c.getJsonRpcEndpointFromChain,exports.throwIfInvalidRecoveryUpgradePath=c.throwIfInvalidRecoveryUpgradePath,exports.toWalletApiUnsignedEthTransaction=m.toWalletApiUnsignedEthTransaction,exports.countryCodesAndNumbers=q.countryCodesAndNumbers,exports.formatPhoneNumber=q.formatPhoneNumber,exports.getPhoneCountryCodeAndNumber=q.getPhoneCountryCodeAndNumber,exports.getPlaceholderPhoneNumber=q.getPlaceholderPhoneNumber,exports.lastFourDigits=q.lastFourDigits,exports.phoneNumberTypingFormatter=q.phoneNumberTypingFormatter,exports.validatePhoneNumber=q.validatePhoneNumber,exports.getUserEmbeddedSolanaWallet=j.getUserEmbeddedSolanaWallet,exports.toObjectKeys=g.toObjectKeys,exports.SolanaUsdcAddressMap=A.SolanaUsdcAddressMap,exports.UsdcAddressMap=A.UsdcAddressMap,exports.getIsTokenUsdc=A.getIsTokenUsdc,exports.generateWalletIdempotencyKey=x.generateWalletIdempotencyKey,exports.chainToMoonpayCurrency=b.chainToMoonpayCurrency,exports.fundingMethodToMoonpayPaymentMethod=b.fundingMethodToMoonpayPaymentMethod,exports.isSupportedChainIdForMoonpay=b.isSupportedChainIdForMoonpay,exports.getCoinbaseOnRampUrl=y.getCoinbaseOnRampUrl,exports.isSupportedChainIdForCoinbaseOnramp=y.isSupportedChainIdForCoinbaseOnramp,exports.toCoinbaseAssetId=y.toCoinbaseAssetId,exports.toCoinbaseBlockchainFromChainId=y.toCoinbaseBlockchainFromChainId,exports.SolanaClient=E.SolanaClient,exports.createSiwsMessage=h.createSiwsMessage,exports.getSolanaRpcEndpointForCluster=C.getSolanaRpcEndpointForCluster,exports.getSolanaUsdcMintAddressForCluster=S.getSolanaUsdcMintAddressForCluster,exports.getSolanaClusterDisplayName=W.getSolanaClusterDisplayName,exports.ALL_WALLET_CLIENT_TYPES=f.ALL_WALLET_CLIENT_TYPES,exports.SUPPORTED_CONNECTOR_TYPES=f.SUPPORTED_CONNECTOR_TYPES,exports.formatLamportsAmount=v.formatLamportsAmount,exports.formatTokenAmount=v.formatTokenAmount,exports.formatWalletAddress=v.formatWalletAddress,exports.formatWeiAmount=v.formatWeiAmount,exports.generateAuthorizationSignature=M.generateAuthorizationSignature,exports.create=U.create,exports.rpc=I.rpc,exports.rawSign=T.rawSign,exports.getWallet=w.getWallet,exports.updateWallet=R.updateWallet,exports.isUnifiedWallet=F.isUnifiedWallet,exports.addSessionSigners=N.addSessionSigners,exports.removeSessionSigners=N.removeSessionSigners,exports.ConnectedStandardSolanaWallet=O.ConnectedStandardSolanaWallet,exports.poll=k.poll,exports.crossApp=L.index,exports.delegatedActions=_.index,exports.depositAddress=D.index,Object.defineProperty(exports,"getCountryCallingCode",{enumerable:!0,get:function(){return B.getCountryCallingCode}}),exports.BICONOMY="biconomy",exports.COINBASE_SMART_WALLET="coinbase_smart_wallet",exports.KERNEL="kernel",exports.LIGHT_ACCOUNT="light_account",exports.NEXUS="nexus",exports.SAFE="safe",exports.THIRDWEB="thirdweb",Object.keys(P).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return P[e]}})}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"isSAewB,yCAEa,uCAEf,+BAEO,8BAMR,qBAJD,wBAEI"}
|
package/dist/dts/index.d.mts
CHANGED
|
@@ -1417,7 +1417,7 @@ type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
|
1417
1417
|
type WalletConnectWalletClientType = (typeof WALLET_CONNECT_WALLET_CLIENT_TYPES)[number];
|
|
1418
1418
|
declare const UNKNOWN_WALLET_CLIENT_TYPES: readonly ["unknown"];
|
|
1419
1419
|
type UnknownWalletClientType = (typeof UNKNOWN_WALLET_CLIENT_TYPES)[number];
|
|
1420
|
-
declare const ALL_WALLET_CLIENT_TYPES: ("safe" | "
|
|
1420
|
+
declare const ALL_WALLET_CLIENT_TYPES: ("safe" | "metamask" | "phantom" | "brave_wallet" | "rainbow" | "coinbase_wallet" | "trust" | "uniswap" | "zerion" | "argent" | "spot" | "omni" | "cryptocom" | "blockchain" | "safepal" | "bitget_wallet" | "zengo" | "1inch" | "binance" | "exodus" | "mew_wallet" | "alphawallet" | "keyring_pro" | "mathwallet" | "unstoppable" | "obvious" | "ambire" | "internet_money_wallet" | "coin98" | "abc_wallet" | "arculus_wallet" | "haha" | "cling_wallet" | "broearn" | "copiosa" | "burrito_wallet" | "enjin_wallet" | "plasma_wallet" | "avacus" | "bee" | "pitaka" | "pltwallet" | "minerva" | "kryptogo" | "prema" | "slingshot" | "kriptonio" | "timeless" | "secux" | "bitizen" | "blocto" | "safemoon" | "privy" | "unknown")[];
|
|
1421
1421
|
type WalletClientType = InjectedWalletClientType | CoinbaseWalletClientType | WalletConnectWalletClientType | EmbeddedWalletClientType | UnknownWalletClientType;
|
|
1422
1422
|
declare const SUPPORTED_CONNECTOR_TYPES: readonly ["injected", "wallet_connect", "wallet_connect_v2", "coinbase_wallet", "embedded"];
|
|
1423
1423
|
type ConnectorType = (typeof SUPPORTED_CONNECTOR_TYPES)[number];
|
|
@@ -2471,12 +2471,12 @@ declare const revokeWallets: (client: Privy) => () => Promise<{
|
|
|
2471
2471
|
user: _privy_io_api_types.User;
|
|
2472
2472
|
}>;
|
|
2473
2473
|
|
|
2474
|
-
declare const index$
|
|
2475
|
-
declare const index$
|
|
2476
|
-
declare namespace index$
|
|
2474
|
+
declare const index$3_delegateWallet: typeof delegateWallet;
|
|
2475
|
+
declare const index$3_revokeWallets: typeof revokeWallets;
|
|
2476
|
+
declare namespace index$3 {
|
|
2477
2477
|
export {
|
|
2478
|
-
index$
|
|
2479
|
-
index$
|
|
2478
|
+
index$3_delegateWallet as delegateWallet,
|
|
2479
|
+
index$3_revokeWallets as revokeWallets,
|
|
2480
2480
|
};
|
|
2481
2481
|
}
|
|
2482
2482
|
|
|
@@ -2585,34 +2585,150 @@ interface SendTransactionOutput {
|
|
|
2585
2585
|
*/
|
|
2586
2586
|
declare const sendTransaction: ({ client, openAuthSession }: SendTransactionDependencies) => ({ user, transaction, address, redirectUrl, }: SendTransactionInput) => Promise<SendTransactionOutput>;
|
|
2587
2587
|
|
|
2588
|
-
type index$
|
|
2589
|
-
type index$
|
|
2590
|
-
type index$
|
|
2591
|
-
type index$
|
|
2592
|
-
type index$
|
|
2593
|
-
type index$
|
|
2594
|
-
type index$
|
|
2595
|
-
type index$
|
|
2596
|
-
type index$
|
|
2597
|
-
declare const index$
|
|
2598
|
-
declare const index$
|
|
2599
|
-
declare const index$
|
|
2588
|
+
type index$2_SendTransactionDependencies = SendTransactionDependencies;
|
|
2589
|
+
type index$2_SendTransactionInput = SendTransactionInput;
|
|
2590
|
+
type index$2_SendTransactionOutput = SendTransactionOutput;
|
|
2591
|
+
type index$2_SignMessageDependencies = SignMessageDependencies;
|
|
2592
|
+
type index$2_SignMessageInput = SignMessageInput;
|
|
2593
|
+
type index$2_SignMessageOutput = SignMessageOutput;
|
|
2594
|
+
type index$2_SignTypedDataDependencies = SignTypedDataDependencies;
|
|
2595
|
+
type index$2_SignTypedDataInput = SignTypedDataInput;
|
|
2596
|
+
type index$2_SignTypedDataOutput = SignTypedDataOutput;
|
|
2597
|
+
declare const index$2_sendTransaction: typeof sendTransaction;
|
|
2598
|
+
declare const index$2_signMessage: typeof signMessage;
|
|
2599
|
+
declare const index$2_signTypedData: typeof signTypedData;
|
|
2600
|
+
declare namespace index$2 {
|
|
2601
|
+
export { index$2_sendTransaction as sendTransaction, index$2_signMessage as signMessage, index$2_signTypedData as signTypedData };
|
|
2602
|
+
export type { index$2_SendTransactionDependencies as SendTransactionDependencies, index$2_SendTransactionInput as SendTransactionInput, index$2_SendTransactionOutput as SendTransactionOutput, index$2_SignMessageDependencies as SignMessageDependencies, index$2_SignMessageInput as SignMessageInput, index$2_SignMessageOutput as SignMessageOutput, index$2_SignTypedDataDependencies as SignTypedDataDependencies, index$2_SignTypedDataInput as SignTypedDataInput, index$2_SignTypedDataOutput as SignTypedDataOutput };
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
type index$1_LinkWithCrossAppAuthDependencies = LinkWithCrossAppAuthDependencies;
|
|
2606
|
+
type index$1_LinkWithCrossAppAuthInput = LinkWithCrossAppAuthInput;
|
|
2607
|
+
type index$1_LinkWithCrossAppAuthOutput = LinkWithCrossAppAuthOutput;
|
|
2608
|
+
type index$1_LoginWithCrossAppAuthDependencies = LoginWithCrossAppAuthDependencies;
|
|
2609
|
+
type index$1_LoginWithCrossAppAuthInput = LoginWithCrossAppAuthInput;
|
|
2610
|
+
type index$1_LoginWithCrossAppAuthOutput = LoginWithCrossAppAuthOutput;
|
|
2611
|
+
declare const index$1_linkWithCrossAppAuth: typeof linkWithCrossAppAuth;
|
|
2612
|
+
declare const index$1_loginWithCrossAppAuth: typeof loginWithCrossAppAuth;
|
|
2600
2613
|
declare namespace index$1 {
|
|
2601
|
-
export { index$
|
|
2602
|
-
export type { index$
|
|
2603
|
-
}
|
|
2604
|
-
|
|
2605
|
-
type
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2614
|
+
export { index$1_linkWithCrossAppAuth as linkWithCrossAppAuth, index$1_loginWithCrossAppAuth as loginWithCrossAppAuth, index$2 as wallet };
|
|
2615
|
+
export type { index$1_LinkWithCrossAppAuthDependencies as LinkWithCrossAppAuthDependencies, index$1_LinkWithCrossAppAuthInput as LinkWithCrossAppAuthInput, index$1_LinkWithCrossAppAuthOutput as LinkWithCrossAppAuthOutput, index$1_LoginWithCrossAppAuthDependencies as LoginWithCrossAppAuthDependencies, index$1_LoginWithCrossAppAuthInput as LoginWithCrossAppAuthInput, index$1_LoginWithCrossAppAuthOutput as LoginWithCrossAppAuthOutput };
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
type DepositConfig = {
|
|
2619
|
+
currencies: Array<{
|
|
2620
|
+
symbol: string;
|
|
2621
|
+
name: string;
|
|
2622
|
+
logoURI: string;
|
|
2623
|
+
chains: Array<{
|
|
2624
|
+
caip2: string;
|
|
2625
|
+
address: string;
|
|
2626
|
+
decimals: number;
|
|
2627
|
+
}>;
|
|
2628
|
+
}>;
|
|
2629
|
+
chains: Record<string, {
|
|
2630
|
+
chainId: number;
|
|
2631
|
+
caip2: string;
|
|
2632
|
+
displayName: string;
|
|
2633
|
+
iconUrl: string;
|
|
2634
|
+
vmType: string;
|
|
2635
|
+
}>;
|
|
2636
|
+
};
|
|
2637
|
+
type DepositAddressQuote = {
|
|
2638
|
+
id: string;
|
|
2639
|
+
deposit_address: string;
|
|
2640
|
+
source_chain: string;
|
|
2641
|
+
source_currency: string;
|
|
2642
|
+
source_vm_type: string;
|
|
2643
|
+
destination_chain: string;
|
|
2644
|
+
destination_currency: string;
|
|
2645
|
+
destination_address: string;
|
|
2646
|
+
refund_address: string;
|
|
2647
|
+
slippage_bps: number;
|
|
2648
|
+
indicative_rate: string;
|
|
2649
|
+
time_estimate_seconds: number;
|
|
2650
|
+
created_at: string;
|
|
2651
|
+
};
|
|
2652
|
+
type DepositAddressOrderBase = {
|
|
2653
|
+
id: string;
|
|
2654
|
+
provider_request_id: string;
|
|
2655
|
+
source_chain: string;
|
|
2656
|
+
source_currency: string;
|
|
2657
|
+
source_amount: string;
|
|
2658
|
+
depositor_address: string;
|
|
2659
|
+
destination_chain: string;
|
|
2660
|
+
destination_currency: string;
|
|
2661
|
+
tracking_url: string;
|
|
2662
|
+
created_at: string;
|
|
2663
|
+
updated_at: string;
|
|
2664
|
+
};
|
|
2665
|
+
type CompletedDepositAddressOrder = DepositAddressOrderBase & {
|
|
2666
|
+
status: 'completed';
|
|
2667
|
+
destination_amount: string;
|
|
2668
|
+
};
|
|
2669
|
+
type IncompleteDepositAddressOrder = DepositAddressOrderBase & {
|
|
2670
|
+
status: 'executing' | 'refunded' | 'failed';
|
|
2671
|
+
destination_amount: null;
|
|
2672
|
+
};
|
|
2673
|
+
type DepositAddressOrder = CompletedDepositAddressOrder | IncompleteDepositAddressOrder;
|
|
2674
|
+
type DepositAddressPollingResult = {
|
|
2675
|
+
status: 'success';
|
|
2676
|
+
order: DepositAddressOrder;
|
|
2677
|
+
} | {
|
|
2678
|
+
status: 'aborted';
|
|
2679
|
+
error?: Error;
|
|
2680
|
+
} | {
|
|
2681
|
+
status: 'timeout';
|
|
2682
|
+
error?: Error;
|
|
2683
|
+
};
|
|
2684
|
+
type GenerateDepositAddressInput = {
|
|
2685
|
+
sourceChain: string;
|
|
2686
|
+
sourceCurrency: string;
|
|
2687
|
+
destinationChain: string;
|
|
2688
|
+
destinationCurrency: string;
|
|
2689
|
+
destinationAddress: string;
|
|
2690
|
+
refundAddress?: string;
|
|
2691
|
+
slippageBps?: number;
|
|
2692
|
+
};
|
|
2693
|
+
type WaitForDepositInput = {
|
|
2694
|
+
depositAddressId: string;
|
|
2695
|
+
quoteCreatedAt: string;
|
|
2696
|
+
signal?: AbortSignal;
|
|
2697
|
+
pollIntervalMs?: number;
|
|
2698
|
+
timeoutMs?: number;
|
|
2699
|
+
};
|
|
2700
|
+
type WaitForCompletionInput = {
|
|
2701
|
+
orderId: string;
|
|
2702
|
+
signal?: AbortSignal;
|
|
2703
|
+
pollIntervalMs?: number;
|
|
2704
|
+
timeoutMs?: number;
|
|
2705
|
+
};
|
|
2706
|
+
type GetDepositInput = {
|
|
2707
|
+
orderId: string;
|
|
2708
|
+
};
|
|
2709
|
+
type ResolveRefundAddressError = 'NOT_AUTHENTICATED' | 'UNSUPPORTED_CHAIN' | 'REFUND_WALLET_CREATION_FAILED';
|
|
2710
|
+
type ResolveRefundAddressResult = {
|
|
2711
|
+
ok: true;
|
|
2712
|
+
address: string;
|
|
2713
|
+
} | {
|
|
2714
|
+
ok: false;
|
|
2715
|
+
error: ResolveRefundAddressError;
|
|
2716
|
+
};
|
|
2717
|
+
|
|
2718
|
+
type index_CompletedDepositAddressOrder = CompletedDepositAddressOrder;
|
|
2719
|
+
type index_DepositAddressOrder = DepositAddressOrder;
|
|
2720
|
+
type index_DepositAddressPollingResult = DepositAddressPollingResult;
|
|
2721
|
+
type index_DepositAddressQuote = DepositAddressQuote;
|
|
2722
|
+
type index_DepositConfig = DepositConfig;
|
|
2723
|
+
type index_GenerateDepositAddressInput = GenerateDepositAddressInput;
|
|
2724
|
+
type index_GetDepositInput = GetDepositInput;
|
|
2725
|
+
type index_IncompleteDepositAddressOrder = IncompleteDepositAddressOrder;
|
|
2726
|
+
type index_ResolveRefundAddressError = ResolveRefundAddressError;
|
|
2727
|
+
type index_ResolveRefundAddressResult = ResolveRefundAddressResult;
|
|
2728
|
+
type index_WaitForCompletionInput = WaitForCompletionInput;
|
|
2729
|
+
type index_WaitForDepositInput = WaitForDepositInput;
|
|
2613
2730
|
declare namespace index {
|
|
2614
|
-
export {
|
|
2615
|
-
export type { index_LinkWithCrossAppAuthDependencies as LinkWithCrossAppAuthDependencies, index_LinkWithCrossAppAuthInput as LinkWithCrossAppAuthInput, index_LinkWithCrossAppAuthOutput as LinkWithCrossAppAuthOutput, index_LoginWithCrossAppAuthDependencies as LoginWithCrossAppAuthDependencies, index_LoginWithCrossAppAuthInput as LoginWithCrossAppAuthInput, index_LoginWithCrossAppAuthOutput as LoginWithCrossAppAuthOutput };
|
|
2731
|
+
export type { index_CompletedDepositAddressOrder as CompletedDepositAddressOrder, index_DepositAddressOrder as DepositAddressOrder, index_DepositAddressPollingResult as DepositAddressPollingResult, index_DepositAddressQuote as DepositAddressQuote, index_DepositConfig as DepositConfig, index_GenerateDepositAddressInput as GenerateDepositAddressInput, index_GetDepositInput as GetDepositInput, index_IncompleteDepositAddressOrder as IncompleteDepositAddressOrder, index_ResolveRefundAddressError as ResolveRefundAddressError, index_ResolveRefundAddressResult as ResolveRefundAddressResult, index_WaitForCompletionInput as WaitForCompletionInput, index_WaitForDepositInput as WaitForDepositInput };
|
|
2616
2732
|
}
|
|
2617
2733
|
|
|
2618
2734
|
interface SignWalletRequestInput {
|
|
@@ -2885,5 +3001,5 @@ declare const THIRDWEB: "thirdweb";
|
|
|
2885
3001
|
/** @deprecated {@link SmartWalletType} is a well-typed union, use the `'nexus'` literal instead */
|
|
2886
3002
|
declare const NEXUS: "nexus";
|
|
2887
3003
|
|
|
2888
|
-
export { ALL_WALLET_CLIENT_TYPES, BICONOMY, COINBASE_SMART_WALLET, ConnectedStandardSolanaWallet, EmbeddedBitcoinWalletProvider, EmbeddedProviderError, InMemoryCache, KERNEL, LIGHT_ACCOUNT, LocalStorage, MoonpayApiError, NEXUS, PrivyApiError, PrivyClientError, PrivyConnectorError, PrivyEmbeddedWalletErrorCode, PrivyProviderRpcError, ProviderErrors, SAFE, SUPPORTED_CONNECTOR_TYPES, SolanaClient, SolanaUsdcAddressMap, THIRDWEB, UsdcAddressMap, addSessionSigners, chainToMoonpayCurrency, countryCodesAndNumbers, create, createErrorFormatter, createSiwsMessage, index as crossApp, Privy as default, index$
|
|
2889
|
-
export type { Cluster, CoinbaseAssetId, CoinbaseWalletClientType, ConnectorType, CreateSiwsMessageOpts, EIP1193Provider, EmbeddedWalletClientType, EmbeddedWalletConfig, EmbeddedWalletRecoveryOptions, EntropyIdVerifier, ErrorMessageMap, ExternalWallet, ExternalWalletMetadata, FundingMethod, FundingProvider, GenerateAuthorizationSignatureInput, GenerateAuthorizationSignatureOutput, IdentifierString, InjectedWalletClientType, LogLevel, Logger, MfaMethod, MfaPromise, MfaSubmitArgs, MfaSubmitPromise, MoonpayTransactionStatus, MoonpayTransactionStatusResponse, OAuthProviderType, OnNeedsRecovery, PaymentOption, PollOptions, PollResult, PreparedTransactionRequest, PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletProvider, Quantity, SetRecoveryInput, SmartWalletType, SolanaCluster, SolanaSignAndSendTransactionInput, SolanaSignAndSendTransactionMode, SolanaSignAndSendTransactionOptions, SolanaSignAndSendTransactionOutput, SolanaSignMessageInput, SolanaSignMessageOutput, SolanaSignTransactionInput, SolanaSignTransactionOptions, SolanaSignTransactionOutput, SolanaStandardWallet, SolanaTransactionCommitment, Storage, UnknownWalletClientType, UnsignedTransactionRequest, UnsignedTransactionRequestWithChainId, WalletBranding, WalletClientType, WalletConnectWalletClientType };
|
|
3004
|
+
export { ALL_WALLET_CLIENT_TYPES, BICONOMY, COINBASE_SMART_WALLET, ConnectedStandardSolanaWallet, EmbeddedBitcoinWalletProvider, EmbeddedProviderError, InMemoryCache, KERNEL, LIGHT_ACCOUNT, LocalStorage, MoonpayApiError, NEXUS, PrivyApiError, PrivyClientError, PrivyConnectorError, PrivyEmbeddedWalletErrorCode, PrivyProviderRpcError, ProviderErrors, SAFE, SUPPORTED_CONNECTOR_TYPES, SolanaClient, SolanaUsdcAddressMap, THIRDWEB, UsdcAddressMap, addSessionSigners, chainToMoonpayCurrency, countryCodesAndNumbers, create, createErrorFormatter, createSiwsMessage, index$1 as crossApp, Privy as default, index$3 as delegatedActions, index as depositAddress, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, generateAuthorizationSignature, generateWalletIdempotencyKey, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCoinbaseOnRampUrl, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getIsTokenUsdc, getJsonRpcEndpointFromChain, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, getWallet, isEmbeddedWalletAccount, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, isUnifiedWallet, lastFourDigits, phoneNumberTypingFormatter, poll, rawSign, removeSessionSigners, rpc, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toObjectKeys, toWalletApiUnsignedEthTransaction, updateWallet, validatePhoneNumber };
|
|
3005
|
+
export type { Cluster, CoinbaseAssetId, CoinbaseWalletClientType, CompletedDepositAddressOrder, ConnectorType, CreateSiwsMessageOpts, DepositAddressOrder, DepositAddressPollingResult, DepositAddressQuote, DepositConfig, EIP1193Provider, EmbeddedWalletClientType, EmbeddedWalletConfig, EmbeddedWalletRecoveryOptions, EntropyIdVerifier, ErrorMessageMap, ExternalWallet, ExternalWalletMetadata, FundingMethod, FundingProvider, GenerateAuthorizationSignatureInput, GenerateAuthorizationSignatureOutput, GenerateDepositAddressInput, GetDepositInput, IdentifierString, IncompleteDepositAddressOrder, InjectedWalletClientType, LogLevel, Logger, MfaMethod, MfaPromise, MfaSubmitArgs, MfaSubmitPromise, MoonpayTransactionStatus, MoonpayTransactionStatusResponse, OAuthProviderType, OnNeedsRecovery, PaymentOption, PollOptions, PollResult, PreparedTransactionRequest, PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletProvider, Quantity, ResolveRefundAddressError, ResolveRefundAddressResult, SetRecoveryInput, SmartWalletType, SolanaCluster, SolanaSignAndSendTransactionInput, SolanaSignAndSendTransactionMode, SolanaSignAndSendTransactionOptions, SolanaSignAndSendTransactionOutput, SolanaSignMessageInput, SolanaSignMessageOutput, SolanaSignTransactionInput, SolanaSignTransactionOptions, SolanaSignTransactionOutput, SolanaStandardWallet, SolanaTransactionCommitment, Storage, UnknownWalletClientType, UnsignedTransactionRequest, UnsignedTransactionRequestWithChainId, WaitForCompletionInput, WaitForDepositInput, WalletBranding, WalletClientType, WalletConnectWalletClientType };
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1417,7 +1417,7 @@ type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
|
1417
1417
|
type WalletConnectWalletClientType = (typeof WALLET_CONNECT_WALLET_CLIENT_TYPES)[number];
|
|
1418
1418
|
declare const UNKNOWN_WALLET_CLIENT_TYPES: readonly ["unknown"];
|
|
1419
1419
|
type UnknownWalletClientType = (typeof UNKNOWN_WALLET_CLIENT_TYPES)[number];
|
|
1420
|
-
declare const ALL_WALLET_CLIENT_TYPES: ("safe" | "
|
|
1420
|
+
declare const ALL_WALLET_CLIENT_TYPES: ("safe" | "metamask" | "phantom" | "brave_wallet" | "rainbow" | "coinbase_wallet" | "trust" | "uniswap" | "zerion" | "argent" | "spot" | "omni" | "cryptocom" | "blockchain" | "safepal" | "bitget_wallet" | "zengo" | "1inch" | "binance" | "exodus" | "mew_wallet" | "alphawallet" | "keyring_pro" | "mathwallet" | "unstoppable" | "obvious" | "ambire" | "internet_money_wallet" | "coin98" | "abc_wallet" | "arculus_wallet" | "haha" | "cling_wallet" | "broearn" | "copiosa" | "burrito_wallet" | "enjin_wallet" | "plasma_wallet" | "avacus" | "bee" | "pitaka" | "pltwallet" | "minerva" | "kryptogo" | "prema" | "slingshot" | "kriptonio" | "timeless" | "secux" | "bitizen" | "blocto" | "safemoon" | "privy" | "unknown")[];
|
|
1421
1421
|
type WalletClientType = InjectedWalletClientType | CoinbaseWalletClientType | WalletConnectWalletClientType | EmbeddedWalletClientType | UnknownWalletClientType;
|
|
1422
1422
|
declare const SUPPORTED_CONNECTOR_TYPES: readonly ["injected", "wallet_connect", "wallet_connect_v2", "coinbase_wallet", "embedded"];
|
|
1423
1423
|
type ConnectorType = (typeof SUPPORTED_CONNECTOR_TYPES)[number];
|
|
@@ -2471,12 +2471,12 @@ declare const revokeWallets: (client: Privy) => () => Promise<{
|
|
|
2471
2471
|
user: _privy_io_api_types.User;
|
|
2472
2472
|
}>;
|
|
2473
2473
|
|
|
2474
|
-
declare const index$
|
|
2475
|
-
declare const index$
|
|
2476
|
-
declare namespace index$
|
|
2474
|
+
declare const index$3_delegateWallet: typeof delegateWallet;
|
|
2475
|
+
declare const index$3_revokeWallets: typeof revokeWallets;
|
|
2476
|
+
declare namespace index$3 {
|
|
2477
2477
|
export {
|
|
2478
|
-
index$
|
|
2479
|
-
index$
|
|
2478
|
+
index$3_delegateWallet as delegateWallet,
|
|
2479
|
+
index$3_revokeWallets as revokeWallets,
|
|
2480
2480
|
};
|
|
2481
2481
|
}
|
|
2482
2482
|
|
|
@@ -2585,34 +2585,150 @@ interface SendTransactionOutput {
|
|
|
2585
2585
|
*/
|
|
2586
2586
|
declare const sendTransaction: ({ client, openAuthSession }: SendTransactionDependencies) => ({ user, transaction, address, redirectUrl, }: SendTransactionInput) => Promise<SendTransactionOutput>;
|
|
2587
2587
|
|
|
2588
|
-
type index$
|
|
2589
|
-
type index$
|
|
2590
|
-
type index$
|
|
2591
|
-
type index$
|
|
2592
|
-
type index$
|
|
2593
|
-
type index$
|
|
2594
|
-
type index$
|
|
2595
|
-
type index$
|
|
2596
|
-
type index$
|
|
2597
|
-
declare const index$
|
|
2598
|
-
declare const index$
|
|
2599
|
-
declare const index$
|
|
2588
|
+
type index$2_SendTransactionDependencies = SendTransactionDependencies;
|
|
2589
|
+
type index$2_SendTransactionInput = SendTransactionInput;
|
|
2590
|
+
type index$2_SendTransactionOutput = SendTransactionOutput;
|
|
2591
|
+
type index$2_SignMessageDependencies = SignMessageDependencies;
|
|
2592
|
+
type index$2_SignMessageInput = SignMessageInput;
|
|
2593
|
+
type index$2_SignMessageOutput = SignMessageOutput;
|
|
2594
|
+
type index$2_SignTypedDataDependencies = SignTypedDataDependencies;
|
|
2595
|
+
type index$2_SignTypedDataInput = SignTypedDataInput;
|
|
2596
|
+
type index$2_SignTypedDataOutput = SignTypedDataOutput;
|
|
2597
|
+
declare const index$2_sendTransaction: typeof sendTransaction;
|
|
2598
|
+
declare const index$2_signMessage: typeof signMessage;
|
|
2599
|
+
declare const index$2_signTypedData: typeof signTypedData;
|
|
2600
|
+
declare namespace index$2 {
|
|
2601
|
+
export { index$2_sendTransaction as sendTransaction, index$2_signMessage as signMessage, index$2_signTypedData as signTypedData };
|
|
2602
|
+
export type { index$2_SendTransactionDependencies as SendTransactionDependencies, index$2_SendTransactionInput as SendTransactionInput, index$2_SendTransactionOutput as SendTransactionOutput, index$2_SignMessageDependencies as SignMessageDependencies, index$2_SignMessageInput as SignMessageInput, index$2_SignMessageOutput as SignMessageOutput, index$2_SignTypedDataDependencies as SignTypedDataDependencies, index$2_SignTypedDataInput as SignTypedDataInput, index$2_SignTypedDataOutput as SignTypedDataOutput };
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
type index$1_LinkWithCrossAppAuthDependencies = LinkWithCrossAppAuthDependencies;
|
|
2606
|
+
type index$1_LinkWithCrossAppAuthInput = LinkWithCrossAppAuthInput;
|
|
2607
|
+
type index$1_LinkWithCrossAppAuthOutput = LinkWithCrossAppAuthOutput;
|
|
2608
|
+
type index$1_LoginWithCrossAppAuthDependencies = LoginWithCrossAppAuthDependencies;
|
|
2609
|
+
type index$1_LoginWithCrossAppAuthInput = LoginWithCrossAppAuthInput;
|
|
2610
|
+
type index$1_LoginWithCrossAppAuthOutput = LoginWithCrossAppAuthOutput;
|
|
2611
|
+
declare const index$1_linkWithCrossAppAuth: typeof linkWithCrossAppAuth;
|
|
2612
|
+
declare const index$1_loginWithCrossAppAuth: typeof loginWithCrossAppAuth;
|
|
2600
2613
|
declare namespace index$1 {
|
|
2601
|
-
export { index$
|
|
2602
|
-
export type { index$
|
|
2603
|
-
}
|
|
2604
|
-
|
|
2605
|
-
type
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2614
|
+
export { index$1_linkWithCrossAppAuth as linkWithCrossAppAuth, index$1_loginWithCrossAppAuth as loginWithCrossAppAuth, index$2 as wallet };
|
|
2615
|
+
export type { index$1_LinkWithCrossAppAuthDependencies as LinkWithCrossAppAuthDependencies, index$1_LinkWithCrossAppAuthInput as LinkWithCrossAppAuthInput, index$1_LinkWithCrossAppAuthOutput as LinkWithCrossAppAuthOutput, index$1_LoginWithCrossAppAuthDependencies as LoginWithCrossAppAuthDependencies, index$1_LoginWithCrossAppAuthInput as LoginWithCrossAppAuthInput, index$1_LoginWithCrossAppAuthOutput as LoginWithCrossAppAuthOutput };
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
type DepositConfig = {
|
|
2619
|
+
currencies: Array<{
|
|
2620
|
+
symbol: string;
|
|
2621
|
+
name: string;
|
|
2622
|
+
logoURI: string;
|
|
2623
|
+
chains: Array<{
|
|
2624
|
+
caip2: string;
|
|
2625
|
+
address: string;
|
|
2626
|
+
decimals: number;
|
|
2627
|
+
}>;
|
|
2628
|
+
}>;
|
|
2629
|
+
chains: Record<string, {
|
|
2630
|
+
chainId: number;
|
|
2631
|
+
caip2: string;
|
|
2632
|
+
displayName: string;
|
|
2633
|
+
iconUrl: string;
|
|
2634
|
+
vmType: string;
|
|
2635
|
+
}>;
|
|
2636
|
+
};
|
|
2637
|
+
type DepositAddressQuote = {
|
|
2638
|
+
id: string;
|
|
2639
|
+
deposit_address: string;
|
|
2640
|
+
source_chain: string;
|
|
2641
|
+
source_currency: string;
|
|
2642
|
+
source_vm_type: string;
|
|
2643
|
+
destination_chain: string;
|
|
2644
|
+
destination_currency: string;
|
|
2645
|
+
destination_address: string;
|
|
2646
|
+
refund_address: string;
|
|
2647
|
+
slippage_bps: number;
|
|
2648
|
+
indicative_rate: string;
|
|
2649
|
+
time_estimate_seconds: number;
|
|
2650
|
+
created_at: string;
|
|
2651
|
+
};
|
|
2652
|
+
type DepositAddressOrderBase = {
|
|
2653
|
+
id: string;
|
|
2654
|
+
provider_request_id: string;
|
|
2655
|
+
source_chain: string;
|
|
2656
|
+
source_currency: string;
|
|
2657
|
+
source_amount: string;
|
|
2658
|
+
depositor_address: string;
|
|
2659
|
+
destination_chain: string;
|
|
2660
|
+
destination_currency: string;
|
|
2661
|
+
tracking_url: string;
|
|
2662
|
+
created_at: string;
|
|
2663
|
+
updated_at: string;
|
|
2664
|
+
};
|
|
2665
|
+
type CompletedDepositAddressOrder = DepositAddressOrderBase & {
|
|
2666
|
+
status: 'completed';
|
|
2667
|
+
destination_amount: string;
|
|
2668
|
+
};
|
|
2669
|
+
type IncompleteDepositAddressOrder = DepositAddressOrderBase & {
|
|
2670
|
+
status: 'executing' | 'refunded' | 'failed';
|
|
2671
|
+
destination_amount: null;
|
|
2672
|
+
};
|
|
2673
|
+
type DepositAddressOrder = CompletedDepositAddressOrder | IncompleteDepositAddressOrder;
|
|
2674
|
+
type DepositAddressPollingResult = {
|
|
2675
|
+
status: 'success';
|
|
2676
|
+
order: DepositAddressOrder;
|
|
2677
|
+
} | {
|
|
2678
|
+
status: 'aborted';
|
|
2679
|
+
error?: Error;
|
|
2680
|
+
} | {
|
|
2681
|
+
status: 'timeout';
|
|
2682
|
+
error?: Error;
|
|
2683
|
+
};
|
|
2684
|
+
type GenerateDepositAddressInput = {
|
|
2685
|
+
sourceChain: string;
|
|
2686
|
+
sourceCurrency: string;
|
|
2687
|
+
destinationChain: string;
|
|
2688
|
+
destinationCurrency: string;
|
|
2689
|
+
destinationAddress: string;
|
|
2690
|
+
refundAddress?: string;
|
|
2691
|
+
slippageBps?: number;
|
|
2692
|
+
};
|
|
2693
|
+
type WaitForDepositInput = {
|
|
2694
|
+
depositAddressId: string;
|
|
2695
|
+
quoteCreatedAt: string;
|
|
2696
|
+
signal?: AbortSignal;
|
|
2697
|
+
pollIntervalMs?: number;
|
|
2698
|
+
timeoutMs?: number;
|
|
2699
|
+
};
|
|
2700
|
+
type WaitForCompletionInput = {
|
|
2701
|
+
orderId: string;
|
|
2702
|
+
signal?: AbortSignal;
|
|
2703
|
+
pollIntervalMs?: number;
|
|
2704
|
+
timeoutMs?: number;
|
|
2705
|
+
};
|
|
2706
|
+
type GetDepositInput = {
|
|
2707
|
+
orderId: string;
|
|
2708
|
+
};
|
|
2709
|
+
type ResolveRefundAddressError = 'NOT_AUTHENTICATED' | 'UNSUPPORTED_CHAIN' | 'REFUND_WALLET_CREATION_FAILED';
|
|
2710
|
+
type ResolveRefundAddressResult = {
|
|
2711
|
+
ok: true;
|
|
2712
|
+
address: string;
|
|
2713
|
+
} | {
|
|
2714
|
+
ok: false;
|
|
2715
|
+
error: ResolveRefundAddressError;
|
|
2716
|
+
};
|
|
2717
|
+
|
|
2718
|
+
type index_CompletedDepositAddressOrder = CompletedDepositAddressOrder;
|
|
2719
|
+
type index_DepositAddressOrder = DepositAddressOrder;
|
|
2720
|
+
type index_DepositAddressPollingResult = DepositAddressPollingResult;
|
|
2721
|
+
type index_DepositAddressQuote = DepositAddressQuote;
|
|
2722
|
+
type index_DepositConfig = DepositConfig;
|
|
2723
|
+
type index_GenerateDepositAddressInput = GenerateDepositAddressInput;
|
|
2724
|
+
type index_GetDepositInput = GetDepositInput;
|
|
2725
|
+
type index_IncompleteDepositAddressOrder = IncompleteDepositAddressOrder;
|
|
2726
|
+
type index_ResolveRefundAddressError = ResolveRefundAddressError;
|
|
2727
|
+
type index_ResolveRefundAddressResult = ResolveRefundAddressResult;
|
|
2728
|
+
type index_WaitForCompletionInput = WaitForCompletionInput;
|
|
2729
|
+
type index_WaitForDepositInput = WaitForDepositInput;
|
|
2613
2730
|
declare namespace index {
|
|
2614
|
-
export {
|
|
2615
|
-
export type { index_LinkWithCrossAppAuthDependencies as LinkWithCrossAppAuthDependencies, index_LinkWithCrossAppAuthInput as LinkWithCrossAppAuthInput, index_LinkWithCrossAppAuthOutput as LinkWithCrossAppAuthOutput, index_LoginWithCrossAppAuthDependencies as LoginWithCrossAppAuthDependencies, index_LoginWithCrossAppAuthInput as LoginWithCrossAppAuthInput, index_LoginWithCrossAppAuthOutput as LoginWithCrossAppAuthOutput };
|
|
2731
|
+
export type { index_CompletedDepositAddressOrder as CompletedDepositAddressOrder, index_DepositAddressOrder as DepositAddressOrder, index_DepositAddressPollingResult as DepositAddressPollingResult, index_DepositAddressQuote as DepositAddressQuote, index_DepositConfig as DepositConfig, index_GenerateDepositAddressInput as GenerateDepositAddressInput, index_GetDepositInput as GetDepositInput, index_IncompleteDepositAddressOrder as IncompleteDepositAddressOrder, index_ResolveRefundAddressError as ResolveRefundAddressError, index_ResolveRefundAddressResult as ResolveRefundAddressResult, index_WaitForCompletionInput as WaitForCompletionInput, index_WaitForDepositInput as WaitForDepositInput };
|
|
2616
2732
|
}
|
|
2617
2733
|
|
|
2618
2734
|
interface SignWalletRequestInput {
|
|
@@ -2885,5 +3001,5 @@ declare const THIRDWEB: "thirdweb";
|
|
|
2885
3001
|
/** @deprecated {@link SmartWalletType} is a well-typed union, use the `'nexus'` literal instead */
|
|
2886
3002
|
declare const NEXUS: "nexus";
|
|
2887
3003
|
|
|
2888
|
-
export { ALL_WALLET_CLIENT_TYPES, BICONOMY, COINBASE_SMART_WALLET, ConnectedStandardSolanaWallet, EmbeddedBitcoinWalletProvider, EmbeddedProviderError, InMemoryCache, KERNEL, LIGHT_ACCOUNT, LocalStorage, MoonpayApiError, NEXUS, PrivyApiError, PrivyClientError, PrivyConnectorError, PrivyEmbeddedWalletErrorCode, PrivyProviderRpcError, ProviderErrors, SAFE, SUPPORTED_CONNECTOR_TYPES, SolanaClient, SolanaUsdcAddressMap, THIRDWEB, UsdcAddressMap, addSessionSigners, chainToMoonpayCurrency, countryCodesAndNumbers, create, createErrorFormatter, createSiwsMessage, index as crossApp, Privy as default, index$
|
|
2889
|
-
export type { Cluster, CoinbaseAssetId, CoinbaseWalletClientType, ConnectorType, CreateSiwsMessageOpts, EIP1193Provider, EmbeddedWalletClientType, EmbeddedWalletConfig, EmbeddedWalletRecoveryOptions, EntropyIdVerifier, ErrorMessageMap, ExternalWallet, ExternalWalletMetadata, FundingMethod, FundingProvider, GenerateAuthorizationSignatureInput, GenerateAuthorizationSignatureOutput, IdentifierString, InjectedWalletClientType, LogLevel, Logger, MfaMethod, MfaPromise, MfaSubmitArgs, MfaSubmitPromise, MoonpayTransactionStatus, MoonpayTransactionStatusResponse, OAuthProviderType, OnNeedsRecovery, PaymentOption, PollOptions, PollResult, PreparedTransactionRequest, PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletProvider, Quantity, SetRecoveryInput, SmartWalletType, SolanaCluster, SolanaSignAndSendTransactionInput, SolanaSignAndSendTransactionMode, SolanaSignAndSendTransactionOptions, SolanaSignAndSendTransactionOutput, SolanaSignMessageInput, SolanaSignMessageOutput, SolanaSignTransactionInput, SolanaSignTransactionOptions, SolanaSignTransactionOutput, SolanaStandardWallet, SolanaTransactionCommitment, Storage, UnknownWalletClientType, UnsignedTransactionRequest, UnsignedTransactionRequestWithChainId, WalletBranding, WalletClientType, WalletConnectWalletClientType };
|
|
3004
|
+
export { ALL_WALLET_CLIENT_TYPES, BICONOMY, COINBASE_SMART_WALLET, ConnectedStandardSolanaWallet, EmbeddedBitcoinWalletProvider, EmbeddedProviderError, InMemoryCache, KERNEL, LIGHT_ACCOUNT, LocalStorage, MoonpayApiError, NEXUS, PrivyApiError, PrivyClientError, PrivyConnectorError, PrivyEmbeddedWalletErrorCode, PrivyProviderRpcError, ProviderErrors, SAFE, SUPPORTED_CONNECTOR_TYPES, SolanaClient, SolanaUsdcAddressMap, THIRDWEB, UsdcAddressMap, addSessionSigners, chainToMoonpayCurrency, countryCodesAndNumbers, create, createErrorFormatter, createSiwsMessage, index$1 as crossApp, Privy as default, index$3 as delegatedActions, index as depositAddress, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, generateAuthorizationSignature, generateWalletIdempotencyKey, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCoinbaseOnRampUrl, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getIsTokenUsdc, getJsonRpcEndpointFromChain, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, getWallet, isEmbeddedWalletAccount, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, isUnifiedWallet, lastFourDigits, phoneNumberTypingFormatter, poll, rawSign, removeSessionSigners, rpc, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toObjectKeys, toWalletApiUnsignedEthTransaction, updateWallet, validatePhoneNumber };
|
|
3005
|
+
export type { Cluster, CoinbaseAssetId, CoinbaseWalletClientType, CompletedDepositAddressOrder, ConnectorType, CreateSiwsMessageOpts, DepositAddressOrder, DepositAddressPollingResult, DepositAddressQuote, DepositConfig, EIP1193Provider, EmbeddedWalletClientType, EmbeddedWalletConfig, EmbeddedWalletRecoveryOptions, EntropyIdVerifier, ErrorMessageMap, ExternalWallet, ExternalWalletMetadata, FundingMethod, FundingProvider, GenerateAuthorizationSignatureInput, GenerateAuthorizationSignatureOutput, GenerateDepositAddressInput, GetDepositInput, IdentifierString, IncompleteDepositAddressOrder, InjectedWalletClientType, LogLevel, Logger, MfaMethod, MfaPromise, MfaSubmitArgs, MfaSubmitPromise, MoonpayTransactionStatus, MoonpayTransactionStatusResponse, OAuthProviderType, OnNeedsRecovery, PaymentOption, PollOptions, PollResult, PreparedTransactionRequest, PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletProvider, Quantity, ResolveRefundAddressError, ResolveRefundAddressResult, SetRecoveryInput, SmartWalletType, SolanaCluster, SolanaSignAndSendTransactionInput, SolanaSignAndSendTransactionMode, SolanaSignAndSendTransactionOptions, SolanaSignAndSendTransactionOutput, SolanaSignMessageInput, SolanaSignMessageOutput, SolanaSignTransactionInput, SolanaSignTransactionOptions, SolanaSignTransactionOutput, SolanaStandardWallet, SolanaTransactionCommitment, Storage, UnknownWalletClientType, UnsignedTransactionRequest, UnsignedTransactionRequestWithChainId, WaitForCompletionInput, WaitForDepositInput, WalletBranding, WalletClientType, WalletConnectWalletClientType };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{i as delegatedActions}from"../index-g0cxoRWQ.mjs";export{i as crossApp}from"../index-Bu3ySxLM.mjs";import"./delegatedActions/delegateWallet.mjs";import"../Error.mjs";import"../wallet-api/unified-wallet.mjs";import"./delegatedActions/utils.mjs";import"../utils/getAllUserEmbeddedEthereumWallets.mjs";import"../utils/embedded-wallets.mjs";import"../utils/getAllUserEmbeddedSolanaWallets.mjs";import"../utils/getUserEmbeddedEthereumWallet.mjs";import"../utils/getUserEmbeddedSolanaWallet.mjs";import"./delegatedActions/revokeWallets.mjs";import"./crossApp/loginWithCrossAppAuth.mjs";import"./crossApp/linkWithCrossAppAuth.mjs";import"../index-DTAjYY8z.mjs";import"./crossApp/wallet/signMessage.mjs";import"./crossApp/wallet/utils/isCrossAppWalletSmart.mjs";import"./crossApp/wallet/utils/sendCrossAppRequest.mjs";import"./crossApp/wallet/utils/getCrossAppAccountByWalletAddress.mjs";import"./crossApp/wallet/utils/getProviderAccessTokenOrRelink.mjs";import"./crossApp/wallet/utils/throwIfNotLoggedIn.mjs";import"./crossApp/wallet/signTypedData.mjs";import"../utils/typedData/generateDomainType.mjs";import"./crossApp/wallet/sendTransaction.mjs";
|
|
1
|
+
export{i as delegatedActions}from"../index-g0cxoRWQ.mjs";export{i as crossApp}from"../index-Bu3ySxLM.mjs";export{i as depositAddress}from"./depositAddress/index.mjs";import"./delegatedActions/delegateWallet.mjs";import"../Error.mjs";import"../wallet-api/unified-wallet.mjs";import"./delegatedActions/utils.mjs";import"../utils/getAllUserEmbeddedEthereumWallets.mjs";import"../utils/embedded-wallets.mjs";import"../utils/getAllUserEmbeddedSolanaWallets.mjs";import"../utils/getUserEmbeddedEthereumWallet.mjs";import"../utils/getUserEmbeddedSolanaWallet.mjs";import"./delegatedActions/revokeWallets.mjs";import"./crossApp/loginWithCrossAppAuth.mjs";import"./crossApp/linkWithCrossAppAuth.mjs";import"../index-DTAjYY8z.mjs";import"./crossApp/wallet/signMessage.mjs";import"./crossApp/wallet/utils/isCrossAppWalletSmart.mjs";import"./crossApp/wallet/utils/sendCrossAppRequest.mjs";import"./crossApp/wallet/utils/getCrossAppAccountByWalletAddress.mjs";import"./crossApp/wallet/utils/getProviderAccessTokenOrRelink.mjs";import"./crossApp/wallet/utils/throwIfNotLoggedIn.mjs";import"./crossApp/wallet/signTypedData.mjs";import"../utils/typedData/generateDomainType.mjs";import"./crossApp/wallet/sendTransaction.mjs";
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"fetch-retry";import{PrivyErrorCode as t}from"@privy-io/api-base";import{getPathWithParams as s,AppConfig as i,AnalyticsEvent as r,RefreshSession as a}from"@privy-io/routes";import{PrivyClientError as o,PrivyApiError as n}from"../Error.mjs";import{Session as h}from"../Session.mjs";import c from"../toAbortSignalTimeout.mjs";import{toSearchParams as l}from"../utils/toSearchParams.mjs";import{toLoggerWithLevel as g}from"./logger.mjs";import"eventemitter3";import"jose";import"js-cookie";import"../Token.mjs";import"../utils/allSettled.mjs";import"../utils/noop.mjs";let d="privy:caid";class p{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:i}){return`${this.baseUrl}${s(e.path,t)}${l(i)}`}async fetch(e,{body:t,params:s,query:i,headers:r,onRequest:a=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:s,query:i}),{method:e.method,body:JSON.stringify(t),headers:r}),h=await a(o),c=await this._fetch(o,h),l=await c.json();if(c.status>299)throw new n({...l,status:c.status});return l}async _beforeRequestWithoutInitialize(e){let t=await this.session.getPrivyAccessToken()??await this.session.getCustomerAccessToken(),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:c(2e4),headers:s,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequest(e){return await this._initialize(),await this.getAccessTokenInternal(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(i,{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(d);if("string"==typeof e&&e.length>0)return this._analyticsId=e,e}catch(e){this.logger.error("Unable to load clientId",e)}try{this._analyticsId=this._crypto.randomUUID()}catch(e){this.logger.error("Unable to generate uuidv4",e)}if(this._analyticsId){try{await this._storage.put(d,this._analyticsId)}catch(e){this.logger.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}}async destroyClientAnalyticsId(){try{return await this._storage.del(d)}catch(e){this.logger.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(r,{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 this.logger.debug("[privy:refresh] 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,s){let i=await this.session.getCustomerAccessToken();if(!this.session.hasRefreshCredentials(i,e??null))throw this.logger.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new n({code:t.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage",status:401});try{this.logger.debug(`[privy:refresh] fetching: ${a.path}`);let t=await this.fetch(a,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),i=t.session_update_action;return this.logger.debug(`[privy:refresh] response: ${i}`),"set"===i&&(await this.session.updateWithTokensResponse(t),this.logger.debug("[privy:refresh] tokens stored")),"clear"===i&&(await this.session.destroyLocalState(),this.logger.debug("[privy:refresh] tokens cleared"),s||this.callbacks?.setUser?.(null)),"ignore"===i&&(t.token&&(await this.session.storeCustomerAccessToken(t.token),this.logger.debug("[privy:refresh] token stored (CAT)")),t.privy_access_token&&(await this.session.storePrivyAccessToken(t.privy_access_token),this.logger.debug("[privy:refresh] token stored (PAT)")),t.identity_token&&(this.logger.debug("[privy:refresh] token stored (IDT)"),await this.session.storeIdentityToken(t.identity_token))),this.logger.debug("[privy:refresh] returning response"),s||this.callbacks?.setUser?.(t.user),t}catch(e){throw this.logger.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof n&&e.code===t.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),s||this.callbacks?.setUser?.(null)),e}}async getAccessToken(){let[e,t]=await Promise.all([this.session.getCustomerAccessToken(),this.session.getRefreshToken()]);if(e&&!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),s=await this.session.getCustomerAccessToken();return t.token||this.logger.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.logger.debug("[privy:getAccessToken] expected new token in response received existing"),s===e&&this.logger.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??s}return e&&!this.session.tokenIsActive(e)?(this.logger.debug("[privy:getAccessToken] unable to refresh inactive token"),this.callbacks?.setUser?.(null),await this.session.destroyLocalState(),null):e}async getAccessTokenInternal(){let e=await this.getAccessToken();return await this.session.getPrivyAccessToken()??e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${this._crypto.randomUUID()}`,t="blobby";await this._storage.put(e,t);let s=await this._storage.get(e);return await this._storage.del(e),s===t}catch(e){return this.logger.error(e),!1}}constructor(t){this._sdkVersion="js-sdk-core:0.
|
|
1
|
+
import e from"fetch-retry";import{PrivyErrorCode as t}from"@privy-io/api-base";import{getPathWithParams as s,AppConfig as i,AnalyticsEvent as r,RefreshSession as a}from"@privy-io/routes";import{PrivyClientError as o,PrivyApiError as n}from"../Error.mjs";import{Session as h}from"../Session.mjs";import c from"../toAbortSignalTimeout.mjs";import{toSearchParams as l}from"../utils/toSearchParams.mjs";import{toLoggerWithLevel as g}from"./logger.mjs";import"eventemitter3";import"jose";import"js-cookie";import"../Token.mjs";import"../utils/allSettled.mjs";import"../utils/noop.mjs";let d="privy:caid";class p{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:i}){return`${this.baseUrl}${s(e.path,t)}${l(i)}`}async fetch(e,{body:t,params:s,query:i,headers:r,onRequest:a=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:s,query:i}),{method:e.method,body:JSON.stringify(t),headers:r}),h=await a(o),c=await this._fetch(o,h),l=await c.json();if(c.status>299)throw new n({...l,status:c.status});return l}async _beforeRequestWithoutInitialize(e){let t=await this.session.getPrivyAccessToken()??await this.session.getCustomerAccessToken(),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:c(2e4),headers:s,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequest(e){return await this._initialize(),await this.getAccessTokenInternal(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(i,{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(d);if("string"==typeof e&&e.length>0)return this._analyticsId=e,e}catch(e){this.logger.error("Unable to load clientId",e)}try{this._analyticsId=this._crypto.randomUUID()}catch(e){this.logger.error("Unable to generate uuidv4",e)}if(this._analyticsId){try{await this._storage.put(d,this._analyticsId)}catch(e){this.logger.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}}async destroyClientAnalyticsId(){try{return await this._storage.del(d)}catch(e){this.logger.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(r,{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 this.logger.debug("[privy:refresh] 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,s){let i=await this.session.getCustomerAccessToken();if(!this.session.hasRefreshCredentials(i,e??null))throw this.logger.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new n({code:t.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage",status:401});try{this.logger.debug(`[privy:refresh] fetching: ${a.path}`);let t=await this.fetch(a,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),i=t.session_update_action;return this.logger.debug(`[privy:refresh] response: ${i}`),"set"===i&&(await this.session.updateWithTokensResponse(t),this.logger.debug("[privy:refresh] tokens stored")),"clear"===i&&(await this.session.destroyLocalState(),this.logger.debug("[privy:refresh] tokens cleared"),s||this.callbacks?.setUser?.(null)),"ignore"===i&&(t.token&&(await this.session.storeCustomerAccessToken(t.token),this.logger.debug("[privy:refresh] token stored (CAT)")),t.privy_access_token&&(await this.session.storePrivyAccessToken(t.privy_access_token),this.logger.debug("[privy:refresh] token stored (PAT)")),t.identity_token&&(this.logger.debug("[privy:refresh] token stored (IDT)"),await this.session.storeIdentityToken(t.identity_token))),this.logger.debug("[privy:refresh] returning response"),s||this.callbacks?.setUser?.(t.user),t}catch(e){throw this.logger.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof n&&e.code===t.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),s||this.callbacks?.setUser?.(null)),e}}async getAccessToken(){let[e,t]=await Promise.all([this.session.getCustomerAccessToken(),this.session.getRefreshToken()]);if(e&&!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),s=await this.session.getCustomerAccessToken();return t.token||this.logger.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.logger.debug("[privy:getAccessToken] expected new token in response received existing"),s===e&&this.logger.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??s}return e&&!this.session.tokenIsActive(e)?(this.logger.debug("[privy:getAccessToken] unable to refresh inactive token"),this.callbacks?.setUser?.(null),await this.session.destroyLocalState(),null):e}async getAccessTokenInternal(){let e=await this.getAccessToken();return await this.session.getPrivyAccessToken()??e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${this._crypto.randomUUID()}`,t="blobby";await this._storage.put(e,t);let s=await this._storage.get(e);return await this._storage.del(e),s===t}catch(e){return this.logger.error(e),!1}}constructor(t){this._sdkVersion="js-sdk-core:0.66.0",this._cache=new Map,this.logger=g({level:t.logger?.level??t.logLevel??"ERROR",logger:t.logger??console}),this._storage=t.storage,this._crypto=t.crypto,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.callbacks=t.callbacks,this.nativeAppIdentifier=t.nativeAppIdentifier,this.session=new h({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{p as PrivyInternal};
|
|
2
2
|
//# sourceMappingURL=PrivyInternal.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"./client/Privy.mjs";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{isEmbeddedWalletAccount}from"./utils/embedded-wallets.mjs";export{getEntropyDetailsFromAccount,getEntropyDetailsFromUser}from"./utils/entropy.mjs";export{getUserSmartWallet}from"./utils/getUserSmartWallet.mjs";export{getJsonRpcEndpointFromChain,throwIfInvalidRecoveryUpgradePath}from"./embedded/utils/index.mjs";export{toWalletApiUnsignedEthTransaction}from"./embedded/stack/wallet-api-eth-transaction.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{SolanaUsdcAddressMap,UsdcAddressMap,getIsTokenUsdc}from"./utils/getIsTokenUsdc.mjs";export{generateWalletIdempotencyKey}from"./utils/generateWalletIdempotencyKey.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{generateAuthorizationSignature}from"./wallet-api/generate-authorization-signature.mjs";export{create}from"./wallet-api/create.mjs";export{rpc}from"./wallet-api/rpc.mjs";export{rawSign}from"./wallet-api/raw-sign.mjs";export{getWallet}from"./wallet-api/get-wallet.mjs";export{updateWallet}from"./wallet-api/update-wallet.mjs";export{isUnifiedWallet}from"./wallet-api/unified-wallet.mjs";export{addSessionSigners,removeSessionSigners}from"./embedded/stack/session-signers.mjs";export{ConnectedStandardSolanaWallet}from"./solana/ConnectedStandardSolanaWallet.mjs";export{poll}from"./utils/poll.mjs";export{i as crossApp}from"./index-Bu3ySxLM.mjs";export{i as delegatedActions}from"./index-g0cxoRWQ.mjs";export{getCountryCallingCode}from"libphonenumber-js/min";import"./crypto/resolve.mjs";import"./client/AppApi.mjs";import"@privy-io/routes";import"./client/CrossAppApi.mjs";import"./Token.mjs";import"jose";import"./client/DelegatedWalletsApi.mjs";import"./client/EmbeddedWalletApi.mjs";import"./embedded/EmbeddedBitcoinWalletProvider.mjs";import"./embedded/stack/walletCreate.mjs";import"./embedded/EmbeddedWalletProxy.mjs";import"./utils/sleep.mjs";import"./embedded/EventCallbackQueue.mjs";import"./embedded/withMfa.mjs";import"./embedded/EmbeddedWalletProvider.mjs";import"eventemitter3";import"viem";import"@privy-io/ethereum";import"./embedded/stack/walletRpc.mjs";import"./utils/encodings.mjs";import"./embedded/stack/wallet-api-eth-typed-data.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"@privy-io/api-base";import"./Session.mjs";import"js-cookie";import"./utils/allSettled.mjs";import"./toAbortSignalTimeout.mjs";import"./utils/toSearchParams.mjs";import"./client/logger.mjs";import"./utils/noop.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"viem/chains";import"libphonenumber-js/examples.mobile.json";import"canonicalize";import"@privy-io/encoding";import"./wallet-api/types.mjs";import"./action/delegatedActions/utils.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";import"./action/delegatedActions/delegateWallet.mjs";import"./action/delegatedActions/revokeWallets.mjs";const t="biconomy",r="coinbase_smart_wallet",o="kernel",s="light_account",m="safe",a="thirdweb",l="nexus";export{t as BICONOMY,r as COINBASE_SMART_WALLET,o as KERNEL,s as LIGHT_ACCOUNT,l as NEXUS,m as SAFE,a as THIRDWEB,e as default};
|
|
1
|
+
import e from"./client/Privy.mjs";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{isEmbeddedWalletAccount}from"./utils/embedded-wallets.mjs";export{getEntropyDetailsFromAccount,getEntropyDetailsFromUser}from"./utils/entropy.mjs";export{getUserSmartWallet}from"./utils/getUserSmartWallet.mjs";export{getJsonRpcEndpointFromChain,throwIfInvalidRecoveryUpgradePath}from"./embedded/utils/index.mjs";export{toWalletApiUnsignedEthTransaction}from"./embedded/stack/wallet-api-eth-transaction.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{SolanaUsdcAddressMap,UsdcAddressMap,getIsTokenUsdc}from"./utils/getIsTokenUsdc.mjs";export{generateWalletIdempotencyKey}from"./utils/generateWalletIdempotencyKey.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{generateAuthorizationSignature}from"./wallet-api/generate-authorization-signature.mjs";export{create}from"./wallet-api/create.mjs";export{rpc}from"./wallet-api/rpc.mjs";export{rawSign}from"./wallet-api/raw-sign.mjs";export{getWallet}from"./wallet-api/get-wallet.mjs";export{updateWallet}from"./wallet-api/update-wallet.mjs";export{isUnifiedWallet}from"./wallet-api/unified-wallet.mjs";export{addSessionSigners,removeSessionSigners}from"./embedded/stack/session-signers.mjs";export{ConnectedStandardSolanaWallet}from"./solana/ConnectedStandardSolanaWallet.mjs";export{poll}from"./utils/poll.mjs";export{i as crossApp}from"./index-Bu3ySxLM.mjs";export{i as delegatedActions}from"./index-g0cxoRWQ.mjs";export{i as depositAddress}from"./action/depositAddress/index.mjs";export{getCountryCallingCode}from"libphonenumber-js/min";import"./crypto/resolve.mjs";import"./client/AppApi.mjs";import"@privy-io/routes";import"./client/CrossAppApi.mjs";import"./Token.mjs";import"jose";import"./client/DelegatedWalletsApi.mjs";import"./client/EmbeddedWalletApi.mjs";import"./embedded/EmbeddedBitcoinWalletProvider.mjs";import"./embedded/stack/walletCreate.mjs";import"./embedded/EmbeddedWalletProxy.mjs";import"./utils/sleep.mjs";import"./embedded/EventCallbackQueue.mjs";import"./embedded/withMfa.mjs";import"./embedded/EmbeddedWalletProvider.mjs";import"eventemitter3";import"viem";import"@privy-io/ethereum";import"./embedded/stack/walletRpc.mjs";import"./utils/encodings.mjs";import"./embedded/stack/wallet-api-eth-typed-data.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"@privy-io/api-base";import"./Session.mjs";import"js-cookie";import"./utils/allSettled.mjs";import"./toAbortSignalTimeout.mjs";import"./utils/toSearchParams.mjs";import"./client/logger.mjs";import"./utils/noop.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"viem/chains";import"libphonenumber-js/examples.mobile.json";import"canonicalize";import"@privy-io/encoding";import"./wallet-api/types.mjs";import"./action/delegatedActions/utils.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";import"./action/delegatedActions/delegateWallet.mjs";import"./action/delegatedActions/revokeWallets.mjs";const t="biconomy",r="coinbase_smart_wallet",o="kernel",s="light_account",m="safe",a="thirdweb",l="nexus";export{t as BICONOMY,r as COINBASE_SMART_WALLET,o as KERNEL,s as LIGHT_ACCOUNT,l as NEXUS,m as SAFE,a as THIRDWEB,e as default};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"names":["BICONOMY","COINBASE_SMART_WALLET","KERNEL","LIGHT_ACCOUNT","SAFE","THIRDWEB","NEXUS"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"names":["BICONOMY","COINBASE_SMART_WALLET","KERNEL","LIGHT_ACCOUNT","SAFE","THIRDWEB","NEXUS"],"mappings":"0jNAeO,MAAMA,EAAW,WAEXC,EAAwB,wBAExBC,EAAS,SAETC,EAAgB,gBAEhBC,EAAO,OAEPC,EAAW,WAEXC,EAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@privy-io/js-sdk-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"description": "Vanilla JS client for the Privy Auth API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"js-cookie": "^3.0.5",
|
|
59
59
|
"libphonenumber-js": "^1.10.44",
|
|
60
60
|
"set-cookie-parser": "^2.6.0",
|
|
61
|
+
"@privy-io/api-base": "1.9.0",
|
|
61
62
|
"@privy-io/chains": "0.3.0",
|
|
62
63
|
"@privy-io/encoding": "0.1.3",
|
|
63
64
|
"@privy-io/ethereum": "0.1.4",
|
|
64
|
-
"@privy-io/routes": "0.2.3"
|
|
65
|
-
"@privy-io/api-base": "1.9.0"
|
|
65
|
+
"@privy-io/routes": "0.2.3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@metamask/eth-sig-util": "^8.2.0",
|