@privy-io/react-auth 3.6.0 → 3.7.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.
Files changed (51) hide show
  1. package/dist/cjs/EmbeddedWalletConnectingScreen-JRafXI8d.js +27 -0
  2. package/dist/cjs/{SignRequestScreen-DBTM8mH6.js → SignRequestScreen-Dy02euV9.js} +1 -1
  3. package/dist/cjs/abstract-smart-wallets.js +1 -1
  4. package/dist/cjs/{events-context-B1SQ9SZZ.js → events-context-7-Gs8c_9.js} +1 -1
  5. package/dist/cjs/extended-chains.js +1 -1
  6. package/dist/cjs/index.js +6 -7
  7. package/dist/cjs/internal.js +1 -1
  8. package/dist/cjs/{smart-wallets-DS5H3O_R.js → smart-wallets-DaqaXBrW.js} +1 -1
  9. package/dist/cjs/smart-wallets.js +1 -1
  10. package/dist/cjs/solana.js +1 -1
  11. package/dist/cjs/ui.js +1 -1
  12. package/dist/cjs/use-export-wallet-Cz8MVlvJ.js +2 -0
  13. package/dist/cjs/{useActiveWallet-DSa22Ge3.js → useActiveWallet-C5D3a-je.js} +1 -1
  14. package/dist/cjs/{usePrivy-BRFNEdKI.js → usePrivy-BdYU4BZI.js} +1 -1
  15. package/dist/dts/{events-context-B1q54lAU.d.mts → events-context-CCElA92Y.d.mts} +1 -1
  16. package/dist/dts/{events-context-B1q54lAU.d.ts → events-context-CCElA92Y.d.ts} +1 -1
  17. package/dist/dts/extended-chains.d.mts +1 -1
  18. package/dist/dts/extended-chains.d.ts +1 -1
  19. package/dist/dts/farcaster.d.mts +1 -1
  20. package/dist/dts/farcaster.d.ts +1 -1
  21. package/dist/dts/index.d.mts +93 -6
  22. package/dist/dts/index.d.ts +93 -6
  23. package/dist/dts/internal.d.mts +1 -1
  24. package/dist/dts/internal.d.ts +1 -1
  25. package/dist/dts/smart-wallets.d.mts +1 -1
  26. package/dist/dts/smart-wallets.d.ts +1 -1
  27. package/dist/dts/solana.d.mts +3 -3
  28. package/dist/dts/solana.d.ts +3 -3
  29. package/dist/dts/{types-BSeKsLfK.d.mts → types-B6UNnZ2P.d.mts} +8 -1
  30. package/dist/dts/{types-BSeKsLfK.d.ts → types-B6UNnZ2P.d.ts} +8 -1
  31. package/dist/dts/ui.d.mts +1 -1
  32. package/dist/dts/ui.d.ts +1 -1
  33. package/dist/esm/EmbeddedWalletConnectingScreen-D50stmJi.mjs +25 -0
  34. package/dist/esm/{SignRequestScreen-B2NV0Hvv.mjs → SignRequestScreen-D9o7VhNz.mjs} +1 -1
  35. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  36. package/dist/esm/{events-context-DpXp5E_5.mjs → events-context-ClaboIDc.mjs} +1 -1
  37. package/dist/esm/extended-chains.mjs +1 -1
  38. package/dist/esm/index.mjs +5 -6
  39. package/dist/esm/internal.mjs +1 -1
  40. package/dist/esm/{smart-wallets-X-vN2hVx.mjs → smart-wallets-BXT3GZwg.mjs} +1 -1
  41. package/dist/esm/smart-wallets.mjs +1 -1
  42. package/dist/esm/solana.mjs +1 -1
  43. package/dist/esm/ui.mjs +2 -2
  44. package/dist/esm/use-export-wallet-DTiEdSYz.mjs +1 -0
  45. package/dist/esm/{useActiveWallet-6VCN4YGN.mjs → useActiveWallet-B8DSbnuu.mjs} +1 -1
  46. package/dist/esm/{usePrivy-DLA1ZqHR.mjs → usePrivy-BCcRF869.mjs} +1 -1
  47. package/package.json +8 -6
  48. package/dist/cjs/EmbeddedWalletConnectingScreen-fhtSGmI2.js +0 -27
  49. package/dist/cjs/use-export-wallet-DPcrptkc.js +0 -2
  50. package/dist/esm/EmbeddedWalletConnectingScreen-DNdaS6u7.mjs +0 -25
  51. package/dist/esm/use-export-wallet-CPIcGGw7.mjs +0 -1
