@privy-io/react-auth 2.18.2 → 2.19.1
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/abstract-smart-wallets.js +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/{frame-B38H7ILa.js → frame-8JZCzmCf.js} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{internal-context-Uge-4WDr.js → internal-context-B_aIJuQh.js} +1 -1
- package/dist/cjs/{paths-CdRs2pll.js → paths-B00ZrFQm.js} +1 -1
- package/dist/cjs/privy-provider-w2CZwYgl.js +29 -0
- package/dist/cjs/smart-wallets-Dr1Osypf.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{use-sign-with-user-signer-BrJ6QN6E.js → use-sign-with-user-signer-BQ_24mRh.js} +1 -1
- package/dist/cjs/{useActiveWallet-Bid3gn-d.js → useActiveWallet-DtQAu2Xs.js} +1 -1
- package/dist/cjs/{useFundWallet-BSIeXhtj.js → useFundWallet-BwCeN7KG.js} +1 -1
- package/dist/dts/extended-chains.d.mts +2 -1
- package/dist/dts/extended-chains.d.ts +2 -1
- package/dist/dts/farcaster.d.mts +2 -1
- package/dist/dts/farcaster.d.ts +2 -1
- package/dist/dts/index.d.mts +106 -99
- package/dist/dts/index.d.ts +106 -99
- package/dist/dts/smart-wallets.d.mts +2 -1
- package/dist/dts/smart-wallets.d.ts +2 -1
- package/dist/dts/solana.d.mts +5 -4
- package/dist/dts/solana.d.ts +5 -4
- package/dist/dts/{types-cSndhqyV.d.mts → types-ZqHmGCwO.d.mts} +55 -6
- package/dist/dts/{types-cSndhqyV.d.ts → types-ZqHmGCwO.d.ts} +55 -6
- package/dist/dts/ui.d.mts +2 -1
- package/dist/dts/ui.d.ts +2 -1
- package/dist/dts/{useSolanaWallets-BGaZqngA.d.mts → useSolanaWallets-idhSZbQC.d.mts} +1 -1
- package/dist/dts/{useSolanaWallets-BGaZqngA.d.ts → useSolanaWallets-idhSZbQC.d.ts} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/{frame-FpttHlk8.mjs → frame-DMd4vZ0H.mjs} +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{internal-context-BzsB315R.mjs → internal-context-qdNgTV5f.mjs} +1 -1
- package/dist/esm/{paths-CYLUXo_U.mjs → paths-DCwuPDUk.mjs} +1 -1
- package/dist/esm/privy-provider-CCrdZtua.mjs +29 -0
- package/dist/esm/smart-wallets-hHAH4Mag.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{use-sign-with-user-signer-C21K9CRz.mjs → use-sign-with-user-signer-DnNPDfxp.mjs} +1 -1
- package/dist/esm/{useActiveWallet-DwAADhPG.mjs → useActiveWallet-DevxnhSd.mjs} +1 -1
- package/dist/esm/{useFundWallet-CHnKKMFA.mjs → useFundWallet-NTlLFshj.mjs} +1 -1
- package/package.json +5 -4
- package/dist/cjs/privy-provider-CUA5RhGV.js +0 -29
- package/dist/cjs/smart-wallets-Dh0jTSUz.js +0 -1
- package/dist/esm/privy-provider-CGNOFJ8i.mjs +0 -29
- package/dist/esm/smart-wallets-DWVzc4NE.mjs +0 -1
package/dist/cjs/{use-sign-with-user-signer-BrJ6QN6E.js → use-sign-with-user-signer-BQ_24mRh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("viem"),t=require("react"),i=require("./internal-context-Uge-4WDr.js");function r(e){return e?new Date(1e3*e):null}function a(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt??e.verifiedAt).getTime()-(t.firstVerifiedAt??t.verifiedAt).getTime())).find((e=>e.type===t))}const l=e=>e?n(e).find((e=>0===e.walletIndex))??null:null,n=e=>e?s(e,"ethereum"):[],s=(e,t)=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t)),d=e=>e?s(e,"solana"):[],m=e=>e?d(e).find((e=>0===e.walletIndex))??null:null;let o=(t,i)=>t===i||!(!t.startsWith("0x")||!i.startsWith("0x"))&&e.getAddress(t)===e.getAddress(i);const p=/*#__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,isModalOpen:!1,mfaMethods:[]}),u=()=>t.useContext(p);exports.PrivyContext=p,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 a={id:i.id,address:i.address,type:i.type,imported:i.imported,delegated:i.delegated,verifiedAt:r(i.verified_at),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};t.push(a);break;case"smart_wallet":let l={address:i.address,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at),smartWalletType:i.smart_wallet_type};t.push(l);break;case"cross_app":let n={type:i.type,subject:i.subject,embeddedWallets:i.embedded_wallets,smartWallets:i.smart_wallets,providerApp:{id:i.provider_app_id},verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(n);break;case"email":let s={address:i.address,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(s);break;case"phone":let d={number:i.phoneNumber,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(d);break;case"google_oauth":let m={subject:i.subject,email:i.email,name:i.name,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(m);break;case"spotify_oauth":let o={subject:i.subject,email:i.email,name:i.name,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(o);break;case"instagram_oauth":let p={subject:i.subject,username:i.username,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(p);break;case"twitter_oauth":let u={subject:i.subject,username:i.username,name:i.name,type:i.type,profilePictureUrl:i.profile_picture_url,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(u);break;case"discord_oauth":let f={subject:i.subject,username:i.username,email:i.email,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(f);break;case"github_oauth":let c={subject:i.subject,username:i.username,name:i.name,email:i.email,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(c);break;case"tiktok_oauth":let _={subject:i.subject,username:i.username,name:i.name,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(_);break;case"line_oauth":let y={subject:i.subject,name:i.name,email:i.email,profilePictureUrl:i.profile_picture_url,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(y);break;case"linkedin_oauth":let v={subject:i.subject,name:i.name,email:i.email,vanityName:i.vanity_name,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(v);break;case"apple_oauth":let h={subject:i.subject,email:i.email,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(h);break;case"custom_auth":t.push({type:i.type,customUserId:i.custom_user_id,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)});break;case"farcaster":let A={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,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at),signerPublicKey:i.signer_public_key};t.push(A);break;case"passkey":let b={type:i.type,enrolledInMfa:i.enrolled_in_mfa,credentialId:i.credential_id,authenticatorName:i.authenticator_name,createdWithDevice:i.created_with_device,createdWithOs:i.created_with_os,createdWithBrowser:i.created_with_browser,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(b);break;case"telegram":let I={type:i.type,telegramUserId:i.telegram_user_id,firstName:i.first_name,lastName:i.last_name,username:i.username,photoUrl:i.photo_url,verifiedAt:r(i.first_verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(I);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),i=a(t,"wallet"),l=a(t,"smart_wallet"),n=a(t,"email"),s=a(t,"phone"),d=a(t,"google_oauth"),m=a(t,"twitter_oauth"),o=a(t,"discord_oauth"),p=a(t,"github_oauth"),u=a(t,"spotify_oauth"),f=a(t,"instagram_oauth"),c=a(t,"tiktok_oauth"),_=a(t,"line_oauth"),y=a(t,"linkedin_oauth"),v=a(t,"apple_oauth"),h=a(t,"farcaster"),A=a(t,"telegram"),b=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:n&&{address:n?.address},phone:s&&{number:s?.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},smartWallet:l&&{address:l.address,smartWalletType:l.smartWalletType},google:d&&{subject:d.subject,email:d.email,name:d.name},twitter:m&&{subject:m.subject,username:m.username,name:m.name,profilePictureUrl:m.profilePictureUrl},discord:o&&{subject:o.subject,username:o.username,email:o.email},github:p&&{subject:p.subject,username:p.username,name:p.name,email:p.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:c&&{subject:c.subject,username:c.username,name:c.name},line:_&&{subject:_.subject,name:_.name,email:_.email,profilePictureUrl:_.profilePictureUrl},linkedin:y&&{subject:y.subject,name:y.name,email:y.email,vanityName:y.vanityName},apple:v&&{subject:v.subject,email:v.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url,signerPublicKey:h.signerPublicKey},telegram:A&&{telegramUserId:A.telegramUserId,firstName:A.firstName,lastName:A.lastName,username:A.username,photoUrl:A.photoUrl},delegatedWallets:[],mfaMethods:b.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}},exports.getAllPrivyWalletsForChainType=s,exports.getConnectedWalletWithAddress=(e,t)=>e.find((e=>o(e.address,t)))||null,exports.getImportedPrivyEthereumWallet=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,exports.getImportedPrivySolanaWallet=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType))||null,exports.getIsUnifiedWallet=e=>!!e.id&&"privy-v2"===e.recoveryMethod,exports.getPrivyEthereumHDWallets=n,exports.getPrivyEthereumWallet=l,exports.getPrivyPrimaryWallet=e=>l(e)??m(e),exports.getPrivySolanaHDWallets=d,exports.getPrivySolanaWallet=m,exports.getPrivyWalletWithAddress=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&o(e.address,t)))||null,exports.usePrivyContext=u,exports.useSignWithUserSigner=()=>{let{getAccessToken:e}=u(),{walletProxy:r}=i.usePrivyInternal();return t.useMemo((()=>({signWithUserSigner:async({message:t})=>{if(!r)throw Error("Wallet proxy not initialized");let i=await e();if(!i)throw Error("User must be authenticated");let{signature:a}=await r.signWithUserSigner({accessToken:i,message:t});return{signature:a}}})),[r,e])};
|
|
1
|
+
"use strict";var e=require("viem"),t=require("react"),i=require("./internal-context-B_aIJuQh.js");function r(e){return e?new Date(1e3*e):null}function a(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt??e.verifiedAt).getTime()-(t.firstVerifiedAt??t.verifiedAt).getTime())).find((e=>e.type===t))}const l=e=>e?n(e).find((e=>0===e.walletIndex))??null:null,n=e=>e?s(e,"ethereum"):[],s=(e,t)=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t)),d=e=>e?s(e,"solana"):[],m=e=>e?d(e).find((e=>0===e.walletIndex))??null:null;let o=(t,i)=>t===i||!(!t.startsWith("0x")||!i.startsWith("0x"))&&e.getAddress(t)===e.getAddress(i);const p=/*#__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,isModalOpen:!1,mfaMethods:[]}),u=()=>t.useContext(p);exports.PrivyContext=p,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 a={id:i.id,address:i.address,type:i.type,imported:i.imported,delegated:i.delegated,verifiedAt:r(i.verified_at),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};t.push(a);break;case"smart_wallet":let l={address:i.address,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at),smartWalletType:i.smart_wallet_type};t.push(l);break;case"cross_app":let n={type:i.type,subject:i.subject,embeddedWallets:i.embedded_wallets,smartWallets:i.smart_wallets,providerApp:{id:i.provider_app_id},verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(n);break;case"email":let s={address:i.address,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(s);break;case"phone":let d={number:i.phoneNumber,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(d);break;case"google_oauth":let m={subject:i.subject,email:i.email,name:i.name,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(m);break;case"spotify_oauth":let o={subject:i.subject,email:i.email,name:i.name,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(o);break;case"instagram_oauth":let p={subject:i.subject,username:i.username,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(p);break;case"twitter_oauth":let u={subject:i.subject,username:i.username,name:i.name,type:i.type,profilePictureUrl:i.profile_picture_url,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(u);break;case"discord_oauth":let f={subject:i.subject,username:i.username,email:i.email,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(f);break;case"github_oauth":let c={subject:i.subject,username:i.username,name:i.name,email:i.email,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(c);break;case"tiktok_oauth":let _={subject:i.subject,username:i.username,name:i.name,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(_);break;case"line_oauth":let y={subject:i.subject,name:i.name,email:i.email,profilePictureUrl:i.profile_picture_url,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(y);break;case"linkedin_oauth":let v={subject:i.subject,name:i.name,email:i.email,vanityName:i.vanity_name,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(v);break;case"apple_oauth":let h={subject:i.subject,email:i.email,type:i.type,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(h);break;case"custom_auth":t.push({type:i.type,customUserId:i.custom_user_id,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)});break;case"farcaster":let A={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,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at),signerPublicKey:i.signer_public_key};t.push(A);break;case"passkey":let b={type:i.type,enrolledInMfa:i.enrolled_in_mfa,credentialId:i.credential_id,authenticatorName:i.authenticator_name,createdWithDevice:i.created_with_device,createdWithOs:i.created_with_os,createdWithBrowser:i.created_with_browser,verifiedAt:r(i.verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(b);break;case"telegram":let I={type:i.type,telegramUserId:i.telegram_user_id,firstName:i.first_name,lastName:i.last_name,username:i.username,photoUrl:i.photo_url,verifiedAt:r(i.first_verified_at),firstVerifiedAt:r(i.first_verified_at),latestVerifiedAt:r(i.latest_verified_at)};t.push(I);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),i=a(t,"wallet"),l=a(t,"smart_wallet"),n=a(t,"email"),s=a(t,"phone"),d=a(t,"google_oauth"),m=a(t,"twitter_oauth"),o=a(t,"discord_oauth"),p=a(t,"github_oauth"),u=a(t,"spotify_oauth"),f=a(t,"instagram_oauth"),c=a(t,"tiktok_oauth"),_=a(t,"line_oauth"),y=a(t,"linkedin_oauth"),v=a(t,"apple_oauth"),h=a(t,"farcaster"),A=a(t,"telegram"),b=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:n&&{address:n?.address},phone:s&&{number:s?.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},smartWallet:l&&{address:l.address,smartWalletType:l.smartWalletType},google:d&&{subject:d.subject,email:d.email,name:d.name},twitter:m&&{subject:m.subject,username:m.username,name:m.name,profilePictureUrl:m.profilePictureUrl},discord:o&&{subject:o.subject,username:o.username,email:o.email},github:p&&{subject:p.subject,username:p.username,name:p.name,email:p.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:c&&{subject:c.subject,username:c.username,name:c.name},line:_&&{subject:_.subject,name:_.name,email:_.email,profilePictureUrl:_.profilePictureUrl},linkedin:y&&{subject:y.subject,name:y.name,email:y.email,vanityName:y.vanityName},apple:v&&{subject:v.subject,email:v.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url,signerPublicKey:h.signerPublicKey},telegram:A&&{telegramUserId:A.telegramUserId,firstName:A.firstName,lastName:A.lastName,username:A.username,photoUrl:A.photoUrl},delegatedWallets:[],mfaMethods:b.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}},exports.getAllPrivyWalletsForChainType=s,exports.getConnectedWalletWithAddress=(e,t)=>e.find((e=>o(e.address,t)))||null,exports.getImportedPrivyEthereumWallet=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,exports.getImportedPrivySolanaWallet=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType))||null,exports.getIsUnifiedWallet=e=>!!e.id&&"privy-v2"===e.recoveryMethod,exports.getPrivyEthereumHDWallets=n,exports.getPrivyEthereumWallet=l,exports.getPrivyPrimaryWallet=e=>l(e)??m(e),exports.getPrivySolanaHDWallets=d,exports.getPrivySolanaWallet=m,exports.getPrivyWalletWithAddress=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&o(e.address,t)))||null,exports.usePrivyContext=u,exports.useSignWithUserSigner=()=>{let{getAccessToken:e}=u(),{walletProxy:r}=i.usePrivyInternal();return t.useMemo((()=>({signWithUserSigner:async({message:t})=>{if(!r)throw Error("Wallet proxy not initialized");let i=await e();if(!i)throw Error("User must be authenticated");let{signature:a}=await r.signWithUserSigner({accessToken:i,message:t});return{signature:a}}})),[r,e])};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("./privy-provider-
|
|
1
|
+
"use strict";var e=require("react"),t=require("./privy-provider-w2CZwYgl.js"),l=require("./use-sign-with-user-signer-BQ_24mRh.js"),n=require("./internal-context-B_aIJuQh.js");exports.useActiveWallet=()=>{let l=t.useAppConfig(),{wallets:n}=t.useWallets(),{wallets:r}=t.useSolanaWallets(),s=t.useActiveWalletStore((e=>e.wallet));e.useEffect((()=>{if(!l.id)return;let e=t.s.get(t.toActiveWalletKey(l.id));t.useActiveWalletStore.setState({wallet:e})}),[l.id]);let i=e.useMemo((()=>{if(!s)return;let[,e]=s.split(":");return n.find((t=>t.address===e))||r.find((t=>t.address===e))}),[s,n,r]),a=e.useMemo((()=>i?"ethereum"===i.type?i.chainId:"solana":void 0),[i]);return{connect:async e=>{e?.reset&&(t.s.del(t.toActiveWalletKey(l.id)),t.useActiveWalletStore.setState({wallet:void 0}));let{wallet:s}=await t.open();if(!s)return{};let[,i]=s.split(":"),a=n.find((e=>e.address===i));if(a)return{wallet:a,network:a.chainId};let u=r.find((e=>e.address===i));return u?{wallet:u,network:"solana"}:{}},setActiveWallet:e.useCallback((e=>{t.setActiveWallet({address:e.address,client:e.walletClientType,appId:l.id})}),[l.id]),wallet:i,network:a}},exports.useConnectWallet=function(n){let{connectWallet:r}=e.useContext(l.PrivyContext);return t.usePrivyEventSubscription("connectWallet",n),{connectWallet:r}},exports.useFundWallet=e=>{t.usePrivyEventSubscription("fundWallet",e);let{fundWallet:l}=n.usePrivyInternal();return{fundWallet:l}},exports.useLogin=function(n){let{login:r}=e.useContext(l.PrivyContext);return t.usePrivyEventSubscription("login",n),{login:r}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),n=require("./privy-provider-
|
|
1
|
+
"use strict";var e=require("react"),n=require("./privy-provider-w2CZwYgl.js"),t=require("@solana/spl-token"),a=require("@solana/web3.js"),r=require("@privy-io/js-sdk-core"),s=require("./internal-context-B_aIJuQh.js"),o={id:n.SOLANA_FUNDING_PLUGIN_ID,getBalance:({address:e,cluster:n})=>new a.Connection(r.getSolanaRpcEndpointForCluster(n)).getBalance(new a.PublicKey(e)),getTokenBalance:async({address:e,cluster:n,mintAddress:t})=>await new r.SolanaClient({...n,rpcUrl:r.getSolanaRpcEndpointForCluster(n)}).getTokenAccountsByOwner(e,t)||{amount:BigInt(0),decimals:9},createTransferTransaction:async({from:e,to:n,amount:t,cluster:s})=>{let o=new a.PublicKey(e),i=new a.Transaction;i.add(a.SystemProgram.transfer({fromPubkey:o,toPubkey:new a.PublicKey(n),lamports:t}));let c=new a.Connection(r.getSolanaRpcEndpointForCluster(s)),l=await c.getLatestBlockhash();return i.recentBlockhash=l.blockhash,i.feePayer=o,{transaction:i,connection:c}},createSplTransferTransaction:async({from:e,to:n,amount:s,cluster:o,mintAddress:i})=>{let c=new a.PublicKey(i),l=new a.PublicKey(e),u=new a.PublicKey(n),d=new a.Transaction,p=t.getAssociatedTokenAddressSync(c,l),y=t.getAssociatedTokenAddressSync(c,u);d.add(t.createAssociatedTokenAccountIdempotentInstruction(l,y,u,c)),d.add(t.createTransferInstruction(p,y,l,s));let g=new a.Connection(r.getSolanaRpcEndpointForCluster(o)),w=await g.getLatestBlockhash();return d.recentBlockhash=w.blockhash,d.feePayer=l,{transaction:d,connection:g}},createBridgeTransactionFromRelayQuote:async({quote:e,from:t,cluster:s})=>{let o=e.steps[0]?.items?.[0];if(!o)return;let i=o.data.instructions.map((({keys:e,programId:t,data:r})=>new a.TransactionInstruction({keys:e.map((({pubkey:e,isSigner:n,isWritable:t})=>({pubkey:new a.PublicKey(e),isSigner:n,isWritable:t}))),programId:new a.PublicKey(t),data:n.bufferFrom(r,"hex")}))),c=o.data.addressLookupTableAddresses?.map((e=>new a.PublicKey(e))),l=new a.Connection(r.getSolanaRpcEndpointForCluster(s)),u=await Promise.all((c??[]).map((async e=>l.getAddressLookupTable(e).then((e=>e.value))))),{blockhash:d}=await l.getLatestBlockhash();return{transaction:new a.VersionedTransaction(new a.TransactionMessage({payerKey:new a.PublicKey(t),instructions:i,recentBlockhash:d}).compileToV0Message(u)),connection:l}}};exports.t=o,exports.useFundWallet=t=>{n.usePrivyEventSubscription("fundSolanaWallet",t);let a=n.useAppConfig(),{setModalData:r}=n.usePrivyModal(),{openModal:i}=s.usePrivyInternal();return n.useRegisterPlugin(o),{fundWallet:e.useCallback((async(e,t)=>{r({funding:n.prepareSolanaFundingModalData({address:e,appConfig:a,fundWalletConfig:t,methodScreen:n.FundingMethodSelectionScreen})}),i(n.FundingMethodSelectionScreen)}),[a,r,i])}};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CurveSigningChainType, WalletResponseType } from '@privy-io/public-api';
|
|
2
|
-
import { U as User } from './types-
|
|
2
|
+
import { U as User } from './types-ZqHmGCwO.js';
|
|
3
3
|
import '@coinbase/wallet-sdk';
|
|
4
4
|
import '@reown/appkit';
|
|
5
5
|
import '@solana/wallet-adapter-base';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'viem';
|
|
8
8
|
import '@privy-io/js-sdk-core';
|
|
9
|
+
import '@base-org/account';
|
|
9
10
|
import '@solana/wallet-standard-features';
|
|
10
11
|
import '@wallet-standard/base';
|
|
11
12
|
import '@wallet-standard/features';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CurveSigningChainType, WalletResponseType } from '@privy-io/public-api';
|
|
2
|
-
import { U as User } from './types-
|
|
2
|
+
import { U as User } from './types-ZqHmGCwO.js';
|
|
3
3
|
import '@coinbase/wallet-sdk';
|
|
4
4
|
import '@reown/appkit';
|
|
5
5
|
import '@solana/wallet-adapter-base';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'viem';
|
|
8
8
|
import '@privy-io/js-sdk-core';
|
|
9
|
+
import '@base-org/account';
|
|
9
10
|
import '@solana/wallet-standard-features';
|
|
10
11
|
import '@wallet-standard/base';
|
|
11
12
|
import '@wallet-standard/features';
|
package/dist/dts/farcaster.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LoginToFrame, U as User } from './types-
|
|
1
|
+
import { L as LoginToFrame, U as User } from './types-ZqHmGCwO.js';
|
|
2
2
|
import '@coinbase/wallet-sdk';
|
|
3
3
|
import '@reown/appkit';
|
|
4
4
|
import '@solana/wallet-adapter-base';
|
|
@@ -6,6 +6,7 @@ import 'react';
|
|
|
6
6
|
import 'viem';
|
|
7
7
|
import '@privy-io/js-sdk-core';
|
|
8
8
|
import '@privy-io/public-api';
|
|
9
|
+
import '@base-org/account';
|
|
9
10
|
import '@solana/wallet-standard-features';
|
|
10
11
|
import '@wallet-standard/base';
|
|
11
12
|
import '@wallet-standard/features';
|
package/dist/dts/farcaster.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LoginToFrame, U as User } from './types-
|
|
1
|
+
import { L as LoginToFrame, U as User } from './types-ZqHmGCwO.js';
|
|
2
2
|
import '@coinbase/wallet-sdk';
|
|
3
3
|
import '@reown/appkit';
|
|
4
4
|
import '@solana/wallet-adapter-base';
|
|
@@ -6,6 +6,7 @@ import 'react';
|
|
|
6
6
|
import 'viem';
|
|
7
7
|
import '@privy-io/js-sdk-core';
|
|
8
8
|
import '@privy-io/public-api';
|
|
9
|
+
import '@base-org/account';
|
|
9
10
|
import '@solana/wallet-standard-features';
|
|
10
11
|
import '@wallet-standard/base';
|
|
11
12
|
import '@wallet-standard/features';
|
package/dist/dts/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
3
|
+
import { d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as EIP1193Provider, s as EntropyIdVerifier$1, H as HDWalletWithMetadata, u as RequestArguments, v as WalletConnector, B as BaseConnectedEthereumWallet, w as PrivyProxyProvider, x as WalletClientType, y as ConnectedWalletMetadata, z as PrivyClientConfig, A as ConnectorType, D as SetBaseAccountSdkType, G as WalletListEntry, I as AppConfig, J as BaseConnectedWallet, l as SolanaWalletConnector, U as User, K as ConnectWalletModalOptions, N as LoginModalOptions, g as CreateWalletOptions, W as Wallet, Q as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, T as SignTypedDataParams, M as MfaMethod, V as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, X as FundWalletConfig, Y as ConnectedWallet, O as OAuthTokens, Z as CrossAppProviderDetails, _ as OAuthProviderType, $ as MoonpaySignRequest, a0 as MoonpaySignResponse, a1 as SmartWalletConfig, a as LoginMethod, a2 as ExternalWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as SiwsMessageType, a7 as OAuthFlowState, a8 as LoginWithCode, a9 as OtpFlowState, aa as PasskeyFlowState, ab as SiweFlowState, ac as BaseAccountSdkType, ad as UnsignedTransactionRequestWithChainId, ae as BaseConnectedWalletType, C as ConnectedSolanaWallet, af as SessionSignerInput, ag as TelegramAuthFlowState } from './types-ZqHmGCwO.js';
|
|
4
|
+
export { az as Apple, aM as AppleOAuthWithMetadata, aU as ContractUIOptions, aD as CrossAppAccount, aP as CrossAppAccountWithMetadata, aw as Discord, aH as DiscordOAuthWithMetadata, aR as Email, ar as EmailWithMetadata, aY as Farcaster, aN as FarcasterWithMetadata, ax as Github, aI as GithubOAuthWithMetadata, au as Google, aF as GoogleOAuthWithMetadata, aB as Line, aK as LineOAuthWithMetadata, aE as LinkedAccountType, b as LinkedAccountWithMetadata, ay as LinkedIn, aL as LinkedInOAuthWithMetadata, a_ as LoginMethodOrderOption, ai as MessageTypes, ak as MoonpayConfig, al as MoonpayCurrencyCode, aW as MoonpayFundingConfig, am as MoonpayPaymentMethod, aV as NativeFundingConfig, aq as NonEmptyArray, aZ as Passkey, aQ as PasskeyWithMetadata, aS as Phone, as as PhoneWithMetadata, aX as PriceDisplayOptions, P as PrivyErrorCode, an as Quantity, aj as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aC as Telegram, aO as TelegramWithMetadata, aA as Tiktok, aJ as TiktokOAuthWithMetadata, ao as TransactionLog, ap as TransactionReceipt, aT as TransactionUIOptions, av as Twitter, aG as TwitterOAuthWithMetadata, ah as TypedMessage, at as WalletWithMetadata } from './types-ZqHmGCwO.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { TurnstileProps } from '@marsidev/react-turnstile';
|
|
7
7
|
import { AppKit } from '@reown/appkit';
|
|
@@ -16,29 +16,17 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
|
16
16
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
|
|
17
17
|
import { Cluster } from '@solana/web3.js';
|
|
18
18
|
import { FetchOptions } from 'ofetch';
|
|
19
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
20
|
-
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
19
|
+
import { P as PrivyEvents } from './useSolanaWallets-idhSZbQC.js';
|
|
20
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-idhSZbQC.js';
|
|
21
21
|
import * as viem_accounts from 'viem/accounts';
|
|
22
22
|
import '@coinbase/wallet-sdk';
|
|
23
23
|
import '@solana/wallet-adapter-base';
|
|
24
|
+
import '@base-org/account';
|
|
24
25
|
import '@solana/wallet-standard-features';
|
|
25
26
|
import '@wallet-standard/base';
|
|
26
27
|
import '@wallet-standard/features';
|
|
27
28
|
import '@metamask/eth-sig-util';
|
|
28
29
|
|
|
29
|
-
type MobileWalletConfig = {
|
|
30
|
-
client: WalletClientType;
|
|
31
|
-
name: string;
|
|
32
|
-
isInstalled: boolean;
|
|
33
|
-
installLink: string;
|
|
34
|
-
chainTypes: Array<'ethereum' | 'solana'>;
|
|
35
|
-
getMobileRedirect: (args: {
|
|
36
|
-
useUniversalLink: boolean;
|
|
37
|
-
isSolana: boolean;
|
|
38
|
-
connectOnly: boolean;
|
|
39
|
-
}) => string | undefined;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
30
|
type BaseProxyRequest = {
|
|
43
31
|
accessToken: string;
|
|
44
32
|
} & Partial<MfaSubmitArgs>;
|
|
@@ -452,57 +440,6 @@ interface EmbeddedWalletProxy {
|
|
|
452
440
|
signFarcasterMessage: (data: FarcasterSignRequestDataType) => Promise<FarcasterSignResponseDataType>;
|
|
453
441
|
}
|
|
454
442
|
|
|
455
|
-
declare function getCustomerAccessToken(): Promise<string | null>;
|
|
456
|
-
/**
|
|
457
|
-
* Properties to initialize the {@link PrivyProvider}.
|
|
458
|
-
*/
|
|
459
|
-
interface PrivyProviderProps {
|
|
460
|
-
/** Your Privy App ID, which can be retrieved from the Privy dashboard. */
|
|
461
|
-
appId: string;
|
|
462
|
-
/** Your Privy App Client ID, which can be retrieved from the Privy dashboard. */
|
|
463
|
-
clientId?: string;
|
|
464
|
-
/**
|
|
465
|
-
* Client configuration options.
|
|
466
|
-
* Values here will override their server-configuration counterparts.
|
|
467
|
-
*/
|
|
468
|
-
config?: PrivyClientConfig;
|
|
469
|
-
/**
|
|
470
|
-
* @ignore
|
|
471
|
-
* @class
|
|
472
|
-
*/
|
|
473
|
-
children: react__default.ReactNode;
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Passes the Privy authentication context to your React components.
|
|
477
|
-
*
|
|
478
|
-
* This should wrap any components that will to use the Privy SDK via the {@link usePrivy} hook. As an example:
|
|
479
|
-
*
|
|
480
|
-
* ```typescript
|
|
481
|
-
* // At your application root (e.g. `_app.tsx` in NextJS):
|
|
482
|
-
* import {PrivyProvider} from '@privy-io/react-auth';
|
|
483
|
-
*
|
|
484
|
-
* <PrivyProvider appId="APP_ID_FROM_DASHBOARD" onSuccess={() => console.log('Success!')}>
|
|
485
|
-
* <Component {...pageProps} />
|
|
486
|
-
* </PrivyProvider>
|
|
487
|
-
* ```
|
|
488
|
-
*
|
|
489
|
-
*/
|
|
490
|
-
declare const PrivyProvider: ({ config, ...props }: PrivyProviderProps) => JSX.Element;
|
|
491
|
-
|
|
492
|
-
type CaptchaProps = Partial<Pick<TurnstileProps, 'onUnsupported' | 'onError' | 'onSuccess' | 'onExpire' | 'onSubmit'>> & {
|
|
493
|
-
delayedExecution?: boolean;
|
|
494
|
-
};
|
|
495
|
-
/**
|
|
496
|
-
* Used to render an invisible captcha alongside important forms
|
|
497
|
-
*
|
|
498
|
-
* Notes:
|
|
499
|
-
* - **Only for internal use, or use with headless SDK** _(the Privy modal handles captchas internally with this component)_
|
|
500
|
-
* - Only one `<Captcha />` should be rendered at a time, since it injects/removes a global script
|
|
501
|
-
* - the state of the captcha workflow can be accessed using `useCaptcha`
|
|
502
|
-
* - wrapper around [marsidev/react-turnstile](https://github.com/marsidev/react-turnstile), _accepts same [props](https://docs.page/marsidev/react-turnstile/props)_
|
|
503
|
-
*/
|
|
504
|
-
declare const Captcha: ({ delayedExecution, ...props }: CaptchaProps) => react_jsx_runtime.JSX.Element | null;
|
|
505
|
-
|
|
506
443
|
/**
|
|
507
444
|
* Build a viem public client for a given chainId if it is one of our
|
|
508
445
|
* supported chains.
|
|
@@ -791,8 +728,8 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
|
|
|
791
728
|
blockNumber?: bigint | undefined;
|
|
792
729
|
blockTag?: viem.BlockTag | undefined;
|
|
793
730
|
address?: Address | undefined;
|
|
794
|
-
domain?: string | undefined;
|
|
795
731
|
nonce?: string | undefined;
|
|
732
|
+
domain?: string | undefined;
|
|
796
733
|
scheme?: string | undefined;
|
|
797
734
|
time?: Date | undefined;
|
|
798
735
|
message: string;
|
|
@@ -1330,31 +1267,6 @@ declare class Embedded1193Provider extends EventEmitter implements EIP1193Provid
|
|
|
1330
1267
|
private handleWalletApiRequest;
|
|
1331
1268
|
}
|
|
1332
1269
|
|
|
1333
|
-
declare global {
|
|
1334
|
-
interface Window {
|
|
1335
|
-
ethereum?: any;
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
/**
|
|
1339
|
-
* @hidden
|
|
1340
|
-
*
|
|
1341
|
-
* The PrivyProxyProvider adds a middleware layer on top of the underlying wallet provider.
|
|
1342
|
-
* */
|
|
1343
|
-
declare class PrivyProxyProvider implements EIP1193Provider {
|
|
1344
|
-
rpcTimeoutDuration: number;
|
|
1345
|
-
walletProvider?: EIP1193Provider;
|
|
1346
|
-
private _subscriptions;
|
|
1347
|
-
constructor(walletProvider?: EIP1193Provider, rpcTimeoutDuration?: number);
|
|
1348
|
-
on(eventName: string, listener: (...args: any[]) => void): any;
|
|
1349
|
-
request(request: {
|
|
1350
|
-
method: string;
|
|
1351
|
-
params?: any[] | undefined;
|
|
1352
|
-
}): Promise<any>;
|
|
1353
|
-
removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => any;
|
|
1354
|
-
walletTimeout: (error?: WalletTimeoutError, timeoutMs?: number) => Promise<string[]>;
|
|
1355
|
-
setWalletProvider: (provider: EIP1193Provider) => void;
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
1270
|
declare abstract class EthereumWalletConnector extends WalletConnector {
|
|
1359
1271
|
wallets: BaseConnectedEthereumWallet[];
|
|
1360
1272
|
chains: Chain[];
|
|
@@ -1406,6 +1318,70 @@ declare abstract class EthereumWalletConnector extends WalletConnector {
|
|
|
1406
1318
|
unsubscribeListeners(): void;
|
|
1407
1319
|
}
|
|
1408
1320
|
|
|
1321
|
+
type MobileWalletConfig = {
|
|
1322
|
+
client: WalletClientType;
|
|
1323
|
+
name: string;
|
|
1324
|
+
isInstalled: boolean;
|
|
1325
|
+
installLink: string;
|
|
1326
|
+
chainTypes: Array<'ethereum' | 'solana'>;
|
|
1327
|
+
getMobileRedirect: (args: {
|
|
1328
|
+
useUniversalLink: boolean;
|
|
1329
|
+
isSolana: boolean;
|
|
1330
|
+
connectOnly: boolean;
|
|
1331
|
+
}) => string | undefined;
|
|
1332
|
+
};
|
|
1333
|
+
|
|
1334
|
+
declare function getCustomerAccessToken(): Promise<string | null>;
|
|
1335
|
+
/**
|
|
1336
|
+
* Properties to initialize the {@link PrivyProvider}.
|
|
1337
|
+
*/
|
|
1338
|
+
interface PrivyProviderProps {
|
|
1339
|
+
/** Your Privy App ID, which can be retrieved from the Privy dashboard. */
|
|
1340
|
+
appId: string;
|
|
1341
|
+
/** Your Privy App Client ID, which can be retrieved from the Privy dashboard. */
|
|
1342
|
+
clientId?: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* Client configuration options.
|
|
1345
|
+
* Values here will override their server-configuration counterparts.
|
|
1346
|
+
*/
|
|
1347
|
+
config?: PrivyClientConfig;
|
|
1348
|
+
/**
|
|
1349
|
+
* @ignore
|
|
1350
|
+
* @class
|
|
1351
|
+
*/
|
|
1352
|
+
children: react__default.ReactNode;
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Passes the Privy authentication context to your React components.
|
|
1356
|
+
*
|
|
1357
|
+
* This should wrap any components that will to use the Privy SDK via the {@link usePrivy} hook. As an example:
|
|
1358
|
+
*
|
|
1359
|
+
* ```typescript
|
|
1360
|
+
* // At your application root (e.g. `_app.tsx` in NextJS):
|
|
1361
|
+
* import {PrivyProvider} from '@privy-io/react-auth';
|
|
1362
|
+
*
|
|
1363
|
+
* <PrivyProvider appId="APP_ID_FROM_DASHBOARD" onSuccess={() => console.log('Success!')}>
|
|
1364
|
+
* <Component {...pageProps} />
|
|
1365
|
+
* </PrivyProvider>
|
|
1366
|
+
* ```
|
|
1367
|
+
*
|
|
1368
|
+
*/
|
|
1369
|
+
declare const PrivyProvider: ({ config, ...props }: PrivyProviderProps) => JSX.Element;
|
|
1370
|
+
|
|
1371
|
+
type CaptchaProps = Partial<Pick<TurnstileProps, 'onUnsupported' | 'onError' | 'onSuccess' | 'onExpire' | 'onSubmit'>> & {
|
|
1372
|
+
delayedExecution?: boolean;
|
|
1373
|
+
};
|
|
1374
|
+
/**
|
|
1375
|
+
* Used to render an invisible captcha alongside important forms
|
|
1376
|
+
*
|
|
1377
|
+
* Notes:
|
|
1378
|
+
* - **Only for internal use, or use with headless SDK** _(the Privy modal handles captchas internally with this component)_
|
|
1379
|
+
* - Only one `<Captcha />` should be rendered at a time, since it injects/removes a global script
|
|
1380
|
+
* - the state of the captcha workflow can be accessed using `useCaptcha`
|
|
1381
|
+
* - wrapper around [marsidev/react-turnstile](https://github.com/marsidev/react-turnstile), _accepts same [props](https://docs.page/marsidev/react-turnstile/props)_
|
|
1382
|
+
*/
|
|
1383
|
+
declare const Captcha: ({ delayedExecution, ...props }: CaptchaProps) => react_jsx_runtime.JSX.Element | null;
|
|
1384
|
+
|
|
1409
1385
|
declare class EmbeddedWalletConnector extends EthereumWalletConnector {
|
|
1410
1386
|
connectorType: ConnectorType;
|
|
1411
1387
|
walletIndex: number;
|
|
@@ -1438,6 +1414,7 @@ interface ConnectorManagerEvents {
|
|
|
1438
1414
|
declare class ConnectorManager extends EventEmitter<ConnectorManagerEvents> {
|
|
1439
1415
|
walletConnectors: WalletConnector[];
|
|
1440
1416
|
initialized: boolean;
|
|
1417
|
+
setBaseAccountSdk: SetBaseAccountSdkType;
|
|
1441
1418
|
private storedConnections;
|
|
1442
1419
|
private activeWallet?;
|
|
1443
1420
|
private privyAppId;
|
|
@@ -1452,7 +1429,7 @@ declare class ConnectorManager extends EventEmitter<ConnectorManagerEvents> {
|
|
|
1452
1429
|
private walletChainType;
|
|
1453
1430
|
private externalWalletConfig;
|
|
1454
1431
|
private appKit?;
|
|
1455
|
-
constructor(privyAppId: string, walletConnectCloudProjectId: string, rpcConfig: RpcConfig, chains: Chain[], defaultChain: Chain, store: Store, walletList: WalletListEntry[], shouldEnforceDefaultChainOnConnect: boolean, externalWalletConfig: AppConfig['externalWallets'], privyAppName: string, walletChainType?: 'ethereum-and-solana' | 'ethereum-only' | 'solana-only', appKit?: AppKit);
|
|
1432
|
+
constructor(privyAppId: string, walletConnectCloudProjectId: string, rpcConfig: RpcConfig, chains: Chain[], defaultChain: Chain, store: Store, walletList: WalletListEntry[], shouldEnforceDefaultChainOnConnect: boolean, externalWalletConfig: AppConfig['externalWallets'], privyAppName: string, setBaseAccountSdk: SetBaseAccountSdkType, walletChainType?: 'ethereum-and-solana' | 'ethereum-only' | 'solana-only', appKit?: AppKit);
|
|
1456
1433
|
/**
|
|
1457
1434
|
* The core wallets array that is exposed to developers. It builds
|
|
1458
1435
|
* the wallets away with the following logic:
|
|
@@ -2599,7 +2576,7 @@ declare class PrivyClient {
|
|
|
2599
2576
|
* config. We can set this once and only once. If it is set twice, event listeners will be created
|
|
2600
2577
|
* on the first ConnectorManager and are not re-created.
|
|
2601
2578
|
*/
|
|
2602
|
-
initializeConnectorManager({ walletConnectCloudProjectId, rpcConfig, chains, defaultChain, store, walletList, shouldEnforceDefaultChainOnConnect, externalWalletConfig, appName, walletChainType, appKit, }: {
|
|
2579
|
+
initializeConnectorManager({ walletConnectCloudProjectId, rpcConfig, chains, defaultChain, store, walletList, shouldEnforceDefaultChainOnConnect, externalWalletConfig, appName, walletChainType, setBaseAccountSdk, appKit, }: {
|
|
2603
2580
|
walletConnectCloudProjectId: string;
|
|
2604
2581
|
rpcConfig: RpcConfig;
|
|
2605
2582
|
chains: Chain[];
|
|
@@ -2610,6 +2587,7 @@ declare class PrivyClient {
|
|
|
2610
2587
|
externalWalletConfig: AppConfig['externalWallets'];
|
|
2611
2588
|
appName: string;
|
|
2612
2589
|
walletChainType: 'ethereum-and-solana' | 'ethereum-only' | 'solana-only';
|
|
2590
|
+
setBaseAccountSdk: SetBaseAccountSdkType;
|
|
2613
2591
|
appKit?: AppKit;
|
|
2614
2592
|
}): void;
|
|
2615
2593
|
generateApi(): Http;
|
|
@@ -2767,7 +2745,7 @@ declare class PrivyClient {
|
|
|
2767
2745
|
nonce: string;
|
|
2768
2746
|
account: string;
|
|
2769
2747
|
accountType: LoginMethod;
|
|
2770
|
-
externalWalletMetadata?:
|
|
2748
|
+
externalWalletMetadata?: ExternalWalletMetadata;
|
|
2771
2749
|
telegramAuthResult?: TelegramAuthResult;
|
|
2772
2750
|
telegramWebAppData?: TelegramWebAppData;
|
|
2773
2751
|
farcasterEmbeddedAddress?: string;
|
|
@@ -3386,17 +3364,46 @@ interface UseFundWalletInterface {
|
|
|
3386
3364
|
declare const useFundWallet: (callbacks?: PrivyEvents["fundWallet"]) => UseFundWalletInterface;
|
|
3387
3365
|
|
|
3388
3366
|
/**
|
|
3367
|
+
* @deprecated in favor of UseConnectBaseAccountInterface
|
|
3389
3368
|
* Hook to headlessly connect a Coinbase Smart Wallet to a user.
|
|
3390
3369
|
*/
|
|
3391
3370
|
interface UseConnectCoinbaseSmartWalletInterface {
|
|
3392
3371
|
/**
|
|
3393
3372
|
* Method to headlessly connect a Coinbase Smart Wallet to a user.
|
|
3394
|
-
* @
|
|
3373
|
+
* @deprecated in favor of connectBaseAccount
|
|
3395
3374
|
*/
|
|
3396
3375
|
connectCoinbaseSmartWallet: () => void;
|
|
3397
3376
|
}
|
|
3377
|
+
/**
|
|
3378
|
+
* @deprecated in favor of useConnectBaseAccount
|
|
3379
|
+
*/
|
|
3398
3380
|
declare const useConnectCoinbaseSmartWallet: () => UseConnectCoinbaseSmartWalletInterface;
|
|
3399
3381
|
|
|
3382
|
+
/**
|
|
3383
|
+
* Hook to headlessly connect a Base Account to a user.
|
|
3384
|
+
*/
|
|
3385
|
+
interface UseConnectBaseAccountInterface {
|
|
3386
|
+
/**
|
|
3387
|
+
* Method to headlessly connect a Base Account to a user.
|
|
3388
|
+
* @experimental
|
|
3389
|
+
*/
|
|
3390
|
+
connectBaseAccount: () => void;
|
|
3391
|
+
}
|
|
3392
|
+
declare const useConnectBaseAccount: () => UseConnectBaseAccountInterface;
|
|
3393
|
+
|
|
3394
|
+
/**
|
|
3395
|
+
* Hook to access the instance of the Base Account SDK that Privy loads.
|
|
3396
|
+
*/
|
|
3397
|
+
interface UseBaseAccountSdkInterface {
|
|
3398
|
+
/**
|
|
3399
|
+
* The instance of the Base Account SDK that Privy loads. This state will be
|
|
3400
|
+
* undefined until the SDK initializes.
|
|
3401
|
+
* @experimental
|
|
3402
|
+
*/
|
|
3403
|
+
baseAccountSdk: BaseAccountSdkType | undefined;
|
|
3404
|
+
}
|
|
3405
|
+
declare const useBaseAccountSdk: () => UseBaseAccountSdkInterface;
|
|
3406
|
+
|
|
3400
3407
|
type UseAuthMfa = {
|
|
3401
3408
|
/**
|
|
3402
3409
|
* Trigger the verification flow for auth MFA.
|
|
@@ -4211,4 +4218,4 @@ declare const toViemAccount: ({ wallet }: {
|
|
|
4211
4218
|
type: "local";
|
|
4212
4219
|
}>;
|
|
4213
4220
|
|
|
4214
|
-
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
|
|
4221
|
+
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
|