@dynamic-labs/midnight 4.91.3 → 4.91.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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,21 @@
1
1
 
2
+ ### [4.91.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.4...v4.91.5) (2026-07-02)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * revoke WaaS signed-session callback on client rebuild to stop iOS nonce race ([#11766](https://github.com/dynamic-labs/dynamic-auth/issues/11766)) ([c895b5d](https://github.com/dynamic-labs/dynamic-auth/commit/c895b5d0987d62a9f5597741dbeae0ec7fedfe5b))
8
+ * **sdk-react-core:** allow sendOneTimeCode to target non-primary chain wallets ([#11777](https://github.com/dynamic-labs/dynamic-auth/issues/11777)) ([63f82af](https://github.com/dynamic-labs/dynamic-auth/commit/63f82af7c52be595bc2948ec88ee9c919ac9275a))
9
+ * **webview-controller:** resolve post-login wallet race in Viem and ZeroDev controllers ([#11774](https://github.com/dynamic-labs/dynamic-auth/issues/11774)) ([95ed26e](https://github.com/dynamic-labs/dynamic-auth/commit/95ed26eee09d9aff5a5af6517ab7e1360ef5f337))
10
+
11
+ ### [4.91.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.3...v4.91.4) (2026-07-01)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * 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))
17
+ * 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))
18
+
2
19
  ### [4.91.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.2...v4.91.3) (2026-06-30)
3
20
 
4
21
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.91.3";
6
+ var version = "4.91.5";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.91.3";
2
+ var version = "4.91.5";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/midnight",
3
- "version": "4.91.3",
3
+ "version": "4.91.5",
4
4
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -18,15 +18,15 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/assert-package-version": "4.91.3",
21
+ "@dynamic-labs/assert-package-version": "4.91.5",
22
22
  "@dynamic-labs/sdk-api-core": "0.0.1046",
23
23
  "@midnight-ntwrk/dapp-connector-api": "4.0.1",
24
- "@dynamic-labs/logger": "4.91.3",
25
- "@dynamic-labs/types": "4.91.3",
26
- "@dynamic-labs/utils": "4.91.3",
27
- "@dynamic-labs/waas": "4.91.3",
28
- "@dynamic-labs/wallet-book": "4.91.3",
29
- "@dynamic-labs/wallet-connector-core": "4.91.3"
24
+ "@dynamic-labs/logger": "4.91.5",
25
+ "@dynamic-labs/types": "4.91.5",
26
+ "@dynamic-labs/utils": "4.91.5",
27
+ "@dynamic-labs/waas": "4.91.5",
28
+ "@dynamic-labs/wallet-book": "4.91.5",
29
+ "@dynamic-labs/wallet-connector-core": "4.91.5"
30
30
  },
31
31
  "peerDependencies": {}
32
32
  }
@@ -100,7 +100,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
100
100
  var _a;
101
101
  const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
102
102
  if (!signedSessionId) {
103
- throw new utils.DynamicError('Signed session ID is required');
103
+ throw new utils.DynamicError('Signed session ID is required', 'signed_session_id_is_required');
104
104
  }
105
105
  return signedSessionId;
106
106
  });
@@ -122,7 +122,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
122
122
  signedSessionId,
123
123
  });
124
124
  if (!targetWallet) {
125
- throw new utils.DynamicError('Account not found');
125
+ throw new utils.DynamicError('Account not found', 'account_not_found');
126
126
  }
127
127
  const isWalletActive = walletConnectorCore.isSameAddress(targetWallet.accountAddress, this.activeAccountAddress || '', this.connectedChain);
