@portal-hq/web 0.0.4 → 0.0.6
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/index.js +13 -2
- package/lib/commonjs/mpc/index.js +1 -1
- package/lib/esm/index.js +13 -2
- package/lib/esm/mpc/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +17 -2
- package/src/mpc/index.ts +1 -1
- package/types.d.ts +7 -6
package/lib/commonjs/index.js
CHANGED
|
@@ -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 = '
|
|
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
|
****************************/
|
|
@@ -272,7 +283,7 @@ class Portal {
|
|
|
272
283
|
}
|
|
273
284
|
else if (typeof this.gatewayConfig === 'object' &&
|
|
274
285
|
// eslint-disable-next-line no-prototype-builtins
|
|
275
|
-
this.gatewayConfig.hasOwnProperty(this.chainId)) {
|
|
286
|
+
!this.gatewayConfig.hasOwnProperty(this.chainId)) {
|
|
276
287
|
// If there's no explicit mapping for the current chainId, error out
|
|
277
288
|
throw new Error(`[PortalProvider] No RPC endpoint configured for chainId: ${this.chainId}`);
|
|
278
289
|
}
|
|
@@ -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.
|
|
15
|
+
const WEB_SDK_VERSION = '0.0.6';
|
|
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 = '
|
|
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
|
****************************/
|
|
@@ -266,7 +277,7 @@ class Portal {
|
|
|
266
277
|
}
|
|
267
278
|
else if (typeof this.gatewayConfig === 'object' &&
|
|
268
279
|
// eslint-disable-next-line no-prototype-builtins
|
|
269
|
-
this.gatewayConfig.hasOwnProperty(this.chainId)) {
|
|
280
|
+
!this.gatewayConfig.hasOwnProperty(this.chainId)) {
|
|
270
281
|
// If there's no explicit mapping for the current chainId, error out
|
|
271
282
|
throw new Error(`[PortalProvider] No RPC endpoint configured for chainId: ${this.chainId}`);
|
|
272
283
|
}
|
package/lib/esm/mpc/index.js
CHANGED
|
@@ -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.
|
|
12
|
+
const WEB_SDK_VERSION = '0.0.6';
|
|
13
13
|
class Mpc {
|
|
14
14
|
constructor({ portal }) {
|
|
15
15
|
this.configureIframe = () => {
|
package/package.json
CHANGED
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 = '
|
|
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
|
****************************/
|
|
@@ -338,7 +353,7 @@ class Portal {
|
|
|
338
353
|
} else if (
|
|
339
354
|
typeof this.gatewayConfig === 'object' &&
|
|
340
355
|
// eslint-disable-next-line no-prototype-builtins
|
|
341
|
-
this.gatewayConfig.hasOwnProperty(this.chainId)
|
|
356
|
+
!this.gatewayConfig.hasOwnProperty(this.chainId)
|
|
342
357
|
) {
|
|
343
358
|
// If there's no explicit mapping for the current chainId, error out
|
|
344
359
|
throw new Error(
|
package/src/mpc/index.ts
CHANGED
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
|
-
|
|
113
|
+
partialPubKey: Pubkey[]
|
|
117
114
|
pederson: PedersonParams[]
|
|
118
|
-
|
|
115
|
+
pubkey: Pubkey
|
|
116
|
+
q: string
|
|
117
|
+
share: string
|
|
118
|
+
signingSharePairId?: string
|
|
119
|
+
ssid: string
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
export interface EIP1559Transaction {
|