@portal-hq/provider 4.0.2 → 4.0.3
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/lib/commonjs/signers/mpc.js +2 -1
- package/lib/esm/signers/mpc.js +3 -2
- package/package.json +4 -4
- package/src/signers/mpc.ts +4 -2
- package/types.d.ts +1 -0
|
@@ -39,11 +39,11 @@ class MpcSigner {
|
|
|
39
39
|
}
|
|
40
40
|
return params;
|
|
41
41
|
};
|
|
42
|
+
this.featureFlags = featureFlags;
|
|
42
43
|
this.keychain = keychain;
|
|
43
44
|
this.mpc = react_native_1.NativeModules.PortalMobileMpc;
|
|
44
45
|
this.mpcHost = mpcHost;
|
|
45
46
|
this.version = version;
|
|
46
|
-
this.featureFlags = featureFlags;
|
|
47
47
|
if (!this.mpc) {
|
|
48
48
|
throw new Error(`[Portal.Provider.MpcSigner] The MPC module could not be found by the signer. This is usually an issue with React Native linking. Please verify that the 'PortalReactNative' module is properly linked to this project.`);
|
|
49
49
|
}
|
|
@@ -71,6 +71,7 @@ class MpcSigner {
|
|
|
71
71
|
}
|
|
72
72
|
const metadata = {
|
|
73
73
|
clientPlatform: 'REACT_NATIVE',
|
|
74
|
+
clientPlatformVersion: (0, utils_1.getClientPlatformVersion)(),
|
|
74
75
|
isMultiBackupEnabled: this.featureFlags.isMultiBackupEnabled,
|
|
75
76
|
mpcServerVersion: this.version,
|
|
76
77
|
optimized: true,
|
package/lib/esm/signers/mpc.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { PortalCurve } from '@portal-hq/core';
|
|
11
|
-
import { PortalMpcError, } from '@portal-hq/utils';
|
|
11
|
+
import { PortalMpcError, getClientPlatformVersion, } from '@portal-hq/utils';
|
|
12
12
|
import { NativeModules } from 'react-native';
|
|
13
13
|
class MpcSigner {
|
|
14
14
|
constructor({ keychain, mpcHost = 'mpc.portalhq.io', version = 'v6', featureFlags = {}, }) {
|
|
@@ -37,11 +37,11 @@ class MpcSigner {
|
|
|
37
37
|
}
|
|
38
38
|
return params;
|
|
39
39
|
};
|
|
40
|
+
this.featureFlags = featureFlags;
|
|
40
41
|
this.keychain = keychain;
|
|
41
42
|
this.mpc = NativeModules.PortalMobileMpc;
|
|
42
43
|
this.mpcHost = mpcHost;
|
|
43
44
|
this.version = version;
|
|
44
|
-
this.featureFlags = featureFlags;
|
|
45
45
|
if (!this.mpc) {
|
|
46
46
|
throw new Error(`[Portal.Provider.MpcSigner] The MPC module could not be found by the signer. This is usually an issue with React Native linking. Please verify that the 'PortalReactNative' module is properly linked to this project.`);
|
|
47
47
|
}
|
|
@@ -69,6 +69,7 @@ class MpcSigner {
|
|
|
69
69
|
}
|
|
70
70
|
const metadata = {
|
|
71
71
|
clientPlatform: 'REACT_NATIVE',
|
|
72
|
+
clientPlatformVersion: getClientPlatformVersion(),
|
|
72
73
|
isMultiBackupEnabled: this.featureFlags.isMultiBackupEnabled,
|
|
73
74
|
mpcServerVersion: this.version,
|
|
74
75
|
optimized: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portal-hq/provider",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/esm/index",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"test": "jest"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@portal-hq/connect": "^4.0.
|
|
23
|
-
"@portal-hq/utils": "^4.0.
|
|
22
|
+
"@portal-hq/connect": "^4.0.3",
|
|
23
|
+
"@portal-hq/utils": "^4.0.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@babel/preset-typescript": "^7.18.6",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"ts-jest": "^29.0.3",
|
|
31
31
|
"typescript": "^4.8.4"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "f5873ba2108f0f75ac2121d42506c48bc23ef773"
|
|
34
34
|
}
|
package/src/signers/mpc.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
KeychainAdapter,
|
|
6
6
|
PortalMpcError,
|
|
7
7
|
type SigningRequestArguments,
|
|
8
|
+
getClientPlatformVersion,
|
|
8
9
|
} from '@portal-hq/utils'
|
|
9
10
|
import { NativeModules } from 'react-native'
|
|
10
11
|
|
|
@@ -17,11 +18,11 @@ import {
|
|
|
17
18
|
import Signer from './abstract'
|
|
18
19
|
|
|
19
20
|
class MpcSigner implements Signer {
|
|
21
|
+
private featureFlags: FeatureFlags
|
|
20
22
|
private keychain: KeychainAdapter
|
|
21
23
|
private mpc: PortalMobileMpc
|
|
22
24
|
private mpcHost: string // should we add a default here mpc.portalhq.io
|
|
23
25
|
private version = 'v6'
|
|
24
|
-
private featureFlags: FeatureFlags
|
|
25
26
|
|
|
26
27
|
constructor({
|
|
27
28
|
keychain,
|
|
@@ -29,11 +30,11 @@ class MpcSigner implements Signer {
|
|
|
29
30
|
version = 'v6',
|
|
30
31
|
featureFlags = {},
|
|
31
32
|
}: MpcSignerOptions) {
|
|
33
|
+
this.featureFlags = featureFlags
|
|
32
34
|
this.keychain = keychain
|
|
33
35
|
this.mpc = NativeModules.PortalMobileMpc
|
|
34
36
|
this.mpcHost = mpcHost
|
|
35
37
|
this.version = version
|
|
36
|
-
this.featureFlags = featureFlags
|
|
37
38
|
|
|
38
39
|
if (!this.mpc) {
|
|
39
40
|
throw new Error(
|
|
@@ -76,6 +77,7 @@ class MpcSigner implements Signer {
|
|
|
76
77
|
|
|
77
78
|
const metadata: PortalMobileMpcMetadata = {
|
|
78
79
|
clientPlatform: 'REACT_NATIVE',
|
|
80
|
+
clientPlatformVersion: getClientPlatformVersion(),
|
|
79
81
|
isMultiBackupEnabled: this.featureFlags.isMultiBackupEnabled,
|
|
80
82
|
mpcServerVersion: this.version,
|
|
81
83
|
optimized: true,
|