128
128
  if (!isWalletActive) {
@@ -199,7 +199,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
199
199
  this.ensureActiveAccountFromVerifiedCredentials();
200
200
  const walletClient = yield this.getWaasWalletClient();
201
201
  if (!this.activeAccountAddress) {
202
- throw new utils.DynamicError('Active account address is required');
202
+ throw new utils.DynamicError('Active account address is required', 'active_account_address_is_required');
203
203
  }
204
204
  const signedSessionId = yield this.requireSignedSessionId();
205
205
  const mfaToken = yield ((_a = this.getMfaToken) === null || _a === void 0 ? void 0 : _a.call(this, {
@@ -242,7 +242,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
242
242
  return _tslib.__awaiter(this, void 0, void 0, function* () {
243
243
  var _a, _b, _c, _d;
244
244
  if (!this.activeAccountAddress) {
245
- throw new utils.DynamicError('Active account address is required');
245
+ throw new utils.DynamicError('Active account address is required', 'active_account_address_is_required');
246
246
  }
247
247
  const walletClient = yield this.getWaasWalletClient();
248
248
  const signedSessionId = yield this.requireSignedSessionId();
@@ -297,7 +297,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
297
297
  from,
298
298
  onSubmit: (tx) => _tslib.__awaiter(this, void 0, void 0, function* () {
299
299
  if (tx.to === undefined || tx.value === undefined) {
300
- throw new utils.DynamicError('Recipient and amount are required before submitting');
300
+ throw new utils.DynamicError('Recipient and amount are required before submitting', 'recipient_and_amount_are_required_before');
301
301
  }
302
302
  // Native NIGHT needs no tokenType; any other (shielded) token is passed
303
303
  // by its ledger token type so the correct balance is debited.
@@ -367,7 +367,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
367
367
  var _a, _b, _c, _d;
368
368
  this.ensureActiveAccountFromVerifiedCredentials();
369
369
  if (!this.activeAccountAddress) {
370
- throw new utils.DynamicError('Active account address is required');
370
+ throw new utils.DynamicError('Active account address is required', 'active_account_address_is_required');
371
371
  }
372
372
  const walletClient = yield this.getWaasWalletClient();
373
373
  const signedSessionId = yield this.requireSignedSessionId();
@@ -431,7 +431,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
431
431
  var _a, _b, _c;
432
432
  this.ensureActiveAccountFromVerifiedCredentials();
433
433
  if (!this.activeAccountAddress) {
434
- throw new utils.DynamicError('Active account address is required');
434
+ throw new utils.DynamicError('Active account address is required', 'active_account_address_is_required');
435
435
  }
436
436
  const walletClient = yield this.getWaasWalletClient();
437
437
  const signedSessionId = yield this.requireSignedSessionId();
@@ -476,7 +476,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
476
476
  var _a, _b, _c;
477
477
  this.ensureActiveAccountFromVerifiedCredentials();
478
478
  if (!this.activeAccountAddress) {
479
- throw new utils.DynamicError('Active account address is required');
479
+ throw new utils.DynamicError('Active account address is required', 'active_account_address_is_required');
480
480
  }
481
481
  const walletClient = yield this.getWaasWalletClient();
482
482
  const signedSessionId = yield this.requireSignedSessionId();
@@ -535,7 +535,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
535
535
  var _a, _b, _c;
536
536
  this.ensureActiveAccountFromVerifiedCredentials();
537
537
  if (!this.activeAccountAddress) {
538
- throw new utils.DynamicError('Active account address is required');
538
+ throw new utils.DynamicError('Active account address is required', 'active_account_address_is_required');
539
539
  }
540
540
  const walletClient = yield this.getWaasWalletClient();
541
541
  const signedSessionId = yield this.requireSignedSessionId();
@@ -567,7 +567,7 @@ class DynamicWaasMidnightConnector extends waas.withDynamicWaas(WaasMidnightWall
567
567
  var _a, _b, _c;
568
568
  this.ensureActiveAccountFromVerifiedCredentials();
569
569
  if (!this.activeAccountAddress) {
570
- throw new utils.DynamicError('Active account address is required');
570
+ throw new utils.DynamicError('Active account address is required', 'active_account_address_is_required');
571
571
  }
572
572
  const walletClient = yield this.getWaasWalletClient();
573
573
  const signedSessionId = yield this.requireSignedSessionId();
@@ -27,6 +27,7 @@ declare const DynamicWaasMidnightConnector_base: (abstract new (...args: any[])
27
27
  relayUrl?: string | undefined;
28
28
  baseClientKeysharesRelayApiUrl?: string | undefined;
29
29
  dynamicWaasClient: import("@dynamic-labs-wallet/browser-wallet-client").DynamicWalletClient | undefined;
30
+ revokeSignedSession: (() => void) | undefined;
30
31
  chainName: string;
31
32
  authMode: "cookie" | "header";
32
33
  logger: Logger;
@@ -58,6 +59,9 @@ declare const DynamicWaasMidnightConnector_base: (abstract new (...args: any[])
58
59
  accountAddress: string;
59
60
  password?: string | undefined;
60
61
  }): Promise<void>;
62
+ createRevocableSignedSessionCallback(): {
63
+ getSignedSessionId: () => Promise<string>;
64
+ };
61
65
  createDynamicWaasClient(traceContext?: import("dist/packages/waas/utils/instrumentation").TraceContext | undefined): Promise<import("@dynamic-labs-wallet/browser-wallet-client").DynamicWalletClient>;
62
66
  getWaasWalletClient(traceContext?: import("dist/packages/waas/utils/instrumentation").TraceContext | undefined, { forceRebuild }?: {
63
67
  forceRebuild?: boolean | undefined;
@@ -105,12 +109,11 @@ declare const DynamicWaasMidnightConnector_base: (abstract new (...args: any[])
105
109
  accountAddress: string;
106
110
  password?: string | undefined;
107
111
  googleDriveAccessToken?: string | undefined;
108
- }): Promise<void>;
112
+ }): Promise<void>; /**
113
+ * When active account is not set (e.g. primary wallet restored from session),
114
+ * fall back to the first Midnight verified credential so signing and getAddress work.
115
+ */
109
116
  exportClientKeysharesFromGoogleDrive({ accountAddress, password, }: {
110
- /**
111
- * When active account is not set (e.g. primary wallet restored from session),
112
- * fall back to the first Midnight verified credential so signing and getAddress work.
113
- */
114
117
  accountAddress: string;
115
118
  password?: string | undefined;
116
119
  }): Promise<void>;
@@ -132,9 +135,6 @@ declare const DynamicWaasMidnightConnector_base: (abstract new (...args: any[])
132
135
  thresholdSignatureScheme: string;
133
136
  password?: string | undefined;
134
137
  }): Promise<void>;
135
- /**
136
- * Connects to the WaaS wallet client
137
- */
138
138
  revokeDelegation({ accountAddress, password, }: {
139
139
  accountAddress: string;
140
140
  password?: string | undefined;
@@ -96,7 +96,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
96
96
  var _a;
97
97
  const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
98
98
  if (!signedSessionId) {
99
- throw new DynamicError('Signed session ID is required');
99
+ throw new DynamicError('Signed session ID is required', 'signed_session_id_is_required');
100
100
  }
101
101
  return signedSessionId;
102
102
  });
@@ -118,7 +118,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
118
118
  signedSessionId,
119
119
  });
120
120
  if (!targetWallet) {
121
- throw new DynamicError('Account not found');
121
+ throw new DynamicError('Account not found', 'account_not_found');
122
122
  }
123
123
  const isWalletActive = isSameAddress(targetWallet.accountAddress, this.activeAccountAddress || '', this.connectedChain);
124
124
  if (!isWalletActive) {
@@ -195,7 +195,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
195
195
  this.ensureActiveAccountFromVerifiedCredentials();
196
196
  const walletClient = yield this.getWaasWalletClient();
197
197
  if (!this.activeAccountAddress) {
198
- throw new DynamicError('Active account address is required');
198
+ throw new DynamicError('Active account address is required', 'active_account_address_is_required');
199
199
  }
200
200
  const signedSessionId = yield this.requireSignedSessionId();
201
201
  const mfaToken = yield ((_a = this.getMfaToken) === null || _a === void 0 ? void 0 : _a.call(this, {
@@ -238,7 +238,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
238
238
  return __awaiter(this, void 0, void 0, function* () {
239
239
  var _a, _b, _c, _d;
240
240
  if (!this.activeAccountAddress) {
241
- throw new DynamicError('Active account address is required');
241
+ throw new DynamicError('Active account address is required', 'active_account_address_is_required');
242
242
  }
243
243
  const walletClient = yield this.getWaasWalletClient();
244
244
  const signedSessionId = yield this.requireSignedSessionId();
@@ -293,7 +293,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
293
293
  from,
294
294
  onSubmit: (tx) => __awaiter(this, void 0, void 0, function* () {
295
295
  if (tx.to === undefined || tx.value === undefined) {
296
- throw new DynamicError('Recipient and amount are required before submitting');
296
+ throw new DynamicError('Recipient and amount are required before submitting', 'recipient_and_amount_are_required_before');
297
297
  }
298
298
  // Native NIGHT needs no tokenType; any other (shielded) token is passed
299
299
  // by its ledger token type so the correct balance is debited.
@@ -363,7 +363,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
363
363
  var _a, _b, _c, _d;
364
364
  this.ensureActiveAccountFromVerifiedCredentials();
365
365
  if (!this.activeAccountAddress) {
366
- throw new DynamicError('Active account address is required');
366
+ throw new DynamicError('Active account address is required', 'active_account_address_is_required');
367
367
  }
368
368
  const walletClient = yield this.getWaasWalletClient();
369
369
  const signedSessionId = yield this.requireSignedSessionId();
@@ -427,7 +427,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
427
427
  var _a, _b, _c;
428
428
  this.ensureActiveAccountFromVerifiedCredentials();
429
429
  if (!this.activeAccountAddress) {
430
- throw new DynamicError('Active account address is required');
430
+ throw new DynamicError('Active account address is required', 'active_account_address_is_required');
431
431
  }
432
432
  const walletClient = yield this.getWaasWalletClient();
433
433
  const signedSessionId = yield this.requireSignedSessionId();
@@ -472,7 +472,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
472
472
  var _a, _b, _c;
473
473
  this.ensureActiveAccountFromVerifiedCredentials();
474
474
  if (!this.activeAccountAddress) {
475
- throw new DynamicError('Active account address is required');
475
+ throw new DynamicError('Active account address is required', 'active_account_address_is_required');
476
476
  }
477
477
  const walletClient = yield this.getWaasWalletClient();
478
478
  const signedSessionId = yield this.requireSignedSessionId();
@@ -531,7 +531,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
531
531
  var _a, _b, _c;
532
532
  this.ensureActiveAccountFromVerifiedCredentials();
533
533
  if (!this.activeAccountAddress) {
534
- throw new DynamicError('Active account address is required');
534
+ throw new DynamicError('Active account address is required', 'active_account_address_is_required');
535
535
  }
536
536
  const walletClient = yield this.getWaasWalletClient();
537
537
  const signedSessionId = yield this.requireSignedSessionId();
@@ -563,7 +563,7 @@ class DynamicWaasMidnightConnector extends withDynamicWaas(WaasMidnightWalletCon
563
563
  var _a, _b, _c;
564
564
  this.ensureActiveAccountFromVerifiedCredentials();
565
565
  if (!this.activeAccountAddress) {
566
- throw new DynamicError('Active account address is required');
566
+ throw new DynamicError('Active account address is required', 'active_account_address_is_required');
567
567
  }
568
568
  const walletClient = yield this.getWaasWalletClient();
569
569
  const signedSessionId = yield this.requireSignedSessionId();