@dynamic-labs/bitcoin 4.92.4 → 5.0.0-rc.1

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,17 @@
1
1
 
2
+ ## [5.0.0-rc.1](https://github.com/dynamic-labs/dynamic-auth/compare/v5.0.0-rc.0...v5.0.0-rc.1) (2026-07-17)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * move legacy embedded wallet to waas upgrade flow to new legacy-embedded-wallet-migration package (#11841)
8
+ * drop default injection of legacy embedded wallet connectors (#11833)
9
+ * remove legacy embedded wallet support (#11979)
10
+ * throw when legacy embedded wallet is detected without migration provider (#11855)
11
+ * remove deprecated eclipse package (#11831)
12
+ * remove deprecated functions and props (#11832)
13
+
14
+
2
15
  ### [4.92.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.92.3...v4.92.4) (2026-07-16)
3
16
 
4
17
 
@@ -57,6 +70,7 @@
57
70
  * improve social OAuth error messages ([#11837](https://github.com/dynamic-labs/dynamic-auth/issues/11837)) ([8e57c06](https://github.com/dynamic-labs/dynamic-auth/commit/8e57c067c5a89111a32a12fb82e190cf6c46ad67))
58
71
  * **react-native-extension:** reject path traversal in downloadFile fileName ([#11816](https://github.com/dynamic-labs/dynamic-auth/issues/11816)) ([9367a56](https://github.com/dynamic-labs/dynamic-auth/commit/9367a56b6daa853d7f7e7f5534261bc68825b239))
59
72
  * **sdk-react-core:** display exactly the bytes signed in personal_sign preview ([#11818](https://github.com/dynamic-labs/dynamic-auth/issues/11818)) ([30b9382](https://github.com/dynamic-labs/dynamic-auth/commit/30b93829122f00060cb484aef09a03294c03f651))
73
+
60
74
 
61
75
  ### [4.91.6](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.5...v4.91.6) (2026-07-03)
62
76
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.92.4";
6
+ var version = "5.0.0-rc.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.92.4";
2
+ var version = "5.0.0-rc.1";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/bitcoin",
3
- "version": "4.92.4",
3
+ "version": "5.0.0-rc.1",
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",
@@ -22,20 +22,20 @@
22
22
  "@dynamic-labs-wallet/forward-mpc-client": "1.0.1",
23
23
  "@bitcoinerlab/secp256k1": "1.1.1",
24
24
  "@btckit/types": "0.0.19",
25
- "@dynamic-labs/sdk-api-core": "0.0.1073",
25
+ "@dynamic-labs/sdk-api-core": "0.0.1082",
26
26
  "@wallet-standard/app": "1.0.1",
27
27
  "@wallet-standard/base": "1.0.1",
28
28
  "bitcoinjs-lib": "6.1.5",
29
29
  "ecpair": "2.1.0",
30
30
  "sats-connect": "4.2.1",
31
31
  "jsontokens": "4.0.1",
32
- "@dynamic-labs/assert-package-version": "4.92.4",
33
- "@dynamic-labs/logger": "4.92.4",
34
- "@dynamic-labs/types": "4.92.4",
35
- "@dynamic-labs/utils": "4.92.4",
36
- "@dynamic-labs/waas": "4.92.4",
37
- "@dynamic-labs/wallet-book": "4.92.4",
38
- "@dynamic-labs/wallet-connector-core": "4.92.4",
32
+ "@dynamic-labs/assert-package-version": "5.0.0-rc.1",
33
+ "@dynamic-labs/logger": "5.0.0-rc.1",
34
+ "@dynamic-labs/types": "5.0.0-rc.1",
35
+ "@dynamic-labs/utils": "5.0.0-rc.1",
36
+ "@dynamic-labs/waas": "5.0.0-rc.1",
37
+ "@dynamic-labs/wallet-book": "5.0.0-rc.1",
38
+ "@dynamic-labs/wallet-connector-core": "5.0.0-rc.1",
39
39
  "eventemitter3": "5.0.1"
40
40
  },
41
41
  "peerDependencies": {}
@@ -204,7 +204,7 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
204
204
  switchNetwork(_a) {
205
205
  return _tslib.__awaiter(this, arguments, void 0, function* ({ networkChainId, networkName, }) {
206
206
  let targetId = BITCOIN_MAINNET_NETWORK_ID;
207
- if (networkChainId !== undefined && networkChainId !== null) {
207
+ if (networkChainId) {
208
208
  targetId = Number(networkChainId);
209
209
  }
210
210
  else if (networkName === null || networkName === void 0 ? void 0 : networkName.toLowerCase().includes('test')) {
@@ -293,7 +293,6 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
293
293
  });
294
294
  const signedTransaction = yield walletClient.signTransaction({
295
295
  authToken: (_d = this.getAuthToken) === null || _d === void 0 ? void 0 : _d.call(this),
296
- bitcoinConfig: { network: yield this.getBitcoinNetworkEnum() },
297
296
  elevatedAccessToken,
298
297
  mfaToken,
299
298
  password,
@@ -638,17 +637,12 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
638
637
  if (allCredentials.length === 0) {
639
638
  throw new utils.DynamicError(`No verified credentials found. The address ${this.activeAccountAddress} may not be properly registered.`, 'no_verified_credentials_found_the_address');
640
639
  }
641
- // The public key is stored on the wallet's primary (mainnet) address entry
642
- // and is shared across every per-network encoding, since the same key
643
- // signs both. Look it up by the wallet identity address rather than the
644
- // active address, which after a network switch is the testnet encoding.
645
- const walletIdentityAddress = this.getWalletIdentityAddress();
646
640
  for (const credential of allCredentials) {
647
641
  const { walletAdditionalAddresses } = credential !== null && credential !== void 0 ? credential : {};
648
642
  if (!walletAdditionalAddresses) {
649
643
  continue;
650
644
  }
651
- const additionalAddress = walletAdditionalAddresses.find((address) => address.address === walletIdentityAddress);
645
+ const additionalAddress = walletAdditionalAddresses.find((address) => address.address === this.activeAccountAddress);
652
646
  if (additionalAddress === null || additionalAddress === void 0 ? void 0 : additionalAddress.publicKey) {
653
647
  return additionalAddress.publicKey;
654
648
  }
@@ -657,7 +651,7 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
657
651
  .flatMap((cred) => { var _a; return (_a = cred.walletAdditionalAddresses) !== null && _a !== void 0 ? _a : []; })
658
652
  .map((addr) => addr.address)
659
653
  .join(', ');
660
- throw new utils.DynamicError(`No additional address found for ${walletIdentityAddress}. Available addresses: ${allAvailableAddresses || 'none'}`, 'no_additional_address_found_for_available');
654
+ throw new utils.DynamicError(`No additional address found for ${this.activeAccountAddress}. Available addresses: ${allAvailableAddresses || 'none'}`, 'no_additional_address_found_for_available');
661
655
  });
662
656
  }
663
657
  /**
@@ -28,7 +28,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
28
28
  relayUrl?: string | undefined;
29
29
  baseClientKeysharesRelayApiUrl?: string | undefined;
30
30
  dynamicWaasClient: import("@dynamic-labs-wallet/browser-wallet-client").DynamicWalletClient | undefined;
31
- revokeSignedSession: (() => void) | undefined;
31
+ revokeSignedSession: ((reason?: string | undefined) => void) | undefined;
32
32
  chainName: string;
33
33
  authMode: "cookie" | "header";
34
34
  logger: Logger;
@@ -121,6 +121,21 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
121
121
  accountAddress: string;
122
122
  password?: string | undefined;
123
123
  }): Promise<void>;
124
+ runBackupLifecycle({ provider, accountAddress, password, performBackup, }: {
125
+ provider: string;
126
+ accountAddress: string;
127
+ password?: string | undefined;
128
+ performBackup: (prerequisites: {
129
+ walletClient: import("@dynamic-labs-wallet/browser-wallet-client").DynamicWalletClient;
130
+ resolvedPassword: string | undefined;
131
+ signedSessionId: string;
132
+ sessionPublicKey: string | undefined;
133
+ traceContext: {
134
+ traceId: string;
135
+ startTime: number;
136
+ };
137
+ }) => Promise<void>;
138
+ }): Promise<void>;
124
139
  backupKeySharesToGoogleDrive({ accountAddress, password, googleDriveAccessToken, }: {
125
140
  accountAddress: string;
126
141
  password?: string | undefined;
@@ -129,7 +144,11 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
129
144
  exportClientKeysharesFromGoogleDrive({ accountAddress, password, }: {
130
145
  accountAddress: string;
131
146
  password?: string | undefined;
132
- }): Promise<void>;
147
+ }): Promise<void>; /**
148
+ * Resolves the wallet's payment address for a network from the credential's
149
+ * network-tagged additional addresses. Mainnet falls back to the primary
150
+ * address (wallets created before per-network registration).
151
+ */
133
152
  backupKeySharesToICloud({ accountAddress, password, }: {
134
153
  accountAddress: string;
135
154
  password?: string | undefined;
@@ -200,7 +200,7 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
200
200
  switchNetwork(_a) {
201
201
  return __awaiter(this, arguments, void 0, function* ({ networkChainId, networkName, }) {
202
202
  let targetId = BITCOIN_MAINNET_NETWORK_ID;
203
- if (networkChainId !== undefined && networkChainId !== null) {
203
+ if (networkChainId) {
204
204
  targetId = Number(networkChainId);
205
205
  }
206
206
  else if (networkName === null || networkName === void 0 ? void 0 : networkName.toLowerCase().includes('test')) {
@@ -289,7 +289,6 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
289
289
  });
290
290
  const signedTransaction = yield walletClient.signTransaction({
291
291
  authToken: (_d = this.getAuthToken) === null || _d === void 0 ? void 0 : _d.call(this),
292
- bitcoinConfig: { network: yield this.getBitcoinNetworkEnum() },
293
292
  elevatedAccessToken,
294
293
  mfaToken,
295
294
  password,
@@ -634,17 +633,12 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
634
633
  if (allCredentials.length === 0) {
635
634
  throw new DynamicError(`No verified credentials found. The address ${this.activeAccountAddress} may not be properly registered.`, 'no_verified_credentials_found_the_address');
636
635
  }
637
- // The public key is stored on the wallet's primary (mainnet) address entry
638
- // and is shared across every per-network encoding, since the same key
639
- // signs both. Look it up by the wallet identity address rather than the
640
- // active address, which after a network switch is the testnet encoding.
641
- const walletIdentityAddress = this.getWalletIdentityAddress();
642
636
  for (const credential of allCredentials) {
643
637
  const { walletAdditionalAddresses } = credential !== null && credential !== void 0 ? credential : {};
644
638
  if (!walletAdditionalAddresses) {
645
639
  continue;
646
640
  }
647
- const additionalAddress = walletAdditionalAddresses.find((address) => address.address === walletIdentityAddress);
641
+ const additionalAddress = walletAdditionalAddresses.find((address) => address.address === this.activeAccountAddress);
648
642
  if (additionalAddress === null || additionalAddress === void 0 ? void 0 : additionalAddress.publicKey) {
649
643
  return additionalAddress.publicKey;
650
644
  }
@@ -653,7 +647,7 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
653
647
  .flatMap((cred) => { var _a; return (_a = cred.walletAdditionalAddresses) !== null && _a !== void 0 ? _a : []; })
654
648
  .map((addr) => addr.address)
655
649
  .join(', ');
656
- throw new DynamicError(`No additional address found for ${walletIdentityAddress}. Available addresses: ${allAvailableAddresses || 'none'}`, 'no_additional_address_found_for_available');
650
+ throw new DynamicError(`No additional address found for ${this.activeAccountAddress}. Available addresses: ${allAvailableAddresses || 'none'}`, 'no_additional_address_found_for_available');
657
651
  });
658
652
  }
659
653
  /**