@getpara/core-sdk 2.0.0-alpha.3 → 2.0.0-dev.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.
- package/dist/cjs/index.js +1465 -420
- package/dist/cjs/index.js.br +0 -0
- package/dist/cjs/index.js.gz +0 -0
- package/dist/esm/index.js +1468 -422
- package/dist/esm/index.js.br +0 -0
- package/dist/esm/index.js.gz +0 -0
- package/dist/types/ParaCore.d.ts +414 -35
- package/dist/types/types/coreApi.d.ts +20 -20
- package/dist/types/types/methods.d.ts +49 -1
- package/package.json +3 -4
|
@@ -2,7 +2,7 @@ import { BackupKitEmailProps, CurrentWalletIds, ExternalWalletInfo, OnRampPurcha
|
|
|
2
2
|
import { AuthStateLogin, AuthStateVerify, OAuthResponse, AuthStateBaseParams, WithCustomTheme, WithUseShortUrls, Verify2faResponse, AuthStateSignup, AuthStateVerifyOrLogin, OAuthUrlParams, StorageType, PollParams } from './methods.js';
|
|
3
3
|
import { ParaCore } from '../ParaCore.js';
|
|
4
4
|
import { FullSignatureRes, Wallet } from './wallet.js';
|
|
5
|
-
export declare const PARA_CORE_METHODS: readonly ["
|
|
5
|
+
export declare const PARA_CORE_METHODS: readonly ["signUpOrLogInV2", "verifyNewAccountV2", "waitForLoginV2", "waitForSignupV2", "waitForWalletCreationV2", "verifyOAuthV2", "verifyFarcasterV2", "verifyTelegramV2", "resendVerificationCode", "loginExternalWalletV2", "verifyExternalWalletV2", "setup2faV2", "enable2faV2", "verify2faV2", "logout", "clearStorage", "isSessionActive", "isFullyLoggedIn", "refreshSession", "keepSessionAlive", "exportSession", "importSession", "getVerificationToken", "fetchWallets", "createWallet", "createWalletPerType", "getPregenWalletsV2", "hasPregenWalletV2", "updatePregenWalletIdentifierV2", "createPregenWalletV2", "createPregenWalletPerTypeV2", "claimPregenWalletsV2", "distributeNewWalletShare", "getUserShare", "setUserShare", "refreshShare", "signMessage", "signTransaction", "initiateOnRampTransaction"];
|
|
6
6
|
export type CoreMethodName = (typeof PARA_CORE_METHODS)[number];
|
|
7
7
|
export type CoreMethodParams<method extends CoreMethodName & keyof CoreMethods> = CoreMethods[method] extends {
|
|
8
8
|
params: infer P;
|
|
@@ -19,7 +19,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
19
19
|
response?: unknown;
|
|
20
20
|
sync?: true;
|
|
21
21
|
}> & {
|
|
22
|
-
|
|
22
|
+
signUpOrLogInV2: {
|
|
23
23
|
params: WithCustomTheme & WithUseShortUrls & {
|
|
24
24
|
/**
|
|
25
25
|
* The user's email address or phone number, in the form `{ email: '...' } | { phone: '+1...' }`}
|
|
@@ -28,7 +28,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
28
28
|
};
|
|
29
29
|
response: AuthStateVerify | AuthStateLogin;
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
verifyNewAccountV2: {
|
|
32
32
|
params: WithCustomTheme & WithUseShortUrls & {
|
|
33
33
|
/**
|
|
34
34
|
* The verification code entered by the user.
|
|
@@ -37,7 +37,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
37
37
|
};
|
|
38
38
|
response: AuthStateSignup;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
waitForLoginV2: {
|
|
41
41
|
params: PollParams & {
|
|
42
42
|
/**
|
|
43
43
|
* Whether to skip the session refresh
|
|
@@ -59,7 +59,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
59
59
|
partnerId?: string;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
waitForSignupV2: {
|
|
63
63
|
params: PollParams & {
|
|
64
64
|
/**
|
|
65
65
|
* A function returning a boolean, indicating whether the signup process should be cancelled.
|
|
@@ -68,7 +68,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
68
68
|
};
|
|
69
69
|
response: true;
|
|
70
70
|
};
|
|
71
|
-
|
|
71
|
+
waitForWalletCreationV2: {
|
|
72
72
|
params: PollParams & {
|
|
73
73
|
/**
|
|
74
74
|
* A function returning a boolean, indicating whether wallet creation should be cancelled.
|
|
@@ -86,7 +86,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
86
86
|
recoverySecret?: string;
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
verifyOAuthV2: {
|
|
90
90
|
params: AuthStateBaseParams & OAuthUrlParams & PollParams & {
|
|
91
91
|
/**
|
|
92
92
|
* A function returning a boolean, indicating whether the OAuth process should be cancelled.
|
|
@@ -100,7 +100,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
100
100
|
};
|
|
101
101
|
response: OAuthResponse;
|
|
102
102
|
};
|
|
103
|
-
|
|
103
|
+
verifyFarcasterV2: {
|
|
104
104
|
params: AuthStateBaseParams & PollParams & {
|
|
105
105
|
/**
|
|
106
106
|
* A function returning a boolean, indicating whether the Farcaster login process should be cancelled.
|
|
@@ -114,7 +114,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
114
114
|
};
|
|
115
115
|
response: OAuthResponse;
|
|
116
116
|
};
|
|
117
|
-
|
|
117
|
+
verifyTelegramV2: {
|
|
118
118
|
params: AuthStateBaseParams & {
|
|
119
119
|
/**
|
|
120
120
|
* The response received from the Telegram login bot.
|
|
@@ -123,7 +123,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
123
123
|
};
|
|
124
124
|
response: OAuthResponse;
|
|
125
125
|
};
|
|
126
|
-
|
|
126
|
+
loginExternalWalletV2: {
|
|
127
127
|
params: AuthStateBaseParams & {
|
|
128
128
|
/**
|
|
129
129
|
* The external wallet information to use for login.
|
|
@@ -132,7 +132,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
132
132
|
};
|
|
133
133
|
response: AuthStateVerifyOrLogin;
|
|
134
134
|
};
|
|
135
|
-
|
|
135
|
+
verifyExternalWalletV2: {
|
|
136
136
|
params: AuthStateBaseParams & VerifyExternalWalletParams;
|
|
137
137
|
response: AuthStateSignup;
|
|
138
138
|
};
|
|
@@ -184,11 +184,11 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
184
184
|
params: void;
|
|
185
185
|
response: string;
|
|
186
186
|
};
|
|
187
|
-
|
|
187
|
+
setup2faV2: {
|
|
188
188
|
params: void;
|
|
189
189
|
response: Setup2faResponse;
|
|
190
190
|
};
|
|
191
|
-
|
|
191
|
+
enable2faV2: {
|
|
192
192
|
params: {
|
|
193
193
|
/**
|
|
194
194
|
* The two-factor authentication code entered by the user.
|
|
@@ -197,7 +197,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
197
197
|
};
|
|
198
198
|
response: void;
|
|
199
199
|
};
|
|
200
|
-
|
|
200
|
+
verify2faV2: {
|
|
201
201
|
params: {
|
|
202
202
|
/**
|
|
203
203
|
* The email or phone number for the user to verify, in the form `{ email: '...' } | { phone: '+1...' }`
|
|
@@ -247,7 +247,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
247
247
|
recoverySecret?: string;
|
|
248
248
|
};
|
|
249
249
|
};
|
|
250
|
-
|
|
250
|
+
getPregenWalletsV2: {
|
|
251
251
|
params: {
|
|
252
252
|
/**
|
|
253
253
|
* The pregen ID for the wallets to fetch. If not provided, all available wallets will be retrieved.
|
|
@@ -256,7 +256,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
256
256
|
};
|
|
257
257
|
response: WalletEntity[];
|
|
258
258
|
};
|
|
259
|
-
|
|
259
|
+
updatePregenWalletIdentifierV2: {
|
|
260
260
|
params: {
|
|
261
261
|
/**
|
|
262
262
|
* The ID of the pregen wallet to update.
|
|
@@ -269,7 +269,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
269
269
|
};
|
|
270
270
|
response: void;
|
|
271
271
|
};
|
|
272
|
-
|
|
272
|
+
hasPregenWalletV2: {
|
|
273
273
|
params: {
|
|
274
274
|
/**
|
|
275
275
|
* The pregen ID for the wallet to check.
|
|
@@ -278,7 +278,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
278
278
|
};
|
|
279
279
|
response: boolean;
|
|
280
280
|
};
|
|
281
|
-
|
|
281
|
+
createPregenWalletV2: {
|
|
282
282
|
params: {
|
|
283
283
|
/**
|
|
284
284
|
* The type of wallet to create, 'EVM' | 'SOLANA' | 'COSMOS'
|
|
@@ -291,7 +291,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
291
291
|
};
|
|
292
292
|
response: Wallet;
|
|
293
293
|
};
|
|
294
|
-
|
|
294
|
+
createPregenWalletPerTypeV2: {
|
|
295
295
|
params: {
|
|
296
296
|
/**
|
|
297
297
|
* The wallet types to create. If not provided, defaults to your application's `supportedWalletTypes` setting.
|
|
@@ -304,7 +304,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
304
304
|
};
|
|
305
305
|
response: Wallet[];
|
|
306
306
|
};
|
|
307
|
-
|
|
307
|
+
claimPregenWalletsV2: {
|
|
308
308
|
params: {
|
|
309
309
|
/**
|
|
310
310
|
* The pregen identifier for the wallet to claim. If not provided, will attempt to claim all wallets in storage.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras, OAuthMethod, WalletType } from '@getpara/user-management-client';
|
|
1
|
+
import { AuthType, PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras, OAuthMethod, WalletType } from '@getpara/user-management-client';
|
|
2
2
|
import { Theme } from './theme.js';
|
|
3
3
|
import { RecoveryStatus } from './recovery.js';
|
|
4
4
|
import { Wallet } from './wallet.js';
|
|
@@ -16,6 +16,20 @@ export type VerifyExternalWalletV1 = {
|
|
|
16
16
|
};
|
|
17
17
|
export type PortalUrlType = 'createAuth' | 'createPassword' | 'loginAuth' | 'loginPassword' | 'txReview' | 'onRamp';
|
|
18
18
|
export type PortalUrlOptions = {
|
|
19
|
+
params?: Record<string, string | undefined | null>;
|
|
20
|
+
authType?: AuthType;
|
|
21
|
+
isForNewDevice?: boolean;
|
|
22
|
+
loginEncryptionPublicKey?: string;
|
|
23
|
+
newDeviceSessionId?: string;
|
|
24
|
+
newDeviceEncryptionKey?: string;
|
|
25
|
+
partnerId?: string;
|
|
26
|
+
sessionId?: string;
|
|
27
|
+
theme?: Theme;
|
|
28
|
+
pathId?: string;
|
|
29
|
+
displayName?: string;
|
|
30
|
+
pfpUrl?: string;
|
|
31
|
+
};
|
|
32
|
+
export type PortalUrlOptionsV2 = {
|
|
19
33
|
params?: Record<string, string | undefined | null>;
|
|
20
34
|
isForNewDevice?: boolean;
|
|
21
35
|
thisDevice?: Device;
|
|
@@ -25,6 +39,40 @@ export type PortalUrlOptions = {
|
|
|
25
39
|
pathId?: string;
|
|
26
40
|
shorten?: boolean;
|
|
27
41
|
};
|
|
42
|
+
export type GetWebAuthUrlForLoginParams = {
|
|
43
|
+
/**
|
|
44
|
+
* The session ID for the URL.
|
|
45
|
+
*/
|
|
46
|
+
sessionId: string;
|
|
47
|
+
/**
|
|
48
|
+
* Either 'email' | 'phone' | 'farcaster' | 'telegram'
|
|
49
|
+
*/
|
|
50
|
+
authType?: AuthType;
|
|
51
|
+
/**
|
|
52
|
+
* The public key to use for encrypting the login encryption key.
|
|
53
|
+
*/
|
|
54
|
+
loginEncryptionPublicKey: string;
|
|
55
|
+
/**
|
|
56
|
+
* The partner ID for the URL.
|
|
57
|
+
*/
|
|
58
|
+
partnerId?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The session ID for the new device being registered.
|
|
61
|
+
*/
|
|
62
|
+
newDeviceSessionId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The public key for the new device being registered.
|
|
65
|
+
*/
|
|
66
|
+
newDeviceEncryptionKey?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The Telegram or Farcaster display name for the user.
|
|
69
|
+
*/
|
|
70
|
+
displayName?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The Telegram or Farcaster URL for the user's profile picture.
|
|
73
|
+
*/
|
|
74
|
+
pfpUrl?: string;
|
|
75
|
+
};
|
|
28
76
|
export type WithAuthMethod = {
|
|
29
77
|
/**
|
|
30
78
|
* Which authorization method to use for the URL, either `'passkey'` or `'passwprd'`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-dev.1",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@celo/utils": "^8.0.0",
|
|
11
11
|
"@cosmjs/encoding": "^0.32.4",
|
|
12
|
-
"@getpara/user-management-client": "2.0.0-
|
|
12
|
+
"@getpara/user-management-client": "2.0.0-dev.1",
|
|
13
13
|
"@noble/hashes": "^1.5.0",
|
|
14
14
|
"base64url": "^3.0.1",
|
|
15
15
|
"ethereumjs-util": "7.1.5",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"test": "vitest run --coverage"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@faker-js/faker": "^9.5.1",
|
|
31
30
|
"typescript": "5.1.6"
|
|
32
31
|
},
|
|
33
32
|
"files": [
|
|
@@ -41,5 +40,5 @@
|
|
|
41
40
|
"require": "./dist/cjs/index.js"
|
|
42
41
|
}
|
|
43
42
|
},
|
|
44
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "426e843bd6084fb2e5f30ab87b02c79fc2f52832"
|
|
45
44
|
}
|