@privy-io/react-auth 2.18.2 → 2.19.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/abstract-smart-wallets.js +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{internal-context-Uge-4WDr.js → internal-context-BChQoYJ7.js} +1 -1
- package/dist/cjs/privy-provider-CENM9vOZ.js +29 -0
- package/dist/cjs/smart-wallets-B8cmx9jP.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-YijW4Qvj.js} +1 -1
- package/dist/cjs/{useActiveWallet-Bid3gn-d.js → useActiveWallet-ChBjCxdS.js} +1 -1
- package/dist/cjs/{useFundWallet-BSIeXhtj.js → useFundWallet-ChzgQztK.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 +23 -6
- package/dist/dts/index.d.ts +23 -6
- 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-C5FjymFC.d.mts} +17 -2
- package/dist/dts/{types-cSndhqyV.d.ts → types-C5FjymFC.d.ts} +17 -2
- package/dist/dts/ui.d.mts +2 -1
- package/dist/dts/ui.d.ts +2 -1
- package/dist/dts/{useSolanaWallets-BGaZqngA.d.mts → useSolanaWallets-C_wdD6lb.d.mts} +1 -1
- package/dist/dts/{useSolanaWallets-BGaZqngA.d.ts → useSolanaWallets-C_wdD6lb.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/index.mjs +1 -1
- package/dist/esm/{internal-context-BzsB315R.mjs → internal-context-DelFGnzS.mjs} +1 -1
- package/dist/esm/privy-provider-BrsjzEmo.mjs +29 -0
- package/dist/esm/smart-wallets-Cp5Kl2CX.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-DCN1LHu1.mjs} +1 -1
- package/dist/esm/{useActiveWallet-DwAADhPG.mjs → useActiveWallet-Bu4Myhqk.mjs} +1 -1
- package/dist/esm/{useFundWallet-CHnKKMFA.mjs → useFundWallet-DpRl0Fim.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-YijW4Qvj.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-BChQoYJ7.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-CENM9vOZ.js"),l=require("./use-sign-with-user-signer-YijW4Qvj.js"),n=require("./internal-context-BChQoYJ7.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-CENM9vOZ.js"),t=require("@solana/spl-token"),a=require("@solana/web3.js"),r=require("@privy-io/js-sdk-core"),s=require("./internal-context-BChQoYJ7.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,5 +1,6 @@
|
|
|
1
1
|
import { CurveSigningChainType, WalletResponseType } from '@privy-io/public-api';
|
|
2
|
-
import { U as User } from './types-
|
|
2
|
+
import { U as User } from './types-C5FjymFC.js';
|
|
3
|
+
import '@base-org/account';
|
|
3
4
|
import '@coinbase/wallet-sdk';
|
|
4
5
|
import '@reown/appkit';
|
|
5
6
|
import '@solana/wallet-adapter-base';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CurveSigningChainType, WalletResponseType } from '@privy-io/public-api';
|
|
2
|
-
import { U as User } from './types-
|
|
2
|
+
import { U as User } from './types-C5FjymFC.js';
|
|
3
|
+
import '@base-org/account';
|
|
3
4
|
import '@coinbase/wallet-sdk';
|
|
4
5
|
import '@reown/appkit';
|
|
5
6
|
import '@solana/wallet-adapter-base';
|
package/dist/dts/farcaster.d.mts
CHANGED
package/dist/dts/farcaster.d.ts
CHANGED
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 { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-
|
|
4
|
-
export { ax as Apple, aK as AppleOAuthWithMetadata, aS as ContractUIOptions, aB as CrossAppAccount, aN as CrossAppAccountWithMetadata, au as Discord, aF as DiscordOAuthWithMetadata, aP as Email, ap as EmailWithMetadata, aW as Farcaster, aL as FarcasterWithMetadata, av as Github, aG as GithubOAuthWithMetadata, as as Google, aD as GoogleOAuthWithMetadata, az as Line, aI as LineOAuthWithMetadata, aC as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aJ as LinkedInOAuthWithMetadata, aY as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aU as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aT as NativeFundingConfig, ao as NonEmptyArray, aX as Passkey, aO as PasskeyWithMetadata, aQ as Phone, aq as PhoneWithMetadata, aV as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aA as Telegram, aM as TelegramWithMetadata, ay as Tiktok, aH as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aR as TransactionUIOptions, at as Twitter, aE as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-
|
|
3
|
+
import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-C5FjymFC.js';
|
|
4
|
+
export { ax as Apple, aK as AppleOAuthWithMetadata, aS as ContractUIOptions, aB as CrossAppAccount, aN as CrossAppAccountWithMetadata, au as Discord, aF as DiscordOAuthWithMetadata, aP as Email, ap as EmailWithMetadata, aW as Farcaster, aL as FarcasterWithMetadata, av as Github, aG as GithubOAuthWithMetadata, as as Google, aD as GoogleOAuthWithMetadata, az as Line, aI as LineOAuthWithMetadata, aC as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aJ as LinkedInOAuthWithMetadata, aY as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aU as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aT as NativeFundingConfig, ao as NonEmptyArray, aX as Passkey, aO as PasskeyWithMetadata, aQ as Phone, aq as PhoneWithMetadata, aV as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aA as Telegram, aM as TelegramWithMetadata, ay as Tiktok, aH as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aR as TransactionUIOptions, at as Twitter, aE as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-C5FjymFC.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,9 +16,10 @@ 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-C_wdD6lb.js';
|
|
20
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-C_wdD6lb.js';
|
|
21
21
|
import * as viem_accounts from 'viem/accounts';
|
|
22
|
+
import '@base-org/account';
|
|
22
23
|
import '@coinbase/wallet-sdk';
|
|
23
24
|
import '@solana/wallet-adapter-base';
|
|
24
25
|
import '@solana/wallet-standard-features';
|
|
@@ -3386,17 +3387,33 @@ interface UseFundWalletInterface {
|
|
|
3386
3387
|
declare const useFundWallet: (callbacks?: PrivyEvents["fundWallet"]) => UseFundWalletInterface;
|
|
3387
3388
|
|
|
3388
3389
|
/**
|
|
3390
|
+
* @deprecated in favor of UseConnectBaseAccountInterface
|
|
3389
3391
|
* Hook to headlessly connect a Coinbase Smart Wallet to a user.
|
|
3390
3392
|
*/
|
|
3391
3393
|
interface UseConnectCoinbaseSmartWalletInterface {
|
|
3392
3394
|
/**
|
|
3393
3395
|
* Method to headlessly connect a Coinbase Smart Wallet to a user.
|
|
3394
|
-
* @
|
|
3396
|
+
* @deprecated in favor of connectBaseAccount
|
|
3395
3397
|
*/
|
|
3396
3398
|
connectCoinbaseSmartWallet: () => void;
|
|
3397
3399
|
}
|
|
3400
|
+
/**
|
|
3401
|
+
* @deprecated in favor of useConnectBaseAccount
|
|
3402
|
+
*/
|
|
3398
3403
|
declare const useConnectCoinbaseSmartWallet: () => UseConnectCoinbaseSmartWalletInterface;
|
|
3399
3404
|
|
|
3405
|
+
/**
|
|
3406
|
+
* Hook to headlessly connect a Base Account to a user.
|
|
3407
|
+
*/
|
|
3408
|
+
interface UseConnectBaseAccountInterface {
|
|
3409
|
+
/**
|
|
3410
|
+
* Method to headlessly connect a Base Account to a user.
|
|
3411
|
+
* @experimental
|
|
3412
|
+
*/
|
|
3413
|
+
connectBaseAccount: () => void;
|
|
3414
|
+
}
|
|
3415
|
+
declare const useConnectBaseAccount: () => UseConnectBaseAccountInterface;
|
|
3416
|
+
|
|
3400
3417
|
type UseAuthMfa = {
|
|
3401
3418
|
/**
|
|
3402
3419
|
* Trigger the verification flow for auth MFA.
|
|
@@ -4211,4 +4228,4 @@ declare const toViemAccount: ({ wallet }: {
|
|
|
4211
4228
|
type: "local";
|
|
4212
4229
|
}>;
|
|
4213
4230
|
|
|
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 };
|
|
4231
|
+
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 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, 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 };
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-
|
|
4
|
-
export { ax as Apple, aK as AppleOAuthWithMetadata, aS as ContractUIOptions, aB as CrossAppAccount, aN as CrossAppAccountWithMetadata, au as Discord, aF as DiscordOAuthWithMetadata, aP as Email, ap as EmailWithMetadata, aW as Farcaster, aL as FarcasterWithMetadata, av as Github, aG as GithubOAuthWithMetadata, as as Google, aD as GoogleOAuthWithMetadata, az as Line, aI as LineOAuthWithMetadata, aC as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aJ as LinkedInOAuthWithMetadata, aY as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aU as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aT as NativeFundingConfig, ao as NonEmptyArray, aX as Passkey, aO as PasskeyWithMetadata, aQ as Phone, aq as PhoneWithMetadata, aV as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aA as Telegram, aM as TelegramWithMetadata, ay as Tiktok, aH as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aR as TransactionUIOptions, at as Twitter, aE as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-
|
|
3
|
+
import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-C5FjymFC.js';
|
|
4
|
+
export { ax as Apple, aK as AppleOAuthWithMetadata, aS as ContractUIOptions, aB as CrossAppAccount, aN as CrossAppAccountWithMetadata, au as Discord, aF as DiscordOAuthWithMetadata, aP as Email, ap as EmailWithMetadata, aW as Farcaster, aL as FarcasterWithMetadata, av as Github, aG as GithubOAuthWithMetadata, as as Google, aD as GoogleOAuthWithMetadata, az as Line, aI as LineOAuthWithMetadata, aC as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aJ as LinkedInOAuthWithMetadata, aY as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aU as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aT as NativeFundingConfig, ao as NonEmptyArray, aX as Passkey, aO as PasskeyWithMetadata, aQ as Phone, aq as PhoneWithMetadata, aV as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aA as Telegram, aM as TelegramWithMetadata, ay as Tiktok, aH as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aR as TransactionUIOptions, at as Twitter, aE as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-C5FjymFC.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,9 +16,10 @@ 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-C_wdD6lb.js';
|
|
20
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-C_wdD6lb.js';
|
|
21
21
|
import * as viem_accounts from 'viem/accounts';
|
|
22
|
+
import '@base-org/account';
|
|
22
23
|
import '@coinbase/wallet-sdk';
|
|
23
24
|
import '@solana/wallet-adapter-base';
|
|
24
25
|
import '@solana/wallet-standard-features';
|
|
@@ -3386,17 +3387,33 @@ interface UseFundWalletInterface {
|
|
|
3386
3387
|
declare const useFundWallet: (callbacks?: PrivyEvents["fundWallet"]) => UseFundWalletInterface;
|
|
3387
3388
|
|
|
3388
3389
|
/**
|
|
3390
|
+
* @deprecated in favor of UseConnectBaseAccountInterface
|
|
3389
3391
|
* Hook to headlessly connect a Coinbase Smart Wallet to a user.
|
|
3390
3392
|
*/
|
|
3391
3393
|
interface UseConnectCoinbaseSmartWalletInterface {
|
|
3392
3394
|
/**
|
|
3393
3395
|
* Method to headlessly connect a Coinbase Smart Wallet to a user.
|
|
3394
|
-
* @
|
|
3396
|
+
* @deprecated in favor of connectBaseAccount
|
|
3395
3397
|
*/
|
|
3396
3398
|
connectCoinbaseSmartWallet: () => void;
|
|
3397
3399
|
}
|
|
3400
|
+
/**
|
|
3401
|
+
* @deprecated in favor of useConnectBaseAccount
|
|
3402
|
+
*/
|
|
3398
3403
|
declare const useConnectCoinbaseSmartWallet: () => UseConnectCoinbaseSmartWalletInterface;
|
|
3399
3404
|
|
|
3405
|
+
/**
|
|
3406
|
+
* Hook to headlessly connect a Base Account to a user.
|
|
3407
|
+
*/
|
|
3408
|
+
interface UseConnectBaseAccountInterface {
|
|
3409
|
+
/**
|
|
3410
|
+
* Method to headlessly connect a Base Account to a user.
|
|
3411
|
+
* @experimental
|
|
3412
|
+
*/
|
|
3413
|
+
connectBaseAccount: () => void;
|
|
3414
|
+
}
|
|
3415
|
+
declare const useConnectBaseAccount: () => UseConnectBaseAccountInterface;
|
|
3416
|
+
|
|
3400
3417
|
type UseAuthMfa = {
|
|
3401
3418
|
/**
|
|
3402
3419
|
* Trigger the verification flow for auth MFA.
|
|
@@ -4211,4 +4228,4 @@ declare const toViemAccount: ({ wallet }: {
|
|
|
4211
4228
|
type: "local";
|
|
4212
4229
|
}>;
|
|
4213
4230
|
|
|
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 };
|
|
4231
|
+
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 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, 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 };
|
|
@@ -4,7 +4,8 @@ import { SmartAccountClient } from 'permissionless';
|
|
|
4
4
|
import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
|
|
5
5
|
import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
|
|
6
6
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
7
|
-
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-
|
|
7
|
+
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-C5FjymFC.js';
|
|
8
|
+
import '@base-org/account';
|
|
8
9
|
import '@coinbase/wallet-sdk';
|
|
9
10
|
import '@reown/appkit';
|
|
10
11
|
import '@solana/wallet-adapter-base';
|
|
@@ -4,7 +4,8 @@ import { SmartAccountClient } from 'permissionless';
|
|
|
4
4
|
import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
|
|
5
5
|
import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
|
|
6
6
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
7
|
-
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-
|
|
7
|
+
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-C5FjymFC.js';
|
|
8
|
+
import '@base-org/account';
|
|
8
9
|
import '@coinbase/wallet-sdk';
|
|
9
10
|
import '@reown/appkit';
|
|
10
11
|
import '@solana/wallet-adapter-base';
|
package/dist/dts/solana.d.mts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-
|
|
2
|
-
export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-C5FjymFC.js';
|
|
2
|
+
export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-C5FjymFC.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-C_wdD6lb.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-C_wdD6lb.js';
|
|
5
5
|
import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
|
|
6
6
|
import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
|
|
7
7
|
import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
|
|
8
8
|
import { Transaction, VersionedTransaction, Cluster, SendOptions, TransactionSignature, Connection } from '@solana/web3.js';
|
|
9
9
|
import EventEmitter from 'eventemitter3';
|
|
10
10
|
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
11
|
+
import '@base-org/account';
|
|
11
12
|
import '@coinbase/wallet-sdk';
|
|
12
13
|
import '@reown/appkit';
|
|
13
14
|
import 'react';
|
package/dist/dts/solana.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-
|
|
2
|
-
export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-C5FjymFC.js';
|
|
2
|
+
export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-C5FjymFC.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-C_wdD6lb.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-C_wdD6lb.js';
|
|
5
5
|
import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
|
|
6
6
|
import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
|
|
7
7
|
import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
|
|
8
8
|
import { Transaction, VersionedTransaction, Cluster, SendOptions, TransactionSignature, Connection } from '@solana/web3.js';
|
|
9
9
|
import EventEmitter from 'eventemitter3';
|
|
10
10
|
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
11
|
+
import '@base-org/account';
|
|
11
12
|
import '@coinbase/wallet-sdk';
|
|
12
13
|
import '@reown/appkit';
|
|
13
14
|
import 'react';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createBaseAccountSDK } from '@base-org/account';
|
|
1
2
|
import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk';
|
|
2
3
|
import { AppKit } from '@reown/appkit';
|
|
3
4
|
import { StandardWalletAdapter, Adapter, WalletError, MessageSignerWalletAdapterProps, WalletAdapterProps, SignerWalletAdapterProps } from '@solana/wallet-adapter-base';
|
|
@@ -555,7 +556,7 @@ declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
|
|
|
555
556
|
type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
|
|
556
557
|
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain", "binance"];
|
|
557
558
|
type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
|
|
558
|
-
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet"];
|
|
559
|
+
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet", "base_account"];
|
|
559
560
|
type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
560
561
|
type WalletConnectWalletClientType = (typeof WALLET_CONNECT_WALLET_CLIENT_TYPES)[number];
|
|
561
562
|
declare const UNKNOWN_WALLET_CLIENT_TYPES: readonly ["unknown"];
|
|
@@ -1232,7 +1233,7 @@ type PriceDisplayOptions = {
|
|
|
1232
1233
|
primary: 'native-token';
|
|
1233
1234
|
secondary: null;
|
|
1234
1235
|
};
|
|
1235
|
-
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1236
|
+
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'base_account' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1236
1237
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1237
1238
|
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'binance';
|
|
1238
1239
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
@@ -1264,6 +1265,17 @@ type ExternalWalletsConfig = {
|
|
|
1264
1265
|
*/
|
|
1265
1266
|
config?: Parameters<typeof createCoinbaseWalletSDK>[0];
|
|
1266
1267
|
};
|
|
1268
|
+
/**
|
|
1269
|
+
* Options to configure connections to the Base Account (passkey-based smart wallet).
|
|
1270
|
+
*/
|
|
1271
|
+
baseAccount?: {
|
|
1272
|
+
/**
|
|
1273
|
+
* Allows you to override the default configuration options for initializing the Base Account
|
|
1274
|
+
* connector. This includes overriding the connection options (via config.preference.options)
|
|
1275
|
+
* or adding additional configuration (i.e. enabling subAccounts)
|
|
1276
|
+
*/
|
|
1277
|
+
config?: Parameters<typeof createBaseAccountSDK>[0];
|
|
1278
|
+
};
|
|
1267
1279
|
/**
|
|
1268
1280
|
* Mapping between `walletClientType`s to the length of time after which signature and RPC requests will timeout for that
|
|
1269
1281
|
* `walletClientType`.
|
|
@@ -1825,6 +1837,9 @@ type AppConfig = {
|
|
|
1825
1837
|
coinbaseWallet: {
|
|
1826
1838
|
config: NonNullable<NonNullable<NonNullable<PrivyClientConfig['externalWallets']>['coinbaseWallet']>['config']>;
|
|
1827
1839
|
};
|
|
1840
|
+
baseAccount: {
|
|
1841
|
+
config: NonNullable<NonNullable<NonNullable<PrivyClientConfig['externalWallets']>['baseAccount']>['config']>;
|
|
1842
|
+
};
|
|
1828
1843
|
walletConnect: {
|
|
1829
1844
|
enabled: boolean;
|
|
1830
1845
|
appKit?: AppKit;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createBaseAccountSDK } from '@base-org/account';
|
|
1
2
|
import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk';
|
|
2
3
|
import { AppKit } from '@reown/appkit';
|
|
3
4
|
import { StandardWalletAdapter, Adapter, WalletError, MessageSignerWalletAdapterProps, WalletAdapterProps, SignerWalletAdapterProps } from '@solana/wallet-adapter-base';
|
|
@@ -555,7 +556,7 @@ declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
|
|
|
555
556
|
type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
|
|
556
557
|
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain", "binance"];
|
|
557
558
|
type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
|
|
558
|
-
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet"];
|
|
559
|
+
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet", "base_account"];
|
|
559
560
|
type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
560
561
|
type WalletConnectWalletClientType = (typeof WALLET_CONNECT_WALLET_CLIENT_TYPES)[number];
|
|
561
562
|
declare const UNKNOWN_WALLET_CLIENT_TYPES: readonly ["unknown"];
|
|
@@ -1232,7 +1233,7 @@ type PriceDisplayOptions = {
|
|
|
1232
1233
|
primary: 'native-token';
|
|
1233
1234
|
secondary: null;
|
|
1234
1235
|
};
|
|
1235
|
-
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1236
|
+
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'base_account' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1236
1237
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1237
1238
|
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'binance';
|
|
1238
1239
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
@@ -1264,6 +1265,17 @@ type ExternalWalletsConfig = {
|
|
|
1264
1265
|
*/
|
|
1265
1266
|
config?: Parameters<typeof createCoinbaseWalletSDK>[0];
|
|
1266
1267
|
};
|
|
1268
|
+
/**
|
|
1269
|
+
* Options to configure connections to the Base Account (passkey-based smart wallet).
|
|
1270
|
+
*/
|
|
1271
|
+
baseAccount?: {
|
|
1272
|
+
/**
|
|
1273
|
+
* Allows you to override the default configuration options for initializing the Base Account
|
|
1274
|
+
* connector. This includes overriding the connection options (via config.preference.options)
|
|
1275
|
+
* or adding additional configuration (i.e. enabling subAccounts)
|
|
1276
|
+
*/
|
|
1277
|
+
config?: Parameters<typeof createBaseAccountSDK>[0];
|
|
1278
|
+
};
|
|
1267
1279
|
/**
|
|
1268
1280
|
* Mapping between `walletClientType`s to the length of time after which signature and RPC requests will timeout for that
|
|
1269
1281
|
* `walletClientType`.
|
|
@@ -1825,6 +1837,9 @@ type AppConfig = {
|
|
|
1825
1837
|
coinbaseWallet: {
|
|
1826
1838
|
config: NonNullable<NonNullable<NonNullable<PrivyClientConfig['externalWallets']>['coinbaseWallet']>['config']>;
|
|
1827
1839
|
};
|
|
1840
|
+
baseAccount: {
|
|
1841
|
+
config: NonNullable<NonNullable<NonNullable<PrivyClientConfig['externalWallets']>['baseAccount']>['config']>;
|
|
1842
|
+
};
|
|
1828
1843
|
walletConnect: {
|
|
1829
1844
|
enabled: boolean;
|
|
1830
1845
|
appKit?: AppKit;
|
package/dist/dts/ui.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions } from './types-C5FjymFC.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Chain, Cluster } from '@privy-io/js-sdk-core';
|
|
5
|
+
import '@base-org/account';
|
|
5
6
|
import '@coinbase/wallet-sdk';
|
|
6
7
|
import '@reown/appkit';
|
|
7
8
|
import '@solana/wallet-adapter-base';
|
package/dist/dts/ui.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions } from './types-C5FjymFC.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Chain, Cluster } from '@privy-io/js-sdk-core';
|
|
5
|
+
import '@base-org/account';
|
|
5
6
|
import '@coinbase/wallet-sdk';
|
|
6
7
|
import '@reown/appkit';
|
|
7
8
|
import '@solana/wallet-adapter-base';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from '@privy-io/js-sdk-core';
|
|
2
|
-
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-
|
|
2
|
+
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-C5FjymFC.js';
|
|
3
3
|
import { MouseEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from '@privy-io/js-sdk-core';
|
|
2
|
-
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-
|
|
2
|
+
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-C5FjymFC.js';
|
|
3
3
|
import { MouseEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as o}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as t,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as c}from"viem/chains";import{u as s,g as l,c as d}from"./use-sign-with-user-signer-
|
|
1
|
+
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as o}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as t,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as c}from"viem/chains";import{u as s,g as l,c as d}from"./use-sign-with-user-signer-DCN1LHu1.mjs";import{o as p,w as m,e as u,a as h,a$ as I,b0 as g,b1 as y,x as f}from"./privy-provider-BrsjzEmo.mjs";import{u as v}from"./internal-context-DelFGnzS.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-Cp5Kl2CX.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-CYLUXo_U.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"zustand";import"@headlessui/react";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@walletconnect/ethereum-provider";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"qrcode";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=s(),{hideWalletUIs:P,openPrivyModal:S,chains:b,appId:A,rpcConfig:W,client:M}=v(),k=p(),{wallets:F}=m(),{setModalData:x}=u(),q=l(T),R=!!q&&d(q),D=async(o=c.id)=>{let s=w(F);if(!s)throw Error("No connected wallet found");let l="string"==typeof o?r(o):o;if(![c.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let d=b.find((e=>e.id===l));if(!d)throw Error("Chain not configured");await s.switchChain(d.id);let p=await s.getEthereumProvider(),m=t({account:s.address,transport:n(p)}),u=a({address:s.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:d,transport:i(f(d,W,A)),publicTransport:i(f(d,W,A)),signer:u})};return{signMessage:async({message:e},o)=>{let r=await D(o);return new Promise((async(o,t)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);P.current=!0,x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:I,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTypedData:async(e,o)=>{let r=await D(o);return new Promise((async(o,t)=>{P.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:I,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},sendTransaction:async e=>{let r=await D(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:c,entropyIdVerifier:s}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:c,entropyIdVerifier:s,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:s,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data,eip_712_meta:{paymaster_params:{paymaster:i.paymaster,paymaster_input:i.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTransaction:async e=>{let r=await D(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:c,entropyIdVerifier:s}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:c,entropyIdVerifier:s,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:s,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return r.signTransaction(i)},onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))}}}export{T as useAbstractSmartWallets};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as r}from"react";import{create as e,rawSign as t}from"@privy-io/js-sdk-core";import{u as a}from"./internal-context-
|
|
1
|
+
import{useMemo as r}from"react";import{create as e,rawSign as t}from"@privy-io/js-sdk-core";import{u as a}from"./internal-context-DelFGnzS.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-DCN1LHu1.mjs";import"viem";const u=()=>{let{refreshSessionAndUser:t,privy:i}=a();return r((()=>({async createWallet(r){let a=await e(i,{request:{chain_type:r.chainType}}),s=await t();if(!s)throw Error("User must be authenticated before creating a Privy wallet");return{user:s,wallet:a}}})),[t,i])},d=()=>{let{user:e}=i(),{privy:u}=a(),{signWithUserSigner:d}=s();return r((()=>({async signRawHash({address:r,chainType:a,hash:i}){if(!e)throw Error("User must be authenticated before signing");let s=n(e,a).filter((r=>o(r))).find((e=>e.address===r));if(!s)throw Error("Wallet not found");let h=await t(u,d,{wallet_id:s.id,params:{hash:i}});if(h.data&&"signature"in h.data&&"hex"===h.data.encoding)return{signature:h.data.signature};throw Error("Failed to sign")}})),[u])};export{u as useCreateWallet,d as useSignRawHash};
|
package/dist/esm/farcaster.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as t}from"react";import{F as e}from"./frame-FpttHlk8.mjs";import{P as r}from"./paths-CYLUXo_U.mjs";import{u as i}from"./internal-context-
|
|
1
|
+
import{useCallback as t}from"react";import{F as e}from"./frame-FpttHlk8.mjs";import{P as r}from"./paths-CYLUXo_U.mjs";import{u as i}from"./internal-context-DelFGnzS.mjs";import"ofetch";const a=()=>{let{client:a,setAuthenticated:s,setUser:n}=i();return{initLoginToFrame:t((async()=>{let t=new e;if(!a)throw new r("Must initialize Privy client first.");return a.startAuthFlow(t),await t.init()}),[a]),loginToFrame:t((async({message:t,signature:i})=>{if(!a)throw new r("Must initialize Privy client first.");if(!(a.authFlow instanceof e))throw new r("Must initialize Farcaster frame flow first.");let o=(t=>{let e=t.match(/farcaster:\/\/fid\/(\d+)/);return e&&e[1]?parseInt(e[1],10):null})(t);if(!o)throw new r("Invalid message format; could not parse Farcaster ID.");a.authFlow.setAuthData({message:t,signature:i,fid:o});let{user:l}=await a.authenticate();return l&&(n(l),s(!0)),l}),[a,n,s])}};export{a as useLoginToFrame};
|