@@ -1 +1 @@
1
- "use strict";var e=require("./internal-context-CeWKmK5u.js"),r=require("@privy-io/js-sdk-core"),t=require("react"),n=require("./EmbeddedWalletConnectingScreen-fhtSGmI2.js"),a=require("./events-context-B1SQ9SZZ.js");function i(e){let r=e.replace("eip155:","");if(r)return parseInt(r);throw Error("Chain ID not compatible with CAIP-2 format.")}const o=e=>e.filter((e=>"wallets"===e.method||("exchange"===e.method?"coinbase"===e.provider:"card"===e.method||"payment-request"===e.method?"coinbase"===e.provider||"moonpay"===e.provider:(e.method,!1)))),l={[r.mainnet.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[r.sepolia.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[r.optimism.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[r.optimismSepolia.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[r.polygon.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[r.polygonAmoy.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[r.base.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[r.baseSepolia.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[r.avalanche.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[r.avalancheFuji.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[r.arbitrum.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[r.arbitrumSepolia.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"};const d=e=>e.reduce(((e,r)=>!e||e.walletIndex<r.walletIndex?r:e),null),s=async({appConfig:r,getAccessToken:t,initializeWalletProxy:a,user:i,privy:o,emitPrivyEvent:l,recoverEmbeddedWallet:s,setModalData:u,openModal:p,setUser:E,options:f,timeoutDuration:h,refreshSessionAndUser:y,chainType:m})=>{let[v,g]=await Promise.all([a(h),t()]);if(!g||!i)throw l("createWallet","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!v&&r.customAuth?.enabled)throw l("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(f&&"walletIndex"in f&&"number"==typeof f.walletIndex){if("user-controlled-server-wallets-only"===r.embeddedWallets.mode)throw l("createWallet","onError",e.PrivyErrorCode.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return c({accessToken:g,appConfig:r,privy:o,emitPrivyEvent:l,openModal:p,proxy:v,refreshSessionAndUser:y,recoverEmbeddedWallet:s,setModalData:u,user:i,walletIndex:f.walletIndex,chainType:m,setUser:E})}let C=f&&"createAdditional"in f&&f.createAdditional,w=n.getPrivyWalletsWithFilter(i,{chainType:m});if(w[0]&&!C)throw l("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return c({accessToken:g,appConfig:r,privy:o,emitPrivyEvent:l,openModal:p,proxy:v,recoverEmbeddedWallet:s,setModalData:u,user:i,walletIndex:(d(w)?.walletIndex??-1)+1,chainType:m,refreshSessionAndUser:y,setUser:E})};let c=async({accessToken:r,appConfig:t,privy:a,emitPrivyEvent:i,proxy:o,refreshSessionAndUser:l,recoverEmbeddedWallet:d,user:s,walletIndex:c,setModalData:p,openModal:E,chainType:f,setUser:h})=>{if(c<0)throw i("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${c}) is invalid.`);let y=n.getPrivyPrimaryWallet(s);if(c>0&&!y)throw i("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(t.embeddedWallets.requireUserOwnedRecoveryOnCreate&&"user-controlled-server-wallets-only"===t.embeddedWallets.mode)throw i("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!y&&t.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await u({emitPrivyEvent:i,setModalData:p,openModal:E,chainType:f});let m=n.getPrivyWalletsWithFilter(s,{chainType:f,walletIndex:c})[0];if(m)return{user:s,account:m};if(0===c&&!o)return u({emitPrivyEvent:i,setModalData:p,openModal:E,chainType:f});if(!o)throw i("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return n.createWalletAtIndex({appConfig:t,walletIndex:c,chainType:f,user:s,accessToken:r,proxy:o,refreshSessionAndUser:l,privy:a,recoverEmbeddedWallet:d,setUser:h})},u=async({emitPrivyEvent:r,setModalData:t,openModal:a,chainType:i})=>new Promise(((o,l)=>{t({createWallet:{onSuccess:({user:e,account:t})=>{r("createWallet","onSuccess",{wallet:t}),o({user:e,account:t})},onFailure:t=>{r("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),l(t)},callAuthOnSuccessOnClose:!1,shouldCreateEth:"ethereum"===i,shouldCreateSol:"solana"===i}}),a(n.EmbeddedWalletOnAccountCreateScreen)}));const p=()=>{let r=a.useAppConfig(),t=a.useEmitPrivyEvent(),{setModalData:i}=n.usePrivyModal(),{initializeWalletProxy:o,recoverEmbeddedWallet:l,setUser:d,openModal:c,refreshSessionAndUser:u,privy:p,client:E}=e.usePrivyInternal();return{create:async({chainType:n,options:f,latestUser:h})=>{let y=h;if(y||(y=await u()),!y)throw t("createWallet","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await s({appConfig:r,privy:p,getAccessToken:()=>E.getAccessToken(),refreshSessionAndUser:u,initializeWalletProxy:o,user:y,emitPrivyEvent:t,recoverEmbeddedWallet:l,setModalData:i,openModal:c,setUser:d,options:f,timeoutDuration:a.WALLET_PROXY_TIMEOUT,chainType:n})}}};function E(e){let{create:r}=p();return a.usePrivyEventSubscription("createWallet",e),{createWallet:async e=>{e&&"target"in e&&e&&(e=void 0);let{account:t}=await r({chainType:"ethereum",options:e});return t}}}const f=async({emitPrivyEvent:r,getAccessToken:t,initializeWalletProxy:a,refreshSessionAndUser:i,user:o,appConfig:l},{privateKey:d,chainType:s,additionalSigners:c})=>{if(!o)throw r("linkAccount","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new e.PrivyClientError("User must be authenticated before linking an account.");let u="user-controlled-server-wallets-only"===l.embeddedWallets.mode?"tee":"on-device";if(c&&"on-device"===u)throw new e.PrivyClientError("Specifying additionalSigners is only supported for TEE execution and this app uses On-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[p,E]=await Promise.all([t(),a(15e3)]);if(!E||!p)throw r("linkAccount","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new e.PrivyClientError("User must be authenticated before linking an account.");let{address:f}=await E.importWallet({privateKey:d,accessToken:p,chainType:s,mode:u,additionalSigners:c}),h=await i(),y="solana"===s?n.getImportedPrivySolanaWallets(h):n.getImportedPrivyEthereumWallets(h),m=y?.find((e=>e.address===f));if(!m)throw r("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return r("createWallet","onSuccess",{wallet:m}),m},h=()=>{let{user:r}=n.usePrivyContext(),{client:i,refreshSessionAndUser:o,initializeWalletProxy:l}=e.usePrivyInternal(),d=a.useEmitPrivyEvent(),s=a.useAppConfig();return{importWallet:t.useCallback((({privateKey:e,additionalSigners:t})=>f({getAccessToken:()=>i.getAccessToken(),user:r,initializeWalletProxy:l,refreshSessionAndUser:o,emitPrivyEvent:d,appConfig:s},{privateKey:e,chainType:"ethereum",additionalSigners:t})),[r,i,o,l,d,s])}};exports.extractChainIdFromCAIP2=i,exports.filterSupportedOptions=o,exports.importWallet=f,exports.isFirstClassChainWallet=function(e){return["ethereum","solana"].includes(e.chainType)},exports.prepareFundingModalData=({address:r,appConfig:t,fundWalletConfig:n,methodScreen:a,chainIdOverride:d,comingFromSendTransactionScreen:s=!1})=>{let c,u;if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let p=o(t.fundingConfig.options);if(p.length<1)throw Error("Wallet funding is not enabled");c=d||(n?.chain?n.chain.id:i(t.fundingConfig.defaultRecommendedCurrency.chain));let E=t.chains.find((e=>e.id===c));if(!E)throw new e.PrivyClientError(`Funding chain ${c} is not in PrivyProvider chains list`);let f=n?.amount??t.fundingConfig.defaultRecommendedAmount,h=!1;function y(){if(!c)return;let e=l[c];p.find((e=>"wallets"===e.method))&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),u=e,h=!0}n&&"asset"in n?"USDC"===n.asset?y():"string"!=typeof n.asset&&"erc20"in n.asset&&(h=((e,r)=>e===l[r.id])(u=n.asset.erc20,E)):"USDC"===t.fundingConfig.defaultRecommendedCurrency.asset&&y();let m=n?.defaultFundingMethod;return{chainType:"ethereum",address:r,amount:f,chain:E,erc20Address:u,erc20ContractInfo:h?{symbol:"USDC",decimals:6}:void 0,isUSDC:h,methodScreen:a,supportedOptions:p,comingFromSendTransactionScreen:s,defaultFundingMethod:m,usingDefaultFundingMethod:!!m,preferredCardProvider:n?.card?.preferredProvider,crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:n&&"uiConfig"in n?n.uiConfig:void 0,externalSolanaFundingScreen:null}},exports.prepareSolanaFundingModalData=function({address:e,fundWalletConfig:r,appConfig:t,comingFromSendTransactionScreen:n,externalSolanaFundingScreen:a,methodScreen:i}){if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let l=o(t.fundingConfig.options);if(l.length<1)throw Error("Wallet funding is not enabled");if("USDC"===r?.asset&&"solana:testnet"===r?.chain)throw Error("USDC funding is not supported on the Solana testnet");let d=r?.amount??t.fundingConfig.defaultRecommendedAmount,s=r?.defaultFundingMethod;return{chainType:"solana",address:e,supportedOptions:l,amount:d,isUSDC:"USDC"===r?.asset,methodScreen:i,comingFromSendTransactionScreen:n,chain:r?.chain||"solana:mainnet",crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:s,preferredCardProvider:r?.card?.preferredProvider,usingDefaultFundingMethod:!!s,uiConfig:r?.uiConfig,externalSolanaFundingScreen:a}},exports.useCreateWallet=E,exports.useCreateWalletInternal=p,exports.useImportWallet=h,exports.usePrivy=()=>{let{importWallet:e}=h(),{createWallet:r}=E();return{...t.useContext(n.PrivyContext),importWallet:e,createWallet:r}};
1
+ "use strict";var e=require("./internal-context-CeWKmK5u.js"),r=require("@privy-io/js-sdk-core"),t=require("react"),n=require("./EmbeddedWalletConnectingScreen-JRafXI8d.js"),a=require("./events-context-7-Gs8c_9.js");function i(e){let r=e.replace("eip155:","");if(r)return parseInt(r);throw Error("Chain ID not compatible with CAIP-2 format.")}const o=e=>e.filter((e=>"wallets"===e.method||("exchange"===e.method?"coinbase"===e.provider:"card"===e.method||"payment-request"===e.method?"coinbase"===e.provider||"moonpay"===e.provider:(e.method,!1)))),l={[r.mainnet.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[r.sepolia.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[r.optimism.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[r.optimismSepolia.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[r.polygon.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[r.polygonAmoy.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[r.base.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[r.baseSepolia.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[r.avalanche.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[r.avalancheFuji.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[r.arbitrum.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[r.arbitrumSepolia.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"};const d=e=>e.reduce(((e,r)=>!e||e.walletIndex<r.walletIndex?r:e),null),s=async({appConfig:r,getAccessToken:t,initializeWalletProxy:a,user:i,privy:o,emitPrivyEvent:l,recoverEmbeddedWallet:s,setModalData:u,openModal:p,setUser:E,options:f,timeoutDuration:h,refreshSessionAndUser:y,chainType:m})=>{let[v,g]=await Promise.all([a(h),t()]);if(!g||!i)throw l("createWallet","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!v&&r.customAuth?.enabled)throw l("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(f&&"walletIndex"in f&&"number"==typeof f.walletIndex){if("user-controlled-server-wallets-only"===r.embeddedWallets.mode)throw l("createWallet","onError",e.PrivyErrorCode.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return c({accessToken:g,appConfig:r,privy:o,emitPrivyEvent:l,openModal:p,proxy:v,refreshSessionAndUser:y,recoverEmbeddedWallet:s,setModalData:u,user:i,walletIndex:f.walletIndex,chainType:m,setUser:E})}let C=f&&"createAdditional"in f&&f.createAdditional,w=n.getPrivyWalletsWithFilter(i,{chainType:m});if(w[0]&&!C)throw l("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return c({accessToken:g,appConfig:r,privy:o,emitPrivyEvent:l,openModal:p,proxy:v,recoverEmbeddedWallet:s,setModalData:u,user:i,walletIndex:(d(w)?.walletIndex??-1)+1,chainType:m,refreshSessionAndUser:y,setUser:E})};let c=async({accessToken:r,appConfig:t,privy:a,emitPrivyEvent:i,proxy:o,refreshSessionAndUser:l,recoverEmbeddedWallet:d,user:s,walletIndex:c,setModalData:p,openModal:E,chainType:f,setUser:h})=>{if(c<0)throw i("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${c}) is invalid.`);let y=n.getPrivyPrimaryWallet(s);if(c>0&&!y)throw i("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(t.embeddedWallets.requireUserOwnedRecoveryOnCreate&&"user-controlled-server-wallets-only"===t.embeddedWallets.mode)throw i("createWallet","onError",e.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!y&&t.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await u({emitPrivyEvent:i,setModalData:p,openModal:E,chainType:f});let m=n.getPrivyWalletsWithFilter(s,{chainType:f,walletIndex:c})[0];if(m)return{user:s,account:m};if(0===c&&!o)return u({emitPrivyEvent:i,setModalData:p,openModal:E,chainType:f});if(!o)throw i("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return n.createWalletAtIndex({appConfig:t,walletIndex:c,chainType:f,user:s,accessToken:r,proxy:o,refreshSessionAndUser:l,privy:a,recoverEmbeddedWallet:d,setUser:h})},u=async({emitPrivyEvent:r,setModalData:t,openModal:a,chainType:i})=>new Promise(((o,l)=>{t({createWallet:{onSuccess:({user:e,account:t})=>{r("createWallet","onSuccess",{wallet:t}),o({user:e,account:t})},onFailure:t=>{r("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),l(t)},callAuthOnSuccessOnClose:!1,shouldCreateEth:"ethereum"===i,shouldCreateSol:"solana"===i}}),a(n.EmbeddedWalletOnAccountCreateScreen)}));const p=()=>{let r=a.useAppConfig(),t=a.useEmitPrivyEvent(),{setModalData:i}=n.usePrivyModal(),{initializeWalletProxy:o,recoverEmbeddedWallet:l,setUser:d,openModal:c,refreshSessionAndUser:u,privy:p,client:E}=e.usePrivyInternal();return{create:async({chainType:n,options:f,latestUser:h})=>{let y=h;if(y||(y=await u()),!y)throw t("createWallet","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await s({appConfig:r,privy:p,getAccessToken:()=>E.getAccessToken(),refreshSessionAndUser:u,initializeWalletProxy:o,user:y,emitPrivyEvent:t,recoverEmbeddedWallet:l,setModalData:i,openModal:c,setUser:d,options:f,timeoutDuration:a.WALLET_PROXY_TIMEOUT,chainType:n})}}};function E(e){let{create:r}=p();return a.usePrivyEventSubscription("createWallet",e),{createWallet:async e=>{e&&"target"in e&&e&&(e=void 0);let{account:t}=await r({chainType:"ethereum",options:e});return t}}}const f=async({emitPrivyEvent:r,getAccessToken:t,initializeWalletProxy:a,refreshSessionAndUser:i,user:o,appConfig:l},{privateKey:d,chainType:s,additionalSigners:c})=>{if(!o)throw r("linkAccount","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new e.PrivyClientError("User must be authenticated before linking an account.");let u="user-controlled-server-wallets-only"===l.embeddedWallets.mode?"tee":"on-device";if(c&&"on-device"===u)throw new e.PrivyClientError("Specifying additionalSigners is only supported for TEE execution and this app uses On-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[p,E]=await Promise.all([t(),a(15e3)]);if(!E||!p)throw r("linkAccount","onError",e.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new e.PrivyClientError("User must be authenticated before linking an account.");let{address:f}=await E.importWallet({privateKey:d,accessToken:p,chainType:s,mode:u,additionalSigners:c}),h=await i(),y="solana"===s?n.getImportedPrivySolanaWallets(h):n.getImportedPrivyEthereumWallets(h),m=y?.find((e=>e.address===f));if(!m)throw r("createWallet","onError",e.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return r("createWallet","onSuccess",{wallet:m}),m},h=()=>{let{user:r}=n.usePrivyContext(),{client:i,refreshSessionAndUser:o,initializeWalletProxy:l}=e.usePrivyInternal(),d=a.useEmitPrivyEvent(),s=a.useAppConfig();return{importWallet:t.useCallback((({privateKey:e,additionalSigners:t})=>f({getAccessToken:()=>i.getAccessToken(),user:r,initializeWalletProxy:l,refreshSessionAndUser:o,emitPrivyEvent:d,appConfig:s},{privateKey:e,chainType:"ethereum",additionalSigners:t})),[r,i,o,l,d,s])}};exports.extractChainIdFromCAIP2=i,exports.filterSupportedOptions=o,exports.importWallet=f,exports.isFirstClassChainWallet=function(e){return["ethereum","solana"].includes(e.chainType)},exports.prepareFundingModalData=({address:r,appConfig:t,fundWalletConfig:n,methodScreen:a,chainIdOverride:d,comingFromSendTransactionScreen:s=!1})=>{let c,u;if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let p=o(t.fundingConfig.options);if(p.length<1)throw Error("Wallet funding is not enabled");c=d||(n?.chain?n.chain.id:i(t.fundingConfig.defaultRecommendedCurrency.chain));let E=t.chains.find((e=>e.id===c));if(!E)throw new e.PrivyClientError(`Funding chain ${c} is not in PrivyProvider chains list`);let f=n?.amount??t.fundingConfig.defaultRecommendedAmount,h=!1;function y(){if(!c)return;let e=l[c];p.find((e=>"wallets"===e.method))&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),u=e,h=!0}n&&"asset"in n?"USDC"===n.asset?y():"string"!=typeof n.asset&&"erc20"in n.asset&&(h=((e,r)=>e===l[r.id])(u=n.asset.erc20,E)):"USDC"===t.fundingConfig.defaultRecommendedCurrency.asset&&y();let m=n?.defaultFundingMethod;return{chainType:"ethereum",address:r,amount:f,chain:E,erc20Address:u,erc20ContractInfo:h?{symbol:"USDC",decimals:6}:void 0,isUSDC:h,methodScreen:a,supportedOptions:p,comingFromSendTransactionScreen:s,defaultFundingMethod:m,usingDefaultFundingMethod:!!m,preferredCardProvider:n?.card?.preferredProvider,crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:n&&"uiConfig"in n?n.uiConfig:void 0,externalSolanaFundingScreen:null}},exports.prepareSolanaFundingModalData=function({address:e,fundWalletConfig:r,appConfig:t,comingFromSendTransactionScreen:n,externalSolanaFundingScreen:a,methodScreen:i}){if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let l=o(t.fundingConfig.options);if(l.length<1)throw Error("Wallet funding is not enabled");if("USDC"===r?.asset&&"solana:testnet"===r?.chain)throw Error("USDC funding is not supported on the Solana testnet");let d=r?.amount??t.fundingConfig.defaultRecommendedAmount,s=r?.defaultFundingMethod;return{chainType:"solana",address:e,supportedOptions:l,amount:d,isUSDC:"USDC"===r?.asset,methodScreen:i,comingFromSendTransactionScreen:n,chain:r?.chain||"solana:mainnet",crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:s,preferredCardProvider:r?.card?.preferredProvider,usingDefaultFundingMethod:!!s,uiConfig:r?.uiConfig,externalSolanaFundingScreen:a}},exports.useCreateWallet=E,exports.useCreateWalletInternal=p,exports.useImportWallet=h,exports.usePrivy=()=>{let{importWallet:e}=h(),{createWallet:r}=E();return{...t.useContext(n.PrivyContext),importWallet:e,createWallet:r}};
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { U as User, L as LoginMethod, a as LinkedAccountWithMetadata, P as PrivyErrorCode, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, O as OAuthTokens, F as FundingMethod, S as SolanaChain } from './types-BSeKsLfK.js';
2
+ import { U as User, L as LoginMethod, a as LinkedAccountWithMetadata, P as PrivyErrorCode, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, O as OAuthTokens, F as FundingMethod, S as SolanaChain } from './types-B6UNnZ2P.js';
3
3
 
4
4
  /**
5
5
  * `CallbackError` optionally includes a second parameter with further error details.
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { U as User, L as LoginMethod, a as LinkedAccountWithMetadata, P as PrivyErrorCode, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, O as OAuthTokens, F as FundingMethod, S as SolanaChain } from './types-BSeKsLfK.js';
2
+ import { U as User, L as LoginMethod, a as LinkedAccountWithMetadata, P as PrivyErrorCode, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, O as OAuthTokens, F as FundingMethod, S as SolanaChain } from './types-B6UNnZ2P.js';
3
3
 
4
4
  /**
5
5
  * `CallbackError` optionally includes a second parameter with further error details.
@@ -1,5 +1,5 @@
1
1
  import { CurveSigningChainType, Wallet } from '@privy-io/api-types';
2
- import { U as User } from './types-BSeKsLfK.js';
2
+ import { U as User } from './types-B6UNnZ2P.js';
3
3
  import '@coinbase/wallet-sdk';
4
4
  import '@simplewebauthn/browser';
5
5
  import '@solana/kit';
@@ -1,5 +1,5 @@
1
1
  import { CurveSigningChainType, Wallet } from '@privy-io/api-types';
2
- import { U as User } from './types-BSeKsLfK.js';
2
+ import { U as User } from './types-B6UNnZ2P.js';
3
3
  import '@coinbase/wallet-sdk';
4
4
  import '@simplewebauthn/browser';
5
5
  import '@solana/kit';
@@ -1,4 +1,4 @@
1
- import { d as LoginToMiniApp, U as User } from './types-BSeKsLfK.js';
1
+ import { d as LoginToMiniApp, U as User } from './types-B6UNnZ2P.js';
2
2
  import '@coinbase/wallet-sdk';
3
3
  import '@simplewebauthn/browser';
4
4
  import '@solana/kit';
@@ -1,4 +1,4 @@
1
- import { d as LoginToMiniApp, U as User } from './types-BSeKsLfK.js';
1
+ import { d as LoginToMiniApp, U as User } from './types-B6UNnZ2P.js';
2
2
  import '@coinbase/wallet-sdk';
3
3
  import '@simplewebauthn/browser';
4
4
  import '@solana/kit';
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { k as MfaSubmitArgs, c as UserRecoveryMethod, g as SessionSignerInput, E as EthereumRpcRequestType, l as SolanaRpcRequestType, m as EthereumRpcResponseType, n as SolanaRpcResponseType, o as PrivyFarcasterSignerInitResponse, p as EIP1193Provider, q as EntropyIdVerifier$1, H as HDWalletWithMetadata, r as RequestArguments, s as WalletConnector, B as BaseConnectedEthereumWallet, u as PrivyProxyProvider, v as WalletClientType, w as ConnectedWalletMetadata, x as PrivyClientConfig, y as ConnectorType, z as SetBaseAccountSdkType, A as WalletListEntry, D as AppConfig, G as BaseConnectedWallet, j as SolanaWalletConnector, U as User, I as ConnectWalletModalOptions, J as LoginModalOptions, C as CreateWalletOptions, W as Wallet, K as SetWalletRecoveryOptions, f as SignMessageModalUIOptions, N as SignTypedDataParams, M as MfaMethod, Q as UnsignedTransactionRequest, e as SendTransactionModalUIOptions, T as FundWalletConfig, V as ConnectedWallet, O as OAuthTokens, X as CrossAppProviderDetails, Y as MoonpaySignRequest, Z as MoonpaySignResponse, _ as SmartWalletConfig, $ as SiwsMessageType, L as LoginMethod, a0 as ExternalWalletMetadata, a1 as TelegramAuthResult, a2 as TelegramWebAppData, a3 as OAuthUserInfo, a4 as OAuthFlowState, a5 as LoginWithCode, a6 as OtpFlowState, a7 as PasskeyFlowState, a8 as SiweFlowState, a as LinkedAccountWithMetadata, a9 as BaseAccountSdkType, aa as UnsignedTransactionRequestWithChainId, ab as BaseConnectedWalletType, b as BaseConnectedSolanaWallet, ac as TelegramAuthFlowState } from './types-BSeKsLfK.js';
4
- export { au as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, ay as CrossAppAccount, aK as CrossAppAccountWithMetadata, ar as Discord, aC as DiscordOAuthWithMetadata, aM as Email, am as EmailWithMetadata, aS as Farcaster, aI as FarcasterWithMetadata, as as Github, aD as GithubOAuthWithMetadata, ap as Google, aA as GoogleOAuthWithMetadata, aw as Line, aF as LineOAuthWithMetadata, az as LinkedAccountType, at as LinkedIn, aG as LinkedInOAuthWithMetadata, aU as LoginMethodOrderOption, ae as MessageTypes, ag as MoonpayCurrencyCode, ah as MoonpayPaymentMethod, aQ as NativeFundingConfig, al as NonEmptyArray, aT as Passkey, aL as PasskeyWithMetadata, aN as Phone, an as PhoneWithMetadata, aR as PriceDisplayOptions, P as PrivyErrorCode, aW as PrivyI18nStrings, ai as Quantity, aV as SiwsFlowState, af as SmartWallet, ax as Telegram, aJ as TelegramWithMetadata, av as Tiktok, aE as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aO as TransactionUIOptions, aq as Twitter, aB as TwitterOAuthWithMetadata, ad as TypedMessage, ao as WalletWithMetadata } from './types-BSeKsLfK.js';
3
+ import { k as MfaSubmitArgs, c as UserRecoveryMethod, g as SessionSignerInput, E as EthereumRpcRequestType, l as SolanaRpcRequestType, m as EthereumRpcResponseType, n as SolanaRpcResponseType, o as PrivyFarcasterSignerInitResponse, p as EIP1193Provider, q as EntropyIdVerifier$1, H as HDWalletWithMetadata, r as RequestArguments, s as WalletConnector, B as BaseConnectedEthereumWallet, u as PrivyProxyProvider, v as WalletClientType, w as ConnectedWalletMetadata, x as PrivyClientConfig, y as ConnectorType, z as SetBaseAccountSdkType, A as WalletListEntry, D as AppConfig, G as BaseConnectedWallet, j as SolanaWalletConnector, U as User, I as ConnectWalletModalOptions, J as LoginModalOptions, C as CreateWalletOptions, W as Wallet, K as SetWalletRecoveryOptions, f as SignMessageModalUIOptions, N as SignTypedDataParams, M as MfaMethod, Q as UnsignedTransactionRequest, e as SendTransactionModalUIOptions, T as FundWalletConfig, V as ConnectedWallet, O as OAuthTokens, X as CrossAppProviderDetails, Y as MoonpaySignRequest, Z as MoonpaySignResponse, _ as SmartWalletConfig, $ as SiwsMessageType, L as LoginMethod, a0 as ExternalWalletMetadata, a1 as TelegramAuthResult, a2 as TelegramWebAppData, a3 as OAuthUserInfo, a4 as OAuthFlowState, a5 as LoginWithCode, a6 as OtpFlowState, a7 as PasskeyFlowState, a8 as SiweFlowState, a as LinkedAccountWithMetadata, a9 as BaseAccountSdkType, aa as UnsignedTransactionRequestWithChainId, ab as BaseConnectedWalletType, b as BaseConnectedSolanaWallet, ac as TelegramAuthFlowState } from './types-B6UNnZ2P.js';
4
+ export { au as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, ay as CrossAppAccount, aK as CrossAppAccountWithMetadata, ar as Discord, aC as DiscordOAuthWithMetadata, aM as Email, am as EmailWithMetadata, aS as Farcaster, aI as FarcasterWithMetadata, as as Github, aD as GithubOAuthWithMetadata, ap as Google, aA as GoogleOAuthWithMetadata, aw as Line, aF as LineOAuthWithMetadata, az as LinkedAccountType, at as LinkedIn, aG as LinkedInOAuthWithMetadata, aU as LoginMethodOrderOption, ae as MessageTypes, ag as MoonpayCurrencyCode, ah as MoonpayPaymentMethod, aQ as NativeFundingConfig, al as NonEmptyArray, aT as Passkey, aL as PasskeyWithMetadata, aN as Phone, an as PhoneWithMetadata, aR as PriceDisplayOptions, P as PrivyErrorCode, aW as PrivyI18nStrings, ai as Quantity, aV as SiwsFlowState, af as SmartWallet, ax as Telegram, aJ as TelegramWithMetadata, av as Tiktok, aE as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aO as TransactionUIOptions, aq as Twitter, aB as TwitterOAuthWithMetadata, ad as TypedMessage, ao as WalletWithMetadata } from './types-B6UNnZ2P.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -15,8 +15,10 @@ import { Address, HttpTransport, Hex } from 'viem';
15
15
  import * as _simplewebauthn_browser from '@simplewebauthn/browser';
16
16
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/browser';
17
17
  import { FetchOptions } from 'ofetch';
18
- import { P as PrivyEvents } from './events-context-B1q54lAU.js';
19
- export { C as CallbackError } from './events-context-B1q54lAU.js';
18
+ import { P as PrivyEvents } from './events-context-CCElA92Y.js';
19
+ export { C as CallbackError } from './events-context-CCElA92Y.js';
20
+ import { PaymentRequirementsSelector } from 'x402/client';
21
+ import { X402Config } from 'x402/types';
20
22
  import * as viem_accounts from 'viem/accounts';
21
23
  import '@coinbase/wallet-sdk';
22
24
  import '@solana/kit';
@@ -580,6 +582,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
580
582
  Method: "eth_getTransactionByHash";
581
583
  Parameters: [hash: viem.Hash];
582
584
  ReturnType: viem.RpcTransaction | null;
585
+ }, {
586
+ Method: "eth_getTransactionBySenderAndNonce";
587
+ Parameters: [sender: Address, nonce: viem.Quantity];
588
+ ReturnType: viem.RpcTransaction | null;
583
589
  }, {
584
590
  Method: "eth_getTransactionCount";
585
591
  Parameters: [address: Address, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier];
@@ -633,6 +639,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
633
639
  Method: "eth_sendRawTransaction";
634
640
  Parameters: [signedTransaction: viem.Hex];
635
641
  ReturnType: viem.Hash;
642
+ }, {
643
+ Method: "eth_sendRawTransactionSync";
644
+ Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
645
+ ReturnType: viem.RpcTransactionReceipt;
636
646
  }, {
637
647
  Method: "eth_simulateV1";
638
648
  Parameters: [{
@@ -715,6 +725,7 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
715
725
  prepareTransactionRequest: <const request extends viem.PrepareTransactionRequestRequest<Chain, chainOverride>, chainOverride extends viem.Chain | undefined = undefined, accountOverride extends viem.Account | Address | undefined = undefined>(args: viem.PrepareTransactionRequestParameters<Chain, viem.Account | undefined, chainOverride, accountOverride, request>) => Promise<viem.PrepareTransactionRequestReturnType<Chain, viem.Account | undefined, chainOverride, accountOverride, request>>;
716
726
  readContract: <const abi extends viem.Abi | readonly unknown[], functionName extends viem.ContractFunctionName<abi, "pure" | "view">, const args extends viem.ContractFunctionArgs<abi, "pure" | "view", functionName>>(args: viem.ReadContractParameters<abi, functionName, args>) => Promise<viem.ReadContractReturnType<abi, functionName, args>>;
717
727
  sendRawTransaction: (args: viem.SendRawTransactionParameters) => Promise<viem.SendRawTransactionReturnType>;
728
+ sendRawTransactionSync: (args: viem.SendRawTransactionSyncParameters) => Promise<viem.SendRawTransactionSyncReturnType<Chain>>;
718
729
  simulate: <const calls extends readonly unknown[]>(args: viem.SimulateBlocksParameters<calls>) => Promise<viem.SimulateBlocksReturnType<calls>>;
719
730
  simulateBlocks: <const calls extends readonly unknown[]>(args: viem.SimulateBlocksParameters<calls>) => Promise<viem.SimulateBlocksReturnType<calls>>;
720
731
  simulateCalls: <const calls extends readonly unknown[]>(args: viem.SimulateCallsParameters<calls>) => Promise<viem.SimulateCallsReturnType<calls>>;
@@ -890,6 +901,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
890
901
  Method: "eth_getTransactionByHash";
891
902
  Parameters: [hash: viem.Hash];
892
903
  ReturnType: viem.RpcTransaction | null;
904
+ }, {
905
+ Method: "eth_getTransactionBySenderAndNonce";
906
+ Parameters: [sender: Address, nonce: viem.Quantity];
907
+ ReturnType: viem.RpcTransaction | null;
893
908
  }, {
894
909
  Method: "eth_getTransactionCount";
895
910
  Parameters: [address: Address, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier];
@@ -943,6 +958,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
943
958
  Method: "eth_sendRawTransaction";
944
959
  Parameters: [signedTransaction: viem.Hex];
945
960
  ReturnType: viem.Hash;
961
+ }, {
962
+ Method: "eth_sendRawTransactionSync";
963
+ Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
964
+ ReturnType: viem.RpcTransactionReceipt;
946
965
  }, {
947
966
  Method: "eth_simulateV1";
948
967
  Parameters: [{
@@ -1105,6 +1124,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
1105
1124
  Method: "eth_getTransactionByHash";
1106
1125
  Parameters: [hash: viem.Hash];
1107
1126
  ReturnType: viem.RpcTransaction | null;
1127
+ }, {
1128
+ Method: "eth_getTransactionBySenderAndNonce";
1129
+ Parameters: [sender: Address, nonce: viem.Quantity];
1130
+ ReturnType: viem.RpcTransaction | null;
1108
1131
  }, {
1109
1132
  Method: "eth_getTransactionCount";
1110
1133
  Parameters: [address: Address, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier];
@@ -1158,6 +1181,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
1158
1181
  Method: "eth_sendRawTransaction";
1159
1182
  Parameters: [signedTransaction: viem.Hex];
1160
1183
  ReturnType: viem.Hash;
1184
+ }, {
1185
+ Method: "eth_sendRawTransactionSync";
1186
+ Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
1187
+ ReturnType: viem.RpcTransactionReceipt;
1161
1188
  }, {
1162
1189
  Method: "eth_simulateV1";
1163
1190
  Parameters: [{
@@ -1331,6 +1358,7 @@ type MobileWalletConfig = {
1331
1358
  };
1332
1359
 
1333
1360
  declare function getCustomerAccessToken(): Promise<string | null>;
1361
+ declare function getIdentityToken(): Promise<string | null>;
1334
1362
  /**
1335
1363
  * Properties to initialize the {@link PrivyProvider}.
1336
1364
  */
@@ -3858,6 +3886,58 @@ declare function useSignTypedData(callbacks?: PrivyEvents['signTypedData']): {
3858
3886
  }>;
3859
3887
  };
3860
3888
 
3889
+ /**
3890
+ * Wraps a fetch function to automatically handle x402 payments.
3891
+ *
3892
+ * @param options - Configuration options for the wrapped fetch
3893
+ * @param options.walletAddress - Optional: The address of the Privy wallet to use. Defaults to first connected wallet.
3894
+ * @param options.fetch - The fetch function to wrap (typically globalThis.fetch)
3895
+ * @param options.maxValue - Maximum allowed payment amount in base units (default: 100000 = 0.1 USDC)
3896
+ * @param options.paymentRequirementsSelector - Function to select payment requirements from 402 response
3897
+ * @param options.config - Optional x402 configuration
3898
+ * @returns A wrapped fetch function that handles 402 responses automatically
3899
+ */
3900
+ type WrapFetchWithPayment = (options: {
3901
+ walletAddress?: string;
3902
+ fetch: typeof globalThis.fetch;
3903
+ maxValue?: bigint;
3904
+ paymentRequirementsSelector?: PaymentRequirementsSelector;
3905
+ config?: X402Config;
3906
+ }) => (input: RequestInfo, init?: RequestInit) => Promise<Response>;
3907
+ /**
3908
+ * Return type for the useX402Fetch hook
3909
+ */
3910
+ type UseX402Fetch = {
3911
+ /**
3912
+ * Wraps a fetch function to automatically handle x402 payments.
3913
+ * See {@link WrapFetchWithPayment} for details.
3914
+ */
3915
+ wrapFetchWithPayment: WrapFetchWithPayment;
3916
+ };
3917
+ /**
3918
+ * Hook that provides x402 payment functionality for Privy embedded wallets.
3919
+ *
3920
+ * Returns a `wrapFetchWithPayment` function that wraps the native fetch API to automatically
3921
+ * handle 402 Payment Required responses by creating and sending payment headers signed with
3922
+ * Privy embedded wallets.
3923
+ *
3924
+ * @example
3925
+ * ```typescript
3926
+ * const {wallets} = useWallets();
3927
+ * const {wrapFetchWithPayment} = useX402Fetch();
3928
+ *
3929
+ * const fetchWithPayment = wrapFetchWithPayment({
3930
+ * walletAddress: wallets[0].address,
3931
+ * fetch,
3932
+ * });
3933
+ * const response = await fetchWithPayment('https://api.example.com/premium');
3934
+ * ```
3935
+ *
3936
+ * @experimental This API is experimental and may change in future versions
3937
+ * @returns Object containing wrapFetchWithPayment function
3938
+ */
3939
+ declare const useX402Fetch: () => UseX402Fetch;
3940
+
3861
3941
  /**
3862
3942
  * Use this hook to check whether or not the Privy modal is currently visible.
3863
3943
  *
@@ -4258,10 +4338,17 @@ declare const useHeadlessDelegatedActions: () => UseHeadlessDelegatedActionsInte
4258
4338
  */
4259
4339
  declare function getEmbeddedConnectedWallet(wallets: ConnectedWallet[]): ConnectedWallet | null;
4260
4340
 
4341
+ /**
4342
+ * @deprecated Use `PrivyModal` instead
4343
+ */
4261
4344
  declare const LoginModal: ({ open }: {
4262
4345
  open: boolean;
4263
4346
  }) => react_jsx_runtime.JSX.Element;
4264
4347
 
4348
+ declare const PrivyModal: ({ open }: {
4349
+ open: boolean;
4350
+ }) => react_jsx_runtime.JSX.Element;
4351
+
4265
4352
  /**
4266
4353
  * Helper function to create a viem Account instance given a connected Ethereum wallet.
4267
4354
  *
@@ -4282,7 +4369,7 @@ declare const toViemAccount: ({ wallet }: {
4282
4369
  }) => Promise<Hex>;
4283
4370
  signTransaction: <serializer extends viem.SerializeTransactionFn<viem.TransactionSerializable> = viem.SerializeTransactionFn<viem.TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
4284
4371
  serializer?: serializer | undefined;
4285
- } | undefined) => Promise<viem.IsNarrowable<viem.TransactionSerialized<viem.GetTransactionType<transaction>>, Hex> extends true ? viem.TransactionSerialized<viem.GetTransactionType<transaction>> : Hex>;
4372
+ } | undefined) => Promise<Hex>;
4286
4373
  signTypedData: <const typedData extends viem.TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: viem.TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
4287
4374
  publicKey: Hex;
4288
4375
  source: string;
@@ -4300,4 +4387,4 @@ declare const useMigrateWallets: () => {
4300
4387
  }>;
4301
4388
  };
4302
4389
 
4303
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, 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 UseGetAccessTokenForProvider, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, 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, useGetAccessTokenForProvider, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletRecovery, useSign7702Authorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
4390
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyModal, 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 UseGetAccessTokenForProvider, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, type UseX402Fetch, User, VERSION, Wallet, WalletConnector, WalletListEntry, type WrapFetchWithPayment, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, getIdentityToken, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGetAccessTokenForProvider, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletRecovery, useSign7702Authorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets, useX402Fetch };
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { k as MfaSubmitArgs, c as UserRecoveryMethod, g as SessionSignerInput, E as EthereumRpcRequestType, l as SolanaRpcRequestType, m as EthereumRpcResponseType, n as SolanaRpcResponseType, o as PrivyFarcasterSignerInitResponse, p as EIP1193Provider, q as EntropyIdVerifier$1, H as HDWalletWithMetadata, r as RequestArguments, s as WalletConnector, B as BaseConnectedEthereumWallet, u as PrivyProxyProvider, v as WalletClientType, w as ConnectedWalletMetadata, x as PrivyClientConfig, y as ConnectorType, z as SetBaseAccountSdkType, A as WalletListEntry, D as AppConfig, G as BaseConnectedWallet, j as SolanaWalletConnector, U as User, I as ConnectWalletModalOptions, J as LoginModalOptions, C as CreateWalletOptions, W as Wallet, K as SetWalletRecoveryOptions, f as SignMessageModalUIOptions, N as SignTypedDataParams, M as MfaMethod, Q as UnsignedTransactionRequest, e as SendTransactionModalUIOptions, T as FundWalletConfig, V as ConnectedWallet, O as OAuthTokens, X as CrossAppProviderDetails, Y as MoonpaySignRequest, Z as MoonpaySignResponse, _ as SmartWalletConfig, $ as SiwsMessageType, L as LoginMethod, a0 as ExternalWalletMetadata, a1 as TelegramAuthResult, a2 as TelegramWebAppData, a3 as OAuthUserInfo, a4 as OAuthFlowState, a5 as LoginWithCode, a6 as OtpFlowState, a7 as PasskeyFlowState, a8 as SiweFlowState, a as LinkedAccountWithMetadata, a9 as BaseAccountSdkType, aa as UnsignedTransactionRequestWithChainId, ab as BaseConnectedWalletType, b as BaseConnectedSolanaWallet, ac as TelegramAuthFlowState } from './types-BSeKsLfK.js';
4
- export { au as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, ay as CrossAppAccount, aK as CrossAppAccountWithMetadata, ar as Discord, aC as DiscordOAuthWithMetadata, aM as Email, am as EmailWithMetadata, aS as Farcaster, aI as FarcasterWithMetadata, as as Github, aD as GithubOAuthWithMetadata, ap as Google, aA as GoogleOAuthWithMetadata, aw as Line, aF as LineOAuthWithMetadata, az as LinkedAccountType, at as LinkedIn, aG as LinkedInOAuthWithMetadata, aU as LoginMethodOrderOption, ae as MessageTypes, ag as MoonpayCurrencyCode, ah as MoonpayPaymentMethod, aQ as NativeFundingConfig, al as NonEmptyArray, aT as Passkey, aL as PasskeyWithMetadata, aN as Phone, an as PhoneWithMetadata, aR as PriceDisplayOptions, P as PrivyErrorCode, aW as PrivyI18nStrings, ai as Quantity, aV as SiwsFlowState, af as SmartWallet, ax as Telegram, aJ as TelegramWithMetadata, av as Tiktok, aE as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aO as TransactionUIOptions, aq as Twitter, aB as TwitterOAuthWithMetadata, ad as TypedMessage, ao as WalletWithMetadata } from './types-BSeKsLfK.js';
3
+ import { k as MfaSubmitArgs, c as UserRecoveryMethod, g as SessionSignerInput, E as EthereumRpcRequestType, l as SolanaRpcRequestType, m as EthereumRpcResponseType, n as SolanaRpcResponseType, o as PrivyFarcasterSignerInitResponse, p as EIP1193Provider, q as EntropyIdVerifier$1, H as HDWalletWithMetadata, r as RequestArguments, s as WalletConnector, B as BaseConnectedEthereumWallet, u as PrivyProxyProvider, v as WalletClientType, w as ConnectedWalletMetadata, x as PrivyClientConfig, y as ConnectorType, z as SetBaseAccountSdkType, A as WalletListEntry, D as AppConfig, G as BaseConnectedWallet, j as SolanaWalletConnector, U as User, I as ConnectWalletModalOptions, J as LoginModalOptions, C as CreateWalletOptions, W as Wallet, K as SetWalletRecoveryOptions, f as SignMessageModalUIOptions, N as SignTypedDataParams, M as MfaMethod, Q as UnsignedTransactionRequest, e as SendTransactionModalUIOptions, T as FundWalletConfig, V as ConnectedWallet, O as OAuthTokens, X as CrossAppProviderDetails, Y as MoonpaySignRequest, Z as MoonpaySignResponse, _ as SmartWalletConfig, $ as SiwsMessageType, L as LoginMethod, a0 as ExternalWalletMetadata, a1 as TelegramAuthResult, a2 as TelegramWebAppData, a3 as OAuthUserInfo, a4 as OAuthFlowState, a5 as LoginWithCode, a6 as OtpFlowState, a7 as PasskeyFlowState, a8 as SiweFlowState, a as LinkedAccountWithMetadata, a9 as BaseAccountSdkType, aa as UnsignedTransactionRequestWithChainId, ab as BaseConnectedWalletType, b as BaseConnectedSolanaWallet, ac as TelegramAuthFlowState } from './types-B6UNnZ2P.js';
4
+ export { au as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, ay as CrossAppAccount, aK as CrossAppAccountWithMetadata, ar as Discord, aC as DiscordOAuthWithMetadata, aM as Email, am as EmailWithMetadata, aS as Farcaster, aI as FarcasterWithMetadata, as as Github, aD as GithubOAuthWithMetadata, ap as Google, aA as GoogleOAuthWithMetadata, aw as Line, aF as LineOAuthWithMetadata, az as LinkedAccountType, at as LinkedIn, aG as LinkedInOAuthWithMetadata, aU as LoginMethodOrderOption, ae as MessageTypes, ag as MoonpayCurrencyCode, ah as MoonpayPaymentMethod, aQ as NativeFundingConfig, al as NonEmptyArray, aT as Passkey, aL as PasskeyWithMetadata, aN as Phone, an as PhoneWithMetadata, aR as PriceDisplayOptions, P as PrivyErrorCode, aW as PrivyI18nStrings, ai as Quantity, aV as SiwsFlowState, af as SmartWallet, ax as Telegram, aJ as TelegramWithMetadata, av as Tiktok, aE as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aO as TransactionUIOptions, aq as Twitter, aB as TwitterOAuthWithMetadata, ad as TypedMessage, ao as WalletWithMetadata } from './types-B6UNnZ2P.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -15,8 +15,10 @@ import { Address, HttpTransport, Hex } from 'viem';
15
15
  import * as _simplewebauthn_browser from '@simplewebauthn/browser';
16
16
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/browser';
17
17
  import { FetchOptions } from 'ofetch';
18
- import { P as PrivyEvents } from './events-context-B1q54lAU.js';
19
- export { C as CallbackError } from './events-context-B1q54lAU.js';
18
+ import { P as PrivyEvents } from './events-context-CCElA92Y.js';
19
+ export { C as CallbackError } from './events-context-CCElA92Y.js';
20
+ import { PaymentRequirementsSelector } from 'x402/client';
21
+ import { X402Config } from 'x402/types';
20
22
  import * as viem_accounts from 'viem/accounts';
21
23
  import '@coinbase/wallet-sdk';
22
24
  import '@solana/kit';
@@ -580,6 +582,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
580
582
  Method: "eth_getTransactionByHash";
581
583
  Parameters: [hash: viem.Hash];
582
584
  ReturnType: viem.RpcTransaction | null;
585
+ }, {
586
+ Method: "eth_getTransactionBySenderAndNonce";
587
+ Parameters: [sender: Address, nonce: viem.Quantity];
588
+ ReturnType: viem.RpcTransaction | null;
583
589
  }, {
584
590
  Method: "eth_getTransactionCount";
585
591
  Parameters: [address: Address, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier];
@@ -633,6 +639,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
633
639
  Method: "eth_sendRawTransaction";
634
640
  Parameters: [signedTransaction: viem.Hex];
635
641
  ReturnType: viem.Hash;
642
+ }, {
643
+ Method: "eth_sendRawTransactionSync";
644
+ Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
645
+ ReturnType: viem.RpcTransactionReceipt;
636
646
  }, {
637
647
  Method: "eth_simulateV1";
638
648
  Parameters: [{
@@ -715,6 +725,7 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
715
725
  prepareTransactionRequest: <const request extends viem.PrepareTransactionRequestRequest<Chain, chainOverride>, chainOverride extends viem.Chain | undefined = undefined, accountOverride extends viem.Account | Address | undefined = undefined>(args: viem.PrepareTransactionRequestParameters<Chain, viem.Account | undefined, chainOverride, accountOverride, request>) => Promise<viem.PrepareTransactionRequestReturnType<Chain, viem.Account | undefined, chainOverride, accountOverride, request>>;
716
726
  readContract: <const abi extends viem.Abi | readonly unknown[], functionName extends viem.ContractFunctionName<abi, "pure" | "view">, const args extends viem.ContractFunctionArgs<abi, "pure" | "view", functionName>>(args: viem.ReadContractParameters<abi, functionName, args>) => Promise<viem.ReadContractReturnType<abi, functionName, args>>;
717
727
  sendRawTransaction: (args: viem.SendRawTransactionParameters) => Promise<viem.SendRawTransactionReturnType>;
728
+ sendRawTransactionSync: (args: viem.SendRawTransactionSyncParameters) => Promise<viem.SendRawTransactionSyncReturnType<Chain>>;
718
729
  simulate: <const calls extends readonly unknown[]>(args: viem.SimulateBlocksParameters<calls>) => Promise<viem.SimulateBlocksReturnType<calls>>;
719
730
  simulateBlocks: <const calls extends readonly unknown[]>(args: viem.SimulateBlocksParameters<calls>) => Promise<viem.SimulateBlocksReturnType<calls>>;
720
731
  simulateCalls: <const calls extends readonly unknown[]>(args: viem.SimulateCallsParameters<calls>) => Promise<viem.SimulateCallsReturnType<calls>>;
@@ -890,6 +901,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
890
901
  Method: "eth_getTransactionByHash";
891
902
  Parameters: [hash: viem.Hash];
892
903
  ReturnType: viem.RpcTransaction | null;
904
+ }, {
905
+ Method: "eth_getTransactionBySenderAndNonce";
906
+ Parameters: [sender: Address, nonce: viem.Quantity];
907
+ ReturnType: viem.RpcTransaction | null;
893
908
  }, {
894
909
  Method: "eth_getTransactionCount";
895
910
  Parameters: [address: Address, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier];
@@ -943,6 +958,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
943
958
  Method: "eth_sendRawTransaction";
944
959
  Parameters: [signedTransaction: viem.Hex];
945
960
  ReturnType: viem.Hash;
961
+ }, {
962
+ Method: "eth_sendRawTransactionSync";
963
+ Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
964
+ ReturnType: viem.RpcTransactionReceipt;
946
965
  }, {
947
966
  Method: "eth_simulateV1";
948
967
  Parameters: [{
@@ -1105,6 +1124,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
1105
1124
  Method: "eth_getTransactionByHash";
1106
1125
  Parameters: [hash: viem.Hash];
1107
1126
  ReturnType: viem.RpcTransaction | null;
1127
+ }, {
1128
+ Method: "eth_getTransactionBySenderAndNonce";
1129
+ Parameters: [sender: Address, nonce: viem.Quantity];
1130
+ ReturnType: viem.RpcTransaction | null;
1108
1131
  }, {
1109
1132
  Method: "eth_getTransactionCount";
1110
1133
  Parameters: [address: Address, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier];
@@ -1158,6 +1181,10 @@ declare const getPublicClient: (chainId: number, chains: Chain[], rpcConfig: Rpc
1158
1181
  Method: "eth_sendRawTransaction";
1159
1182
  Parameters: [signedTransaction: viem.Hex];
1160
1183
  ReturnType: viem.Hash;
1184
+ }, {
1185
+ Method: "eth_sendRawTransactionSync";
1186
+ Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
1187
+ ReturnType: viem.RpcTransactionReceipt;
1161
1188
  }, {
1162
1189
  Method: "eth_simulateV1";
1163
1190
  Parameters: [{
@@ -1331,6 +1358,7 @@ type MobileWalletConfig = {
1331
1358
  };
1332
1359
 
1333
1360
  declare function getCustomerAccessToken(): Promise<string | null>;
1361
+ declare function getIdentityToken(): Promise<string | null>;
1334
1362
  /**
1335
1363
  * Properties to initialize the {@link PrivyProvider}.
1336
1364
  */
@@ -3858,6 +3886,58 @@ declare function useSignTypedData(callbacks?: PrivyEvents['signTypedData']): {
3858
3886
  }>;
3859
3887
  };
3860
3888
 
3889
+ /**
3890
+ * Wraps a fetch function to automatically handle x402 payments.
3891
+ *
3892
+ * @param options - Configuration options for the wrapped fetch
3893
+ * @param options.walletAddress - Optional: The address of the Privy wallet to use. Defaults to first connected wallet.
3894
+ * @param options.fetch - The fetch function to wrap (typically globalThis.fetch)
3895
+ * @param options.maxValue - Maximum allowed payment amount in base units (default: 100000 = 0.1 USDC)
3896
+ * @param options.paymentRequirementsSelector - Function to select payment requirements from 402 response
3897
+ * @param options.config - Optional x402 configuration
3898
+ * @returns A wrapped fetch function that handles 402 responses automatically
3899
+ */
3900
+ type WrapFetchWithPayment = (options: {
3901
+ walletAddress?: string;
3902
+ fetch: typeof globalThis.fetch;
3903
+ maxValue?: bigint;
3904
+ paymentRequirementsSelector?: PaymentRequirementsSelector;
3905
+ config?: X402Config;
3906
+ }) => (input: RequestInfo, init?: RequestInit) => Promise<Response>;
3907
+ /**
3908
+ * Return type for the useX402Fetch hook
3909
+ */
3910
+ type UseX402Fetch = {
3911
+ /**
3912
+ * Wraps a fetch function to automatically handle x402 payments.
3913
+ * See {@link WrapFetchWithPayment} for details.
3914
+ */
3915
+ wrapFetchWithPayment: WrapFetchWithPayment;
3916
+ };
3917
+ /**
3918
+ * Hook that provides x402 payment functionality for Privy embedded wallets.
3919
+ *
3920
+ * Returns a `wrapFetchWithPayment` function that wraps the native fetch API to automatically
3921
+ * handle 402 Payment Required responses by creating and sending payment headers signed with
3922
+ * Privy embedded wallets.
3923
+ *
3924
+ * @example
3925
+ * ```typescript
3926
+ * const {wallets} = useWallets();
3927
+ * const {wrapFetchWithPayment} = useX402Fetch();
3928
+ *
3929
+ * const fetchWithPayment = wrapFetchWithPayment({
3930
+ * walletAddress: wallets[0].address,
3931
+ * fetch,
3932
+ * });
3933
+ * const response = await fetchWithPayment('https://api.example.com/premium');
3934
+ * ```
3935
+ *
3936
+ * @experimental This API is experimental and may change in future versions
3937
+ * @returns Object containing wrapFetchWithPayment function
3938
+ */
3939
+ declare const useX402Fetch: () => UseX402Fetch;
3940
+
3861
3941
  /**
3862
3942
  * Use this hook to check whether or not the Privy modal is currently visible.
3863
3943
  *
@@ -4258,10 +4338,17 @@ declare const useHeadlessDelegatedActions: () => UseHeadlessDelegatedActionsInte
4258
4338
  */
4259
4339
  declare function getEmbeddedConnectedWallet(wallets: ConnectedWallet[]): ConnectedWallet | null;
4260
4340
 
4341
+ /**
4342
+ * @deprecated Use `PrivyModal` instead
4343
+ */
4261
4344
  declare const LoginModal: ({ open }: {
4262
4345
  open: boolean;
4263
4346
  }) => react_jsx_runtime.JSX.Element;
4264
4347
 
4348
+ declare const PrivyModal: ({ open }: {
4349
+ open: boolean;
4350
+ }) => react_jsx_runtime.JSX.Element;
4351
+
4265
4352
  /**
4266
4353
  * Helper function to create a viem Account instance given a connected Ethereum wallet.
4267
4354
  *
@@ -4282,7 +4369,7 @@ declare const toViemAccount: ({ wallet }: {
4282
4369
  }) => Promise<Hex>;
4283
4370
  signTransaction: <serializer extends viem.SerializeTransactionFn<viem.TransactionSerializable> = viem.SerializeTransactionFn<viem.TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
4284
4371
  serializer?: serializer | undefined;
4285
- } | undefined) => Promise<viem.IsNarrowable<viem.TransactionSerialized<viem.GetTransactionType<transaction>>, Hex> extends true ? viem.TransactionSerialized<viem.GetTransactionType<transaction>> : Hex>;
4372
+ } | undefined) => Promise<Hex>;
4286
4373
  signTypedData: <const typedData extends viem.TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: viem.TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
4287
4374
  publicKey: Hex;
4288
4375
  source: string;
@@ -4300,4 +4387,4 @@ declare const useMigrateWallets: () => {
4300
4387
  }>;
4301
4388
  };
4302
4389
 
4303
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, 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 UseGetAccessTokenForProvider, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, 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, useGetAccessTokenForProvider, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletRecovery, useSign7702Authorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
4390
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyModal, 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 UseGetAccessTokenForProvider, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, type UseX402Fetch, User, VERSION, Wallet, WalletConnector, WalletListEntry, type WrapFetchWithPayment, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, getIdentityToken, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGetAccessTokenForProvider, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletRecovery, useSign7702Authorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets, useX402Fetch };
@@ -1,4 +1,4 @@
1
- import { U as User } from './types-BSeKsLfK.js';
1
+ import { U as User } from './types-B6UNnZ2P.js';
2
2
  import '@coinbase/wallet-sdk';
3
3
  import '@simplewebauthn/browser';
4
4
  import '@solana/kit';
@@ -1,4 +1,4 @@
1
- import { U as User } from './types-BSeKsLfK.js';
1
+ import { U as User } from './types-B6UNnZ2P.js';
2
2
  import '@coinbase/wallet-sdk';
3
3
  import '@simplewebauthn/browser';
4
4
  import '@solana/kit';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import react__default from 'react';
3
- import { e as SendTransactionModalUIOptions, f as SignMessageModalUIOptions } from './types-BSeKsLfK.js';
3
+ import { e as SendTransactionModalUIOptions, f as SignMessageModalUIOptions } from './types-B6UNnZ2P.js';
4
4
  import { SmartAccountClient } from 'permissionless';
5
5
  import { EIP1193Provider, Chain, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema, SendTransactionParameters, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters } from 'viem';
6
6
  import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import react__default from 'react';
3
- import { e as SendTransactionModalUIOptions, f as SignMessageModalUIOptions } from './types-BSeKsLfK.js';
3
+ import { e as SendTransactionModalUIOptions, f as SignMessageModalUIOptions } from './types-B6UNnZ2P.js';
4
4
  import { SmartAccountClient } from 'permissionless';
5
5
  import { EIP1193Provider, Chain, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema, SendTransactionParameters, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters } from 'viem';
6
6
  import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
@@ -1,12 +1,12 @@
1
- import { g as SessionSignerInput, W as Wallet, f as SignMessageModalUIOptions, S as SolanaChain, h as SolanaStandardWallet, C as CreateWalletOptions, e as SendTransactionModalUIOptions, i as SolanaFundingConfig } from './types-BSeKsLfK.js';
2
- export { j as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-BSeKsLfK.js';
1
+ import { g as SessionSignerInput, W as Wallet, f as SignMessageModalUIOptions, S as SolanaChain, h as SolanaStandardWallet, C as CreateWalletOptions, e as SendTransactionModalUIOptions, i as SolanaFundingConfig } from './types-B6UNnZ2P.js';
2
+ export { j as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-B6UNnZ2P.js';
3
3
  import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
4
4
  import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
5
5
  import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
6
6
  import EventEmitter from 'eventemitter3';
7
7
  import { SolanaSignAndSendTransactionOptions, SolanaSignTransactionOptions, ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
8
8
  export { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
9
- import { P as PrivyEvents } from './events-context-B1q54lAU.js';
9
+ import { P as PrivyEvents } from './events-context-CCElA92Y.js';
10
10
  import '@coinbase/wallet-sdk';
11
11
  import '@simplewebauthn/browser';
12
12
  import '@solana/kit';
@@ -1,12 +1,12 @@
1
- import { g as SessionSignerInput, W as Wallet, f as SignMessageModalUIOptions, S as SolanaChain, h as SolanaStandardWallet, C as CreateWalletOptions, e as SendTransactionModalUIOptions, i as SolanaFundingConfig } from './types-BSeKsLfK.js';
2
- export { j as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-BSeKsLfK.js';
1
+ import { g as SessionSignerInput, W as Wallet, f as SignMessageModalUIOptions, S as SolanaChain, h as SolanaStandardWallet, C as CreateWalletOptions, e as SendTransactionModalUIOptions, i as SolanaFundingConfig } from './types-B6UNnZ2P.js';
2
+ export { j as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-B6UNnZ2P.js';
3
3
  import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
4
4
  import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
5
5
  import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
6
6
  import EventEmitter from 'eventemitter3';
7
7
  import { SolanaSignAndSendTransactionOptions, SolanaSignTransactionOptions, ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
8
8
  export { ConnectedStandardSolanaWallet } from '@privy-io/js-sdk-core';
9
- import { P as PrivyEvents } from './events-context-B1q54lAU.js';
9
+ import { P as PrivyEvents } from './events-context-CCElA92Y.js';
10
10
  import '@coinbase/wallet-sdk';
11
11
  import '@simplewebauthn/browser';
12
12
  import '@solana/kit';
@@ -1116,7 +1116,9 @@ type PriceDisplayOptions = {
1116
1116
  };
1117
1117
  type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'base_account' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
1118
1118
  /** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
1119
- | 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'wallet_connect_qr' | 'wallet_connect_qr_solana' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'binance' | 'binanceus' | 'bitget_wallet';
1119
+ | 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'wallet_connect_qr' | 'wallet_connect_qr_solana'
1120
+ /** @deprecated rabby_wallet is no longer supported */
1121
+ | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'binance' | 'binanceus' | 'bitget_wallet';
1120
1122
  type NonEmptyArray<T> = [T, ...T[]];
1121
1123
  type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderID | `privy:${string}` | 'farcaster' | 'telegram';
1122
1124
  type ExternalWalletsConfig = {
@@ -2207,6 +2209,11 @@ type ExternalConnectWalletModalOptions = {
2207
2209
  * When set, the connect view will skip the wallets list and go straight to the wallet connection.
2208
2210
  */
2209
2211
  preSelectedWalletId?: string;
2212
+ /**
2213
+ * Whether to hide the modal header content (wallet icon, title, and description).
2214
+ * The close button and padding will still be shown. Defaults to false (header is visible).
2215
+ */
2216
+ hideHeader?: boolean;
2210
2217
  };
2211
2218
  /** Options for Privy's `createWallet` method */
2212
2219
  type CreateWalletOptions = {