@portal-hq/provider 2.0.6 → 2.0.8
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.
|
@@ -62,12 +62,13 @@ class MpcSigner {
|
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
const signingShare = yield this.signingShare;
|
|
65
|
-
const metadata =
|
|
65
|
+
const metadata = {
|
|
66
66
|
clientPlatform: 'REACT_NATIVE',
|
|
67
67
|
mpcServerVersion: this.version,
|
|
68
68
|
optimized: this.featureFlags.optimized,
|
|
69
|
-
}
|
|
70
|
-
const
|
|
69
|
+
};
|
|
70
|
+
const stringifiedMetadata = JSON.stringify(metadata);
|
|
71
|
+
const result = yield this.mpc.sign(apiKey, this.mpcHost, signingShare, message.method, JSON.stringify(this.buildParams(method, params)), provider.gatewayUrl, provider.chainId.toString(), stringifiedMetadata);
|
|
71
72
|
const { data, error } = JSON.parse(String(result));
|
|
72
73
|
if (error && error.code > 0) {
|
|
73
74
|
throw new utils_1.PortalMpcError(error);
|
package/lib/esm/signers/mpc.js
CHANGED
|
@@ -60,12 +60,13 @@ class MpcSigner {
|
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
62
|
const signingShare = yield this.signingShare;
|
|
63
|
-
const metadata =
|
|
63
|
+
const metadata = {
|
|
64
64
|
clientPlatform: 'REACT_NATIVE',
|
|
65
65
|
mpcServerVersion: this.version,
|
|
66
66
|
optimized: this.featureFlags.optimized,
|
|
67
|
-
}
|
|
68
|
-
const
|
|
67
|
+
};
|
|
68
|
+
const stringifiedMetadata = JSON.stringify(metadata);
|
|
69
|
+
const result = yield this.mpc.sign(apiKey, this.mpcHost, signingShare, message.method, JSON.stringify(this.buildParams(method, params)), provider.gatewayUrl, provider.chainId.toString(), stringifiedMetadata);
|
|
69
70
|
const { data, error } = JSON.parse(String(result));
|
|
70
71
|
if (error && error.code > 0) {
|
|
71
72
|
throw new PortalMpcError(error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portal-hq/provider",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
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": "^2.0.
|
|
23
|
-
"@portal-hq/utils": "^2.0.
|
|
22
|
+
"@portal-hq/connect": "^2.0.8",
|
|
23
|
+
"@portal-hq/utils": "^2.0.8"
|
|
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": "b24e07e5135b286db3b287623918c79f0680dc59"
|
|
34
34
|
}
|
package/src/signers/mpc.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import Signer from './abstract'
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
+
PortalMobileMpcMetadata,
|
|
12
13
|
type MpcSignerOptions,
|
|
13
14
|
type PortalMobileMpc,
|
|
14
15
|
type SigningResponse,
|
|
@@ -72,12 +73,12 @@ class MpcSigner implements Signer {
|
|
|
72
73
|
|
|
73
74
|
const signingShare = await this.signingShare
|
|
74
75
|
|
|
75
|
-
const metadata =
|
|
76
|
+
const metadata: PortalMobileMpcMetadata = {
|
|
76
77
|
clientPlatform: 'REACT_NATIVE',
|
|
77
78
|
mpcServerVersion: this.version,
|
|
78
79
|
optimized: this.featureFlags.optimized,
|
|
79
|
-
}
|
|
80
|
-
|
|
80
|
+
}
|
|
81
|
+
const stringifiedMetadata = JSON.stringify(metadata)
|
|
81
82
|
const result = await this.mpc.sign(
|
|
82
83
|
apiKey,
|
|
83
84
|
this.mpcHost,
|
|
@@ -86,7 +87,7 @@ class MpcSigner implements Signer {
|
|
|
86
87
|
JSON.stringify(this.buildParams(method, params)),
|
|
87
88
|
provider.gatewayUrl,
|
|
88
89
|
provider.chainId.toString(),
|
|
89
|
-
|
|
90
|
+
stringifiedMetadata
|
|
90
91
|
)
|
|
91
92
|
|
|
92
93
|
const { data, error } = JSON.parse(String(result)) as SigningResponse
|