@portal-hq/web 0.0.4 → 0.0.5

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.
@@ -20,7 +20,7 @@ class Portal {
20
20
  // Required
21
21
  gatewayConfig,
22
22
  // Optional
23
- apiKey, authToken, authUrl, autoApprove = false, chainId = 1, gdrive, host = 'web.portalhq.io', mpcVersion = 'v4', featureFlags = {
23
+ apiKey, authToken, authUrl, autoApprove = false, chainId = 1, gdrive, host = 'web.portalhq.io', mpcVersion = 'v5', featureFlags = {
24
24
  optimized: false,
25
25
  }, }) {
26
26
  this.ready = false;
@@ -132,6 +132,10 @@ class Portal {
132
132
  return address;
133
133
  });
134
134
  }
135
+ /**
136
+ * @deprecated This method is deprecated and will be removed in a future version.
137
+ * Use the `recoverWallet` method instead.
138
+ */
135
139
  legacyRecoverWallet(cipherText, progress = () => {
136
140
  // Noop
137
141
  }) {
@@ -146,6 +150,13 @@ class Portal {
146
150
  return recoveredCipherText;
147
151
  });
148
152
  }
153
+ provisionWallet(cipherText, backupMethod, backupConfigs, progress = () => {
154
+ // Noop
155
+ }) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ return this.recoverWallet(cipherText, backupMethod, backupConfigs, progress);
158
+ });
159
+ }
149
160
  /****************************
150
161
  * Provider Methods
151
162
  ****************************/
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MpcErrorCodes = exports.MpcError = void 0;
13
13
  const errors_1 = require("./errors");
14
14
  const index_1 = require("../index");
15
- const WEB_SDK_VERSION = '0.0.4';
15
+ const WEB_SDK_VERSION = '0.0.5';
16
16
  class Mpc {
17
17
  constructor({ portal }) {
18
18
  this.configureIframe = () => {
package/lib/esm/index.js CHANGED
@@ -14,7 +14,7 @@ class Portal {
14
14
  // Required
15
15
  gatewayConfig,
16
16
  // Optional
17
- apiKey, authToken, authUrl, autoApprove = false, chainId = 1, gdrive, host = 'web.portalhq.io', mpcVersion = 'v4', featureFlags = {
17
+ apiKey, authToken, authUrl, autoApprove = false, chainId = 1, gdrive, host = 'web.portalhq.io', mpcVersion = 'v5', featureFlags = {
18
18
  optimized: false,
19
19
  }, }) {
20
20
  this.ready = false;
@@ -126,6 +126,10 @@ class Portal {
126
126
  return address;
127
127
  });
128
128
  }
129
+ /**
130
+ * @deprecated This method is deprecated and will be removed in a future version.
131
+ * Use the `recoverWallet` method instead.
132
+ */
129
133
  legacyRecoverWallet(cipherText, progress = () => {
130
134
  // Noop
131
135
  }) {
@@ -140,6 +144,13 @@ class Portal {
140
144
  return recoveredCipherText;
141
145
  });
142
146
  }
147
+ provisionWallet(cipherText, backupMethod, backupConfigs, progress = () => {
148
+ // Noop
149
+ }) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ return this.recoverWallet(cipherText, backupMethod, backupConfigs, progress);
152
+ });
153
+ }
143
154
  /****************************
144
155
  * Provider Methods
145
156
  ****************************/
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { PortalMpcError } from './errors';
11
11
  import { BackupMethods } from '../index';
12
- const WEB_SDK_VERSION = '0.0.4';
12
+ const WEB_SDK_VERSION = '0.0.5';
13
13
  class Mpc {
14
14
  constructor({ portal }) {
15
15
  this.configureIframe = () => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Portal MPC Support for Web",
4
4
  "author": "Portal Labs, Inc.",
5
5
  "homepage": "https://portalhq.io/",
6
- "version": "0.0.4",
6
+ "version": "0.0.5",
7
7
  "license": "MIT",
8
8
  "main": "lib/commonjs/index",
9
9
  "module": "lib/esm/index",
package/src/index.ts CHANGED
@@ -51,7 +51,7 @@ class Portal {
51
51
  chainId = 1,
52
52
  gdrive,
53
53
  host = 'web.portalhq.io',
54
- mpcVersion = 'v4',
54
+ mpcVersion = 'v5',
55
55
  featureFlags = {
56
56
  optimized: false,
57
57
  },
@@ -196,6 +196,10 @@ class Portal {
196
196
  return address
197
197
  }
198
198
 
199
+ /**
200
+ * @deprecated This method is deprecated and will be removed in a future version.
201
+ * Use the `recoverWallet` method instead.
202
+ */
199
203
  public async legacyRecoverWallet(
200
204
  cipherText: string,
201
205
  progress: ProgressCallback = () => {
@@ -217,6 +221,17 @@ class Portal {
217
221
  return recoveredCipherText
218
222
  }
219
223
 
224
+ public async provisionWallet(
225
+ cipherText: string,
226
+ backupMethod: BackupMethods,
227
+ backupConfigs: BackupConfigs,
228
+ progress: ProgressCallback = () => {
229
+ // Noop
230
+ },
231
+ ): Promise<string> {
232
+ return this.recoverWallet(cipherText, backupMethod, backupConfigs, progress)
233
+ }
234
+
220
235
  /****************************
221
236
  * Provider Methods
222
237
  ****************************/
package/src/mpc/index.ts CHANGED
@@ -24,7 +24,7 @@ import type {
24
24
  WorkerResult,
25
25
  } from '../../types'
26
26
 
27
- const WEB_SDK_VERSION = '0.0.4'
27
+ const WEB_SDK_VERSION = '0.0.5'
28
28
 
29
29
  class Mpc {
30
30
  public iframe?: HTMLIFrameElement
package/types.d.ts CHANGED
@@ -107,15 +107,16 @@ export interface DecryptArgs {
107
107
  }
108
108
 
109
109
  export interface DkgData {
110
- share: string
111
- ssid: string
112
- pubkey: Pubkey
113
- partialPubKey: Pubkey[]
114
110
  allY: Pubkey[]
111
+ bks: Bk[]
115
112
  p: string
116
- q: string
113
+ partialPubKey: Pubkey[]
117
114
  pederson: PedersonParams[]
118
- bks: Bk[]
115
+ pubkey: Pubkey
116
+ q: string
117
+ share: string
118
+ signingSharePairId?: string
119
+ ssid: string
119
120
  }
120
121
 
121
122
  export interface EIP1559Transaction {