@getpara/react-sdk 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
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>>;
@@ -0,0 +1,8 @@
1
+ import { AuthType } from '@getpara/user-management-client';
2
+ import { AuthMethod } from '@getpara/web-sdk';
3
+ export declare const useSetLoginURLs: () => ({ supportedAuthMethods, authType, displayName, pfpUrl, }: {
4
+ supportedAuthMethods: Set<AuthMethod>;
5
+ authType: AuthType;
6
+ displayName?: string;
7
+ pfpUrl?: string;
8
+ }) => Promise<void>;
@@ -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.0",
3
+ "version": "1.7.0",
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.0",
16
+ "@getpara/react-components": "1.7.0",
17
+ "@getpara/web-sdk": "1.7.0",
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": "2dd6c8ea893d72d693804e5c5b0856d2ea6c3a7a"
52
+ "gitHead": "241b03ee3d3502af3b8d702dabd615b266da10ae"
53
53
  }