@getpara/react-native-wallet 1.0.2-dev.5 → 1.0.2-dev.6
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.
|
@@ -40,14 +40,13 @@ export declare class ParaMobile extends ParaCore {
|
|
|
40
40
|
* @param {string} biometricsId - The biometrics ID obtained from verification.
|
|
41
41
|
* @returns {Promise<void>}
|
|
42
42
|
*/
|
|
43
|
-
registerPasskey({
|
|
44
|
-
auth: Auth<'email'> | Auth<'phone'>;
|
|
43
|
+
registerPasskey({ biometricsId, ...auth }: {
|
|
45
44
|
biometricsId: string;
|
|
46
|
-
}): Promise<void>;
|
|
45
|
+
} & (Auth<'email'> | Auth<'phone'>)): Promise<void>;
|
|
47
46
|
/**
|
|
48
47
|
* Logs in the user using their authentication credentials.
|
|
49
48
|
* @param {AuthParams} params - The authentication parameters.
|
|
50
49
|
* @returns {Promise<void>}
|
|
51
50
|
*/
|
|
52
|
-
login(auth: Auth<'email'> | Auth<'phone'>): Promise<void>;
|
|
51
|
+
login({ ...auth }: Auth<'email'> | Auth<'phone'>): Promise<void>;
|
|
53
52
|
}
|
|
@@ -7,6 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
10
21
|
import { ParaCore, Environment, decryptPrivateKeyAndDecryptShare, encryptPrivateKey, getAsymmetricKeyPair, getDerivedPrivateKeyAndDecrypt, getPublicKeyHex, getSHA256HashHex, parseCredentialCreationRes, } from '@getpara/web-sdk';
|
|
11
22
|
import { ReactNativeUtils } from './ReactNativeUtils.js';
|
|
12
23
|
import { Passkey, } from 'react-native-passkey';
|
|
@@ -97,7 +108,8 @@ export class ParaMobile extends ParaCore {
|
|
|
97
108
|
* @returns {Promise<void>}
|
|
98
109
|
*/
|
|
99
110
|
registerPasskey(_a) {
|
|
100
|
-
return __awaiter(this,
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
var { biometricsId } = _a, auth = __rest(_a, ["biometricsId"]);
|
|
101
113
|
if (!webcrypto || !webcrypto.getRandomValues) {
|
|
102
114
|
throw new Error('Web crypto is not available. Ensure you have imported the shim from @getpara/react-native-wallet.');
|
|
103
115
|
}
|
|
@@ -164,8 +176,9 @@ export class ParaMobile extends ParaCore {
|
|
|
164
176
|
* @param {AuthParams} params - The authentication parameters.
|
|
165
177
|
* @returns {Promise<void>}
|
|
166
178
|
*/
|
|
167
|
-
login(
|
|
179
|
+
login(_a) {
|
|
168
180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
var auth = __rest(_a, []);
|
|
169
182
|
yield this.logout();
|
|
170
183
|
const { challenge, allowedPublicKeys } = yield this.ctx.client.getWebChallenge(auth);
|
|
171
184
|
const requestJson = {
|
package/package.json
CHANGED
|
@@ -105,7 +105,7 @@ export class ParaMobile extends ParaCore {
|
|
|
105
105
|
* @param {string} biometricsId - The biometrics ID obtained from verification.
|
|
106
106
|
* @returns {Promise<void>}
|
|
107
107
|
*/
|
|
108
|
-
async registerPasskey({
|
|
108
|
+
async registerPasskey({ biometricsId, ...auth }: { biometricsId: string } & (Auth<'email'> | Auth<'phone'>)) {
|
|
109
109
|
if (!webcrypto || !webcrypto.getRandomValues) {
|
|
110
110
|
throw new Error('Web crypto is not available. Ensure you have imported the shim from @getpara/react-native-wallet.');
|
|
111
111
|
}
|
|
@@ -185,7 +185,7 @@ export class ParaMobile extends ParaCore {
|
|
|
185
185
|
* @param {AuthParams} params - The authentication parameters.
|
|
186
186
|
* @returns {Promise<void>}
|
|
187
187
|
*/
|
|
188
|
-
async login(auth: Auth<'email'> | Auth<'phone'>): Promise<void> {
|
|
188
|
+
async login({ ...auth }: Auth<'email'> | Auth<'phone'>): Promise<void> {
|
|
189
189
|
await this.logout();
|
|
190
190
|
const { challenge, allowedPublicKeys } = await this.ctx.client.getWebChallenge(auth);
|
|
191
191
|
|