@getpara/web-sdk 3.7.0 → 3.9.0

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.
@@ -89,15 +89,28 @@ function ed25519PreKeygen(ctx, pregenIdentifier, pregenIdentifierType, _sessionC
89
89
  }
90
90
  });
91
91
  }
92
+ function withMPCNetworkHost(ctx, share) {
93
+ try {
94
+ const signer = JSON.parse(atob(share));
95
+ if (signer.Host) {
96
+ return share;
97
+ }
98
+ signer.Host = getBaseMPCNetworkUrl(ctx.env, !ctx.disableWebSockets, ctx.mpcNetworkUrlOverride);
99
+ return btoa(JSON.stringify(signer));
100
+ } catch (e) {
101
+ return share;
102
+ }
103
+ }
92
104
  function ed25519Sign(ctx, share, userId, walletId, base64Bytes) {
93
105
  return __async(this, null, function* () {
94
106
  const protocolId = uuid.v4();
107
+ const hostedShare = withMPCNetworkHost(ctx, share);
95
108
  const preSignMessageRes = ctx.client.preSignMessage(userId, walletId, base64Bytes, "ED25519", void 0, protocolId);
96
109
  const signRes = (function() {
97
110
  return __async(this, null, function* () {
98
111
  try {
99
112
  const base64Sig = yield new Promise(
100
- (resolve, reject) => globalThis.ed25519Sign(share, protocolId, base64Bytes, (err, result) => {
113
+ (resolve, reject) => globalThis.ed25519Sign(hostedShare, protocolId, base64Bytes, (err, result) => {
101
114
  if (err) {
102
115
  reject(err);
103
116
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@getpara/web-sdk",
3
- "version": "3.7.0",
3
+ "version": "3.9.0",
4
4
  "dependencies": {
5
- "@getpara/core-sdk": "3.7.0",
6
- "@getpara/user-management-client": "3.7.0",
5
+ "@getpara/core-sdk": "3.9.0",
6
+ "@getpara/user-management-client": "3.9.0",
7
7
  "@opentelemetry/api": "^1.9.1",
8
8
  "base64url": "^3.0.1",
9
9
  "buffer": "6.0.3",
@@ -30,7 +30,7 @@
30
30
  "dist",
31
31
  "package.json"
32
32
  ],
33
- "gitHead": "ab8876230a5d00b2c620bd23a4e3ed69762fc192",
33
+ "gitHead": "0ce96d513e4690451e371054e2e75bdcad379639",
34
34
  "main": "dist/index.js",
35
35
  "scripts": {
36
36
  "build": "rm -rf dist && yarn typegen && node ./scripts/build.mjs && yarn post-build",