@dynamic-labs/waas 4.91.3 → 4.91.4
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/CHANGELOG.md +8 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/DynamicWaasMixin.cjs +37 -37
- package/src/DynamicWaasMixin.js +37 -37
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.91.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.3...v4.91.4) (2026-07-01)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* conditionally use /op/ route for AA transactions based on block explorer support ([#11628](https://github.com/dynamic-labs/dynamic-auth/issues/11628)) ([95822dc](https://github.com/dynamic-labs/dynamic-auth/commit/95822dc0edbcd739afe870f0b3881555fdb17eb6))
|
|
8
|
+
* require error codes in all SDK error classes ([#11761](https://github.com/dynamic-labs/dynamic-auth/issues/11761)) ([5744811](https://github.com/dynamic-labs/dynamic-auth/commit/5744811efdd1e415aaf51eec5b3300b323ec1347))
|
|
9
|
+
|
|
2
10
|
### [4.91.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.2...v4.91.3) (2026-06-30)
|
|
3
11
|
|
|
4
12
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/waas",
|
|
3
|
-
"version": "4.91.
|
|
3
|
+
"version": "4.91.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@dynamic-labs-sdk/client": "1.12.1",
|
|
20
|
-
"@dynamic-labs/assert-package-version": "4.91.
|
|
20
|
+
"@dynamic-labs/assert-package-version": "4.91.4",
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.1046",
|
|
22
22
|
"@dynamic-labs-wallet/browser-wallet-client": "1.0.48",
|
|
23
23
|
"@dynamic-labs-wallet/forward-mpc-client": "0.12.0",
|
|
24
|
-
"@dynamic-labs/ethereum-core": "4.91.
|
|
25
|
-
"@dynamic-labs/logger": "4.91.
|
|
26
|
-
"@dynamic-labs/solana-core": "4.91.
|
|
27
|
-
"@dynamic-labs/sui-core": "4.91.
|
|
28
|
-
"@dynamic-labs/utils": "4.91.
|
|
29
|
-
"@dynamic-labs/wallet-book": "4.91.
|
|
30
|
-
"@dynamic-labs/wallet-connector-core": "4.91.
|
|
24
|
+
"@dynamic-labs/ethereum-core": "4.91.4",
|
|
25
|
+
"@dynamic-labs/logger": "4.91.4",
|
|
26
|
+
"@dynamic-labs/solana-core": "4.91.4",
|
|
27
|
+
"@dynamic-labs/sui-core": "4.91.4",
|
|
28
|
+
"@dynamic-labs/utils": "4.91.4",
|
|
29
|
+
"@dynamic-labs/wallet-book": "4.91.4",
|
|
30
|
+
"@dynamic-labs/wallet-connector-core": "4.91.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {}
|
|
33
33
|
}
|
package/src/DynamicWaasMixin.cjs
CHANGED
|
@@ -70,7 +70,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
70
70
|
}
|
|
71
71
|
// Wallet is password-encrypted and needs to be unlocked
|
|
72
72
|
if (!this.getWalletPassword) {
|
|
73
|
-
throw new utils.DynamicError('Wallet is locked but no password provider is configured');
|
|
73
|
+
throw new utils.DynamicError('Wallet is locked but no password provider is configured', 'wallet_is_locked_but_no_password');
|
|
74
74
|
}
|
|
75
75
|
const password = yield this.getWalletPassword({
|
|
76
76
|
accountAddress,
|
|
@@ -179,7 +179,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
179
179
|
};
|
|
180
180
|
const chainName = chainNameMap[connectedChain];
|
|
181
181
|
if (!chainName) {
|
|
182
|
-
throw new utils.DynamicError(`Unsupported chain: ${connectedChain}
|
|
182
|
+
throw new utils.DynamicError(`Unsupported chain: ${connectedChain}`, 'unsupported_chain');
|
|
183
183
|
}
|
|
184
184
|
this.chainName = chainName;
|
|
185
185
|
}
|
|
@@ -188,10 +188,10 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
188
188
|
var _a;
|
|
189
189
|
const authToken = (_a = this.getAuthToken) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
190
190
|
if (!authToken && this.authMode === 'header') {
|
|
191
|
-
throw new utils.DynamicError('Auth token is required in non-cookie auth mode');
|
|
191
|
+
throw new utils.DynamicError('Auth token is required in non-cookie auth mode', 'auth_token_is_required_in_noncookie');
|
|
192
192
|
}
|
|
193
193
|
if (!this.environmentId) {
|
|
194
|
-
throw new utils.DynamicError('Environment ID is required');
|
|
194
|
+
throw new utils.DynamicError('Environment ID is required', 'environment_id_is_required');
|
|
195
195
|
}
|
|
196
196
|
const client = new browserWalletClient.DynamicWalletClient({
|
|
197
197
|
authMode: (this.authMode || 'header'),
|
|
@@ -258,7 +258,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
258
258
|
const walletClient = yield this.getWaasWalletClient();
|
|
259
259
|
const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
260
260
|
if (!signedSessionId) {
|
|
261
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
261
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
262
262
|
}
|
|
263
263
|
const createdWallet = yield walletClient.createWalletAccount({
|
|
264
264
|
authToken: (_b = this.getAuthToken) === null || _b === void 0 ? void 0 : _b.call(this),
|
|
@@ -276,7 +276,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
276
276
|
const walletClient = yield this.getWaasWalletClient();
|
|
277
277
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
278
278
|
if (!signedSessionId) {
|
|
279
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
279
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
280
280
|
}
|
|
281
281
|
yield walletClient.importPrivateKey({
|
|
282
282
|
addressType,
|
|
@@ -296,7 +296,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
296
296
|
const walletClient = yield this.getWaasWalletClient();
|
|
297
297
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
298
298
|
if (!signedSessionId) {
|
|
299
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
299
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
300
300
|
}
|
|
301
301
|
return walletClient.migrateFromFireblocks({
|
|
302
302
|
authToken: (_c = this.getAuthToken) === null || _c === void 0 ? void 0 : _c.call(this),
|
|
@@ -316,17 +316,17 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
316
316
|
const walletClient = yield this.getWaasWalletClient();
|
|
317
317
|
const targetAccountAddress = accountAddress || (yield this.getActiveAccountAddress());
|
|
318
318
|
if (!targetAccountAddress) {
|
|
319
|
-
throw new utils.DynamicError('Account address is required');
|
|
319
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
320
320
|
}
|
|
321
321
|
if (!displayContainer) {
|
|
322
|
-
throw new utils.DynamicError('Missing display container for export private key');
|
|
322
|
+
throw new utils.DynamicError('Missing display container for export private key', 'missing_display_container_for_export_private');
|
|
323
323
|
}
|
|
324
324
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({
|
|
325
325
|
accountAddress: targetAccountAddress,
|
|
326
326
|
}));
|
|
327
327
|
const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
328
328
|
if (!signedSessionId) {
|
|
329
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
329
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
330
330
|
}
|
|
331
331
|
this.__exportHandler.setIframeStamper(displayContainer);
|
|
332
332
|
const mfaToken = yield ((_b = this.getMfaToken) === null || _b === void 0 ? void 0 : _b.call(this, {
|
|
@@ -353,12 +353,12 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
353
353
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
354
354
|
var _b, _c;
|
|
355
355
|
if (!accountAddress) {
|
|
356
|
-
throw new utils.DynamicError('Account address is required');
|
|
356
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
357
357
|
}
|
|
358
358
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
359
359
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
360
360
|
if (!signedSessionId) {
|
|
361
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
361
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
362
362
|
}
|
|
363
363
|
const walletClient = yield this.getWaasWalletClient();
|
|
364
364
|
yield walletClient.exportClientKeyshares({
|
|
@@ -373,13 +373,13 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
373
373
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, googleDriveAccessToken, }) {
|
|
374
374
|
var _b, _c, _d;
|
|
375
375
|
if (!accountAddress) {
|
|
376
|
-
throw new utils.DynamicError('Account address is required');
|
|
376
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
377
377
|
}
|
|
378
378
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPassword({ accountAddress }));
|
|
379
379
|
const walletClient = yield this.getWaasWalletClient();
|
|
380
380
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
381
381
|
if (!signedSessionId) {
|
|
382
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
382
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
383
383
|
}
|
|
384
384
|
return walletClient.backupKeySharesToGoogleDrive({
|
|
385
385
|
accountAddress,
|
|
@@ -395,13 +395,13 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
395
395
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
396
396
|
var _b, _c;
|
|
397
397
|
if (!accountAddress) {
|
|
398
|
-
throw new utils.DynamicError('Account address is required');
|
|
398
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
399
399
|
}
|
|
400
400
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPassword({ accountAddress }));
|
|
401
401
|
const walletClient = yield this.getWaasWalletClient();
|
|
402
402
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
403
403
|
if (!signedSessionId) {
|
|
404
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
404
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
405
405
|
}
|
|
406
406
|
return walletClient.exportClientKeysharesFromGoogleDrive({
|
|
407
407
|
accountAddress,
|
|
@@ -415,13 +415,13 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
415
415
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
416
416
|
var _b, _c, _d;
|
|
417
417
|
if (!accountAddress) {
|
|
418
|
-
throw new utils.DynamicError('Account address is required');
|
|
418
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
419
419
|
}
|
|
420
420
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPassword({ accountAddress }));
|
|
421
421
|
const walletClient = yield this.getWaasWalletClient();
|
|
422
422
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
423
423
|
if (!signedSessionId) {
|
|
424
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
424
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
425
425
|
}
|
|
426
426
|
return walletClient.backupKeySharesToICloud({
|
|
427
427
|
accountAddress,
|
|
@@ -456,14 +456,14 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
456
456
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
457
457
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
458
458
|
if (!accountAddress) {
|
|
459
|
-
throw new utils.DynamicError('Account address is required');
|
|
459
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
460
460
|
}
|
|
461
461
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
462
462
|
const walletClient = yield this.getWaasWalletClient();
|
|
463
463
|
const recoverySignedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
464
464
|
const backupSignedSessionId = yield ((_c = this.getSignedSessionId) === null || _c === void 0 ? void 0 : _c.call(this));
|
|
465
465
|
if (!recoverySignedSessionId || !backupSignedSessionId) {
|
|
466
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
466
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
467
467
|
}
|
|
468
468
|
yield walletClient.getWallet({
|
|
469
469
|
accountAddress,
|
|
@@ -491,18 +491,18 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
491
491
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, thresholdSignatureScheme, password, }) {
|
|
492
492
|
var _b, _c, _d, _e, _f;
|
|
493
493
|
if (!accountAddress) {
|
|
494
|
-
throw new utils.DynamicError('Account address is required');
|
|
494
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
495
495
|
}
|
|
496
496
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
497
497
|
const walletClient = yield this.getWaasWalletClient();
|
|
498
498
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
499
499
|
if (!signedSessionId) {
|
|
500
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
500
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
501
501
|
}
|
|
502
502
|
const wallets = yield walletClient.getWallets();
|
|
503
503
|
const wallet = wallets.find((w) => w.accountAddress === accountAddress);
|
|
504
504
|
if (!wallet) {
|
|
505
|
-
throw new utils.DynamicError('Wallet not found');
|
|
505
|
+
throw new utils.DynamicError('Wallet not found', 'wallet_not_found');
|
|
506
506
|
}
|
|
507
507
|
const oldThresholdSignatureScheme = wallet.thresholdSignatureScheme;
|
|
508
508
|
const mfaToken = yield ((_c = this.getMfaToken) === null || _c === void 0 ? void 0 : _c.call(this, {
|
|
@@ -528,13 +528,13 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
528
528
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
529
529
|
var _b, _c, _d;
|
|
530
530
|
if (!accountAddress) {
|
|
531
|
-
throw new utils.DynamicError('Account address is required');
|
|
531
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
532
532
|
}
|
|
533
533
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
534
534
|
const walletClient = yield this.getWaasWalletClient();
|
|
535
535
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
536
536
|
if (!signedSessionId) {
|
|
537
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
537
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
538
538
|
}
|
|
539
539
|
return walletClient.revokeDelegation({
|
|
540
540
|
accountAddress,
|
|
@@ -548,15 +548,15 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
548
548
|
updatePassword(_a) {
|
|
549
549
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, existingPassword, newPassword, }) {
|
|
550
550
|
if (!accountAddress) {
|
|
551
|
-
throw new utils.DynamicError('Account address is required');
|
|
551
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
552
552
|
}
|
|
553
553
|
const resolvedExistingPassword = existingPassword !== null && existingPassword !== void 0 ? existingPassword : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
554
554
|
if (!resolvedExistingPassword) {
|
|
555
|
-
throw new utils.DynamicError('Existing password is required to update password');
|
|
555
|
+
throw new utils.DynamicError('Existing password is required to update password', 'existing_password_is_required_to_update');
|
|
556
556
|
}
|
|
557
557
|
const walletClient = yield this.getWaasWalletClient();
|
|
558
558
|
if (!this.getSignedSessionId) {
|
|
559
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
559
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
560
560
|
}
|
|
561
561
|
const wallets = yield walletClient.getAllWallets();
|
|
562
562
|
const encryptedWallets = wallets.filter((w) => { var _a; return (_a = w.clientKeySharesBackupInfo) === null || _a === void 0 ? void 0 : _a.passwordEncrypted; });
|
|
@@ -579,11 +579,11 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
579
579
|
setPassword(_a) {
|
|
580
580
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, newPassword, }) {
|
|
581
581
|
if (!accountAddress) {
|
|
582
|
-
throw new utils.DynamicError('Account address is required');
|
|
582
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
583
583
|
}
|
|
584
584
|
const walletClient = yield this.getWaasWalletClient();
|
|
585
585
|
if (!this.getSignedSessionId) {
|
|
586
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
586
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
587
587
|
}
|
|
588
588
|
const wallets = yield walletClient.getAllWallets();
|
|
589
589
|
const passwordUpdateBatchId = crypto.randomUUID();
|
|
@@ -605,16 +605,16 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
605
605
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, message, password, }) {
|
|
606
606
|
var _b, _c, _d, _e;
|
|
607
607
|
if (!accountAddress) {
|
|
608
|
-
throw new utils.DynamicError('Account address is required');
|
|
608
|
+
throw new utils.DynamicError('Account address is required', 'account_address_is_required');
|
|
609
609
|
}
|
|
610
610
|
if (message.length !== 64) {
|
|
611
|
-
throw new utils.DynamicError('Message must be 64 characters long');
|
|
611
|
+
throw new utils.DynamicError('Message must be 64 characters long', 'message_must_be_64_characters_long');
|
|
612
612
|
}
|
|
613
613
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
614
614
|
const walletClient = yield this.getWaasWalletClient();
|
|
615
615
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
616
616
|
if (!signedSessionId) {
|
|
617
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
617
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
618
618
|
}
|
|
619
619
|
const mfaToken = yield ((_c = this.getMfaToken) === null || _c === void 0 ? void 0 : _c.call(this, {
|
|
620
620
|
mfaAction: sdkApiCore.MFAAction.WalletWaasSign,
|
|
@@ -638,12 +638,12 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
638
638
|
var _b, _c;
|
|
639
639
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
640
640
|
if (!resolvedPassword) {
|
|
641
|
-
throw new utils.DynamicError('Password is required to unlock this wallet');
|
|
641
|
+
throw new utils.DynamicError('Password is required to unlock this wallet', 'password_is_required_to_unlock_this');
|
|
642
642
|
}
|
|
643
643
|
const walletClient = yield this.getWaasWalletClient();
|
|
644
644
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
645
645
|
if (!signedSessionId) {
|
|
646
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
646
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
647
647
|
}
|
|
648
648
|
return walletClient.unlockWallet({
|
|
649
649
|
accountAddress,
|
|
@@ -659,7 +659,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
659
659
|
const walletClient = yield this.getWaasWalletClient();
|
|
660
660
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
661
661
|
if (!signedSessionId) {
|
|
662
|
-
throw new utils.DynamicError('Signed session ID is required');
|
|
662
|
+
throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
663
663
|
}
|
|
664
664
|
return walletClient.getWalletRecoveryState({
|
|
665
665
|
accountAddress,
|
|
@@ -828,7 +828,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
828
828
|
}
|
|
829
829
|
getPrivateBalance() {
|
|
830
830
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
831
|
-
throw new utils.DynamicError(`getPrivateBalance is not supported for ${this.chainName} wallets
|
|
831
|
+
throw new utils.DynamicError(`getPrivateBalance is not supported for ${this.chainName} wallets`, 'getprivatebalance_is_not_supported_for_wallets');
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
834
|
}
|
package/src/DynamicWaasMixin.js
CHANGED
|
@@ -66,7 +66,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
66
66
|
}
|
|
67
67
|
// Wallet is password-encrypted and needs to be unlocked
|
|
68
68
|
if (!this.getWalletPassword) {
|
|
69
|
-
throw new DynamicError('Wallet is locked but no password provider is configured');
|
|
69
|
+
throw new DynamicError('Wallet is locked but no password provider is configured', 'wallet_is_locked_but_no_password');
|
|
70
70
|
}
|
|
71
71
|
const password = yield this.getWalletPassword({
|
|
72
72
|
accountAddress,
|
|
@@ -175,7 +175,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
175
175
|
};
|
|
176
176
|
const chainName = chainNameMap[connectedChain];
|
|
177
177
|
if (!chainName) {
|
|
178
|
-
throw new DynamicError(`Unsupported chain: ${connectedChain}
|
|
178
|
+
throw new DynamicError(`Unsupported chain: ${connectedChain}`, 'unsupported_chain');
|
|
179
179
|
}
|
|
180
180
|
this.chainName = chainName;
|
|
181
181
|
}
|
|
@@ -184,10 +184,10 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
184
184
|
var _a;
|
|
185
185
|
const authToken = (_a = this.getAuthToken) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
186
186
|
if (!authToken && this.authMode === 'header') {
|
|
187
|
-
throw new DynamicError('Auth token is required in non-cookie auth mode');
|
|
187
|
+
throw new DynamicError('Auth token is required in non-cookie auth mode', 'auth_token_is_required_in_noncookie');
|
|
188
188
|
}
|
|
189
189
|
if (!this.environmentId) {
|
|
190
|
-
throw new DynamicError('Environment ID is required');
|
|
190
|
+
throw new DynamicError('Environment ID is required', 'environment_id_is_required');
|
|
191
191
|
}
|
|
192
192
|
const client = new DynamicWalletClient({
|
|
193
193
|
authMode: (this.authMode || 'header'),
|
|
@@ -254,7 +254,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
254
254
|
const walletClient = yield this.getWaasWalletClient();
|
|
255
255
|
const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
256
256
|
if (!signedSessionId) {
|
|
257
|
-
throw new DynamicError('Signed session ID is required');
|
|
257
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
258
258
|
}
|
|
259
259
|
const createdWallet = yield walletClient.createWalletAccount({
|
|
260
260
|
authToken: (_b = this.getAuthToken) === null || _b === void 0 ? void 0 : _b.call(this),
|
|
@@ -272,7 +272,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
272
272
|
const walletClient = yield this.getWaasWalletClient();
|
|
273
273
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
274
274
|
if (!signedSessionId) {
|
|
275
|
-
throw new DynamicError('Signed session ID is required');
|
|
275
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
276
276
|
}
|
|
277
277
|
yield walletClient.importPrivateKey({
|
|
278
278
|
addressType,
|
|
@@ -292,7 +292,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
292
292
|
const walletClient = yield this.getWaasWalletClient();
|
|
293
293
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
294
294
|
if (!signedSessionId) {
|
|
295
|
-
throw new DynamicError('Signed session ID is required');
|
|
295
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
296
296
|
}
|
|
297
297
|
return walletClient.migrateFromFireblocks({
|
|
298
298
|
authToken: (_c = this.getAuthToken) === null || _c === void 0 ? void 0 : _c.call(this),
|
|
@@ -312,17 +312,17 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
312
312
|
const walletClient = yield this.getWaasWalletClient();
|
|
313
313
|
const targetAccountAddress = accountAddress || (yield this.getActiveAccountAddress());
|
|
314
314
|
if (!targetAccountAddress) {
|
|
315
|
-
throw new DynamicError('Account address is required');
|
|
315
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
316
316
|
}
|
|
317
317
|
if (!displayContainer) {
|
|
318
|
-
throw new DynamicError('Missing display container for export private key');
|
|
318
|
+
throw new DynamicError('Missing display container for export private key', 'missing_display_container_for_export_private');
|
|
319
319
|
}
|
|
320
320
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({
|
|
321
321
|
accountAddress: targetAccountAddress,
|
|
322
322
|
}));
|
|
323
323
|
const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
324
324
|
if (!signedSessionId) {
|
|
325
|
-
throw new DynamicError('Signed session ID is required');
|
|
325
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
326
326
|
}
|
|
327
327
|
this.__exportHandler.setIframeStamper(displayContainer);
|
|
328
328
|
const mfaToken = yield ((_b = this.getMfaToken) === null || _b === void 0 ? void 0 : _b.call(this, {
|
|
@@ -349,12 +349,12 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
349
349
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
350
350
|
var _b, _c;
|
|
351
351
|
if (!accountAddress) {
|
|
352
|
-
throw new DynamicError('Account address is required');
|
|
352
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
353
353
|
}
|
|
354
354
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
355
355
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
356
356
|
if (!signedSessionId) {
|
|
357
|
-
throw new DynamicError('Signed session ID is required');
|
|
357
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
358
358
|
}
|
|
359
359
|
const walletClient = yield this.getWaasWalletClient();
|
|
360
360
|
yield walletClient.exportClientKeyshares({
|
|
@@ -369,13 +369,13 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
369
369
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, googleDriveAccessToken, }) {
|
|
370
370
|
var _b, _c, _d;
|
|
371
371
|
if (!accountAddress) {
|
|
372
|
-
throw new DynamicError('Account address is required');
|
|
372
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
373
373
|
}
|
|
374
374
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPassword({ accountAddress }));
|
|
375
375
|
const walletClient = yield this.getWaasWalletClient();
|
|
376
376
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
377
377
|
if (!signedSessionId) {
|
|
378
|
-
throw new DynamicError('Signed session ID is required');
|
|
378
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
379
379
|
}
|
|
380
380
|
return walletClient.backupKeySharesToGoogleDrive({
|
|
381
381
|
accountAddress,
|
|
@@ -391,13 +391,13 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
391
391
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
392
392
|
var _b, _c;
|
|
393
393
|
if (!accountAddress) {
|
|
394
|
-
throw new DynamicError('Account address is required');
|
|
394
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
395
395
|
}
|
|
396
396
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPassword({ accountAddress }));
|
|
397
397
|
const walletClient = yield this.getWaasWalletClient();
|
|
398
398
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
399
399
|
if (!signedSessionId) {
|
|
400
|
-
throw new DynamicError('Signed session ID is required');
|
|
400
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
401
401
|
}
|
|
402
402
|
return walletClient.exportClientKeysharesFromGoogleDrive({
|
|
403
403
|
accountAddress,
|
|
@@ -411,13 +411,13 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
411
411
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
412
412
|
var _b, _c, _d;
|
|
413
413
|
if (!accountAddress) {
|
|
414
|
-
throw new DynamicError('Account address is required');
|
|
414
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
415
415
|
}
|
|
416
416
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPassword({ accountAddress }));
|
|
417
417
|
const walletClient = yield this.getWaasWalletClient();
|
|
418
418
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
419
419
|
if (!signedSessionId) {
|
|
420
|
-
throw new DynamicError('Signed session ID is required');
|
|
420
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
421
421
|
}
|
|
422
422
|
return walletClient.backupKeySharesToICloud({
|
|
423
423
|
accountAddress,
|
|
@@ -452,14 +452,14 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
452
452
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
453
453
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
454
454
|
if (!accountAddress) {
|
|
455
|
-
throw new DynamicError('Account address is required');
|
|
455
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
456
456
|
}
|
|
457
457
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
458
458
|
const walletClient = yield this.getWaasWalletClient();
|
|
459
459
|
const recoverySignedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
460
460
|
const backupSignedSessionId = yield ((_c = this.getSignedSessionId) === null || _c === void 0 ? void 0 : _c.call(this));
|
|
461
461
|
if (!recoverySignedSessionId || !backupSignedSessionId) {
|
|
462
|
-
throw new DynamicError('Signed session ID is required');
|
|
462
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
463
463
|
}
|
|
464
464
|
yield walletClient.getWallet({
|
|
465
465
|
accountAddress,
|
|
@@ -487,18 +487,18 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
487
487
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, thresholdSignatureScheme, password, }) {
|
|
488
488
|
var _b, _c, _d, _e, _f;
|
|
489
489
|
if (!accountAddress) {
|
|
490
|
-
throw new DynamicError('Account address is required');
|
|
490
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
491
491
|
}
|
|
492
492
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
493
493
|
const walletClient = yield this.getWaasWalletClient();
|
|
494
494
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
495
495
|
if (!signedSessionId) {
|
|
496
|
-
throw new DynamicError('Signed session ID is required');
|
|
496
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
497
497
|
}
|
|
498
498
|
const wallets = yield walletClient.getWallets();
|
|
499
499
|
const wallet = wallets.find((w) => w.accountAddress === accountAddress);
|
|
500
500
|
if (!wallet) {
|
|
501
|
-
throw new DynamicError('Wallet not found');
|
|
501
|
+
throw new DynamicError('Wallet not found', 'wallet_not_found');
|
|
502
502
|
}
|
|
503
503
|
const oldThresholdSignatureScheme = wallet.thresholdSignatureScheme;
|
|
504
504
|
const mfaToken = yield ((_c = this.getMfaToken) === null || _c === void 0 ? void 0 : _c.call(this, {
|
|
@@ -524,13 +524,13 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
524
524
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
525
525
|
var _b, _c, _d;
|
|
526
526
|
if (!accountAddress) {
|
|
527
|
-
throw new DynamicError('Account address is required');
|
|
527
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
528
528
|
}
|
|
529
529
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
530
530
|
const walletClient = yield this.getWaasWalletClient();
|
|
531
531
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
532
532
|
if (!signedSessionId) {
|
|
533
|
-
throw new DynamicError('Signed session ID is required');
|
|
533
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
534
534
|
}
|
|
535
535
|
return walletClient.revokeDelegation({
|
|
536
536
|
accountAddress,
|
|
@@ -544,15 +544,15 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
544
544
|
updatePassword(_a) {
|
|
545
545
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, existingPassword, newPassword, }) {
|
|
546
546
|
if (!accountAddress) {
|
|
547
|
-
throw new DynamicError('Account address is required');
|
|
547
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
548
548
|
}
|
|
549
549
|
const resolvedExistingPassword = existingPassword !== null && existingPassword !== void 0 ? existingPassword : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
550
550
|
if (!resolvedExistingPassword) {
|
|
551
|
-
throw new DynamicError('Existing password is required to update password');
|
|
551
|
+
throw new DynamicError('Existing password is required to update password', 'existing_password_is_required_to_update');
|
|
552
552
|
}
|
|
553
553
|
const walletClient = yield this.getWaasWalletClient();
|
|
554
554
|
if (!this.getSignedSessionId) {
|
|
555
|
-
throw new DynamicError('Signed session ID is required');
|
|
555
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
556
556
|
}
|
|
557
557
|
const wallets = yield walletClient.getAllWallets();
|
|
558
558
|
const encryptedWallets = wallets.filter((w) => { var _a; return (_a = w.clientKeySharesBackupInfo) === null || _a === void 0 ? void 0 : _a.passwordEncrypted; });
|
|
@@ -575,11 +575,11 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
575
575
|
setPassword(_a) {
|
|
576
576
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, newPassword, }) {
|
|
577
577
|
if (!accountAddress) {
|
|
578
|
-
throw new DynamicError('Account address is required');
|
|
578
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
579
579
|
}
|
|
580
580
|
const walletClient = yield this.getWaasWalletClient();
|
|
581
581
|
if (!this.getSignedSessionId) {
|
|
582
|
-
throw new DynamicError('Signed session ID is required');
|
|
582
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
583
583
|
}
|
|
584
584
|
const wallets = yield walletClient.getAllWallets();
|
|
585
585
|
const passwordUpdateBatchId = crypto.randomUUID();
|
|
@@ -601,16 +601,16 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
601
601
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, message, password, }) {
|
|
602
602
|
var _b, _c, _d, _e;
|
|
603
603
|
if (!accountAddress) {
|
|
604
|
-
throw new DynamicError('Account address is required');
|
|
604
|
+
throw new DynamicError('Account address is required', 'account_address_is_required');
|
|
605
605
|
}
|
|
606
606
|
if (message.length !== 64) {
|
|
607
|
-
throw new DynamicError('Message must be 64 characters long');
|
|
607
|
+
throw new DynamicError('Message must be 64 characters long', 'message_must_be_64_characters_long');
|
|
608
608
|
}
|
|
609
609
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
610
610
|
const walletClient = yield this.getWaasWalletClient();
|
|
611
611
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
612
612
|
if (!signedSessionId) {
|
|
613
|
-
throw new DynamicError('Signed session ID is required');
|
|
613
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
614
614
|
}
|
|
615
615
|
const mfaToken = yield ((_c = this.getMfaToken) === null || _c === void 0 ? void 0 : _c.call(this, {
|
|
616
616
|
mfaAction: MFAAction.WalletWaasSign,
|
|
@@ -634,12 +634,12 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
634
634
|
var _b, _c;
|
|
635
635
|
const resolvedPassword = password !== null && password !== void 0 ? password : (yield this.getPasswordIfNeeded({ accountAddress }));
|
|
636
636
|
if (!resolvedPassword) {
|
|
637
|
-
throw new DynamicError('Password is required to unlock this wallet');
|
|
637
|
+
throw new DynamicError('Password is required to unlock this wallet', 'password_is_required_to_unlock_this');
|
|
638
638
|
}
|
|
639
639
|
const walletClient = yield this.getWaasWalletClient();
|
|
640
640
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
641
641
|
if (!signedSessionId) {
|
|
642
|
-
throw new DynamicError('Signed session ID is required');
|
|
642
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
643
643
|
}
|
|
644
644
|
return walletClient.unlockWallet({
|
|
645
645
|
accountAddress,
|
|
@@ -655,7 +655,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
655
655
|
const walletClient = yield this.getWaasWalletClient();
|
|
656
656
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
657
657
|
if (!signedSessionId) {
|
|
658
|
-
throw new DynamicError('Signed session ID is required');
|
|
658
|
+
throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
|
|
659
659
|
}
|
|
660
660
|
return walletClient.getWalletRecoveryState({
|
|
661
661
|
accountAddress,
|
|
@@ -824,7 +824,7 @@ const withDynamicWaas = (BaseClass) => {
|
|
|
824
824
|
}
|
|
825
825
|
getPrivateBalance() {
|
|
826
826
|
return __awaiter(this, void 0, void 0, function* () {
|
|
827
|
-
throw new DynamicError(`getPrivateBalance is not supported for ${this.chainName} wallets
|
|
827
|
+
throw new DynamicError(`getPrivateBalance is not supported for ${this.chainName} wallets`, 'getprivatebalance_is_not_supported_for_wallets');
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
830
|
}
|