@getpara/react-native-wallet 0.2.2 → 1.0.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.
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
import { ParaCore, Environment, decryptPrivateKeyAndDecryptShare, encryptPrivateKey, getAsymmetricKeyPair, getDerivedPrivateKeyAndDecrypt, getPublicKeyHex, getSHA256HashHex, parseCredentialCreationRes, } from '@getpara/web-sdk';
|
|
12
12
|
import { ReactNativeUtils } from './ReactNativeUtils.js';
|
|
13
13
|
import { Passkey, } from 'react-native-passkey';
|
|
14
|
-
import {
|
|
14
|
+
import { extractAuthInfo, PublicKeyStatus } from '@getpara/user-management-client';
|
|
15
15
|
import { setEnv } from '../config.js';
|
|
16
16
|
import base64url from 'base64url';
|
|
17
17
|
const ES256_ALGORITHM = -7;
|
|
@@ -165,8 +165,12 @@ export class ParaMobile extends ParaCore {
|
|
|
165
165
|
*/
|
|
166
166
|
login(email, phone, countryCode) {
|
|
167
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
var _a;
|
|
168
169
|
yield this.logout();
|
|
169
|
-
const auth =
|
|
170
|
+
const auth = (_a = extractAuthInfo({ email, phone, countryCode })) === null || _a === void 0 ? void 0 : _a.auth;
|
|
171
|
+
if (!auth) {
|
|
172
|
+
throw new Error('No auth provided');
|
|
173
|
+
}
|
|
170
174
|
const { challenge, allowedPublicKeys } = yield this.ctx.client.getWebChallenge(auth);
|
|
171
175
|
const requestJson = {
|
|
172
176
|
challenge,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-native-wallet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Para Wallet for React Native",
|
|
5
5
|
"homepage": "https://getpara.com",
|
|
6
6
|
"author": "Para Team <hello@getpara.com> (https://getpara.com)",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"compile-signer": "bash ./scripts/compileSigner.sh"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@getpara/core-sdk": "0.
|
|
26
|
-
"@getpara/user-management-client": "0.
|
|
27
|
-
"@getpara/web-sdk": "0.
|
|
25
|
+
"@getpara/core-sdk": "1.0.1",
|
|
26
|
+
"@getpara/user-management-client": "1.0.1",
|
|
27
|
+
"@getpara/web-sdk": "1.0.1",
|
|
28
28
|
"@peculiar/webcrypto": "^1.5.0",
|
|
29
29
|
"fastestsmallesttextencoderdecoder": "1.0.22",
|
|
30
30
|
"node-forge": "1.3.1",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "adab14d69316165076fb244001ae271847bc23cc"
|
|
63
63
|
}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
PasskeyGetRequest,
|
|
23
23
|
PasskeyGetResult,
|
|
24
24
|
} from 'react-native-passkey';
|
|
25
|
-
import {
|
|
25
|
+
import { extractAuthInfo, PublicKeyStatus, WalletScheme } from '@getpara/user-management-client';
|
|
26
26
|
import { setEnv } from '../config.js';
|
|
27
27
|
import base64url from 'base64url';
|
|
28
28
|
import { webcrypto } from 'crypto';
|
|
@@ -196,7 +196,12 @@ export class ParaMobile extends ParaCore {
|
|
|
196
196
|
*/
|
|
197
197
|
async login(email?: string, phone?: string, countryCode?: CountryCallingCode): Promise<void> {
|
|
198
198
|
await this.logout();
|
|
199
|
-
const auth =
|
|
199
|
+
const auth = extractAuthInfo({ email, phone, countryCode })?.auth;
|
|
200
|
+
|
|
201
|
+
if (!auth) {
|
|
202
|
+
throw new Error('No auth provided');
|
|
203
|
+
}
|
|
204
|
+
|
|
200
205
|
const { challenge, allowedPublicKeys } = await this.ctx.client.getWebChallenge(auth);
|
|
201
206
|
|
|
202
207
|
const requestJson: PasskeyGetRequest = {
|