@getpara/react-native-wallet 1.0.0 → 1.0.2-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/android/src/main/java/com/para/reactnativewallet/ParaSignerPackage.java +1 -1
- package/dist/AsyncStorage.js +0 -1
- package/dist/KeychainStorage.js +0 -1
- package/dist/config.js +3 -4
- package/dist/react-native/ParaMobile.js +6 -2
- package/dist/react-native/ReactNativeUtils.js +0 -1
- package/ios/ParaSignerModule.h +1 -1
- package/package.json +5 -6
- package/src/AsyncStorage.ts +0 -2
- package/src/KeychainStorage.ts +0 -2
- package/src/config.ts +3 -5
- package/src/react-native/ParaMobile.ts +7 -2
- package/src/react-native/ReactNativeUtils.ts +0 -2
- /package/{capsule-react-native-wallet.podspec → para-react-native-wallet.podspec} +0 -0
|
@@ -8,7 +8,7 @@ import java.util.ArrayList;
|
|
|
8
8
|
import java.util.Collections;
|
|
9
9
|
import java.util.List;
|
|
10
10
|
|
|
11
|
-
public class
|
|
11
|
+
public class ParaSignerPackage implements ReactPackage {
|
|
12
12
|
|
|
13
13
|
@Override
|
|
14
14
|
public List<ViewManager> createViewManagers(
|
package/dist/AsyncStorage.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Copyright (c) Capsule Labs Inc. All rights reserved.
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/dist/KeychainStorage.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Copyright (c) Capsule Labs Inc. All rights reserved.
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Copyright (c) Capsule Labs Inc. All rights reserved.
|
|
2
1
|
import { NativeModules } from 'react-native';
|
|
3
2
|
import { Environment } from '@getpara/web-sdk';
|
|
4
3
|
function getPortalBaseURL(env) {
|
|
@@ -52,10 +51,10 @@ export function setEnv(env) {
|
|
|
52
51
|
mpcNetworkWSServer = getBaseMPCNetworkWSUrl(env);
|
|
53
52
|
init();
|
|
54
53
|
}
|
|
55
|
-
const {
|
|
54
|
+
const { ParaSignerModule } = NativeModules;
|
|
56
55
|
export const DEBUG_MODE_ENABLED = false;
|
|
57
56
|
function init() {
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
ParaSignerModule.setServerUrl(userManagementServer);
|
|
58
|
+
ParaSignerModule.setWsServerUrl(mpcNetworkWSServer);
|
|
60
59
|
}
|
|
61
60
|
init();
|
|
@@ -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,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Copyright (c) Capsule Labs Inc. All rights reserved.
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/ios/ParaSignerModule.h
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-native-wallet",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2-dev.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": "1.0.
|
|
26
|
-
"@getpara/user-management-client": "1.0.
|
|
27
|
-
"@getpara/web-sdk": "1.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",
|
|
@@ -58,6 +58,5 @@
|
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
|
-
}
|
|
62
|
-
"gitHead": "d4a619d2399a681ab36fbd66424997a343e546e2"
|
|
61
|
+
}
|
|
63
62
|
}
|
package/src/AsyncStorage.ts
CHANGED
package/src/KeychainStorage.ts
CHANGED
package/src/config.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Copyright (c) Capsule Labs Inc. All rights reserved.
|
|
2
|
-
|
|
3
1
|
import { NativeModules } from 'react-native';
|
|
4
2
|
import { Environment } from '@getpara/web-sdk';
|
|
5
3
|
|
|
@@ -59,12 +57,12 @@ export function setEnv(env: Environment) {
|
|
|
59
57
|
init();
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
const {
|
|
60
|
+
const { ParaSignerModule } = NativeModules;
|
|
63
61
|
export const DEBUG_MODE_ENABLED = false;
|
|
64
62
|
|
|
65
63
|
function init() {
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
ParaSignerModule.setServerUrl(userManagementServer);
|
|
65
|
+
ParaSignerModule.setWsServerUrl(mpcNetworkWSServer);
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
init();
|
|
@@ -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 = {
|
|
File without changes
|