@getpara/react-sdk 1.6.1-dev.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/{modal/components/AddFunds/MoonPayEmbed.js → MoonPayEmbed-Q2HP2BFI.js} +3 -1
  2. package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
  3. package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
  4. package/dist/chunk-MMUBH76A.js.br +0 -0
  5. package/dist/chunk-MMUBH76A.js.gz +0 -0
  6. package/dist/index.js +6659 -6
  7. package/dist/index.js.br +0 -0
  8. package/dist/index.js.gz +0 -0
  9. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +1 -0
  10. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +2 -1
  11. package/dist/modal/components/common.d.ts +4 -0
  12. package/dist/modal/index.d.ts +1 -0
  13. package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +13 -0
  14. package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +11 -0
  15. package/dist/modal/providers/ExternalWalletContext.d.ts +15 -1
  16. package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +11 -0
  17. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +2 -0
  18. package/dist/modal/types/commonTypes.d.ts +12 -2
  19. package/dist/modal/types/externalWallets.d.ts +2 -0
  20. package/dist/modal/types/modalProps.d.ts +6 -0
  21. package/dist/modal/utils/steps.d.ts +2 -0
  22. package/dist/provider/utils/constants.d.ts +5 -0
  23. package/package.json +5 -5
  24. package/dist/modal/ParaModal.js +0 -337
  25. package/dist/modal/components/Account/Account.js +0 -69
  26. package/dist/modal/components/AddFunds/AddFunds.js +0 -220
  27. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -72
  28. package/dist/modal/components/AddFunds/AddFundsDone.js +0 -43
  29. package/dist/modal/components/AddFunds/index.js +0 -4
  30. package/dist/modal/components/AuthInput/AuthInput.js +0 -283
  31. package/dist/modal/components/AuthInput/countryCodes.js +0 -42
  32. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  33. package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
  34. package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -37
  35. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -113
  36. package/dist/modal/components/AuthOptions/AuthOptions.js +0 -33
  37. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  38. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
  39. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
  40. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -44
  41. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -52
  42. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -93
  43. package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
  44. package/dist/modal/components/Body/Body.js +0 -304
  45. package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -94
  46. package/dist/modal/components/ChainSwitch/config.js +0 -17
  47. package/dist/modal/components/Controls/Controls.js +0 -74
  48. package/dist/modal/components/Controls/Selects.js +0 -213
  49. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -151
  50. package/dist/modal/components/ExternalWalletStep/config.js +0 -17
  51. package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -172
  52. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -123
  53. package/dist/modal/components/Footer/Footer.js +0 -93
  54. package/dist/modal/components/Header/Header.js +0 -43
  55. package/dist/modal/components/Header/hooks/useStepTitle.js +0 -50
  56. package/dist/modal/components/Hero/Hero.js +0 -122
  57. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -55
  58. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -28
  59. package/dist/modal/components/ModalContent/ModalContent.js +0 -310
  60. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
  61. package/dist/modal/components/OAuth/OAuth.js +0 -153
  62. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -139
  63. package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
  64. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
  65. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -101
  66. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -141
  67. package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
  68. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -24
  69. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -159
  70. package/dist/modal/components/Waiting/Waiting.js +0 -17
  71. package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
  72. package/dist/modal/components/WalletCard/WalletCard.js +0 -127
  73. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -52
  74. package/dist/modal/components/common.js +0 -83
  75. package/dist/modal/components/index.js +0 -2
  76. package/dist/modal/constants/constants.js +0 -111
  77. package/dist/modal/constants/defaults.js +0 -10
  78. package/dist/modal/constants/oAuthLogos.js +0 -24
  79. package/dist/modal/hooks/useActiveWallet.js +0 -15
  80. package/dist/modal/hooks/useCreateAccount.js +0 -72
  81. package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -39
  82. package/dist/modal/hooks/useGoBack.js +0 -35
  83. package/dist/modal/hooks/useSetLoginURLs.js +0 -45
  84. package/dist/modal/index.js +0 -32
  85. package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -34
  86. package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -38
  87. package/dist/modal/providers/ExternalWalletContext.js +0 -275
  88. package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -19
  89. package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
  90. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -20
  91. package/dist/modal/stores/index.js +0 -4
  92. package/dist/modal/stores/modal/actions.js +0 -70
  93. package/dist/modal/stores/modal/useModalStore.js +0 -65
  94. package/dist/modal/stores/theme/actions.js +0 -28
  95. package/dist/modal/stores/theme/useThemeStore.js +0 -21
  96. package/dist/modal/stores/userInfo/actions.js +0 -30
  97. package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
  98. package/dist/modal/types/commonTypes.js +0 -1
  99. package/dist/modal/types/externalWallets.js +0 -31
  100. package/dist/modal/types/modalProps.js +0 -12
  101. package/dist/modal/utils/authLayoutHelpers.js +0 -8
  102. package/dist/modal/utils/getMailtoLink.js +0 -10
  103. package/dist/modal/utils/getTileButtonFlex.js +0 -20
  104. package/dist/modal/utils/openPopup.js +0 -60
  105. package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
  106. package/dist/modal/utils/steps.js +0 -228
  107. package/dist/modal/utils/stringFormatters.js +0 -14
  108. package/dist/modal/utils/validateOnRampConfig.js +0 -32
  109. package/dist/provider/ParaProvider.js +0 -22
  110. package/dist/provider/actions/checkIfUserExists.js +0 -21
  111. package/dist/provider/actions/createUser.js +0 -26
  112. package/dist/provider/actions/getAccount.js +0 -22
  113. package/dist/provider/actions/getWallet.js +0 -14
  114. package/dist/provider/actions/initiateLogin.js +0 -20
  115. package/dist/provider/actions/keepSessionAlive.js +0 -20
  116. package/dist/provider/actions/logout.js +0 -17
  117. package/dist/provider/actions/signMessage.js +0 -20
  118. package/dist/provider/actions/signTransaction.js +0 -20
  119. package/dist/provider/actions/waitForAccountCreation.js +0 -21
  120. package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
  121. package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
  122. package/dist/provider/hooks/index.js +0 -4
  123. package/dist/provider/hooks/mutations/index.js +0 -24
  124. package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
  125. package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
  126. package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
  127. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
  128. package/dist/provider/hooks/mutations/useLogout.js +0 -30
  129. package/dist/provider/hooks/mutations/useSignMessage.js +0 -33
  130. package/dist/provider/hooks/mutations/useSignTransaction.js +0 -33
  131. package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
  132. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
  133. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
  134. package/dist/provider/hooks/queries/index.js +0 -8
  135. package/dist/provider/hooks/queries/useAccount.js +0 -21
  136. package/dist/provider/hooks/queries/useWallet.js +0 -22
  137. package/dist/provider/hooks/utils/index.js +0 -10
  138. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
  139. package/dist/provider/hooks/utils/useClient.js +0 -10
  140. package/dist/provider/hooks/utils/useEventListeners.js +0 -105
  141. package/dist/provider/hooks/utils/useInternalClient.js +0 -10
  142. package/dist/provider/hooks/utils/useModal.js +0 -17
  143. package/dist/provider/hooks/utils/useWalletState.js +0 -33
  144. package/dist/provider/index.js +0 -8
  145. package/dist/provider/stores/getters.js +0 -13
  146. package/dist/provider/stores/slices/client.js +0 -9
  147. package/dist/provider/stores/slices/index.js +0 -4
  148. package/dist/provider/stores/slices/modal.js +0 -9
  149. package/dist/provider/stores/slices/wallet.js +0 -11
  150. package/dist/provider/stores/types.js +0 -1
  151. package/dist/provider/stores/useStore.js +0 -27
  152. package/dist/provider/types/provider.js +0 -1
  153. package/dist/provider/types/query.js +0 -1
  154. package/dist/provider/types/utils.js +0 -1
  155. package/dist/provider/utils/renameMutations.js +0 -16
