@privy-io/react-auth 3.15.0 → 3.16.0-beta-20260303155317
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/AccountNotFoundScreen-vfuo7K3q.js +1 -0
- package/dist/cjs/{Address-Xt6eDzsN.js → Address-C2XO5YDn.js} +2 -2
- package/dist/cjs/AffirmativeConsentScreen-DDqJdDR5.js +6 -0
- package/dist/cjs/AllowlistRejectionScreen-bT87iLL0.js +1 -0
- package/dist/cjs/AuthenticateWithWalletScreen-fF9THkYv.js +1 -0
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-DtlBt2Cl.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-Bc_wou1l.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-B0f3rdjx.js +103 -0
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-CEi0IJTY.js +2 -0
- package/dist/cjs/{BridgeNetworkSelectionView-B-GFim4z.js → BridgeNetworkSelectionView-CEEgCj1m.js} +8 -8
- package/dist/cjs/CaptchaScreen-Dj6ymBPO.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-DcmUqAPX.js +16 -0
- package/dist/cjs/ConnectEmailForm-D-0Amqhf.js +3 -0
- package/dist/cjs/ConnectLedgerScreen-CRxctrk4.js +9 -0
- package/dist/cjs/ConnectOnlyLandingScreen-JFMrMqCK.js +1 -0
- package/dist/cjs/ConnectOnlyStatusScreen-DEFH7bgu.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-CEf0NGlE.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-B6TGW3Jk.js → ConnectPhoneForm-kY70TzuW.js} +1 -1
- package/dist/cjs/{ConnectWalletView-CTc3Uc5v.js → ConnectWalletView-DAxk2klb.js} +1 -1
- package/dist/cjs/ConnectionStatusScreen-C4a4QkqP.js +7 -0
- package/dist/cjs/CrossAppAuthScreen-BHWqG6zR.js +1 -0
- package/dist/cjs/CustomLandingScreenView-Cvi2ftR4.js +23 -0
- package/dist/cjs/DelegatedActionsConsentScreen-BmdAqKq1.js +1 -0
- package/dist/cjs/DelegatedActionsRevokeScreen-DYQnCNQW.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-EXc14wEJ.js +1 -0
- package/dist/cjs/EmbeddedWalletCreatedScreen-D5PwFHC7.js +1 -0
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-H0W0Seun.js → EmbeddedWalletKeyExportScreen-DszJVyOe.js} +2 -2
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-C4dBDzQV.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-CJQBG3tr.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DISYQBGG.js +1 -0
- package/dist/cjs/{EnrollTotp-BbePRUGX.js → EnrollTotp-DmEXJI20.js} +8 -8
- package/dist/cjs/ErrorScreen-DBufYBAT.js +4 -0
- package/dist/cjs/{FarcasterConnectStatusScreen-LPCbfVT6.js → FarcasterConnectStatusScreen-BHsQhnxe.js} +6 -6
- package/dist/cjs/FarcasterSignerStatusScreen-ClCsDFns.js +29 -0
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-DCdJwukp.js +2 -0
- package/dist/cjs/{FundWalletMethodHeader-BvRFQpAq.js → FundWalletMethodHeader-B1WvouQK.js} +1 -1
- package/dist/cjs/{FundWithBankDepositScreen-CW9fQXWW.js → FundWithBankDepositScreen-zihRVyvs.js} +4 -4
- package/dist/cjs/FundingEditAmountScreen-CLd-SUXK.js +1 -0
- package/dist/cjs/FundingMethodSelectionScreen-EKlcEwiq.js +1 -0
- package/dist/cjs/InAppBrowserLoginNotPossible-CzYTb-FD.js +1 -0
- package/dist/cjs/InstallWalletScreen-Bgkyz_sV.js +1 -0
- package/dist/cjs/LandingScreen-CfjCU0Nk.js +1 -0
- package/dist/cjs/{LinkConflictScreen-m-9_Aelz.js → LinkConflictScreen-B5l8Yj72.js} +3 -3
- package/dist/cjs/LinkEmailScreen-C8WgXvy5.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-BEr2kUd1.js → LinkPasskeyScreen-zZuixNSn.js} +4 -4
- package/dist/cjs/LinkPhoneScreen-Ce-gRgav.js +1 -0
- package/dist/cjs/LoginFailedScreen-z2hTJqor.js +1 -0
- package/dist/cjs/ManualTransferScreen-DvMhwqIJ.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-Dpg6VFt0.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-CMRoZXUS.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-ihcEpQrd.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-CilRXIV0.js +1 -0
- package/dist/cjs/{ModalHeader-GBAwOroa.js → ModalHeader-CyTOtcfZ.js} +1 -1
- package/dist/cjs/MoonpayStatusScreen-Nyj1xMTq.js +16 -0
- package/dist/cjs/OAuthStatusScreen-_TFqeHsJ.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-Dp0-Ud_g.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-C63gCtWy.js +3 -0
- package/dist/cjs/PasswordRecoveryScreen-Cwa1T4Li.js +20 -0
- package/dist/cjs/{QrCode-B3SMGhXR.js → QrCode-W7V5iJhH.js} +3 -3
- package/dist/cjs/RecoveryOAuthStatusScreen-ByS5mnB4.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-BKEPFkp5.js +1 -0
- package/dist/cjs/{RecoverySelectionScreen-DvNHxJ5j.js → RecoverySelectionScreen-D1oBvaHv.js} +2 -2
- package/dist/cjs/{Screen-Pj2ZYdHC.js → Screen-CmJw2o9A.js} +1 -1
- package/dist/cjs/{ScreenLayout-BHHlzSio.js → ScreenLayout-DNsKsPML.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-DmszLf5G.js → SetAutomaticRecoveryScreen-IX9a3eUr.js} +2 -2
- package/dist/cjs/{SetWalletPasswordForm-H4Il8ttU.js → SetWalletPasswordForm-DfEhJ79E.js} +2 -2
- package/dist/cjs/{SignRequestScreen-DynNsz8H.js → SignRequestScreen-Dqx7elGz.js} +5 -5
- package/dist/cjs/{StandardSignAndSendTransactionScreen-BPzpZJ9p.js → StandardSignAndSendTransactionScreen-BdCYw0my.js} +3 -3
- package/dist/cjs/TelegramAuthScreen-DHvtkANm.js +1 -0
- package/dist/cjs/{TransactionDetails-hXvXoX9X.js → TransactionDetails-Bkf0lmfq.js} +1 -1
- package/dist/cjs/{TransactionErrorView-BRVtuUfe.js → TransactionErrorView-Ckrj9n7Y.js} +4 -4
- package/dist/cjs/TransferFromWalletScreen-4r3KTkpp.js +31 -0
- package/dist/cjs/{TransferOrBridgeLoadingScreen-CJZ5TtOk.js → TransferOrBridgeLoadingScreen-DlJ5lthW.js} +2 -2
- package/dist/cjs/UpdateEmailScreen-qiSXBq0X.js +1 -0
- package/dist/cjs/UpdatePhoneScreen-DysY1yM-.js +1 -0
- package/dist/cjs/UserLimitReachedScreen-De0w5MuT.js +1 -0
- package/dist/cjs/{WalletInfoCard-C9sF64jD.js → WalletInfoCard-CniJMC32.js} +6 -6
- package/dist/cjs/WalletInterstitialScreen-DyxheWue.js +1 -0
- package/dist/cjs/WalletLink-Vtuq8mBK.js +22 -0
- package/dist/cjs/{WalletOverflowButton-vu5a58lx.js → WalletOverflowButton-CkK93UsZ.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{context-BUtefjlp.js → context-BVD9aHyL.js} +1 -1
- package/dist/cjs/ethers-0NnB0y-d.js +1 -0
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/{get-is-unified-wallet-DZz3zBvv.js → get-is-unified-wallet-3wKKPb8T.js} +1 -1
- package/dist/cjs/getErc20Balance-RxLpb74e.js +1 -0
- package/dist/cjs/getErc20TokenInfo-CwuidUyY.js +1 -0
- package/dist/cjs/{index-B2LlWVGv.js → index-BnLXb15t.js} +1 -1
- package/dist/cjs/index-CZcgFfXk.js +12 -0
- package/dist/cjs/index-DvDZFmbh.js +174 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{shared-36UW-DIc.js → shared-TYGDmgn8.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-CRa43-i7.js → shouldProceedtoEmbeddedWalletCreationFlow-vPg8Kr3c.js} +1 -1
- package/dist/cjs/smart-wallets-dvV25L_d.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{styles-g3kNpNZY.js → styles-CQ0az3cX.js} +4 -4
- package/dist/cjs/{to-ui-error-DaZr6PqV.js → to-ui-error-Csc1sILU.js} +2 -2
- package/dist/cjs/ui.js +9 -9
- package/dist/cjs/{use-export-wallet-Bln7maDs.js → use-export-wallet-CqCBNS7w.js} +1 -1
- package/dist/cjs/use-export-wallet-D-c4_YuN.js +1 -0
- package/dist/cjs/useActiveWallet-DiVVvDrc.js +185 -0
- package/dist/cjs/{useGetTokenPrice-62KL9-pY.js → useGetTokenPrice--7EaVoh2.js} +1 -1
- package/dist/cjs/{useI18n-CAzGX3fh.js → useI18n-BCObhUAf.js} +1 -1
- package/dist/cjs/usePrivy-C8r8d5n6.js +1 -0
- package/dist/cjs/{useSolanaRpcClient-CT_ce08U.js → useSolanaRpcClient-B5PLFTBV.js} +1 -1
- package/dist/cjs/useWalletBalance-B2tDjYdh.js +1 -0
- package/dist/cjs/useWallets-CYbllwnl.js +1 -0
- package/dist/cjs/{useWallets-7pxglx6q.js → useWallets-Ngfy6BRk.js} +1 -1
- package/dist/dts/{events-context-DpeYfJb8.d.mts → events-context-DJ7XN_9I.d.mts} +1 -1
- package/dist/dts/{events-context-DpeYfJb8.d.ts → events-context-DJ7XN_9I.d.ts} +1 -1
- package/dist/dts/extended-chains.d.mts +1 -1
- package/dist/dts/extended-chains.d.ts +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +10 -4
- package/dist/dts/index.d.ts +10 -4
- package/dist/dts/internal.d.mts +1 -1
- package/dist/dts/internal.d.ts +1 -1
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +3 -3
- package/dist/dts/solana.d.ts +3 -3
- package/dist/dts/{types-YrdexZMd.d.mts → types-CrwMc83t.d.mts} +10 -0
- package/dist/dts/{types-YrdexZMd.d.ts → types-CrwMc83t.d.ts} +10 -0
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/AccountNotFoundScreen-DxCW4sYL.mjs +1 -0
- package/dist/esm/Address-gS9RaH_3.mjs +17 -0
- package/dist/esm/AffirmativeConsentScreen-BfAJLkHs.mjs +6 -0
- package/dist/esm/AllowlistRejectionScreen-CfIwm_KR.mjs +1 -0
- package/dist/esm/AuthenticateWithWalletScreen-CGMkVkqN.mjs +1 -0
- package/dist/esm/AwaitingEvmToSolBridgingScreen-BEhpNQue.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-DXabkUmb.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-C8_6Jmdn.mjs +103 -0
- package/dist/esm/AwaitingSolToEvmBridgingScreen-DDeK6Ay4.mjs +2 -0
- package/dist/esm/BridgeNetworkSelectionView-BEkgkdcj.mjs +69 -0
- package/dist/esm/CaptchaScreen-AiG4L_WL.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-B2Pe4vVR.mjs +16 -0
- package/dist/esm/ConnectEmailForm-xRPNNO6z.mjs +3 -0
- package/dist/esm/ConnectLedgerScreen-Op6Fai6R.mjs +9 -0
- package/dist/esm/ConnectOnlyLandingScreen-bnn4qrHH.mjs +1 -0
- package/dist/esm/ConnectOnlyStatusScreen-lSx84lvG.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-CLmEnt_8.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-DTZTENXQ.mjs → ConnectPhoneForm-CyET5ztr.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-DMLO1g28.mjs → ConnectWalletView-C7q7CJzF.mjs} +4 -4
- package/dist/esm/ConnectionStatusScreen-Day5J0Vy.mjs +7 -0
- package/dist/esm/CrossAppAuthScreen-CGctDoIE.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-JGe-GePA.mjs → CustomLandingScreenView-DDjvsORu.mjs} +6 -6
- package/dist/esm/DelegatedActionsConsentScreen-CziDKoEO.mjs +1 -0
- package/dist/esm/DelegatedActionsRevokeScreen-CGCYIB8S.mjs +1 -0
- package/dist/esm/EmbeddedWalletConnectingScreen-D5POWVph.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-CBFugH74.mjs +1 -0
- package/dist/esm/{EmbeddedWalletKeyExportScreen-DdviAcYq.mjs → EmbeddedWalletKeyExportScreen-DvPo1Dqc.mjs} +3 -3
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-CiVZK25P.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-CK7LxxHa.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-Cqi_wMos.mjs +1 -0
- package/dist/esm/{EnrollTotp-COmXYzq5.mjs → EnrollTotp-KgOCncuG.mjs} +5 -5
- package/dist/esm/ErrorScreen-oC2GYZyz.mjs +4 -0
- package/dist/esm/{FarcasterConnectStatusScreen-BB7egF78.mjs → FarcasterConnectStatusScreen-BhZ_ibkr.mjs} +8 -8
- package/dist/esm/FarcasterSignerStatusScreen-LgZqqLIg.mjs +28 -0
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-Bpbr58Rk.mjs +1 -0
- package/dist/esm/{FundWalletMethodHeader-DRH4o4R5.mjs → FundWalletMethodHeader-Cj0ejXEe.mjs} +1 -1
- package/dist/esm/{FundWithBankDepositScreen-wFJhtxMV.mjs → FundWithBankDepositScreen-D_Bvn9z-.mjs} +12 -12
- package/dist/esm/FundingEditAmountScreen-DHMuyuSU.mjs +1 -0
- package/dist/esm/FundingMethodSelectionScreen-ClAs5ybE.mjs +1 -0
- package/dist/esm/InAppBrowserLoginNotPossible-BTJOkFD8.mjs +1 -0
- package/dist/esm/InstallWalletScreen-MMyGad_h.mjs +1 -0
- package/dist/esm/LandingScreen-5Oa-RLB-.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-CSZu5Mc7.mjs → LinkConflictScreen-CRUt3M0v.mjs} +3 -3
- package/dist/esm/LinkEmailScreen-BODpl3zv.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-BfLq2-Q5.mjs → LinkPasskeyScreen-C8-qPCc0.mjs} +8 -8
- package/dist/esm/LinkPhoneScreen-BLeNeU6s.mjs +1 -0
- package/dist/esm/LoginFailedScreen-Db6M5P_W.mjs +1 -0
- package/dist/esm/ManualTransferScreen-B1K2GVns.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-FPJhtPEX.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-CWaZHYk3.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-BNsNSjMO.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-BiL-DDiE.mjs +1 -0
- package/dist/esm/{ModalHeader-JjfRejxC.mjs → ModalHeader-BO0_ew01.mjs} +6 -6
- package/dist/esm/MoonpayStatusScreen-CYJ55uJj.mjs +16 -0
- package/dist/esm/OAuthStatusScreen-CdyVmpfT.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-DknmFq5C.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-OJ7pdD7_.mjs +3 -0
- package/dist/esm/PasswordRecoveryScreen-B1gO8QHk.mjs +20 -0
- package/dist/esm/{QrCode-VCBMkqqq.mjs → QrCode-CkFpOhWR.mjs} +3 -3
- package/dist/esm/RecoveryOAuthStatusScreen-B-DJ0UpW.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-D4xjd6G2.mjs +1 -0
- package/dist/esm/{RecoverySelectionScreen-DfHkr07F.mjs → RecoverySelectionScreen-OaYDY3s0.mjs} +2 -2
- package/dist/esm/{Screen-DE3ldE_X.mjs → Screen-DEU9RkqZ.mjs} +3 -3
- package/dist/esm/{ScreenLayout-Ca6ml9wY.mjs → ScreenLayout-CBKj6lhP.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-Ol789UQM.mjs → SetAutomaticRecoveryScreen-CeCoPMb9.mjs} +2 -2
- package/dist/esm/{SetWalletPasswordForm-C2hZtfwu.mjs → SetWalletPasswordForm-DasvIAaE.mjs} +4 -4
- package/dist/esm/SignRequestScreen-DvMVqqRy.mjs +26 -0
- package/dist/esm/{StandardSignAndSendTransactionScreen-C8nW4u5b.mjs → StandardSignAndSendTransactionScreen-P41dVhUg.mjs} +3 -3
- package/dist/esm/TelegramAuthScreen-DDi3bZj8.mjs +1 -0
- package/dist/esm/{TransactionDetails-DkPozym_.mjs → TransactionDetails-TElXTRgE.mjs} +4 -4
- package/dist/esm/{TransactionErrorView-f1bQRoCZ.mjs → TransactionErrorView-nAvkCFbn.mjs} +7 -7
- package/dist/esm/{TransferFromWalletScreen-B8AzQgyG.mjs → TransferFromWalletScreen-DJHQToqB.mjs} +4 -4
- package/dist/esm/{TransferOrBridgeLoadingScreen-BKmOAmlN.mjs → TransferOrBridgeLoadingScreen-DfjuIpgw.mjs} +1 -1
- package/dist/esm/UpdateEmailScreen-BYYYeIGc.mjs +1 -0
- package/dist/esm/UpdatePhoneScreen-BK-lEzDy.mjs +1 -0
- package/dist/esm/UserLimitReachedScreen-DJ6LECFo.mjs +1 -0
- package/dist/esm/{WalletInfoCard-CuZCmvHw.mjs → WalletInfoCard-CvaU9hsg.mjs} +1 -1
- package/dist/esm/WalletInterstitialScreen-BBcEvRlE.mjs +1 -0
- package/dist/esm/{WalletLink-B12jNftF.mjs → WalletLink-CGTEPUiO.mjs} +5 -5
- package/dist/esm/{WalletOverflowButton-DJthXlpc.mjs → WalletOverflowButton-CYYzAWaD.mjs} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-CE35zxmH.mjs +1 -0
- package/dist/esm/ethers-BQABFn4K.mjs +1 -0
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/{get-is-unified-wallet-CMioBd5c.mjs → get-is-unified-wallet-Dy3_T-CK.mjs} +1 -1
- package/dist/esm/getErc20Balance-DsDepObC.mjs +1 -0
- package/dist/esm/{getErc20TokenInfo-1Q6w1Ibq.mjs → getErc20TokenInfo-CwIeNSfD.mjs} +1 -1
- package/dist/esm/{index-BAAWn9Kv.mjs → index-B5IXvf6Q.mjs} +3 -3
- package/dist/esm/{index-BpieExSM.mjs → index-BgDuUMhM.mjs} +1 -1
- package/dist/esm/index-CvRB3i5Y.mjs +174 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{shared-BcHk2XA3.mjs → shared-BU9j9DNx.mjs} +1 -1
- package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BsPl2jCD.mjs → shouldProceedtoEmbeddedWalletCreationFlow-ifSse9fH.mjs} +1 -1
- package/dist/esm/smart-wallets-BfMsOCbS.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{styles-Dr0J8BuN.mjs → styles-rdvIOTsj.mjs} +15 -15
- package/dist/esm/to-ui-error-D6Ur9EPb.mjs +4 -0
- package/dist/esm/ui.mjs +36 -36
- package/dist/esm/{use-export-wallet-CquCci1U.mjs → use-export-wallet-C8egaVlY.mjs} +1 -1
- package/dist/esm/use-export-wallet-CEsGQUX-.mjs +1 -0
- package/dist/esm/useActiveWallet-C-m0Q1tx.mjs +185 -0
- package/dist/esm/useGetTokenPrice-BPzXHAOr.mjs +1 -0
- package/dist/esm/{useI18n-BdIAB9oU.mjs → useI18n-D15_QND3.mjs} +1 -1
- package/dist/esm/usePrivy-BbA3ewrr.mjs +1 -0
- package/dist/esm/{useSolanaRpcClient-ign2YXAl.mjs → useSolanaRpcClient-BAT_UrqZ.mjs} +1 -1
- package/dist/esm/useWalletBalance-CCxr6ymL.mjs +1 -0
- package/dist/esm/{useWallets-DFA-9f9j.mjs → useWallets-C1MMwBpM.mjs} +1 -1
- package/dist/esm/useWallets-Ca4W6aLm.mjs +1 -0
- package/package.json +6 -6
- package/dist/cjs/AccountNotFoundScreen-tDR43oHW.js +0 -1
- package/dist/cjs/AffirmativeConsentScreen-BRBNsOWi.js +0 -6
- package/dist/cjs/AllowlistRejectionScreen-BHoYCH0v.js +0 -1
- package/dist/cjs/AuthenticateWithWalletScreen-CEggKX3g.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-BoYhV9tQ.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-Cz2k5mXb.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-l9n3fNao.js +0 -103
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-yuSZrlo8.js +0 -2
- package/dist/cjs/CaptchaScreen-BndC7zXe.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-BmZ1Zvaw.js +0 -16
- package/dist/cjs/ConnectEmailForm-Gz3TJQaS.js +0 -3
- package/dist/cjs/ConnectLedgerScreen-CTd4ew1b.js +0 -9
- package/dist/cjs/ConnectOnlyLandingScreen-BTm5z22a.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-JtIOf9tK.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-b6jwd3G9.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-BlaYqHPV.js +0 -7
- package/dist/cjs/CrossAppAuthScreen-CLdpzOoL.js +0 -1
- package/dist/cjs/CustomLandingScreenView-C7uyw9AS.js +0 -23
- package/dist/cjs/DelegatedActionsConsentScreen-C66Qamby.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-WnC6Ml_O.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-Lf8XU72H.js +0 -1
- package/dist/cjs/EmbeddedWalletCreatedScreen-DQjc2aO5.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-Cl21QlpI.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DyznRBRm.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-BzIflp1Z.js +0 -1
- package/dist/cjs/ErrorScreen-CkOQuqz_.js +0 -4
- package/dist/cjs/FarcasterSignerStatusScreen-BepAag3F.js +0 -29
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-G5WWMpKM.js +0 -2
- package/dist/cjs/FundingEditAmountScreen-CVPt0UFO.js +0 -1
- package/dist/cjs/FundingMethodSelectionScreen-Bfs4t9ic.js +0 -1
- package/dist/cjs/InAppBrowserLoginNotPossible-AwBNR0cT.js +0 -1
- package/dist/cjs/InstallWalletScreen-B6Hbb2zf.js +0 -1
- package/dist/cjs/LandingScreen-B1FOnI7l.js +0 -1
- package/dist/cjs/LinkEmailScreen-Cbrn-OnF.js +0 -1
- package/dist/cjs/LinkPhoneScreen-jLla569a.js +0 -1
- package/dist/cjs/LoginFailedScreen-DbW_n3Ud.js +0 -1
- package/dist/cjs/ManualTransferScreen-DcMiPTb7.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-CVROFlbO.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-CzvKJxko.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-BC4nUEqe.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-BEIBzXix.js +0 -1
- package/dist/cjs/MoonpayStatusScreen-DTHwGL_G.js +0 -16
- package/dist/cjs/OAuthStatusScreen-1ErCNKnQ.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-DajoZ9ZQ.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-CbNToK-f.js +0 -3
- package/dist/cjs/PasswordRecoveryScreen-HSt33MHO.js +0 -20
- package/dist/cjs/RecoveryOAuthStatusScreen-C9roBryy.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-D1zbL15z.js +0 -1
- package/dist/cjs/TelegramAuthScreen-DxF54ZK7.js +0 -1
- package/dist/cjs/TransferFromWalletScreen-B1iYTL4A.js +0 -31
- package/dist/cjs/UpdateEmailScreen-Ci24R0Wi.js +0 -1
- package/dist/cjs/UpdatePhoneScreen-C5s7Q1Uq.js +0 -1
- package/dist/cjs/UserLimitReachedScreen-DSozFkdB.js +0 -1
- package/dist/cjs/WalletInterstitialScreen-D2r6qjUr.js +0 -1
- package/dist/cjs/WalletLink-BHFIodVQ.js +0 -22
- package/dist/cjs/ethers-CjXeDhFm.js +0 -1
- package/dist/cjs/getErc20Balance-D2jXMvJ8.js +0 -1
- package/dist/cjs/getErc20TokenInfo-DxDd_HN6.js +0 -1
- package/dist/cjs/getPublicClient-BsmZyCGX.js +0 -1
- package/dist/cjs/index-BioFA041.js +0 -12
- package/dist/cjs/index-tQ5GebzM.js +0 -174
- package/dist/cjs/smart-wallets-DL8bKJhE.js +0 -1
- package/dist/cjs/use-export-wallet-BIBOLyrr.js +0 -1
- package/dist/cjs/useActiveWallet-CbC_e7T4.js +0 -185
- package/dist/cjs/usePrivy-Dl1Nx5y2.js +0 -1
- package/dist/cjs/useWalletBalance-DI8AY31i.js +0 -1
- package/dist/cjs/useWallets-CGZli1jq.js +0 -1
- package/dist/esm/AccountNotFoundScreen-CeH1-Vk6.mjs +0 -1
- package/dist/esm/Address-D-q_5it9.mjs +0 -17
- package/dist/esm/AffirmativeConsentScreen-CXITm_N9.mjs +0 -6
- package/dist/esm/AllowlistRejectionScreen-lgFXWCYE.mjs +0 -1
- package/dist/esm/AuthenticateWithWalletScreen-m06-fuCA.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-CckTG9KA.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-eF2GWu8M.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-BOBPSamI.mjs +0 -103
- package/dist/esm/AwaitingSolToEvmBridgingScreen-P3cpg0C5.mjs +0 -2
- package/dist/esm/BridgeNetworkSelectionView-C74EH50n.mjs +0 -69
- package/dist/esm/CaptchaScreen-B3Ykiq24.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-w23Wg5d9.mjs +0 -16
- package/dist/esm/ConnectEmailForm-DQUiQNyc.mjs +0 -3
- package/dist/esm/ConnectLedgerScreen-CeefF4eo.mjs +0 -9
- package/dist/esm/ConnectOnlyLandingScreen-DsUmsQqW.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-BWSDA11j.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-2uZYB3jh.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-DC1viuqC.mjs +0 -7
- package/dist/esm/CrossAppAuthScreen-BBpfShQF.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-BcanXrk2.mjs +0 -1
- package/dist/esm/DelegatedActionsRevokeScreen-CEToWbrk.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-CTdp8K5o.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-BEBjX0Mt.mjs +0 -1
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-eKriq-Nq.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-BAlUIAfz.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-DX_WQZdd.mjs +0 -1
- package/dist/esm/ErrorScreen-V8ec2dKP.mjs +0 -4
- package/dist/esm/FarcasterSignerStatusScreen-DE_ssKid.mjs +0 -28
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-DAhHczol.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-kwQjuyb9.mjs +0 -1
- package/dist/esm/FundingMethodSelectionScreen-CbxUWw1v.mjs +0 -1
- package/dist/esm/InAppBrowserLoginNotPossible-BR9y7vrg.mjs +0 -1
- package/dist/esm/InstallWalletScreen-DkaJ2iZK.mjs +0 -1
- package/dist/esm/LandingScreen-BtCc-4_K.mjs +0 -1
- package/dist/esm/LinkEmailScreen-CMX1b5QU.mjs +0 -1
- package/dist/esm/LinkPhoneScreen-CGYAeavW.mjs +0 -1
- package/dist/esm/LoginFailedScreen-DpfFaY7V.mjs +0 -1
- package/dist/esm/ManualTransferScreen-D3CPPofR.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-YWkK-71P.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-BIGip6ll.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-XrdyfmmI.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-2H1EX_qQ.mjs +0 -1
- package/dist/esm/MoonpayStatusScreen-CqsI_vjN.mjs +0 -16
- package/dist/esm/OAuthStatusScreen-DB8OcP_K.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-DCaGA7kA.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-5cLO3m8F.mjs +0 -3
- package/dist/esm/PasswordRecoveryScreen-Bfqx2sWJ.mjs +0 -20
- package/dist/esm/RecoveryOAuthStatusScreen-CScuB-aG.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-BRb1syw7.mjs +0 -1
- package/dist/esm/SignRequestScreen-CUMcsLye.mjs +0 -26
- package/dist/esm/TelegramAuthScreen-jb192MAl.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-deteEdyS.mjs +0 -1
- package/dist/esm/UpdatePhoneScreen-D3RSZlDk.mjs +0 -1
- package/dist/esm/UserLimitReachedScreen-QT4sbDev.mjs +0 -1
- package/dist/esm/WalletInterstitialScreen-DPTs9K3X.mjs +0 -1
- package/dist/esm/context-CcPjcQxY.mjs +0 -1
- package/dist/esm/ethers-VWEScvge.mjs +0 -1
- package/dist/esm/getErc20Balance-DA4dGV9O.mjs +0 -1
- package/dist/esm/getPublicClient-B4uPLKn-.mjs +0 -1
- package/dist/esm/index-DMvly1BH.mjs +0 -174
- package/dist/esm/smart-wallets-C245MBMI.mjs +0 -1
- package/dist/esm/to-ui-error-CmP4i4IC.mjs +0 -4
- package/dist/esm/use-export-wallet-BzM2a8Is.mjs +0 -1
- package/dist/esm/useActiveWallet-CHY4WQdQ.mjs +0 -185
- package/dist/esm/useGetTokenPrice-PWP-Uiot.mjs +0 -1
- package/dist/esm/usePrivy-DK1coOrO.mjs +0 -1
- package/dist/esm/useWalletBalance-CDyi5_iR.mjs +0 -1
- package/dist/esm/useWallets-rvM1mjSi.mjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-
|
|
2
|
-
/*#__PURE__*/o($,{"aria-hidden":!v||
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-CE35zxmH.mjs";import{a as s}from"./get-is-unified-wallet-Dy3_T-CK.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as u,c as p}from"./Layouts-BlFm53ED.mjs";import{M as m,B as g,S as y,P as v}from"./ModalHeader-BO0_ew01.mjs";import{E as f,b as w,P as b,a as k,I as C,H as S,S as x,c as $,N as B,D as R,d as P,R as A,e as I,f as j,g as L}from"./shared-BU9j9DNx.mjs";import{styled as E}from"styled-components";import{C as T}from"./Checkbox-BhNoOKjX.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import D from"@heroicons/react/24/solid/CheckCircleIcon";import H from"fast-password-entropy";import*as U from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import K from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import O from"@heroicons/react/24/outline/DocumentDuplicateIcon";import N from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-CHmc4-Lu.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[p,y]=n(!0),[v,R]=n(!1),[P,A]=n(""),I=l===P;return i((()=>{P&&!v&&R(!0)}),[P]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(b,{children:[/*#__PURE__*/o(k,{value:P,onChange:e=>A(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>R(!0),placeholder:"confirm your password",type:p?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(C,{style:{right:"0.75rem"},children:p?/*#__PURE__*/o(S,{onClick:()=>y(!1)}):/*#__PURE__*/o(x,{onClick:()=>y(!0)})})]}),
|
|
2
|
+
/*#__PURE__*/o($,{"aria-hidden":!v||I,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/o(B,{onClick:c,loading:a,disabled:!I,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]})},Z=({buttonHideAnimations:i,buttonLoading:t,onSubmit:a,onBack:l,config:c})=>{let[s,p]=n(!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:l}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/o(R,{children:/*#__PURE__*/e(P,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),p((e=>!e))},children:[/*#__PURE__*/o(T,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/o(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(_,{children:["user"===c.initiatedBy&&/*#__PURE__*/o(y,{onClick:c.onCancel,disabled:t,children:"Cancel"}),/*#__PURE__*/o(B,{onClick:a,loading:t,$hideAnimations:i,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]})};let _=E.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
gap: 10px;
|
|
5
|
-
`,q=/[a-z]/,G=/[A-Z]/,X=/[0-9]/,J="!@#$%^&*()\\-_+.",Q=`a-zA-Z0-9${J}`,V=RegExp(`[${J}]`),ee=RegExp(`[${Q}]`);const re=RegExp(`^[${Q}]{6,}$`),oe=()=>
|
|
5
|
+
`,q=/[a-z]/,G=/[A-Z]/,X=/[0-9]/,J="!@#$%^&*()\\-_+.",Q=`a-zA-Z0-9${J}`,V=RegExp(`[${J}]`),ee=RegExp(`[${Q}]`);const re=RegExp(`^[${Q}]{6,}$`),oe=()=>U.generatePassphrase(4,F);function ne(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function ie(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return q.test(e)&&(r+=1),G.test(e)&&(r+=1),X.test(e)&&(r+=1),V.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+H(e)/95)/2}const te=({buttonHideAnimations:a,buttonLoading:l,password:c="",config:s,isResettingPassword:d,onSubmit:p,onClose:y,onBack:v,onPasswordChange:j,onPasswordGenerate:L})=>{let[E,T]=n(!1),[H,U]=n(!1);i((()=>{c&&!H&&U(!0)}),[c]);let F=t((()=>H?6>(c?.length||0)?"Password must be at least 6 characters":re.test(c||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ee.test(e))).map((e=>e.replace(" ","SPACE"))))])(c).join(" ")} )`:null),[c,H]),M=t((()=>F?{value:0,label:"Weak"}:function(e=""){let r=ie(e);return{value:r,label:ne(r)}}(c)),[c,F]),K=t((()=>!c?.length||!!F),[F,c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{onClose:y,closeable:"user"===s.initiatedBy,backFn:v}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e("h3",{style:{color:"var(--privy-color-foreground)"},children:[d?"Reset":"Set"," your password"]}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e(b,{children:[/*#__PURE__*/o(k,{value:c,onChange:e=>j(e.target.value),onKeyUp:e=>{"Enter"===e.key&&p()},placeholder:"enter or generate a strong password",type:E?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e(C,{style:{width:"3.5rem"},children:[E?/*#__PURE__*/o(S,{onClick:()=>T(!1)}):/*#__PURE__*/o(x,{onClick:()=>T(!0)}),/*#__PURE__*/o(A,{onClick:L})]})]}),/*#__PURE__*/o(I,{value:0===M.value?.01:M.value,label:M.label}),/*#__PURE__*/o($,{error:!!F,children:F||`Password Strength: ${H?M.label:"--"}`}),/*#__PURE__*/e(le,{children:[/*#__PURE__*/o(ae,{children:/*#__PURE__*/e(R,{children:[/*#__PURE__*/e(P,{children:[/*#__PURE__*/o(D,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e(P,{children:[/*#__PURE__*/o(D,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/o(B,{onClick:p,loading:l,disabled:K,$hideAnimations:a,children:"Continue"})]})]}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]})};let ae=E(R)`
|
|
6
6
|
flex: 1;
|
|
7
7
|
padding-top: 1rem;
|
|
8
8
|
`,le=E.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
height: 100%;
|
|
12
|
-
`;const ce=({buttonHideAnimations:i,buttonLoading:t,appName:l,password:c,onSubmit:s,onBack:p})=>{let[y,v]=n(!1),[k,$]=n(!0),R=a((()=>{v(!0),c&&navigator.clipboard.writeText(c)}),[c]),P=a((()=>{let e=document.createElement("a"),r=l.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),o=new Blob([se(l,c)],{type:"text/plain"}),n=URL.createObjectURL(o);e.href=n,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{backFn:p,closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(b,{centered:!0,children:[/*#__PURE__*/o(
|
|
12
|
+
`;const ce=({buttonHideAnimations:i,buttonLoading:t,appName:l,password:c,onSubmit:s,onBack:p})=>{let[y,v]=n(!1),[k,$]=n(!0),R=a((()=>{v(!0),c&&navigator.clipboard.writeText(c)}),[c]),P=a((()=>{let e=document.createElement("a"),r=l.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),o=new Blob([se(l,c)],{type:"text/plain"}),n=URL.createObjectURL(o);e.href=n,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{backFn:p,closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(b,{centered:!0,children:[/*#__PURE__*/o(j,{children:k?"•".repeat(c.length):c}),/*#__PURE__*/o(C,{style:{right:"0.75rem"},children:k?/*#__PURE__*/o(S,{onClick:()=>$(!1)}):/*#__PURE__*/o(x,{onClick:()=>$(!0)})})]}),/*#__PURE__*/e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/o(L,{onClick:R,children:/*#__PURE__*/e(r,y?{children:[/*#__PURE__*/o(K,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[/*#__PURE__*/o(O,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e(L,{onClick:P,children:[/*#__PURE__*/o(M,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/o(B,{onClick:s,loading:t,$hideAnimations:i,children:"Continue"}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]})};let se=(e,r)=>`Your wallet recovery password for ${e} is\n\n${r}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const de=({error:n,onClose:i})=>/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(p,n?{children:[/*#__PURE__*/o(N,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Something went wrong",description:n})]}:{children:[/*#__PURE__*/o(D,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Success"})]}),/*#__PURE__*/o(v,{onClick:i,children:"Close"}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]});let he=(e,r)=>{switch(e){case"creating":return"back"===r?e:"saving";case"saving":return"back"===r?"creating":"confirming";case"confirming":return"back"===r?"saving":"finalizing";case"finalizing":return"back"===r?"confirming":"done";default:return e}};const ue=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:t}=s(),{send:d,state:h}=(()=>{let[e,r]=l(he,"creating");return{send:r,state:e}})(),u=a((async()=>{"finalizing"===h&&await e(),d("next")}),[h,d,e]);i((()=>{let e;return"done"===h&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),c)),()=>{e&&clearTimeout(e)}}),[h,r.config.initiatedBy,r.onClose]);let p=a((()=>{d("back")}),[d]),m=a((()=>{t("RecoverySelectionScreen")}),[n,t]);return"creating"===h?/*#__PURE__*/o(te,{...r,onSubmit:u,onBack:"RecoverySelectionScreen"===n?m:void 0}):"saving"===h?/*#__PURE__*/o(ce,{...r,onSubmit:u,onBack:p}):"confirming"===h?/*#__PURE__*/o(Y,{...r,onSubmit:u,onBack:p}):"finalizing"===h?/*#__PURE__*/o(Z,{...r,onSubmit:u,onBack:p}):"done"===h?/*#__PURE__*/o(de,{...r,onSubmit:u}):null};export{ue as S,oe as g};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as r}from"@scure/base";import{Edit as i}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DSTf_eKU.mjs";import{a as d}from"./Layouts-BlFm53ED.mjs";import{M as u,D as g}from"./JsonTree-aPaJmPx7.mjs";import{P as h,G as y}from"./use-export-wallet-CEsGQUX-.mjs";import{W as f,q as x}from"./context-CE35zxmH.mjs";import{u as C}from"./internal-context-Z-fyxadS.mjs";import{u as w,a as v}from"./get-is-unified-wallet-Dy3_T-CK.mjs";import{S as T}from"./ScreenLayout-CBKj6lhP.mjs";import"./useWallets-Ca4W6aLm.mjs";import"eventemitter3";import"viem/utils";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-BO0_ew01.mjs";import"./useActiveWallet-C-m0Q1tx.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";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"./Screen-DEU9RkqZ.mjs";import"./index-Dq_xe9dz.mjs";const b=s.img`
|
|
2
|
+
&& {
|
|
3
|
+
height: ${e=>"sm"===e.size?"65px":"140px"};
|
|
4
|
+
width: ${e=>"sm"===e.size?"65px":"140px"};
|
|
5
|
+
border-radius: 16px;
|
|
6
|
+
margin-bottom: 12px;
|
|
7
|
+
}
|
|
8
|
+
`;let j=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},E=e=>{try{let t=r.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},S=r=>{let{types:i,primaryType:n,...a}=r.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(A,{data:a}),/*#__PURE__*/e(p,{text:(s=r.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const R=({method:o,messageData:r,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:h})=>/*#__PURE__*/e(T,{title:n.title,subtitle:n.description,showClose:!0,onClose:h,icon:i,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(L,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(b,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(D,{children:["personal_sign"===o&&/*#__PURE__*/e(U,{children:j(r)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(S,{typedData:r}),"solana_signMessage"===o&&/*#__PURE__*/e(U,{children:E(r)})]})]})}),_={component:()=>{let{authenticated:t}=w(),{initializeWalletProxy:o,closePrivyModal:r}=C(),{navigate:i,data:s,onUserCloseViaDialogOrKeybindRef:l}=v(),[c,p]=n(!0),[d,u]=n(""),[g,T]=n(),[b,j]=n(null),[E,S]=n(!1);a((()=>{t||i("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),T(new h(new y(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:_,data:D,confirmAndSign:L,onSuccess:A,onFailure:U,uiOptions:M}=s.signMessage,I={title:M?.title||"Sign message",description:M?.description||"Signing this message will not cost you any fees.",buttonText:M?.buttonText||"Sign and continue"},k=e=>{e?A(e):U(g||new h(new y("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{j(null),u(""),T(void 0)}),200)};l.current=()=>{k(b)};/*#__PURE__*/return e(R,{method:_,messageData:D,copy:I,iconUrl:M?.iconUrl&&"string"==typeof M.iconUrl?M.iconUrl:void 0,isLoading:E,success:null!==b,walletProxyIsLoading:c,errorMessage:d,isCancellable:M?.isCancellable,onSign:async()=>{S(!0),u("");try{let e=await L();j(e),S(!1),setTimeout((()=>{k(e)}),x)}catch(e){console.error(e),u("An error has occurred, please try again."),T(new h(new y(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),S(!1)}},onCancel:()=>k(null),onClose:()=>k(b)})}};let D=s.div`
|
|
9
|
+
flex: 1;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 16px;
|
|
13
|
+
`,L=s.p`
|
|
14
|
+
&& {
|
|
15
|
+
margin: 0;
|
|
16
|
+
width: 100%;
|
|
17
|
+
text-align: center;
|
|
18
|
+
color: var(--privy-color-error-dark);
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
line-height: 22px;
|
|
21
|
+
}
|
|
22
|
+
`,A=s(g)`
|
|
23
|
+
margin-top: 0;
|
|
24
|
+
`,U=s(u)`
|
|
25
|
+
margin-top: 0;
|
|
26
|
+
`;export{_ as SignRequestScreen,R as SignRequestView,_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,
|
|
1
|
+
import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,f as l,g as d}from"./get-is-unified-wallet-Dy3_T-CK.mjs";import{u}from"./context-CE35zxmH.mjs";import{u as m}from"./internal-context-Z-fyxadS.mjs";import{u as p}from"./useGetSolPrice-DwwjjGbd.mjs";import{ErrorScreenView as f}from"./ErrorScreen-oC2GYZyz.mjs";import g from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as h}from"styled-components";import{M as y,B as w,P as k}from"./ModalHeader-BO0_ew01.mjs";import{R as v}from"./Layouts-BlFm53ED.mjs";import{C as b}from"./ScreenHeader-CHmc4-Lu.mjs";import{a as A,R as I}from"./Row-C9vrS4Zi.mjs";import{L as S,V as j}from"./Value-tcJV9e0L.mjs";import{S as C,W as T}from"./WalletLink-CGTEPUiO.mjs";import{e as O}from"./StackedContainer-B2vaEl56.mjs";import{G as x}from"./useActiveWallet-C-m0Q1tx.mjs";import{T as $,a as L}from"./TransactionErrorView-nAvkCFbn.mjs";import{g as E}from"./transaction-CnfuREWo.mjs";import{pipe as _,getCompiledTransactionMessageDecoder as F,decompileTransactionMessage as P,setTransactionMessageLifetimeUsingBlockhash as B,compileTransaction as W,getTransactionEncoder as J,getBase58Decoder as M,fetchAddressesForLookupTables as R}from"@solana/kit";import{a as D,f as q,s as U,b as V,u as H}from"./useSolanaRpcClient-BAT_UrqZ.mjs";import{D as z,T as G,a as K,S as Q,A as X,R as Y,J as N,g as Z}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"@privy-io/are-addresses-equal";import"tinycolor2";import"ofetch";import"lucide-react";import"./index-CvRB3i5Y.mjs";import"uuid";import"jose";import"eventemitter3";import"./useWallets-Ca4W6aLm.mjs";import"viem";import"./use-export-wallet-CEsGQUX-.mjs";import"viem/utils";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BbA3ewrr.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./reservoir-0wfhnc0j.mjs";import"./ScreenLayout-CBKj6lhP.mjs";import"./Screen-DEU9RkqZ.mjs";import"./index-Dq_xe9dz.mjs";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"./LoadingSkeleton-U6-3yFwI.mjs";import"./ethers-BQABFn4K.mjs";import"@heroicons/react/24/outline";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./Address-gS9RaH_3.mjs";import"./WalletInfoCard-CvaU9hsg.mjs";import"./shared-FM0rljBt.mjs";import"./Checkbox-BhNoOKjX.mjs";import"./ErrorBanner-CQERa7bL.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-c8L53pJ2.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";const tt=h.span`
|
|
2
2
|
&& {
|
|
3
3
|
width: 82px;
|
|
4
4
|
height: 82px;
|
|
@@ -10,11 +10,11 @@ import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState
|
|
|
10
10
|
display: inline-block;
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
}
|
|
13
|
-
`,nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(A,{children:[r?.action&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(y,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(
|
|
13
|
+
`,nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(A,{children:[r?.action&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(y,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(b,{title:o??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n(nt,{solPrice:c,instruction:d,fees:a,transactionInfo:s,chain:u}),/*#__PURE__*/n(x,{}),/*#__PURE__*/n(at,{loading:!1,onClick:r,children:"Close"}),/*#__PURE__*/n(v,{}),/*#__PURE__*/n(w,{})]});let at=h(k)`
|
|
14
14
|
&& {
|
|
15
15
|
margin-top: 24px;
|
|
16
16
|
}
|
|
17
17
|
transition:
|
|
18
18
|
color 350ms ease,
|
|
19
19
|
background-color 350ms ease;
|
|
20
|
-
`;async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=_().decode(D(t)),o=r.staticAccounts[0]??"",i=await M({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await q(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==G&&a!==X)if(a!==Y){if(a===K){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(N.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(Q.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=H(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:Y,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:Y,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:Y,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:Y,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:b}=m(),v=u(),{user:A}=c(),I=V()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[q,M]=a({value:0n,isLoading:!1}),[U,H]=a(!1),[z,G]=a({}),[X,Y]=a(),K=t?.standardSignAndSendTransaction?.account,N=!!t?.standardSignAndSendTransaction?.signOnly,Q=K?.imported?l(A).find((t=>t.address===K.address)):d(A),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:b}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(q.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,K?.address,q]),rt=r((()=>{let t;if(!C||!b||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}K?.address===C.spender&&(t=n(C.fee));let e=n(q.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,K?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,b,tt,nt,K?.address,q]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:I,privyClient:y,checkFunds:!N});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,I,y,N]),o((()=>{(async function(){if(!K)return;M({value:q.value,isLoading:!0});let{value:t}=await I.rpc.getBalance(K.address,{commitment:"confirmed"}).send();M({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!K){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:v.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(X??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:I.chain,signOnly:N,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return X?/*#__PURE__*/n($,{transactionError:X,chainId:I.chain,onClose:ot,chainType:"solana",onRetry:async()=>{Y(void 0);let{value:t}=await I.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,P(_().decode(D(n)),(t=>F(t)),(t=>W(e,t)),(t=>B(t)),(t=>new Uint8Array(J().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==I.chain?"Solana":I.chain.replace("solana:",""),blockExplorerUrl:I.blockExplorerUrl,total:b?rt?.total:at?.total,fee:b?rt?.fee:at?.fee,balance:b?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:K.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||q.isLoading,isTokenPriceLoading:b&&nt,isMissingFunds:!C?.hasFunds,submitError:X??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!K)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(H(!0),U||!K||!k||!A||!Q)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=R().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:I,signature:n.signature});return void G({...n,fees:t?.fee})}G(n)}catch(t){console.warn({transaction:S,error:t}),Y(t)}finally{H(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
|
|
20
|
+
`;async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=F().decode(D(t)),o=r.staticAccounts[0]??"",i=await q({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await R(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==G&&a!==K)if(a!==Q){if(a===X){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(Y.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(N.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=V(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:Q,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:Q,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:Q,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:Q,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:v}=m(),b=u(),{user:A}=c(),I=H()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[R,q]=a({value:0n,isLoading:!1}),[U,V]=a(!1),[z,G]=a({}),[K,Q]=a(),X=t?.standardSignAndSendTransaction?.account,Y=!!t?.standardSignAndSendTransaction?.signOnly,N=X?.imported?l(A).find((t=>t.address===X.address)):d(A),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:v}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(R.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,X?.address,R]),rt=r((()=>{let t;if(!C||!v||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}X?.address===C.spender&&(t=n(C.fee));let e=n(R.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,X?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,v,tt,nt,X?.address,R]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:I,privyClient:y,checkFunds:!Y});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,I,y,Y]),o((()=>{(async function(){if(!X)return;q({value:R.value,isLoading:!0});let{value:t}=await I.rpc.getBalance(X.address,{commitment:"confirmed"}).send();q({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!X){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:b.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(K??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:I.chain,signOnly:Y,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return K?/*#__PURE__*/n($,{transactionError:K,chainId:I.chain,onClose:ot,chainType:"solana",onRetry:async()=>{Q(void 0);let{value:t}=await I.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,_(F().decode(D(n)),(t=>P(t)),(t=>B(e,t)),(t=>W(t)),(t=>new Uint8Array(J().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${b.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==I.chain?"Solana":I.chain.replace("solana:",""),blockExplorerUrl:I.blockExplorerUrl,total:v?rt?.total:at?.total,fee:v?rt?.fee:at?.fee,balance:v?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:X.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||R.isLoading,isTokenPriceLoading:v&&nt,isMissingFunds:!C?.hasFunds,submitError:K??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!X)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(V(!0),U||!X||!k||!A||!N)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=M().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:I,signature:n.signature});return void G({...n,fees:t?.fee})}G(n)}catch(t){console.warn({transaction:S,error:t}),Q(t)}finally{V(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,m as i,C as a}from"./index-CvRB3i5Y.mjs";import{u as s,q as n}from"./context-CE35zxmH.mjs";import{u as l,b as m,k as c}from"./internal-context-Z-fyxadS.mjs";import{u as d,a as u}from"./get-is-unified-wallet-Dy3_T-CK.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-ifSse9fH.mjs";import{S as v}from"./ScreenLayout-CBKj6lhP.mjs";import{T as y}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-C-m0Q1tx.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-CEsGQUX-.mjs";import"./useWallets-Ca4W6aLm.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BbA3ewrr.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"tinycolor2";import"./ModalHeader-BO0_ew01.mjs";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"./Screen-DEU9RkqZ.mjs";import"./index-Dq_xe9dz.mjs";const g=({success:t,errorMessage:r,onRetry:o})=>{let i=t?"Successfully connected with Telegram":r?r.message:"Verifying connection to Telegram";/*#__PURE__*/return e(v,{title:i,subtitle:t?"You're good to go!":r?r.detail:"Just a few moments more",icon:y,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!r},secondaryCta:r?.retryable&&o?{label:"Retry",onClick:o}:void 0,watermark:!0})},f={component:()=>{let{authenticated:v,logout:y,ready:f,user:h}=d(),{setModalData:A,navigate:b,resetNavigation:j,data:T}=u(),S=s(),{initLoginWithTelegram:w,loginWithTelegram:C,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:k}=l(),[x,L]=t(!1),[M,I]=t(void 0),U=o();async function D(){try{let e=await async function(){let e;if(!v){if(U.enabled&&"error"===U.status)throw new a(U.error,null,m.CAPTCHA_FAILURE);return U.enabled&&"success"!==U.status&&(U.execute(),e=await U.waitForResult()),e}}();await C({captchaToken:e}),L(!0),R(!0)}catch(e){if(e?.privyErrorCode===m.ALLOWLIST_REJECTED)return I(void 0),j(),void b("AllowlistRejectionScreen");if(e?.privyErrorCode===m.USER_LIMIT_REACHED)return console.error(new c(e).toString()),I(void 0),j(),void b("UserLimitReachedScreen");if(e?.privyErrorCode===m.USER_DOES_NOT_EXIST)return I(void 0),j(),void b("AccountNotFoundScreen");if(e?.privyErrorCode===m.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return I(void 0),j(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:k()?.telegramAuthResult,telegramWebAppData:k()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void b("LinkConflictScreen");let{retryable:t,detail:r}=i(e);I({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{D()}),[]),r((()=>{if(!(f&&v&&x&&h))return;if(S?.legal.requireUsersAcceptTerms&&!h.hasAcceptedTerms){let e=setTimeout((()=>{b("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(h,S.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),y()},callAuthOnSuccessOnClose:!0}}),b("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[f,v,x,h]);/*#__PURE__*/return e(g,{success:x,errorMessage:M,onRetry:M?.retryable?async()=>{try{I(void 0),T?.telegramAuthModalData?.seamlessAuth||await w(void 0,T?.login?.disableSignup),await D()}catch(e){let{retryable:t,detail:r}=i(e);I({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{f as TelegramAuthScreen,g as TelegramAuthScreenView,f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import{styled as n}from"styled-components";import{P as r,H as l,W as o}from"./WalletLink-
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import{styled as n}from"styled-components";import{P as r,H as l,W as o}from"./WalletLink-CGTEPUiO.mjs";import{g as d}from"./ethers-BQABFn4K.mjs";import{F as a}from"./Layouts-BlFm53ED.mjs";import c from"@heroicons/react/24/outline/ChevronDownIcon";import{createContext as s,useState as h,useContext as p}from"react";import{s as v,u}from"./context-CE35zxmH.mjs";const g=({label:t,children:n,valueStyles:r})=>/*#__PURE__*/e(f,{children:[/*#__PURE__*/i("div",{children:t}),/*#__PURE__*/i(x,{style:{...r},children:n})]});let f=n.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -13,7 +13,7 @@ import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import{styled as
|
|
|
13
13
|
color: var(--privy-color-foreground-2);
|
|
14
14
|
text-align: right;
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`,x=n.div`
|
|
17
17
|
font-size: 14px;
|
|
18
18
|
line-height: 100%;
|
|
19
19
|
display: flex;
|
|
@@ -22,7 +22,7 @@ import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import{styled as
|
|
|
22
22
|
border-radius: var(--privy-border-radius-full);
|
|
23
23
|
background-color: var(--privy-color-background-2);
|
|
24
24
|
padding: 4px 8px;
|
|
25
|
-
`;const
|
|
25
|
+
`;const m=({gas:t,tokenPrice:n,tokenSymbol:l})=>/*#__PURE__*/e(a,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e(b,{children:[/*#__PURE__*/i(k,{children:"Est. Fees"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(r,{weiQuantities:[BigInt(t)],tokenPrice:n,tokenSymbol:l})})]}),n&&/*#__PURE__*/i(w,{children:`${d(BigInt(t),l)}`})]}),y=({value:t,gas:n,tokenPrice:l,tokenSymbol:o})=>{let c=BigInt(t??0)+BigInt(n);/*#__PURE__*/return e(a,{children:[/*#__PURE__*/e(b,{children:[/*#__PURE__*/i(k,{children:"Total (including fees)"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(r,{weiQuantities:[BigInt(t||0),BigInt(n)],tokenPrice:l,tokenSymbol:o})})]}),l&&/*#__PURE__*/i(w,{children:d(c,o)})]})};let b=n.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-direction: row;
|
|
28
28
|
justify-content: space-between;
|
|
@@ -101,7 +101,7 @@ return e(t,{children:[/*#__PURE__*/e(F,{onClick:l,"data-open":String(d),children
|
|
|
101
101
|
`,V=n.div`
|
|
102
102
|
transform: ${e=>"true"===e.isactive?"rotate(180deg)":"rotate(0deg)"};
|
|
103
103
|
`;const $=({from:t,to:n,txn:r,transactionInfo:d,tokenPrice:a,gas:c,tokenSymbol:s})=>{let h=BigInt(r?.value||0);/*#__PURE__*/
|
|
104
|
-
return i(S,{...u().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e(j,{value:"details",children:[/*#__PURE__*/i(B,{children:/*#__PURE__*/e(E,{children:[/*#__PURE__*/i("div",{children:d?.title||"Details"}),/*#__PURE__*/i(H,{children:/*#__PURE__*/i(l,{weiQuantities:[h],tokenPrice:a,tokenSymbol:s})})]})}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/i(g,{label:"From",children:/*#__PURE__*/i(o,{walletAddress:t,chainId:r.chainId||v,chainType:"ethereum"})}),/*#__PURE__*/i(g,{label:"To",children:/*#__PURE__*/i(o,{walletAddress:n,chainId:r.chainId||v,chainType:"ethereum"})}),d&&d.action&&/*#__PURE__*/i(g,{label:"Action",children:d.action}),c&&/*#__PURE__*/i(
|
|
104
|
+
return i(S,{...u().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e(j,{value:"details",children:[/*#__PURE__*/i(B,{children:/*#__PURE__*/e(E,{children:[/*#__PURE__*/i("div",{children:d?.title||"Details"}),/*#__PURE__*/i(H,{children:/*#__PURE__*/i(l,{weiQuantities:[h],tokenPrice:a,tokenSymbol:s})})]})}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/i(g,{label:"From",children:/*#__PURE__*/i(o,{walletAddress:t,chainId:r.chainId||v,chainType:"ethereum"})}),/*#__PURE__*/i(g,{label:"To",children:/*#__PURE__*/i(o,{walletAddress:n,chainId:r.chainId||v,chainType:"ethereum"})}),d&&d.action&&/*#__PURE__*/i(g,{label:"Action",children:d.action}),c&&/*#__PURE__*/i(m,{value:r.value,gas:c,tokenPrice:a,tokenSymbol:s})]}),/*#__PURE__*/i(A,{children:({isActive:e})=>/*#__PURE__*/i(y,{value:r.value,displayFee:e,gas:c||"0x0",tokenPrice:a,tokenSymbol:s})})]})})};let E=n.div`
|
|
105
105
|
display: flex;
|
|
106
106
|
flex-direction: row;
|
|
107
107
|
justify-content: space-between;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as n}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as l}from"react";import{styled as a}from"styled-components";import{formatTokenAmount as s}from"@privy-io/js-sdk-core";import{M as c,P as d,E as h,B as m,b as u}from"./ModalHeader-
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as n}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as l}from"react";import{styled as a}from"styled-components";import{formatTokenAmount as s}from"@privy-io/js-sdk-core";import{M as c,P as d,E as h,B as m,b as u}from"./ModalHeader-BO0_ew01.mjs";import{L as p,V as g,a as f}from"./Value-tcJV9e0L.mjs";import{a as y,R as x}from"./Row-C9vrS4Zi.mjs";import{E as k}from"./ErrorMessage-D8VaAP5m.mjs";import{L as v}from"./LabelXs-oqZNqbm_.mjs";import{S as b}from"./Subtitle-CV-2yKE4.mjs";import{T as w}from"./Title-BnzYV3Is.mjs";import{A as T}from"./Address-gS9RaH_3.mjs";import{W as I}from"./WalletInfoCard-CvaU9hsg.mjs";import{u as A}from"./context-CE35zxmH.mjs";import{G as S}from"./useActiveWallet-C-m0Q1tx.mjs";import{L as C}from"./LoadingSkeleton-U6-3yFwI.mjs";import{isAddress as $}from"viem";import{B as j}from"./shared-FM0rljBt.mjs";import{C as M}from"./Checkbox-BhNoOKjX.mjs";import{E}from"./ErrorBanner-CQERa7bL.mjs";import{W as O}from"./WarningBanner-c8L53pJ2.mjs";import D from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import N from"@heroicons/react/24/outline/ClipboardDocumentIcon";import F from"@heroicons/react/24/outline/ExclamationCircleIcon";import{u as L}from"./internal-context-Z-fyxadS.mjs";const P=a(p)`
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
gap: 8px;
|
|
@@ -34,17 +34,17 @@ import{jsx as e,jsxs as r,Fragment as n}from"react/jsx-runtime";import{BoltIcon
|
|
|
34
34
|
width: 14px;
|
|
35
35
|
margin-right: 4px;
|
|
36
36
|
object-fit: contain;
|
|
37
|
-
`;const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:l,symbol:a}=i,{action:s,functionName:c}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/r(y,{children:["transaction"!==s&&/*#__PURE__*/r(
|
|
37
|
+
`;const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:l,symbol:a}=i,{action:s,functionName:c}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/r(y,{children:["transaction"!==s&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Action"}),/*#__PURE__*/e(g,{children:c})]}),"mint"===c&&"args"in t&&t.args.filter((e=>e)).map(((n,i)=>/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:`Param ${i}`}),/*#__PURE__*/e(g,{children:"string"==typeof n&&$(n)?/*#__PURE__*/e(T,{address:n,url:o?.blockExplorers?.default?.url,showCopyIcon:!1}):n?.toString()})]},i))),"setApprovalForAll"===c&&t.operator&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Operator"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:t.operator,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===c&&void 0!==t.approved&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Set approval to"}),/*#__PURE__*/e(g,{children:t.approved?"true":"false"})]}),"transfer"===c||"transferWithMemo"===c||"transferFrom"===c||"safeTransferFrom"===c||"approve"===c?/*#__PURE__*/r(n,{children:["formattedAmount"in t&&t.formattedAmount&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amount"}),/*#__PURE__*/r(g,{$isLoading:l,children:[t.formattedAmount," ",a]})]}),"tokenId"in t&&t.tokenId&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token ID"}),/*#__PURE__*/e(g,{children:t.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===c&&/*#__PURE__*/r(n,{children:["amounts"in t&&t.amounts&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amounts"}),/*#__PURE__*/e(g,{children:t.amounts.join(", ")})]}),"tokenIds"in t&&t.tokenIds&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token IDs"}),/*#__PURE__*/e(g,{children:t.tokenIds.join(", ")})]})]}),"approve"===c&&t.spender&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Spender"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:t.spender,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&t.transferFrom&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Transferring from"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:t.transferFrom,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&t.transferTo&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Transferring to"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:t.transferTo,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},U=({variant:i,setPreventMaliciousTransaction:o,colorScheme:t="light",preventMaliciousTransaction:l})=>"warn"===i?/*#__PURE__*/e(H,{children:/*#__PURE__*/r(O,{theme:t,children:[/*#__PURE__*/e("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===i?/*#__PURE__*/e(n,{children:/*#__PURE__*/r(H,{children:[/*#__PURE__*/e(E,{theme:t,children:/*#__PURE__*/r("div",{children:[/*#__PURE__*/e("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/r(q,{children:[/*#__PURE__*/e(M,{color:"var(--privy-color-error)",checked:!l,readOnly:!0,onClick:()=>o(!l)}),/*#__PURE__*/e("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let H=a.div`
|
|
38
38
|
margin-top: 1.5rem;
|
|
39
|
-
`,
|
|
39
|
+
`,q=a.div`
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
gap: 0.5rem;
|
|
43
43
|
margin-top: 0.75rem;
|
|
44
|
-
`;const J=({transactionIndex:e,maxIndex:r})=>"number"!=typeof e||0===r?"":` (${e+1} / ${r+1})`,Q=({img:a,submitError:s,prepareError:u,onClose:v,action:I,title:C,subtitle:$,to:j,tokenAddress:M,network:E,missingFunds:O,fee:D,from:N,cta:F,disabled:L,chain:z,isSubmitting:B,isPreparing:R,isTokenPriceLoading:
|
|
45
|
-
/*#__PURE__*/e(
|
|
44
|
+
`;const J=({transactionIndex:e,maxIndex:r})=>"number"!=typeof e||0===r?"":` (${e+1} / ${r+1})`,Q=({img:a,submitError:s,prepareError:u,onClose:v,action:I,title:C,subtitle:$,to:j,tokenAddress:M,network:E,missingFunds:O,fee:D,from:N,cta:F,disabled:L,chain:z,isSubmitting:B,isPreparing:R,isTokenPriceLoading:H,isTokenContractInfoLoading:q,isSponsored:Q,symbol:G,balance:Y,onClick:re,transactionDetails:ne,transactionIndex:ie,maxIndex:oe,onBack:te,chainName:le,validation:ae,hasScanDetails:se,setIsScanDetailsOpen:ce,preventMaliciousTransaction:de,setPreventMaliciousTransaction:he,tokensSent:me,tokensReceived:ue,isScanning:pe,isCancellable:ge,functionName:fe})=>{let{showTransactionDetails:ye,setShowTransactionDetails:xe,hasMoreDetails:ke,isErc20Ish:ve}=(e=>{let[r,n]=l(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,r])=>r&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:r,setShowTransactionDetails:n,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(ne),be=A(),we=ve&&q||R||H||pe;/*#__PURE__*/return r(n,{children:[/*#__PURE__*/e(c,{onClose:v,backFn:te}),a&&/*#__PURE__*/e(Z,{children:a}),/*#__PURE__*/r(w,{style:{marginTop:a?"1.5rem":0},children:[C,/*#__PURE__*/e(J,{maxIndex:oe,transactionIndex:ie})]}),/*#__PURE__*/e(b,{children:$}),/*#__PURE__*/r(y,{style:{marginTop:"2rem"},children:[(!!me[0]||we)&&/*#__PURE__*/r(x,{children:[ue.length>0?/*#__PURE__*/e(p,{children:"Send"}):/*#__PURE__*/e(p,{children:"approve"===I?"Approval amount":"Amount"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:me.map(((r,n)=>/*#__PURE__*/e(W,{iconUrl:r.iconUrl,value:"setApprovalForAll"===fe?"All":r.value,usdValue:r.usdValue,symbol:r.symbol,nftName:r.nftName,nftCount:r.nftCount,decimals:r.decimals},n)))})]}),ue.length>0&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Receive"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:ue.map(((r,n)=>/*#__PURE__*/e(W,{iconUrl:r.iconUrl,value:r.value,usdValue:r.usdValue,symbol:r.symbol,nftName:r.nftName,nftCount:r.nftCount,decimals:r.decimals},n)))})]}),ne&&"spender"in ne&&ne?.spender?/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Spender"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:ne.spender,url:z?.blockExplorers?.default?.url})})]}):null,j&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"To"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:j,url:z?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),M&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token address"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:M,url:z?.blockExplorers?.default?.url})})]}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Network"}),/*#__PURE__*/e(g,{children:E})]}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Estimated fee"}),/*#__PURE__*/e(g,{$isLoading:R||H||void 0===Q,children:Q?/*#__PURE__*/r(_,{children:[/*#__PURE__*/r(ee,{children:["Sponsored by ",be.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):D})]}),ke&&!se&&/*#__PURE__*/r(n,{children:[/*#__PURE__*/e(x,{className:"cursor-pointer",onClick:()=>xe(!ye),children:/*#__PURE__*/r(f,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e(t,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ye?"rotate(180deg)":void 0}})]})}),ye&&ne&&/*#__PURE__*/e(V,{action:I,chain:z,transactionDetails:ne,isTokenContractInfoLoading:q,symbol:G})]}),se&&/*#__PURE__*/e(x,{children:/*#__PURE__*/r(P,{onClick:()=>ce(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),s?/*#__PURE__*/e(k,{style:{marginTop:"2rem"},children:s.message}):u&&0===ie?
|
|
45
|
+
/*#__PURE__*/e(k,{style:{marginTop:"2rem"},children:u.shortMessage??K}):null,/*#__PURE__*/e(U,{variant:ae,preventMaliciousTransaction:de,setPreventMaliciousTransaction:he}),/*#__PURE__*/e(X,{$useSmallMargins:!(!u&&!s&&"warn"!==ae&&"error"!==ae),address:N,balance:Y,errMsg:R||u||s||!O?void 0:`Add funds on ${z?.name??le} to complete transaction.`}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:B,disabled:L||R,onClick:re,children:F}),ge&&/*#__PURE__*/e(h,{style:{marginTop:"1rem"},onClick:v,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e(m,{})]})},G=({img:o,title:a,subtitle:h,cta:u,instructions:f,network:I,blockExplorerUrl:C,isMissingFunds:$,submitError:j,parseError:M,total:E,swap:O,transactingWalletAddress:D,fee:N,balance:F,disabled:L,isSubmitting:W,isPreparing:z,isTokenPriceLoading:B,onClick:R,onClose:V,onBack:U,isSponsored:H})=>{let q=z||B,[J,Q]=l(!1),G=A();/*#__PURE__*/return r(n,{children:[/*#__PURE__*/e(c,{onClose:V,backFn:U}),o&&/*#__PURE__*/e(Z,{children:o}),/*#__PURE__*/e(w,{style:{marginTop:o?"1.5rem":0},children:a}),/*#__PURE__*/e(b,{children:h}),/*#__PURE__*/r(y,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(E||q)&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amount"}),/*#__PURE__*/e(g,{$isLoading:q,children:E})]}),O&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Swap"}),/*#__PURE__*/e(g,{children:O})]}),I&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Network"}),/*#__PURE__*/e(g,{children:I})]}),(N||q||void 0!==H)&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Estimated fee"}),/*#__PURE__*/e(g,{$isLoading:q,children:H&&!q?/*#__PURE__*/r(_,{children:[/*#__PURE__*/r(ee,{children:["Sponsored by ",G.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):N})]})]}),/*#__PURE__*/e(x,{children:/*#__PURE__*/r(P,{onClick:()=>Q((e=>!e)),children:[/*#__PURE__*/e("span",{children:"Advanced"}),/*#__PURE__*/e(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:J?"rotate(180deg)":void 0}})]})}),J&&/*#__PURE__*/e(n,{children:f.map(((n,i)=>"sol-transfer"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/r(v,{children:["Transfer ",n.withSeed?"with seed":""]})}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amount"}),/*#__PURE__*/r(g,{children:[s({amount:n.value,decimals:n.token.decimals})," ",n.token.symbol]})]}),!!n.toAccount&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Destination"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.toAccount,url:C})})]})]},i):"spl-transfer"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/r(v,{children:["Transfer ",n.token.symbol]})}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amount"}),/*#__PURE__*/e(g,{children:n.value.toString()})]}),!!n.fromAta&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Source"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.fromAta,url:C})})]}),!!n.toAta&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Destination"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.toAta,url:C})})]}),!!n.token.address&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.token.address,url:C})})]})]},i):"ata-creation"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(v,{children:"Create token account"})}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Program ID"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.program,url:C})})]}),!!n.owner&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Owner"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.owner,url:C})})]})]},i):"create-account"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/r(v,{children:["Create account ",n.withSeed?"with seed":""]})}),!!n.account&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Account"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.account,url:C})})]}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amount"}),/*#__PURE__*/r(g,{children:[s({amount:n.value,decimals:9})," SOL"]})]})]},i):"spl-init-account"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(v,{children:"Initialize token account"})}),!!n.account&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Account"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.account,url:C})})]}),!!n.mint&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Mint"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mint,url:C})})]}),!!n.owner&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Owner"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.owner,url:C})})]})]},i):"spl-close-account"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(v,{children:"Close token account"})}),!!n.source&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Source"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.source,url:C})})]}),!!n.destination&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Destination"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.destination,url:C})})]}),!!n.owner&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Owner"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.owner,url:C})})]})]},i):"spl-sync-native"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(v,{children:"Sync native"})}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Program ID"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.program,url:C})})]})]},i):"raydium-swap-base-input"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/r(v,{children:["Raydium swap"," ",n.tokenIn&&n.tokenOut?`${n.tokenIn.symbol} → ${n.tokenOut.symbol}`:""]})}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amount in"}),/*#__PURE__*/e(g,{children:n.amountIn.toString()})]}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Minimum amount out"}),/*#__PURE__*/e(g,{children:n.minimumAmountOut.toString()})]}),n.mintIn&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token in"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mintIn,url:C})})]}),n.mintOut&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token out"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mintOut,url:C})})]})]},i):"raydium-swap-base-output"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/r(v,{children:["Raydium swap"," ",n.tokenIn&&n.tokenOut?`${n.tokenIn.symbol} → ${n.tokenOut.symbol}`:""]})}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Max amount in"}),/*#__PURE__*/e(g,{children:n.maxAmountIn.toString()})]}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amount out"}),/*#__PURE__*/e(g,{children:n.amountOut.toString()})]}),n.mintIn&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token in"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mintIn,url:C})})]}),n.mintOut&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token out"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mintOut,url:C})})]})]},i):"jupiter-swap-shared-accounts-route"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/r(v,{children:["Jupiter swap"," ",n.tokenIn&&n.tokenOut?`${n.tokenIn.symbol} → ${n.tokenOut.symbol}`:""]})}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"In amount"}),/*#__PURE__*/e(g,{children:n.inAmount.toString()})]}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Quoted out amount"}),/*#__PURE__*/e(g,{children:n.quotedOutAmount.toString()})]}),n.mintIn&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token in"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mintIn,url:C})})]}),n.mintOut&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token out"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mintOut,url:C})})]})]},i):"jupiter-swap-exact-out-route"===n.type?/*#__PURE__*/r(Y,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/r(v,{children:["Jupiter swap"," ",n.tokenIn&&n.tokenOut?`${n.tokenIn.symbol} → ${n.tokenOut.symbol}`:""]})}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Quoted in amount"}),/*#__PURE__*/e(g,{children:n.quotedInAmount.toString()})]}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Amount out"}),/*#__PURE__*/e(g,{children:n.outAmount.toString()})]}),n.mintIn&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token in"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mintIn,url:C})})]}),n.mintOut&&/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Token out"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.mintOut,url:C})})]})]},i):/*#__PURE__*/r(Y,{children:[/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Program ID"}),/*#__PURE__*/e(g,{children:/*#__PURE__*/e(T,{address:n.program,url:C})})]}),/*#__PURE__*/r(x,{children:[/*#__PURE__*/e(p,{children:"Data"}),/*#__PURE__*/e(g,{children:n.discriminator})]})]},i)))}),/*#__PURE__*/e(S,{}),j?/*#__PURE__*/e(k,{style:{marginTop:"2rem"},children:j.message}):M?/*#__PURE__*/e(k,{style:{marginTop:"2rem"},children:K}):null,/*#__PURE__*/e(X,{$useSmallMargins:!(!M&&!j),title:"",address:D,balance:F,errMsg:z||M||j||!$?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:W,disabled:L||z,onClick:R,children:u}),/*#__PURE__*/e(m,{})]})};let X=a(I)`
|
|
46
46
|
${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
|
|
47
|
-
`,
|
|
47
|
+
`,Y=a(y)`
|
|
48
48
|
margin-top: 0.5rem;
|
|
49
49
|
border: 1px solid var(--privy-color-foreground-4);
|
|
50
50
|
border-radius: var(--privy-border-radius-sm);
|
|
@@ -163,4 +163,4 @@ import{jsx as e,jsxs as r,Fragment as n}from"react/jsx-runtime";import{BoltIcon
|
|
|
163
163
|
right: 13px;
|
|
164
164
|
width: 24px;
|
|
165
165
|
height: 24px;
|
|
166
|
-
`,fe=({clicked:r})=>/*#__PURE__*/e(r?ge:pe,{});export{Q as S,ne as T,
|
|
166
|
+
`,fe=({clicked:r})=>/*#__PURE__*/e(r?ge:pe,{});export{Q as S,ne as T,G as a};
|
package/dist/esm/{TransferFromWalletScreen-B8AzQgyG.mjs → TransferFromWalletScreen-DJHQToqB.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import{M as o,B as i}from"./ModalHeader-
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import{M as o,B as i}from"./ModalHeader-BO0_ew01.mjs";import{C as r}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as c}from"./FundWalletMethodHeader-Cj0ejXEe.mjs";import{C as s}from"./Chip-D2-wZOHJ.mjs";import{S as p}from"./Subtitle-CV-2yKE4.mjs";import{u as d}from"./context-CE35zxmH.mjs";import{r as m,z as y,e as u,A as h,j as w,Q as f}from"./useActiveWallet-C-m0Q1tx.mjs";import{u as T}from"./internal-context-Z-fyxadS.mjs";import{a as g}from"./get-is-unified-wallet-Dy3_T-CK.mjs";import{u as C}from"./useWallets-Ca4W6aLm.mjs";import{W as v}from"./WalletOverflowButton-CYYzAWaD.mjs";import{A as _,D as j,E as x}from"./index-CvRB3i5Y.mjs";import{isMobile as S}from"react-device-detect";import{styled as W}from"styled-components";import{I as b}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{y as $}from"./use-export-wallet-CEsGQUX-.mjs";import{I as k}from"./styles-rdvIOTsj.mjs";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"./LoadingSkeleton-U6-3yFwI.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"ofetch";import"@privy-io/are-addresses-equal";import"lucide-react";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BbA3ewrr.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./LinkPasskeyScreen-C8-qPCc0.mjs";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-CBKj6lhP.mjs";import"./Screen-DEU9RkqZ.mjs";import"./index-Dq_xe9dz.mjs";const O=({provider:t,displayName:l,logo:a,connectOnly:o,connector:i})=>{let r,{navigate:c,setModalData:s}=g(),{connectWallet:p}=T(),d=m(),h=y(t),w="wallet_connect_v2"===i.connectorType?t:i.walletClientType,f=window.matchMedia("(display-mode: standalone)").matches,C=u({connectorType:i.connectorType,walletClientType:w});r=C&&C.chainTypes.includes(i.chainType)?()=>{C.isInstalled||"solana"===i.chainType&&"isInstalled"in i&&i.isInstalled?(p(i,w),c(o?"ConnectOnlyStatusScreen":"ConnectionStatusScreen")):S?(s({installWalletModalData:{walletConfig:C,chainType:i.chainType,connectOnly:o}}),c("WalletInterstitialScreen")):(s({installWalletModalData:{walletConfig:C,chainType:i.chainType,connectOnly:o}}),c("InstallWalletScreen"))}:"coinbase_wallet"!==i.connectorType||"eoaOnly"!==i.coinbaseWalletConfig.preference?.options||!S||f||$()?()=>{(!_(window.navigator.userAgent)||event?.isTrusted)&&(p(i,w),o?"wallet_connect_v2"===i.connectorType?(s((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),c("ConnectOnlyLandingScreen")):c("ConnectOnlyStatusScreen"):c("ConnectionStatusScreen"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let v=l||h?.metadata?.shortName||h?.name||i.walletClientType;/*#__PURE__*/return e(D,{onClick:r,children:[/*#__PURE__*/n(b,{icon:a||h?.image_url?.md,name:v}),/*#__PURE__*/n("span",{children:v}),/*#__PURE__*/e(M,{id:"chip-container",children:[d?.walletClientType===w&&d?.chainType===i.chainType?/*#__PURE__*/n(I,{color:"gray",children:"Recent"}):/*#__PURE__*/n("span",{id:"connect-text",children:"Connect"}),"solana"===i.chainType&&/*#__PURE__*/n(I,{color:"gray",children:"Solana"})]})]})};let D=W(h)`
|
|
2
2
|
/* Wallet name text color */
|
|
3
3
|
> span {
|
|
4
4
|
color: var(--privy-color-foreground);
|
|
@@ -21,11 +21,11 @@ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState
|
|
|
21
21
|
display: none;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
`,I=
|
|
24
|
+
`,I=W(s)`
|
|
25
25
|
margin-left: auto;
|
|
26
|
-
`,
|
|
26
|
+
`,M=W.div`
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-wrap: wrap;
|
|
29
29
|
gap: 8px;
|
|
30
30
|
margin-left: auto;
|
|
31
|
-
`;const
|
|
31
|
+
`;const E=["coinbase_wallet","base_account"];let F=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","ronin_wallet","haha_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom","binance","kraken_wallet"];const A=["safe"],B=["phantom","backpack","solflare","jupiter","universal_profile"],L={component:()=>{let s,{connectors:m}=T(),{setModalData:y,data:u,navigate:h}=g(),_=d(),{wallets:S}=C(),W=m.filter(w).flatMap((e=>e.wallets)),[b,$]=l("default"),k="solana"===u?.funding?.chainType,D=!!u?.funding?.crossChainBridgingEnabled;s="ethereum"===u?.funding?.chainType?u.funding.erc20Address&&!u.funding.isUSDC?"ethereum-only":D&&!u.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":D&&!u.funding?.isUSDC?"ethereum-and-solana":"solana-only";let I=S.filter((e=>"privy"!==e.walletClientType)),M=I.map((e=>e.walletClientType)),L=W.filter((e=>"privy"!==e.walletClientType)),P=L.map((e=>e.walletClientType)),z=[],H={...u.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let R=({wallet:e,walletChainType:n})=>{y({...u,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>h(q({destChainType:k?"solana":"ethereum",sourceChainType:n}))},solanaFundingData:u?.solanaFundingData?{...u.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),h("FundingAmountEditScreen")};"solana-only"!==s&&z.push(...I.map(((e,t)=>/*#__PURE__*/n(N,{onClick:()=>R({wallet:e,walletChainType:"ethereum"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},t)))),"ethereum-only"!==s&&z.push(...L.map(((e,t)=>/*#__PURE__*/n(N,{onClick:()=>R({wallet:e,walletChainType:"solana"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},t)))),z.push(...(({walletList:e,walletChainType:t,connectors:l,connectOnly:a,ignore:o,walletConnectEnabled:i,forceWallet:r})=>{let c=[],s=[],p=[],d=l.filter((e=>"ethereum-only"===t?"ethereum"===e.chainType:"solana-only"!==t||"solana"===e.chainType)),m=d.find((e=>"wallet_connect_v2"===e.connectorType));for(let[l,y]of(r?[r.wallet]:e).entries()){if("detected_ethereum_wallets"===y)for(let[e,t]of d.filter((({chainType:e,connectorType:n,walletClientType:t})=>"solana"!==e&&("uniswap_wallet_extension"===t||"uniswap_extension"===t?!o.includes("uniswap"):"crypto.com_wallet_extension"===t||"crypto.com_onchain"===t?!o.includes("cryptocom"):"injected"===n&&!o.includes(t)))).entries()){let{walletClientType:o,walletBranding:i,chainType:r}=t;("unknown"===o?s:c).push(/*#__PURE__*/n(O,{connectOnly:a,provider:o,logo:i.icon,displayName:i.name,connector:t},`${l}-${y}-${o}-${r}-${e}`))}if("detected_solana_wallets"===y)for(let[e,i]of d.filter((({chainType:e,walletClientType:n})=>{if("solana"===e)return"ethereum-only"!==t&&!o.includes(n)})).entries()){let{walletClientType:t,walletBranding:o,chainType:r}=i;("unknown"===t?s:c).push(/*#__PURE__*/n(O,{connectOnly:a,provider:t,logo:o.icon,displayName:o.name,connector:i},`${l}-${y}-${t}-${r}-${e}`))}if(B.includes(y)){let e=d.find((e=>"injected"===e.connectorType&&e.walletClientType===y||e.connectorType===y));if(e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${l}-${y}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=d.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${y}-solana`))}}else if(F.includes(y)){let e=d.find((e=>"uniswap"===y?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===y?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===y));if(i&&!e&&(e=m),e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${l}-${y}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=d.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${y}-solana`))}}else if(E.includes(y)){let e=d.find((({connectorType:e})=>e===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?j:x},`${l}-${y}`))}else if(A.includes(y))m&&p.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:m},`${l}-${y}`));else if("wallet_connect"===y)m&&p.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:m,logo:m.walletBranding.icon,displayName:"WalletConnect"},`${l}-${y}`));else if(y===r?.wallet){let t="ethereum"===r.chainType&&e.includes("detected_ethereum_wallets"),o="solana"===r.chainType&&e.includes("detected_solana_wallets");if(t||o){let e=d.find((({walletClientType:e})=>e===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${l}-${y}`))}}}return[...s,...c,...p]})({walletList:_.appearance.walletList.filter((e=>!I.some((n=>n.walletClientType===e))&&!L.some((n=>n.walletClientType===e)))),walletChainType:s,connectors:m,connectOnly:!0,ignore:[..._.appearance.walletList,...M,...P],walletConnectEnabled:_.externalWallets.walletConnect.enabled}));let U=/*#__PURE__*/n(v,{text:"More wallets",onClick:()=>$("overflow")}),q=({sourceChainType:e,destChainType:n})=>"ethereum"===e&&"solana"===n?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===n?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===n?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return a((()=>{y({...u,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:n,walletChainType:t})=>{let l=t??"ethereum",a="ethereum"===l?I.find((t=>t.address===e&&t.walletClientType===n)):L.find((t=>t.address===e&&t.walletClientType===n));return y({...u,funding:{...H,connectedWallet:a,onContinueWithExternalWallet:()=>{h(q({destChainType:k?"solana":"ethereum",sourceChainType:l}))}},solanaFundingData:u?.solanaFundingData?{...u.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:n||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/e(t,"overflow"===b?{children:[/*#__PURE__*/n(o,{backFn:()=>$("default")},"header"),/*#__PURE__*/e(f,{children:[/*#__PURE__*/n(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),z]}),/*#__PURE__*/n(i,{})]}:{children:[/*#__PURE__*/n(c,{}),/*#__PURE__*/n(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/e(f,{children:[z.length>4?z.slice(0,3):z,z.length>4&&U]}),/*#__PURE__*/n(i,{})]})}};let N=({onClick:t,icon:l,name:a,chainType:o})=>/*#__PURE__*/e(h,{onClick:t,children:[/*#__PURE__*/n(k,{style:{width:20},children:/*#__PURE__*/n("img",{src:l})}),a,/*#__PURE__*/n(s,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/n(s,{color:"gray",children:"Solana"})]});export{L as TransferFromWalletScreen,L as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as t}from"styled-components";import{d as o}from"./Layouts-BlFm53ED.mjs";import{B as n}from"./ModalHeader-
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as t}from"styled-components";import{d as o}from"./Layouts-BlFm53ED.mjs";import{B as n}from"./ModalHeader-BO0_ew01.mjs";import{C as m}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as s}from"./FundWalletMethodHeader-Cj0ejXEe.mjs";import{I as a}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as d}from"./index-Dq_xe9dz.mjs";import{a as l,R as c}from"./Row-C9vrS4Zi.mjs";import{L as h,V as p}from"./Value-tcJV9e0L.mjs";import{A as f}from"./Address-gS9RaH_3.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{z as j}from"./useActiveWallet-C-m0Q1tx.mjs";const I=({walletClientType:t,displayName:I,addressToFund:w,chainId:y,chainName:x,isBridging:N,isErc20Flow:T,totalPriceInNativeCurrency:C,totalPriceInUsd:v,gasPriceInNativeCurrency:B,gasPriceInUsd:F})=>{let P=j(t);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(s,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(a,{icon:P?.image_url?.md,name:t})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${N?"Bridging":"Confirming"} with ${I}`}),!N&&!T&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:v||C})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"To"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/i(f,{address:w,showCopyIcon:!1})})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Network"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/e(u,{children:[/*#__PURE__*/i(g,{chainId:y,height:16,width:16})," ",x]})})]}),B&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:F||B})]})]}),/*#__PURE__*/i(o,{height:24}),/*#__PURE__*/i(n,{})]})};let u=t.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
align-items: center;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-BlFm53ED.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-CE35zxmH.mjs";import{a as l}from"./index-CvRB3i5Y.mjs";import{u as d}from"./internal-context-Z-fyxadS.mjs";import{u as c,a as p}from"./get-is-unified-wallet-Dy3_T-CK.mjs";import{C as u}from"./useActiveWallet-C-m0Q1tx.mjs";import{B as h}from"./use-export-wallet-CEsGQUX-.mjs";import{E as v,P as f}from"./ModalHeader-BO0_ew01.mjs";import{I as j,E as y}from"./EmailInputForm-Dgoii4vf.mjs";import{E as g}from"./ErrorMessage-D8VaAP5m.mjs";import{S as w}from"./ScreenLayout-CBKj6lhP.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-Ca4W6aLm.mjs";import"viem";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BbA3ewrr.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";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"./Screen-DEU9RkqZ.mjs";import"./index-Dq_xe9dz.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,j]=m(""),[y,w]=m(""),[k,S]=m(!1),{authenticated:x,user:C}=c(),{initUpdateEmail:A}=d(),{navigate:I,setModalData:P,currentScreen:M}=p(),{enabled:T,token:U}=l(),q=n(),L=h(s)&&(q.disablePlusEmails&&s.includes("+")?(y||w("Please enter a valid email address without a '+'."),!1):(y&&w(""),!0)),W=k||!L,D=()=>{!T||U||x?(async e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");S(!0);try{await A({oldAddress:C.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){P({errorModalData:{error:e,previousScreen:M||"LandingScreen"}}),I("ErrorScreen")}S(!1)})(U):(P({captchaModalData:{callback:e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");return A({oldAddress:C.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(E,{children:[y&&/*#__PURE__*/t(g,{style:{marginTop:"0.25rem",textAlign:"left"},children:y}),/*#__PURE__*/e(b,{$error:!!y,children:[/*#__PURE__*/t(u,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>j(e.target.value),onKeyUp:e=>{"Enter"===e.key&&D()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(v,{isSubmitting:k,onClick:D,disabled:W,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(f,{loadingText:null,loading:k,disabled:W,onClick:D,style:{width:"100%"},children:"Submit"}):null]})}));let E=j,b=y;const S=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),x={component:()=>/*#__PURE__*/t(S,{})};export{x as UpdateEmailScreen,S as UpdateEmailScreenView,x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-CyET5ztr.mjs";import{u as i}from"./internal-context-Z-fyxadS.mjs";import{a as n,u as m}from"./get-is-unified-wallet-Dy3_T-CK.mjs";import{S as a}from"./ScreenLayout-CBKj6lhP.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-CE35zxmH.mjs";import"tinycolor2";import"./useActiveWallet-C-m0Q1tx.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-CEsGQUX-.mjs";import"./useWallets-Ca4W6aLm.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./ModalHeader-BO0_ew01.mjs";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"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-DEU9RkqZ.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Update your phone number",subtitle:n="Add the phone number you'd like to use going forward. We'll send you a confirmation code",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null);/*#__PURE__*/return e(a,{title:i,subtitle:n,icon:t,primaryCta:{label:s?"Submitting":"Update",onClick:async()=>{c?.qualifiedPhoneNumber&&await m(c)},disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/e(r,{onChange:e=>{u(e)},onSubmit:async()=>{},noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:t,data:r,navigate:a,setModalData:c}=n(),{user:u}=m(),{initUpdatePhone:p}=i(),[l,d]=o(!1);/*#__PURE__*/return e(s,{onSubmit:async e=>{d(!0);try{if(!u?.phone?.number)throw Error("User is required to have an phone number to update it.");await p(u?.phone?.number,e.qualifiedPhoneNumber),a("AwaitingPasswordlessCodeScreen")}catch(e){c({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{a as e}from"./get-is-unified-wallet-Dy3_T-CK.mjs";import{S as o}from"./ScreenLayout-CBKj6lhP.mjs";import"@privy-io/are-addresses-equal";import"react";import"./context-CE35zxmH.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-BO0_ew01.mjs";import"styled-components";import"./useActiveWallet-C-m0Q1tx.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-CEsGQUX-.mjs";import"./useWallets-Ca4W6aLm.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";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"./Screen-DEU9RkqZ.mjs";import"./index-Dq_xe9dz.mjs";const i=({style:e,...o})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...o,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),r=({title:e="Unable to sign in",subtitle:r="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:n})=>/*#__PURE__*/t(o,{title:e,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:o}=e();/*#__PURE__*/return t(r,{onGoBack:()=>{o("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import{Check as i,Copy as t}from"lucide-react";import{useState as s,useEffect as a}from"react";import{styled as n}from"styled-components";import{S as m}from"./ModalHeader-
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import{Check as i,Copy as t}from"lucide-react";import{useState as s,useEffect as a}from"react";import{styled as n}from"styled-components";import{S as m}from"./ModalHeader-BO0_ew01.mjs";import{E as l}from"./ErrorMessage-D8VaAP5m.mjs";import{L as d}from"./LabelXs-oqZNqbm_.mjs";import{A as c}from"./Address-gS9RaH_3.mjs";import{B as p}from"./shared-FM0rljBt.mjs";let h=n(p)`
|
|
2
2
|
&& {
|
|
3
3
|
padding: 0.75rem;
|
|
4
4
|
height: 56px;
|