@getpara/react-common 2.11.0 → 2.13.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/classes/ParaInternal.d.ts +7 -9
- package/dist/constants/externalWalletDefaults.d.ts +3 -3
- package/dist/constants/externalWalletDefaults.js +6 -6
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +18 -25
- package/dist/types/externalWalletCommon.d.ts +2 -3
- package/package.json +4 -4
|
@@ -4,10 +4,11 @@ export declare class ParaInternal extends ParaWeb implements InternalInterface {
|
|
|
4
4
|
temporaryShares?: any[];
|
|
5
5
|
skipSessionRefresh?: boolean;
|
|
6
6
|
}) => Promise<void>;
|
|
7
|
-
getTransmissionKeyShares: ({ isForNewDevice }?: {
|
|
7
|
+
getTransmissionKeyShares: ({ isForNewDevice, sessionLookupId: existingSessionLookupId, }?: {
|
|
8
8
|
isForNewDevice?: boolean;
|
|
9
|
+
sessionLookupId?: string;
|
|
9
10
|
}) => Promise<any>;
|
|
10
|
-
userSetupAfterLogin: () => Promise<import("@getpara/shared").SessionInfo>;
|
|
11
|
+
userSetupAfterLogin: (existingSession?: import("@getpara/shared").SessionInfo) => Promise<import("@getpara/shared").SessionInfo>;
|
|
11
12
|
setLoginEncryptionKeyPair: (keyPair?: import("node-forge").pki.rsa.KeyPair) => Promise<void>;
|
|
12
13
|
getPortalURL: (isLegacy?: boolean) => Promise<string>;
|
|
13
14
|
isProviderModalDisabled: () => boolean;
|
|
@@ -16,13 +17,10 @@ export declare class ParaInternal extends ParaWeb implements InternalInterface {
|
|
|
16
17
|
userId?: string;
|
|
17
18
|
}) => Promise<typeof this.authInfo>;
|
|
18
19
|
supportedAuthMethods: (auth: import("@getpara/web-sdk").Auth<import("@getpara/shared").PrimaryAuthType | "userId">) => Promise<Set<import("@getpara/web-sdk").AuthMethod>>;
|
|
19
|
-
constructPortalUrl: (type: import("@getpara/
|
|
20
|
+
constructPortalUrl: (type: import("@getpara/web-sdk").PortalUrlType, opts?: import("@getpara/web-sdk").PortalUrlOptions) => Promise<string>;
|
|
20
21
|
getSwitchWalletsUrl: () => Promise<string>;
|
|
21
|
-
getNewCredentialAndUrl: (
|
|
22
|
-
|
|
23
|
-
url?: string;
|
|
24
|
-
}>;
|
|
25
|
-
prepareLogin: () => import("@getpara/web-sdk").InternalMethodResponse<"prepareLogin">;
|
|
22
|
+
getNewCredentialAndUrl: (params?: import("@getpara/web-sdk").GetNewCredentialAndUrlParams) => Promise<import("@getpara/web-sdk").GetNewCredentialAndUrlResponse>;
|
|
23
|
+
prepareLogin: () => Promise<string>;
|
|
26
24
|
supportedUserAuthMethods: () => Promise<Set<import("@getpara/web-sdk").AuthMethod>>;
|
|
27
25
|
linkAccount: (opts: import("@getpara/web-sdk").InternalMethodParams<"linkAccount">) => import("@getpara/web-sdk").InternalMethodResponse<"linkAccount">;
|
|
28
26
|
unlinkAccount: ({ linkedAccountId, }: import("@getpara/web-sdk").InternalMethodParams<"unlinkAccount">) => import("@getpara/web-sdk").InternalMethodResponse<"unlinkAccount">;
|
|
@@ -37,7 +35,7 @@ export declare class ParaInternal extends ParaWeb implements InternalInterface {
|
|
|
37
35
|
refetch?: boolean;
|
|
38
36
|
}) => Promise<import("@getpara/web-sdk").ProfileBalance>;
|
|
39
37
|
setModalError: (_error?: string) => void;
|
|
40
|
-
waitForWalletSwitching: (args: import("@getpara/web-sdk").
|
|
38
|
+
waitForWalletSwitching: (args: import("@getpara/web-sdk").WaitForLoginParams) => Promise<import("@getpara/web-sdk").WaitForLoginResponse>;
|
|
41
39
|
displayModalError: (error?: string) => void;
|
|
42
40
|
get partnerLogo(): string;
|
|
43
41
|
get partnerName(): string;
|
|
@@ -8,10 +8,10 @@ export declare const defaultCosmosExternalWallet: {
|
|
|
8
8
|
switchChain: () => Promise<void>;
|
|
9
9
|
connectParaEmbedded: () => Promise<{}>;
|
|
10
10
|
signMessage: () => Promise<{}>;
|
|
11
|
-
signVerificationMessage: () => Promise<{}>;
|
|
12
11
|
requestInfo: () => Promise<any>;
|
|
13
12
|
disconnectBase: () => Promise<void>;
|
|
14
13
|
useAccount: () => any;
|
|
14
|
+
switchConnection: () => Promise<void>;
|
|
15
15
|
};
|
|
16
16
|
export declare const defaultEvmExternalWallet: {
|
|
17
17
|
wallets: any[];
|
|
@@ -25,7 +25,6 @@ export declare const defaultEvmExternalWallet: {
|
|
|
25
25
|
switchChain: () => Promise<void>;
|
|
26
26
|
connectParaEmbedded: () => Promise<{}>;
|
|
27
27
|
signMessage: () => Promise<{}>;
|
|
28
|
-
signVerificationMessage: () => Promise<{}>;
|
|
29
28
|
getWalletBalance: () => Promise<any>;
|
|
30
29
|
requestInfo: () => Promise<ExternalWalletInfo>;
|
|
31
30
|
disconnectBase: () => Promise<void>;
|
|
@@ -34,17 +33,18 @@ export declare const defaultEvmExternalWallet: {
|
|
|
34
33
|
isPresent: false;
|
|
35
34
|
};
|
|
36
35
|
verificationStage: any;
|
|
36
|
+
switchConnection: () => Promise<void>;
|
|
37
37
|
};
|
|
38
38
|
export declare const defaultSolanaExternalWallet: {
|
|
39
39
|
wallets: any[];
|
|
40
40
|
disconnect: () => Promise<void>;
|
|
41
41
|
disconnectStatus: string;
|
|
42
42
|
signMessage: () => Promise<{}>;
|
|
43
|
-
signVerificationMessage: () => Promise<{}>;
|
|
44
43
|
requestInfo: () => Promise<ExternalWalletInfo>;
|
|
45
44
|
disconnectBase: () => Promise<void>;
|
|
46
45
|
useWallet: () => any;
|
|
47
46
|
farcasterStatus: {
|
|
48
47
|
isPresent: false;
|
|
49
48
|
};
|
|
49
|
+
switchConnection: () => Promise<void>;
|
|
50
50
|
};
|
|
@@ -9,10 +9,10 @@ const defaultCosmosExternalWallet = {
|
|
|
9
9
|
switchChain: () => Promise.resolve(),
|
|
10
10
|
connectParaEmbedded: () => Promise.resolve({}),
|
|
11
11
|
signMessage: () => Promise.resolve({}),
|
|
12
|
-
signVerificationMessage: () => Promise.resolve({}),
|
|
13
12
|
requestInfo: () => Promise.resolve({}),
|
|
14
13
|
disconnectBase: () => Promise.resolve(),
|
|
15
|
-
useAccount: () => void 0
|
|
14
|
+
useAccount: () => void 0,
|
|
15
|
+
switchConnection: () => Promise.resolve()
|
|
16
16
|
};
|
|
17
17
|
const defaultEvmExternalWallet = {
|
|
18
18
|
wallets: [],
|
|
@@ -26,24 +26,24 @@ const defaultEvmExternalWallet = {
|
|
|
26
26
|
switchChain: () => Promise.resolve(),
|
|
27
27
|
connectParaEmbedded: () => Promise.resolve({}),
|
|
28
28
|
signMessage: () => Promise.resolve({}),
|
|
29
|
-
signVerificationMessage: () => Promise.resolve({}),
|
|
30
29
|
getWalletBalance: () => Promise.resolve(void 0),
|
|
31
30
|
requestInfo: () => Promise.resolve({}),
|
|
32
31
|
disconnectBase: () => Promise.resolve(),
|
|
33
32
|
useAccount: () => void 0,
|
|
34
33
|
farcasterStatus: { isPresent: false },
|
|
35
|
-
verificationStage: void 0
|
|
34
|
+
verificationStage: void 0,
|
|
35
|
+
switchConnection: () => Promise.resolve()
|
|
36
36
|
};
|
|
37
37
|
const defaultSolanaExternalWallet = {
|
|
38
38
|
wallets: [],
|
|
39
39
|
disconnect: () => Promise.resolve(),
|
|
40
40
|
disconnectStatus: "idle",
|
|
41
41
|
signMessage: () => Promise.resolve({}),
|
|
42
|
-
signVerificationMessage: () => Promise.resolve({}),
|
|
43
42
|
requestInfo: () => Promise.resolve({}),
|
|
44
43
|
disconnectBase: () => Promise.resolve(),
|
|
45
44
|
useWallet: () => void 0,
|
|
46
|
-
farcasterStatus: { isPresent: false }
|
|
45
|
+
farcasterStatus: { isPresent: false },
|
|
46
|
+
switchConnection: () => Promise.resolve()
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
49
|
defaultCosmosExternalWallet,
|
|
@@ -31,7 +31,6 @@ export declare const NETWORK_NOT_SUPPORTED_ERROR = "network not supported";
|
|
|
31
31
|
export declare const EMAIL_REGEX: RegExp;
|
|
32
32
|
export declare const BODY_MOTION_VARIANTS: Variants;
|
|
33
33
|
export declare const BODY_TRANSITION: Transition;
|
|
34
|
-
export declare const SDK_VERSION: string;
|
|
35
34
|
export * from './aaguiMetadata.js';
|
|
36
35
|
export * from './externalWalletDefaults.js';
|
|
37
36
|
export * from './oAuthLogos.js';
|
package/dist/constants/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
5
|
} from "../chunk-MMUBH76A.js";
|
|
6
|
-
var _a;
|
|
7
6
|
import { OnRampMethod, OnRampProvider } from "@getpara/core-sdk";
|
|
8
7
|
const PARA_CONNECT = "https://connect.getpara.com/";
|
|
9
8
|
const PARA_TERMS_AND_CONDITIONS = "https://getpara.com/terms";
|
|
@@ -84,50 +83,45 @@ const ON_RAMP_ASSETS = Object.entries({
|
|
|
84
83
|
});
|
|
85
84
|
}, {});
|
|
86
85
|
function getNetworkName(str) {
|
|
87
|
-
var
|
|
88
|
-
return (_b = (
|
|
86
|
+
var _a, _b;
|
|
87
|
+
return (_b = (_a = NETWORKS[str]) == null ? void 0 : _a.name) != null ? _b : `${str[0]}${str.slice(1).toLowerCase()}`;
|
|
89
88
|
}
|
|
90
89
|
function getNetworkIcon(str) {
|
|
91
|
-
var
|
|
92
|
-
return (_b = (
|
|
90
|
+
var _a, _b;
|
|
91
|
+
return (_b = (_a = NETWORKS[str]) == null ? void 0 : _a.icon) != null ? _b : "globe";
|
|
93
92
|
}
|
|
94
93
|
function getAssetCode(str) {
|
|
95
|
-
var
|
|
96
|
-
return (_b = (
|
|
94
|
+
var _a, _b;
|
|
95
|
+
return (_b = (_a = ON_RAMP_ASSETS[str]) == null ? void 0 : _a.code) != null ? _b : str;
|
|
97
96
|
}
|
|
98
97
|
function getAssetName(str) {
|
|
99
|
-
var
|
|
100
|
-
return (_b = (
|
|
98
|
+
var _a, _b;
|
|
99
|
+
return (_b = (_a = ON_RAMP_ASSETS[str]) == null ? void 0 : _a.name) != null ? _b : str;
|
|
101
100
|
}
|
|
102
101
|
function getAssetIcon(str) {
|
|
103
|
-
var
|
|
104
|
-
return (_b = (
|
|
102
|
+
var _a, _b;
|
|
103
|
+
return (_b = (_a = ON_RAMP_ASSETS[str]) == null ? void 0 : _a.icon) != null ? _b : "emptyCircle";
|
|
105
104
|
}
|
|
106
105
|
const MOBILE_SIZE = 480;
|
|
107
106
|
const NETWORK_NOT_SUPPORTED_ERROR = "network not supported";
|
|
108
107
|
const EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
109
108
|
const BODY_MOTION_VARIANTS = {
|
|
110
|
-
enter: (direction) => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
};
|
|
115
|
-
},
|
|
109
|
+
enter: (direction) => ({
|
|
110
|
+
scale: direction > 0 ? 0.95 : 1.05,
|
|
111
|
+
opacity: 0
|
|
112
|
+
}),
|
|
116
113
|
center: {
|
|
117
114
|
scale: 1,
|
|
118
115
|
opacity: 1
|
|
119
116
|
},
|
|
120
|
-
exit: (direction) => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
};
|
|
125
|
-
}
|
|
117
|
+
exit: (direction) => ({
|
|
118
|
+
scale: direction > 0 ? 1.05 : 0.95,
|
|
119
|
+
opacity: 0
|
|
120
|
+
})
|
|
126
121
|
};
|
|
127
122
|
const BODY_TRANSITION = {
|
|
128
123
|
duration: 0.2
|
|
129
124
|
};
|
|
130
|
-
const SDK_VERSION = (_a = process.env.PARA_REACT_SDK_VERSION) != null ? _a : "";
|
|
131
125
|
export * from "./aaguiMetadata.js";
|
|
132
126
|
export * from "./externalWalletDefaults.js";
|
|
133
127
|
export * from "./oAuthLogos.js";
|
|
@@ -142,7 +136,6 @@ export {
|
|
|
142
136
|
ON_RAMP_PROVIDERS,
|
|
143
137
|
PARA_CONNECT,
|
|
144
138
|
PARA_TERMS_AND_CONDITIONS,
|
|
145
|
-
SDK_VERSION,
|
|
146
139
|
WALLET_TYPES_METADATA,
|
|
147
140
|
getAssetCode,
|
|
148
141
|
getAssetIcon,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ParaWeb, { AuthStateLogin, AuthStateVerify, ExternalWalletInfo, TExternalWallet, TWalletType
|
|
1
|
+
import ParaWeb, { AuthStateLogin, AuthStateVerify, ExternalWalletInfo, TExternalWallet, TWalletType } from '@getpara/web-sdk';
|
|
2
2
|
export type DisconnectType = 'ACCOUNT_LINKING' | 'ACCOUNT_WIDGET';
|
|
3
3
|
export type MutationStatus = 'idle' | 'pending' | 'error' | 'success';
|
|
4
4
|
export type DisconnectBaseOptions = {
|
|
@@ -97,9 +97,9 @@ export type ExternalWalletContextType<S extends SignResult = SignResult> = {
|
|
|
97
97
|
wallets: CommonWallet[];
|
|
98
98
|
disconnect: () => Promise<void>;
|
|
99
99
|
signMessage: (_: SignArgs) => Promise<S>;
|
|
100
|
-
signVerificationMessage: () => Promise<S>;
|
|
101
100
|
requestInfo: (_: string) => Promise<ExternalWalletInfo>;
|
|
102
101
|
disconnectBase: (_?: string, __?: DisconnectBaseOptions) => Promise<void>;
|
|
102
|
+
switchConnection?: (_: string) => Promise<void>;
|
|
103
103
|
disconnectStatus: MutationStatus;
|
|
104
104
|
};
|
|
105
105
|
export type ExternalWalletProviderConfigBase = {
|
|
@@ -111,7 +111,6 @@ export type ExternalWalletProviderConfigBase = {
|
|
|
111
111
|
walletsWithFullAuth: TExternalWallet[] | 'ALL';
|
|
112
112
|
includeWalletVerification?: boolean;
|
|
113
113
|
connectionOnly?: boolean;
|
|
114
|
-
connectedWallet?: Pick<Wallet, 'id' | 'type'> | null;
|
|
115
114
|
};
|
|
116
115
|
export type ExternalWalletProviderConfig<W, P = {}> = ExternalWalletProviderConfigBase & {
|
|
117
116
|
wallets: W[];
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/react-components": "2.
|
|
6
|
-
"@getpara/web-sdk": "2.
|
|
5
|
+
"@getpara/react-components": "2.13.0",
|
|
6
|
+
"@getpara/web-sdk": "2.13.0",
|
|
7
7
|
"@moonpay/moonpay-react": "^1.10.6",
|
|
8
8
|
"@ramp-network/ramp-instant-sdk": "^4.0.5",
|
|
9
9
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
],
|
|
41
41
|
"type": "module",
|
|
42
42
|
"types": "dist/index.d.ts",
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "75ac5d1ebe87366c23bb4e485481deb1b593e299"
|
|
44
44
|
}
|