Binary file
Binary file
@@ -0,0 +1 @@
1
+ export declare const ExternalWalletVerificationStep: () => import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,7 @@ import { PropsWithChildren } from 'react';
2
2
  import { TExternalWallet } from '../../types/externalWallets.js';
3
3
  interface ExternalWalletsWrapperProps extends PropsWithChildren {
4
4
  wallets?: TExternalWallet[];
5
+ externalWalletsWithFullAuth?: TExternalWallet[];
5
6
  }
6
- export declare const ExternalWalletsWrapper: ({ children, wallets }: ExternalWalletsWrapperProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const ExternalWalletsWrapper: ({ children, wallets, externalWalletsWithFullAuth }: ExternalWalletsWrapperProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -17,3 +17,7 @@ export declare const StyledCpslTileButton: typeof CpslTileButton;
17
17
  export declare const HeroIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@getpara/core-components").JSX.CpslIcon & Omit<import("react").HTMLAttributes<HTMLCpslIconElement>, "style"> & import("@getpara/react-components/dist/types/components/stencil-generated/react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLCpslIconElement>, "ref"> & {
18
18
  ref?: import("react").Ref<HTMLCpslIconElement>;
19
19
  }, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("@getpara/core-components").JSX.CpslIcon & Omit<import("react").HTMLAttributes<HTMLCpslIconElement>, "style"> & import("@getpara/react-components/dist/types/components/stencil-generated/react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLCpslIconElement>>, keyof import("react").Component<any, {}, any>>;
20
+ export declare const ErrorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
+ export declare const ErrorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@getpara/core-components").JSX.CpslIcon & Omit<import("react").HTMLAttributes<HTMLCpslIconElement>, "style"> & import("@getpara/react-components/dist/types/components/stencil-generated/react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLCpslIconElement>, "ref"> & {
22
+ ref?: import("react").Ref<HTMLCpslIconElement>;
23
+ }, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("@getpara/core-components").JSX.CpslIcon & Omit<import("react").HTMLAttributes<HTMLCpslIconElement>, "style"> & import("@getpara/react-components/dist/types/components/stencil-generated/react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLCpslIconElement>>, keyof import("react").Component<any, {}, any>>;
@@ -8,3 +8,4 @@ export { SaveRecoverySecret } from './components/RecoverySecretStep/RecoverySecr
8
8
  export * from './utils/validateOnRampConfig.js';
9
9
  export * from './types/externalWallets.js';
10
10
  export { useExternalWalletProviderStore } from './stores/externalWalletProvider/useExternalWalletProviderStore.js';
11
+ export * from './types/commonTypes.js';
@@ -7,6 +7,8 @@ export declare const defaultCosmosExternalWallet: {
7
7
  chainId: any;
8
8
  disconnect: () => Promise<void>;
9
9
  switchChain: () => Promise<{}>;
10
+ signMessage: () => Promise<{}>;
11
+ signVerificationMessage: () => Promise<{}>;
10
12
  };
11
13
  export type CosmosExternalWalletContextType = {
12
14
  wallets: CommonWallet[];
@@ -16,6 +18,17 @@ export type CosmosExternalWalletContextType = {
16
18
  switchChain: (chainId: string) => Promise<{
17
19
  error?: string[];
18
20
  }>;
21
+ signMessage: (message: string) => Promise<{
22
+ signature?: string;
23
+ error?: string;
24
+ }>;
25
+ signVerificationMessage: () => Promise<{
26
+ address?: string;
27
+ signature?: string;
28
+ cosmosPublicKeyHex?: string;
29
+ cosmosSigner?: string;
30
+ error?: string;
31
+ }>;
19
32
  };
20
33
  export declare const CosmosExternalWalletContext: import("react").Context<CosmosExternalWalletContextType>;
21
34
  export interface CosmosExternalWalletProviderProps {
@@ -9,6 +9,8 @@ export declare const defaultEvmExternalWallet: {
9
9
  avatar: any;
10
10
  disconnect: () => Promise<void>;
11
11
  switchChain: () => Promise<{}>;
12
+ signMessage: () => Promise<{}>;
13
+ signVerificationMessage: () => Promise<{}>;
12
14
  };
13
15
  export type EvmExternalWalletContextType = {
14
16
  wallets: CommonWallet[];
@@ -20,6 +22,15 @@ export type EvmExternalWalletContextType = {
20
22
  switchChain: (chainId: number) => Promise<{
21
23
  error?: string[];
22
24
  }>;
25
+ signMessage: (message: string) => Promise<{
26
+ signature?: string;
27
+ error?: string;
28
+ }>;
29
+ signVerificationMessage: () => Promise<{
30
+ address?: string;
31
+ signature?: string;
32
+ error?: string;
33
+ }>;
23
34
  };
24
35
  export declare const EvmExternalWalletContext: import("react").Context<EvmExternalWalletContextType>;
25
36
  export interface EvmExternalWalletProviderProps {
@@ -23,6 +23,7 @@ export declare const defaultExternalWallet: {
23
23
  disconnectExternalWallet: () => Promise<void>;
24
24
  switchChain: () => Promise<void>;
25
25
  setChainIdSwitchingTo: () => void;
26
+ verifyWalletSignature: () => Promise<{}>;
26
27
  };
27
28
  export declare const ExternalWalletContext: Context<{
28
29
  wallets: CommonWallet[];
@@ -43,6 +44,12 @@ export declare const ExternalWalletContext: Context<{
43
44
  disconnectExternalWallet: () => Promise<void>;
44
45
  switchChain: (chainId: string) => Promise<void>;
45
46
  setChainIdSwitchingTo: (chainId?: string) => void;
47
+ verifyWalletSignature: () => Promise<{
48
+ address?: string;
49
+ signature?: string;
50
+ cosmosPublicKeyHex?: string;
51
+ cosmosSigner?: string;
52
+ }>;
46
53
  }>;
47
54
  interface ExternalWalletProviderProps {
48
55
  children: ReactNode;
@@ -50,8 +57,9 @@ interface ExternalWalletProviderProps {
50
57
  evmContext: Context<EvmExternalWalletContextType>;
51
58
  solanaContext: Context<SolanaExternalWalletContextType>;
52
59
  cosmosContext: Context<CosmosExternalWalletContextType>;
60
+ externalWalletsWithFullAuth?: TExternalWallet[];
53
61
  }
54
- export declare function ExternalWalletProvider({ children, evmContext, solanaContext, cosmosContext, walletSort, }: ExternalWalletProviderProps): import("react/jsx-runtime").JSX.Element;
62
+ export declare function ExternalWalletProvider({ children, evmContext, solanaContext, cosmosContext, walletSort, externalWalletsWithFullAuth, }: ExternalWalletProviderProps): import("react/jsx-runtime").JSX.Element;
55
63
  export declare const useExternalWallets: () => {
56
64
  wallets: CommonWallet[];
57
65
  chains: CommonChain[];
@@ -71,5 +79,11 @@ export declare const useExternalWallets: () => {
71
79
  disconnectExternalWallet: () => Promise<void>;
72
80
  switchChain: (chainId: string) => Promise<void>;
73
81
  setChainIdSwitchingTo: (chainId?: string) => void;
82
+ verifyWalletSignature: () => Promise<{
83
+ address?: string;
84
+ signature?: string;
85
+ cosmosPublicKeyHex?: string;
86
+ cosmosSigner?: string;
87
+ }>;
74
88
  };
75
89
  export {};
@@ -4,10 +4,21 @@ import ParaWeb from '@getpara/web-sdk';
4
4
  export declare const defaultSolanaExternalWallet: {
5
5
  wallets: any[];
6
6
  disconnect: () => Promise<void>;
7
+ signMessage: () => Promise<{}>;
8
+ signVerificationMessage: () => Promise<{}>;
7
9
  };
8
10
  export type SolanaExternalWalletContextType = {
9
11
  wallets: CommonWallet[];
10
12
  disconnect: () => Promise<void>;
13
+ signMessage: (message: string) => Promise<{
14
+ signature?: string;
15
+ error?: string;
16
+ }>;
17
+ signVerificationMessage: () => Promise<{
18
+ address?: string;
19
+ signature?: string;
20
+ error?: string;
21
+ }>;
11
22
  };
12
23
  export declare const SolanaExternalWalletContext: import("react").Context<SolanaExternalWalletContextType>;
13
24
  export interface SolanaExternalWalletProviderProps {
@@ -2,6 +2,7 @@ import { EvmExternalWalletContextType, EvmExternalWalletProvider } from '../../p
2
2
  import { Context } from 'react';
3
3
  import { SolanaExternalWalletContextType, SolanaExternalWalletProvider } from '../../providers/SolanaExternalWalletContextStub.js';
4
4
  import { CosmosExternalWalletContextType, CosmosExternalWalletProvider } from '../../providers/CosmosExternalWalletContextStub.js';
5
+ import { TExternalWallet } from '../../types/externalWallets.js';
5
6
  interface ExternalWalletProviderState {
6
7
  EvmProvider?: typeof EvmExternalWalletProvider;
7
8
  evmContext?: Context<EvmExternalWalletContextType>;
@@ -11,6 +12,7 @@ interface ExternalWalletProviderState {
11
12
  cosmosContext?: Context<CosmosExternalWalletContextType>;
12
13
  connectParaEvmWallet?: () => Promise<any>;
13
14
  connectParaCosmosWallet?: () => Promise<any>;
15
+ fullAuthWallets: TExternalWallet[];
14
16
  }
15
17
  export interface ExternalWalletProviderActions {
16
18
  updateState: (state: Partial<ExternalWalletProviderState>) => void;
@@ -1,8 +1,10 @@
1
1
  import { IconType } from '@getpara/react-components';
2
+ import { WalletType } from '@getpara/web-sdk';
2
3
  export type WalletMetadata = {
3
4
  id: string;
4
5
  name: string;
5
6
  iconUrl: string;
7
+ rdns?: string;
6
8
  installed?: boolean;
7
9
  isExtension?: boolean;
8
10
  isMobile?: boolean;
@@ -29,13 +31,21 @@ export type WalletMetadata = {
29
31
  export type CommonWallet = {
30
32
  connect: () => Promise<{
31
33
  address?: string;
34
+ bufferAddress?: string;
32
35
  error?: string;
36
+ userExists: boolean;
37
+ isVerified: boolean;
33
38
  }>;
34
- connectMobile: (isManualWalletConnect?: boolean) => Promise<{
39
+ connectMobile: (_: {
40
+ isManualWalletConnect?: boolean;
41
+ }) => Promise<{
35
42
  address?: string;
43
+ bufferAddress?: string;
36
44
  error?: string;
45
+ userExists: boolean;
46
+ isVerified: boolean;
37
47
  }>;
38
- type: 'EVM' | 'SOLANA' | 'COSMOS';
48
+ type: WalletType;
39
49
  } & WalletMetadata;
40
50
  export type CommonChain = {
41
51
  id: string | number;
@@ -4,6 +4,7 @@ export declare enum EvmWallet {
4
4
  COINBASE = "COINBASE",
5
5
  WALLETCONNECT = "WALLETCONNECT",
6
6
  ZERION = "ZERION",
7
+ SAFE = "SAFE",
7
8
  RABBY = "RABBY"
8
9
  }
9
10
  export declare enum SolanaWallet {
@@ -26,6 +27,7 @@ export declare const ExternalWallet: {
26
27
  COINBASE: EvmWallet.COINBASE;
27
28
  WALLETCONNECT: EvmWallet.WALLETCONNECT;
28
29
  ZERION: EvmWallet.ZERION;
30
+ SAFE: EvmWallet.SAFE;
29
31
  RABBY: EvmWallet.RABBY;
30
32
  };
31
33
  export type TExternalWallet = keyof typeof ExternalWallet;
@@ -116,6 +116,12 @@ export interface ParaModalProps {
116
116
  * NOTE: Any wallets that are detected as installed will be sorted first, followed by those that are not detected or not installed.
117
117
  */
118
118
  externalWallets?: TExternalWallet[];
119
+ /**
120
+ * Which external wallets to include full Para authentication for.
121
+ *
122
+ * These wallets should also be included in the externalWallets list in order to be displayed in the modal.
123
+ */
124
+ externalWalletsWithParaAuth?: TExternalWallet[];
119
125
  /**
120
126
  * How the modal should order the components on the main auth screen.
121
127
  * Only the first method of each type (auth or external) will be used.
@@ -5,6 +5,7 @@ export declare enum ModalStep {
5
5
  EX_WALLET_MORE = "EX_WALLET_MORE",
6
6
  EX_WALLET_SELECTED = "EX_WALLET_SELECTED",
7
7
  VERIFICATIONS = "VERIFICATIONS",
8
+ EXTERNAL_WALLET_VERIFICATION = "EXTERNAL_WALLET_VERIFICATION",
8
9
  AWAITING_OAUTH = "AWAITING_OAUTH",
9
10
  FARCASTER_OAUTH = "FARCASTER_OAUTH",
10
11
  BIOMETRIC_CREATION = "BIOMETRIC_CREATION",
@@ -55,6 +56,7 @@ declare enum SignUpModalStep {
55
56
  EX_WALLET_MORE = "EX_WALLET_MORE",
56
57
  EX_WALLET_SELECTED = "EX_WALLET_SELECTED",
57
58
  VERIFICATIONS = "VERIFICATIONS",
59
+ EXTERNAL_WALLET_VERIFICATION = "EXTERNAL_WALLET_VERIFICATION",
58
60
  AWAITING_OAUTH = "AWAITING_OAUTH",
59
61
  FARCASTER_OAUTH = "FARCASTER_OAUTH",
60
62
  TELEGRAM_OAUTH = "TELEGRAM_OAUTH",
@@ -0,0 +1,5 @@
1
+ export declare const EXTERNAL_WALLET_PACKAGE_BY_TYPE: {
2
+ EVM: string;
3
+ COSMOS: string;
4
+ SOLANA: string;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk",
3
- "version": "1.6.1-dev.0",
3
+ "version": "1.7.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,9 +12,9 @@
12
12
  "*.css"
13
13
  ],
14
14
  "dependencies": {
15
- "@getpara/react-common": "1.6.0",
16
- "@getpara/react-components": "1.6.0",
17
- "@getpara/web-sdk": "1.6.0",
15
+ "@getpara/react-common": "1.7.1",
16
+ "@getpara/react-components": "1.7.1",
17
+ "@getpara/web-sdk": "1.7.1",
18
18
  "@tanstack/react-query": "^5.0.0",
19
19
  "date-fns": "^3.6.0",
20
20
  "framer-motion": "11.3.28",
@@ -49,5 +49,5 @@
49
49
  "resolutions": {
50
50
  "styled-components": "^6"
51
51
  },
52
- "gitHead": "e6e791d4e4f9afd94f2093d6045d686b85e5a682"
52
+ "gitHead": "767395af96d4a724946a092de760e9137a73369a"
53
53
  }
@@ -1,337 +0,0 @@
1
- "use client";
2
- import {
3
- __async,
4
- __objRest,
5
- __spreadValues
6
- } from "../chunk-MMUBH76A.js";
7
- import { jsx } from "react/jsx-runtime";
8
- import { CpslAuthModal, defineCustomElements, generateTheme } from "@getpara/react-components";
9
- import { ModalContent } from "./components/index.js";
10
- import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
11
- import { useModalStore, useUserInfoStore, useThemeStore } from "./stores/index.js";
12
- import { ModalStep, RESET_TO_ACCOUNT_STEPS, RESET_TO_AUTH_STEPS } from "./utils/steps.js";
13
- import { AuthLayout } from "./types/modalProps.js";
14
- import { DEFAULTS } from "./constants/defaults.js";
15
- import { useGoBack } from "./hooks/useGoBack.js";
16
- import { isPasskeySupported, ParaEvent } from "@getpara/web-sdk";
17
- import { ExternalWalletsWrapper } from "./components/ExternalWalletsWrapper/ExternalWalletsWrapper.js";
18
- import styled from "styled-components";
19
- import { useExternalWallets } from "./providers/ExternalWalletContext.js";
20
- import { hasEmbeddedAuth, hasExternalWallet } from "./utils/authLayoutHelpers.js";
21
- import { useModal, useWalletState } from "../provider/index.js";
22
- import { useStore } from "../provider/stores/useStore.js";
23
- import { useInternalClient } from "../provider/hooks/utils/useInternalClient.js";
24
- defineCustomElements();
25
- const ParaModal = forwardRef((_a, ref) => {
26
- var _b = _a, { para, isOpen } = _b, rest = __objRest(_b, ["para", "isOpen"]);
27
- const [isInitialized, setIsInitialized] = useState(false);
28
- const setClient = useStore((state) => state.setClient);
29
- const client = useStore((state) => state.client);
30
- const { closeModal, openModal } = useModal();
31
- useEffect(() => {
32
- if (!client) {
33
- setClient(para);
34
- }
35
- setIsInitialized(true);
36
- }, []);
37
- useEffect(() => {
38
- if (!isOpen) {
39
- closeModal();
40
- }
41
- if (isOpen) {
42
- openModal();
43
- }
44
- }, [isOpen]);
45
- if (!isInitialized) {
46
- return null;
47
- }
48
- return /* @__PURE__ */ jsx(ParaModalInner, __spreadValues({ ref, para }, rest));
49
- });
50
- const ParaModalInner = forwardRef(
51
- (_c, ref) => {
52
- var _d = _c, {
53
- theme,
54
- appName,
55
- logo,
56
- disableEmailLogin = false,
57
- disablePhoneLogin = false,
58
- oAuthMethods,
59
- bareModal = false,
60
- className,
61
- currentStepOverride,
62
- externalWallets,
63
- authLayout = [AuthLayout.AUTH_FULL, AuthLayout.EXTERNAL_FULL],
64
- embeddedModal,
65
- onModalStepChange,
66
- hideWallets = false,
67
- onClose
68
- } = _d, rest = __objRest(_d, [
69
- "theme",
70
- "appName",
71
- "logo",
72
- "disableEmailLogin",
73
- "disablePhoneLogin",
74
- "oAuthMethods",
75
- "bareModal",
76
- "className",
77
- "currentStepOverride",
78
- "externalWallets",
79
- "authLayout",
80
- "embeddedModal",
81
- "onModalStepChange",
82
- "hideWallets",
83
- "onClose"
84
- ]);
85
- const modalContentRef = useRef(null);
86
- const updateThemeState = useThemeStore((state) => state.updateState);
87
- const refs = useModalStore((state) => state.refs);
88
- const setWebAuthURLForLogin = useModalStore((state) => state.setWebAuthURLForLogin);
89
- const setWebAuthURLForCreate = useModalStore((state) => state.setWebAuthURLForCreate);
90
- const setBiometricLocationHints = useModalStore((state) => state.setBiometricLocationHints);
91
- const currentStep = useModalStore((state) => state.step);
92
- const setOnModalStepChange = useModalStore((state) => state.setOnModalStepChange);
93
- const setStep = useModalStore((state) => state.setStep);
94
- const setAuthInfo = useUserInfoStore((state) => state.setAuthInfo);
95
- const hasPreviousStep = useModalStore((state) => state.hasPreviousStep());
96
- const setFlow = useModalStore((state) => state.setFlow);
97
- const setIsFullyLoggedIn = useModalStore((state) => state.setIsFullyLoggedIn);
98
- const goBack = useGoBack();
99
- const setAuthLayout = useThemeStore((state) => state.setAuthLayout);
100
- const storedAuthLayout = useThemeStore((state) => state.authLayout);
101
- const resetModalState = useModalStore((state) => state.resetState);
102
- const resetUserInfoState = useUserInfoStore((state) => state.resetState);
103
- const setRecoveryShare = useUserInfoStore((state) => state.setRecoveryShare);
104
- const { disconnectExternalWallet } = useExternalWallets();
105
- const { isOpen, closeModal } = useModal();
106
- const para = useInternalClient();
107
- const { selectedWallet, setSelectedWallet } = useWalletState();
108
- const setIsPasskeySupported = useModalStore((state) => state.setIsPasskeySupported);
109
- const [isModalMounted, setIsModalMounted] = useState(false);
110
- const [isInit, setIsInit] = useState(false);
111
- const [ready, setIsReady] = useState(false);
112
- useImperativeHandle(ref, () => {
113
- return {
114
- goBack() {
115
- goBack();
116
- },
117
- canGoBack() {
118
- return hasPreviousStep;
119
- },
120
- currentStep() {
121
- return currentStep;
122
- },
123
- handleModalClose() {
124
- var _a;
125
- (_a = modalContentRef == null ? void 0 : modalContentRef.current) == null ? void 0 : _a.handleModalClose();
126
- }
127
- };
128
- }, [hasPreviousStep, currentStep]);
129
- const initModal = () => __async(void 0, null, function* () {
130
- const isAccount = yield para.isFullyLoggedIn();
131
- setIsPasskeySupported(yield isPasskeySupported());
132
- if (currentStepOverride) {
133
- setStep(ModalStep[currentStepOverride.toUpperCase()]);
134
- } else if (isAccount) {
135
- setFlow("account");
136
- setStep(ModalStep.ACCOUNT_MAIN);
137
- setIsFullyLoggedIn(true);
138
- } else {
139
- if (currentStep !== ModalStep.AUTH_MAIN && currentStep !== ModalStep.SECRET) {
140
- setStep(ModalStep.AUTH_MAIN);
141
- setFlow();
142
- setWebAuthURLForLogin();
143
- setWebAuthURLForCreate();
144
- setBiometricLocationHints();
145
- }
146
- yield disconnectExternalWallet();
147
- setSelectedWallet({ id: void 0, type: void 0 });
148
- setIsFullyLoggedIn(false);
149
- }
150
- switch (true) {
151
- case para.isEmail:
152
- setAuthInfo({ email: para.getEmail() });
153
- break;
154
- case para.isPhone:
155
- {
156
- const { phone, countryCode } = para.getPhone();
157
- setAuthInfo({ phone, countryCode });
158
- }
159
- break;
160
- case para.isFarcaster:
161
- setAuthInfo({ farcasterUsername: para.getFarcasterUsername() });
162
- break;
163
- case para.isTelegram:
164
- setAuthInfo({ telegramUserId: para.telegramUserId });
165
- if (!isAccount) {
166
- setStep(ModalStep.TELEGRAM_OAUTH);
167
- }
168
- break;
169
- }
170
- setIsInit(true);
171
- });
172
- useEffect(() => {
173
- let _authLayout = authLayout;
174
- if (!(externalWallets == null ? void 0 : externalWallets.length) && hasExternalWallet(authLayout)) {
175
- _authLayout = _authLayout.filter((l) => !l.includes("EXTERNAL"));
176
- }
177
- if (disableEmailLogin && disablePhoneLogin && !(oAuthMethods == null ? void 0 : oAuthMethods.length) && hasEmbeddedAuth(authLayout)) {
178
- _authLayout = _authLayout.filter((l) => !l.includes("AUTH"));
179
- }
180
- if (JSON.stringify(storedAuthLayout) !== JSON.stringify(_authLayout)) {
181
- setAuthLayout(_authLayout);
182
- }
183
- }, [disableEmailLogin, disablePhoneLogin, oAuthMethods, externalWallets, authLayout]);
184
- useEffect(() => {
185
- setOnModalStepChange(onModalStepChange);
186
- }, [onModalStepChange]);
187
- useEffect(() => {
188
- var _a;
189
- updateThemeState({
190
- logo,
191
- appName,
192
- oAuthLogoVariant: (_a = theme == null ? void 0 : theme.oAuthLogoVariant) != null ? _a : "default",
193
- bareModal,
194
- embeddedModal,
195
- hideWallets
196
- });
197
- }, [logo, appName, theme == null ? void 0 : theme.oAuthLogoVariant, bareModal, embeddedModal, hideWallets]);
198
- useEffect(() => {
199
- if (theme) {
200
- generateTheme(theme);
201
- updateThemeState({ isDark: theme.mode === "dark", theme });
202
- }
203
- }, [theme]);
204
- useEffect(() => {
205
- if (para) {
206
- initModal();
207
- if (bareModal) {
208
- setIsModalMounted(true);
209
- }
210
- } else {
211
- console.error("A Para instance must be provided.");
212
- }
213
- }, []);
214
- useEffect(() => {
215
- if (isOpen && para) {
216
- initModal();
217
- }
218
- }, [isOpen]);
219
- const updateActiveWallet = () => {
220
- if (!(selectedWallet == null ? void 0 : selectedWallet.id) || !para.findWallet(selectedWallet == null ? void 0 : selectedWallet.id)) {
221
- const defaultWallet = para.findWallet(void 0, void 0, { forbidPregen: true });
222
- setSelectedWallet({ id: defaultWallet == null ? void 0 : defaultWallet.id, type: defaultWallet == null ? void 0 : defaultWallet.type });
223
- }
224
- };
225
- useEffect(() => {
226
- updateActiveWallet();
227
- }, [para]);
228
- useEffect(() => {
229
- const closePopupWindow = () => {
230
- var _a;
231
- (_a = refs.popupWindow.current) == null ? void 0 : _a.close();
232
- };
233
- if (typeof window !== "undefined") {
234
- window.addEventListener(ParaEvent.WALLETS_CHANGE_EVENT, updateActiveWallet);
235
- window.addEventListener(ParaEvent.EXTERNAL_WALLET_CHANGE_EVENT, updateActiveWallet);
236
- window.addEventListener("beforeunload", closePopupWindow);
237
- }
238
- setIsReady(true);
239
- return () => {
240
- if (typeof window !== "undefined") {
241
- window.removeEventListener(ParaEvent.WALLETS_CHANGE_EVENT, updateActiveWallet);
242
- window.removeEventListener(ParaEvent.EXTERNAL_WALLET_CHANGE_EVENT, updateActiveWallet);
243
- window.removeEventListener("beforeunload", closePopupWindow);
244
- }
245
- };
246
- }, []);
247
- const handleClose = () => {
248
- closeModal();
249
- onClose == null ? void 0 : onClose();
250
- };
251
- const handleModalEntering = () => {
252
- setIsModalMounted(true);
253
- };
254
- const handleModalExited = () => __async(void 0, null, function* () {
255
- if (!bareModal) {
256
- setIsModalMounted(false);
257
- }
258
- if (RESET_TO_AUTH_STEPS.includes(currentStep)) {
259
- resetModalState();
260
- resetUserInfoState();
261
- setRecoveryShare(null);
262
- } else if (RESET_TO_ACCOUNT_STEPS.includes(currentStep)) {
263
- setStep(ModalStep.LOGIN_DONE);
264
- }
265
- if (para) {
266
- yield initModal();
267
- para.exitLoops();
268
- }
269
- if (!bareModal) {
270
- setIsInit(false);
271
- }
272
- });
273
- if (!ready) {
274
- return null;
275
- }
276
- if (!para) {
277
- console.error("A Para instance is required.");
278
- return null;
279
- }
280
- if (!(storedAuthLayout == null ? void 0 : storedAuthLayout.length)) {
281
- const hasExternalWalletError = !(externalWallets == null ? void 0 : externalWallets.length) && hasExternalWallet(authLayout);
282
- const hasEmbeddedWalletError = disableEmailLogin && disablePhoneLogin && !(oAuthMethods == null ? void 0 : oAuthMethods.length) && hasEmbeddedAuth(authLayout);
283
- if (hasExternalWalletError || hasEmbeddedWalletError) {
284
- if (hasExternalWalletError) {
285
- console.error("At least one external wallet must be provided if external wallet auth is enabled.");
286
- }
287
- if (hasEmbeddedWalletError) {
288
- console.error(
289
- "At least one login method (email, phone or OAuth) must be provided if embedded wallet auth is enabled."
290
- );
291
- }
292
- } else {
293
- console.error("At least one auth layout selection is required.");
294
- }
295
- return null;
296
- }
297
- return /* @__PURE__ */ jsx(ExternalWalletsWrapper, { wallets: externalWallets, children: /* @__PURE__ */ jsx(
298
- StyledAuthModal,
299
- {
300
- enterTransitionDuration: DEFAULTS.ANIMATION_DURATION,
301
- exitTransitionDuration: DEFAULTS.ANIMATION_DURATION,
302
- open: isOpen,
303
- onCpslModalExited: handleModalExited,
304
- onCpslModalEntering: handleModalEntering,
305
- onCpslModalRequestClose: handleClose,
306
- noOverlay: bareModal,
307
- className,
308
- "data-testid": "modal",
309
- $embeddedModal: embeddedModal,
310
- children: isModalMounted && (isInit && embeddedModal || !embeddedModal) && /* @__PURE__ */ jsx(
311
- ModalContent,
312
- __spreadValues({
313
- oAuthMethods,
314
- disableEmailLogin,
315
- disablePhoneLogin,
316
- onClose: handleClose
317
- }, rest)
318
- )
319
- }
320
- ) });
321
- }
322
- );
323
- const StyledAuthModal = styled(CpslAuthModal)`
324
- ${({ $embeddedModal }) => $embeddedModal && `
325
- &::part(modal-body-card) {
326
- --card-box-shadow: none;
327
- --card-border-width: 0px;
328
- };
329
-
330
- &::part(modal-footer) {
331
- --card-box-shadow: none;
332
- --card-border-width: 0px;
333
- };`}
334
- `;
335
- export {
336
- ParaModal
337
- };