@privy-io/react-auth 3.2.1 → 3.3.0-beta-20251010144542
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/SignRequestScreen-CP2KA7ya.js +27 -0
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/getEmbeddedConnectedWallet-6TsVZJkD.js +1 -0
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/privy-context-NMR-GjnL.js +1 -0
- package/dist/cjs/{smart-wallets-7Aqc5Nzs.js → smart-wallets-DeRINaJe.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +2 -2
- package/dist/cjs/{use-export-wallet-sK7TOD-_.js → use-export-wallet-BP0lPnqm.js} +1 -1
- package/dist/cjs/{useActiveWallet-BtCoqsEN.js → useActiveWallet-LAFaOocp.js} +1 -1
- package/dist/cjs/{usePrivy-B_0-uaxv.js → usePrivy-qD6wnoRL.js} +1 -1
- package/dist/dts/extended-chains.d.mts +1 -1
- package/dist/dts/extended-chains.d.ts +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +25 -3
- package/dist/dts/index.d.ts +25 -3
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +2 -2
- package/dist/dts/solana.d.ts +2 -2
- package/dist/dts/{types-DbYYrJGX.d.mts → types-C97UOzaM.d.mts} +18 -3
- package/dist/dts/{types-DbYYrJGX.d.ts → types-C97UOzaM.d.ts} +18 -3
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/SignRequestScreen-CGlP3Q5r.mjs +25 -0
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/getEmbeddedConnectedWallet-CM6cDQCS.mjs +1 -0
- package/dist/esm/index.mjs +6 -6
- package/dist/esm/privy-context-C7K3ZBW-.mjs +1 -0
- package/dist/esm/smart-wallets-CdEONzDF.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/use-export-wallet-CaBSW_2U.mjs +1 -0
- package/dist/esm/{useActiveWallet-LdKZteNM.mjs → useActiveWallet-CiDNzxEx.mjs} +1 -1
- package/dist/esm/{usePrivy-DPEbjcra.mjs → usePrivy-DQW-BUcn.mjs} +1 -1
- package/package.json +4 -4
- package/dist/cjs/SignRequestScreen-BbqNYmhD.js +0 -27
- package/dist/cjs/getEmbeddedConnectedWallet-DTU4T9TJ.js +0 -1
- package/dist/cjs/privy-context-CJzQZH6s.js +0 -1
- package/dist/esm/SignRequestScreen-BFYRKL3N.mjs +0 -25
- package/dist/esm/getEmbeddedConnectedWallet-CSSBWE2p.mjs +0 -1
- package/dist/esm/privy-context-CTKe79J4.mjs +0 -1
- package/dist/esm/smart-wallets-kAXh6Vvw.mjs +0 -1
- package/dist/esm/use-export-wallet-BxcU5zVQ.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.getEmbeddedConnectedWallet=function(e){return e.find((e=>"privy"===e.walletClientType&&"embedded"===e.connectorType&&!e.imported))??null};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("viem"),t=require("react"),i=require("./internal-context-DNWjSiYq.js");function a(e){return"string"==typeof e&&/^custom:[a-zA-Z0-9_-]+$/i.test(e)}function r(e){return e?new Date(1e3*e):null}function l(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt?.getTime()??0)-(t.firstVerifiedAt?.getTime()??0))).find((e=>e.type===t))}const n=e=>e?s(e).find((e=>0===e.walletIndex))??null:null,s=e=>e?m(e,"ethereum"):[],m=(e,t)=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t)),d=e=>e?m(e,"solana"):[],o=e=>e?d(e).find((e=>0===e.walletIndex))??null:null;let p=(t,i)=>t===i||!(!t.startsWith("0x")||!i.startsWith("0x"))&&e.getAddress(t)===e.getAddress(i);const u=/*#__PURE__*/t.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:i.notImplemented,login:i.notImplemented,connectOrCreateWallet:i.notImplemented,linkEmail:i.notImplemented,linkPhone:i.notImplemented,linkFarcaster:i.notImplemented,linkWallet:i.notImplemented,startCrossAppAuthFlow:i.notImplemented,linkGoogle:i.notImplemented,linkTwitter:i.notImplemented,linkDiscord:i.notImplemented,linkGithub:i.notImplemented,linkSpotify:i.notImplemented,linkInstagram:i.notImplemented,linkTelegram:i.notImplemented,linkTiktok:i.notImplemented,linkLine:i.notImplemented,linkLinkedIn:i.notImplemented,linkApple:i.notImplemented,linkPasskey:i.notImplemented,updateEmail:i.notImplemented,updatePhone:i.notImplemented,logout:i.notImplemented,getAccessToken:i.notImplemented,unlinkEmail:i.notImplemented,unlinkPhone:i.notImplemented,unlinkWallet:i.notImplemented,unlinkGoogle:i.notImplemented,unlinkTwitter:i.notImplemented,unlinkDiscord:i.notImplemented,unlinkGithub:i.notImplemented,unlinkSpotify:i.notImplemented,unlinkInstagram:i.notImplemented,unlinkTiktok:i.notImplemented,unlinkLine:i.notImplemented,unlinkLinkedIn:i.notImplemented,unlinkApple:i.notImplemented,unlinkCrossAppAccount:i.notImplemented,unlinkFarcaster:i.notImplemented,unlinkTelegram:i.notImplemented,unlinkPasskey:i.notImplemented,signMessage:i.notImplemented,signTypedData:i.notImplemented,enrollInMfa:i.notImplemented,initEnrollmentWithSms:i.notImplemented,initEnrollmentWithTotp:i.notImplemented,initEnrollmentWithPasskey:i.notImplemented,promptMfa:i.notImplemented,init:i.notImplemented,submitEnrollmentWithSms:i.notImplemented,submitEnrollmentWithTotp:i.notImplemented,submitEnrollmentWithPasskey:i.notImplemented,unenroll:i.notImplemented,submit:i.notImplemented,cancel:i.notImplemented,sendTransaction:i.notImplemented,signTransaction:i.notImplemented,exportWallet:i.notImplemented,setWalletPassword:i.notImplemented,setWalletRecovery:i.notImplemented,requestFarcasterSignerFromWarpcast:i.notImplemented,getFarcasterSignerPublicKey:i.notImplemented,signFarcasterMessage:i.notImplemented,signMessageWithCrossAppWallet:i.notImplemented,signTypedDataWithCrossAppWallet:i.notImplemented,sendTransactionWithCrossAppWallet:i.notImplemented,signTransactionWithCrossAppWallet:i.notImplemented,isModalOpen:!1,mfaMethods:[]});exports.PrivyContext=u,exports.convertUserResponseToUser=function(e){if(!e)return null;let t=function(e){let t=[];for(let i of e){let e=i.type;switch(i.type){case"wallet":let l={id:i.id,address:i.address,type:i.type,imported:i.imported,delegated:i.delegated,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at),chainType:i.chain_type,walletClientType:i.wallet_client_type,connectorType:i.connector_type,recoveryMethod:i.recovery_method,walletIndex:i.wallet_index,publicKey:i.public_key};t.push(l);break;case"smart_wallet":let n={address:i.address,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at),smartWalletType:i.smart_wallet_type,smartWalletVersion:i.smart_wallet_version};t.push(n);break;case"cross_app":let s={type:i.type,subject:i.subject,embeddedWallets:i.embedded_wallets,smartWallets:i.smart_wallets,providerApp:{id:i.provider_app_id},firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(s);break;case"email":let m={address:i.address,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(m);break;case"phone":let d={number:i.phoneNumber,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(d);break;case"google_oauth":let o={subject:i.subject,email:i.email,name:i.name,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(o);break;case"spotify_oauth":let p={subject:i.subject,email:i.email,name:i.name,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(p);break;case"instagram_oauth":let u={subject:i.subject,username:i.username,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(u);break;case"twitter_oauth":let c={subject:i.subject,username:i.username,name:i.name,type:i.type,profilePictureUrl:i.profile_picture_url,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(c);break;case"discord_oauth":let f={subject:i.subject,username:i.username,email:i.email,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(f);break;case"github_oauth":let _={subject:i.subject,username:i.username,name:i.name,email:i.email,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(_);break;case"tiktok_oauth":let y={subject:i.subject,username:i.username,name:i.name,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(y);break;case"line_oauth":let h={subject:i.subject,name:i.name,email:i.email,profilePictureUrl:i.profile_picture_url,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(h);break;case"linkedin_oauth":let b={subject:i.subject,name:i.name,email:i.email,vanityName:i.vanity_name,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(b);break;case"apple_oauth":let I={subject:i.subject,email:i.email,type:i.type,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(I);break;case"custom_auth":t.push({type:i.type,customUserId:i.custom_user_id,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)});break;case"farcaster":let k={type:i.type,fid:i.fid,ownerAddress:i.owner_address,displayName:i.display_name,username:i.username,bio:i.bio,pfp:i.profile_picture_url,url:i.homepage_url,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at),signerPublicKey:i.signer_public_key};t.push(k);break;case"passkey":let v={type:i.type,enrolledInMfa:i.enrolled_in_mfa,credentialId:i.credential_id,publicKey:i.public_key,authenticatorName:i.authenticator_name,createdWithDevice:i.created_with_device,createdWithOs:i.created_with_os,createdWithBrowser:i.created_with_browser,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(v);break;case"telegram":let A={type:i.type,telegramUserId:i.telegram_user_id,firstName:i.first_name,lastName:i.last_name,username:i.username,photoUrl:i.photo_url,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(A);break;default:if(a(i.type)){let e={type:i.type,subject:i.subject,name:i.name,username:i.username,email:i.email,profilePictureUrl:i.profile_picture_url,firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(e);break}console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),i=l(t,"wallet"),n=l(t,"smart_wallet"),s=l(t,"email"),m=l(t,"phone"),d=l(t,"google_oauth"),o=l(t,"twitter_oauth"),p=l(t,"discord_oauth"),u=l(t,"github_oauth"),c=l(t,"spotify_oauth"),f=l(t,"instagram_oauth"),_=l(t,"tiktok_oauth"),y=l(t,"line_oauth"),h=l(t,"linkedin_oauth"),b=l(t,"apple_oauth"),I=l(t,"farcaster"),k=l(t,"telegram"),v=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:r(t)})));return{id:e.id,createdAt:r(e.created_at),linkedAccounts:t,email:s&&{address:s?.address},phone:m&&{number:m?.number},wallet:i&&{id:i.id,address:i.address,chainType:i.chainType,walletClientType:i.walletClientType,connectorType:i.connectorType,recoveryMethod:i.recoveryMethod,imported:i.imported,delegated:i.delegated,walletIndex:i.walletIndex,publicKey:i.publicKey},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType,smartWalletVersion:n.smartWalletVersion},google:d&&{subject:d.subject,email:d.email,name:d.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:p&&{subject:p.subject,username:p.username,email:p.email},github:u&&{subject:u.subject,username:u.username,name:u.name,email:u.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:_&&{subject:_.subject,username:_.username,name:_.name},line:y&&{subject:y.subject,name:y.name,email:y.email,profilePictureUrl:y.profilePictureUrl},linkedin:h&&{subject:h.subject,name:h.name,email:h.email,vanityName:h.vanityName},apple:b&&{subject:b.subject,email:b.email},farcaster:I&&{fid:I.fid,ownerAddress:I.ownerAddress,displayName:I.displayName,username:I.username,bio:I.bio,pfp:I.pfp,url:I.url,signerPublicKey:I.signerPublicKey},telegram:k&&{telegramUserId:k.telegramUserId,firstName:k.firstName,lastName:k.lastName,username:k.username,photoUrl:k.photoUrl},delegatedWallets:[],mfaMethods:v.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}},exports.getAllPrivyWalletsForChainType=m,exports.getConnectedWalletWithAddress=(e,t)=>e.find((e=>p(e.address,t)))||null,exports.getImportedPrivyEthereumWallets=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType)),exports.getImportedPrivySolanaWallets=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType)),exports.getIsUnifiedWallet=e=>!!e.id&&"privy-v2"===e.recoveryMethod,exports.getPrivyEthereumHDWallets=s,exports.getPrivyEthereumWallet=n,exports.getPrivyPrimaryWallet=e=>n(e)??o(e),exports.getPrivySolanaHDWallets=d,exports.getPrivySolanaWallet=o,exports.getPrivyWalletWithAddress=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&p(e.address,t)))||null,exports.isCustomOAuthProvider=a,exports.usePrivyContext=()=>t.useContext(u);
|