@dynamic-labs/bitcoin 5.4.1 → 5.6.0

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,26 @@
1
1
 
2
+ ## [5.6.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.5.0...v5.6.0) (2026-09-01)
3
+
4
+
5
+ ### Features
6
+
7
+ * forward target signer passwords ([#12300](https://github.com/dynamic-labs/dynamic-auth/issues/12300)) ([39b142b](https://github.com/dynamic-labs/dynamic-auth/commit/39b142b51767ad54ae57196a381bec19a892c06f))
8
+
9
+ ## [5.5.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.4.1...v5.5.0) (2026-08-31)
10
+
11
+
12
+ ### Features
13
+
14
+ * **waas-evm:** route embedded EVM sends through gas sponsorship when enabled ([#12306](https://github.com/dynamic-labs/dynamic-auth/issues/12306)) ([6046ff3](https://github.com/dynamic-labs/dynamic-auth/commit/6046ff362d8de9402793bdaa7319fda645ff4c04))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **bitcoin:** resolve the active BTC wallet and network correctly across the widget ([#12308](https://github.com/dynamic-labs/dynamic-auth/issues/12308)) ([13e9eae](https://github.com/dynamic-labs/dynamic-auth/commit/13e9eaec19b3925db507c878988cfd82da5a6de6))
20
+ * **btc:** unbreak BTC transaction confirmation, testnet balances and taproot testnet switching ([#12305](https://github.com/dynamic-labs/dynamic-auth/issues/12305)) ([5fd999c](https://github.com/dynamic-labs/dynamic-auth/commit/5fd999c4c819d3a74e967c0cfa77c5877a74906b))
21
+ * **react-native-extension:** stop leaking expo-secure-store into consumer autolinking ([#12296](https://github.com/dynamic-labs/dynamic-auth/issues/12296)) ([1e0396a](https://github.com/dynamic-labs/dynamic-auth/commit/1e0396ab00c79aa0b2f45b6d7b1d339c1dac1203)), closes [#12254](https://github.com/dynamic-labs/dynamic-auth/issues/12254)
22
+ * **screening:** wire connected-wallet screening into the Send Balance UI (DYNT-1663) ([#12303](https://github.com/dynamic-labs/dynamic-auth/issues/12303)) ([5d26ff3](https://github.com/dynamic-labs/dynamic-auth/commit/5d26ff375118302522c39bd2f1fa9e04f7378eaf))
23
+
2
24
  ### [5.4.1](https://github.com/dynamic-labs/dynamic-auth/compare/v5.4.0...v5.4.1) (2026-08-26)
3
25
 
4
26
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "5.4.1";
6
+ var version = "5.6.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "5.4.1";
2
+ var version = "5.6.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/bitcoin",
3
- "version": "5.4.1",
3
+ "version": "5.6.0",
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,8 +18,8 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs-wallet/browser-wallet-client": "1.0.106",
22
- "@dynamic-labs-wallet/forward-mpc-client": "1.0.1",
21
+ "@dynamic-labs-wallet/browser-wallet-client": "1.0.118",
22
+ "@dynamic-labs-wallet/forward-mpc-client": "1.0.2",
23
23
  "@bitcoinerlab/secp256k1": "1.1.1",
24
24
  "@btckit/types": "0.0.19",
25
25
  "@dynamic-labs/sdk-api-core": "0.12.0",
@@ -29,13 +29,13 @@
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": "5.4.1",
33
- "@dynamic-labs/logger": "5.4.1",
34
- "@dynamic-labs/types": "5.4.1",
35
- "@dynamic-labs/utils": "5.4.1",
36
- "@dynamic-labs/waas": "5.4.1",
37
- "@dynamic-labs/wallet-book": "5.4.1",
38
- "@dynamic-labs/wallet-connector-core": "5.4.1",
32
+ "@dynamic-labs/assert-package-version": "5.6.0",
33
+ "@dynamic-labs/logger": "5.6.0",
34
+ "@dynamic-labs/types": "5.6.0",
35
+ "@dynamic-labs/utils": "5.6.0",
36
+ "@dynamic-labs/waas": "5.6.0",
37
+ "@dynamic-labs/wallet-book": "5.6.0",
38
+ "@dynamic-labs/wallet-connector-core": "5.6.0",
39
39
  "eventemitter3": "5.0.1"
40
40
  },
41
41
  "peerDependencies": {}
@@ -286,13 +286,15 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
286
286
  * address (wallets created before per-network registration).
287
287
  */
288
288
  getPaymentAddressForNetwork(network) {
289
- var _a, _b;
289
+ var _a, _b, _c;
290
290
  // Resolved against the wallet that is currently active. Reading
291
291
  // `verifiedCredential` alone would switch the network on the user's first
292
292
  // wallet, handing back an address that belongs to a different wallet.
293
293
  const credential = (_a = this.findCredentialForActiveAddress()) !== null && _a !== void 0 ? _a : this.verifiedCredential;
294
- const tagged = (_b = credential === null || credential === void 0 ? void 0 : credential.walletAdditionalAddresses) === null || _b === void 0 ? void 0 : _b.find((addr) => addr.type === 'payment' &&
295
- addr.network === network);
294
+ // Taproot wallets are minted with `ordinals` rows only, so a `payment`
295
+ // row is preferred but cannot be required or they lose testnet entirely.
296
+ const forNetwork = (_b = credential === null || credential === void 0 ? void 0 : credential.walletAdditionalAddresses) === null || _b === void 0 ? void 0 : _b.filter((addr) => addr.network === network);
297
+ const tagged = (_c = forNetwork === null || forNetwork === void 0 ? void 0 : forNetwork.find((addr) => addr.type === 'payment')) !== null && _c !== void 0 ? _c : forNetwork === null || forNetwork === void 0 ? void 0 : forNetwork.find((addr) => addr.type === 'ordinals');
296
298
  if (tagged === null || tagged === void 0 ? void 0 : tagged.address) {
297
299
  return tagged.address;
298
300
  }
@@ -551,6 +553,34 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
551
553
  }
552
554
  return this.getWaasWalletClient();
553
555
  }
556
+ /**
557
+ * Rebinds the connector when the user switches primary wallet. One connector
558
+ * instance is shared by every BTC wallet, so without this the connector stays
559
+ * on whichever address it was first seeded with and every address-derived
560
+ * read — displayed address, deposit address, balance — reports that wallet.
561
+ *
562
+ * Guarded by isSameWalletAddress so switching to a wallet that is already
563
+ * active on a non-mainnet encoding does not reset it to the primary address.
564
+ */
565
+ afterWalletSelectHook(walletAddress) {
566
+ if (!this.isSameWalletAddress(walletAddress)) {
567
+ this.setActiveAccountAddress(this.resolveAddressForActiveNetwork(walletAddress));
568
+ }
569
+ }
570
+ /**
571
+ * Selecting a wallet hands us its primary (mainnet) address, so binding it
572
+ * verbatim would silently drop a switchNetwork the user already made. Map it
573
+ * onto the network that is currently active instead. Falls back to the given
574
+ * address when the wallet has no row for that network.
575
+ */
576
+ resolveAddressForActiveNetwork(walletAddress) {
577
+ var _a, _b, _c, _d, _e, _f;
578
+ const network = this.activeNetworkId === BITCOIN_TESTNET_NETWORK_ID
579
+ ? 'testnet'
580
+ : 'mainnet';
581
+ const forNetwork = ((_b = (_a = this.findCredentialForAddress(walletAddress)) === null || _a === void 0 ? void 0 : _a.walletAdditionalAddresses) !== null && _b !== void 0 ? _b : []).filter((addr) => addr.network === network);
582
+ return ((_f = (_d = (_c = forNetwork.find((addr) => addr.type === 'payment')) === null || _c === void 0 ? void 0 : _c.address) !== null && _d !== void 0 ? _d : (_e = forNetwork.find((addr) => addr.type === 'ordinals')) === null || _e === void 0 ? void 0 : _e.address) !== null && _f !== void 0 ? _f : walletAddress);
583
+ }
554
584
  /**
555
585
  * Gets the currently active account address
556
586
  * @returns The active account address or undefined if not set
@@ -72,7 +72,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
72
72
  publicKeyHex: string;
73
73
  rawPublicKey: string | Uint8Array | undefined;
74
74
  }>;
75
- addSignerViaReshare({ accountAddress, walletId, businessAccountId, targetSignerIdentity, signerType, password, }: {
75
+ addSignerViaReshare({ accountAddress, walletId, businessAccountId, targetSignerIdentity, signerType, password, targetSignerPassword, }: {
76
76
  accountAddress: string;
77
77
  walletId?: string | undefined;
78
78
  businessAccountId: string;
@@ -83,6 +83,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
83
83
  };
84
84
  signerType?: "endUser" | "server" | undefined;
85
85
  password?: string | undefined;
86
+ targetSignerPassword?: string | undefined;
86
87
  }): Promise<{
87
88
  shareSetId: string;
88
89
  }>;
@@ -95,9 +96,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
95
96
  expectedAddresses: Record<string, string>;
96
97
  coinTypes?: Record<string, number> | undefined;
97
98
  password?: string | undefined;
98
- }): Promise<Record<string, unknown>>; /**
99
- * Gets the current Bitcoin network id (1 mainnet, 2 testnet)
100
- */
99
+ }): Promise<Record<string, unknown>>;
101
100
  exportPrivateKey({ accountAddress, displayContainer, password, }?: {
102
101
  accountAddress?: string | undefined;
103
102
  displayContainer?: HTMLIFrameElement | undefined;
@@ -137,7 +136,15 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
137
136
  hideICloudSignIn(): Promise<void>;
138
137
  isICloudAuthenticated(): Promise<boolean>;
139
138
  refreshWalletAccountShares({ accountAddress, password, }: import("@dynamic-labs/wallet-connector-core").RefreshWalletAccountSharesParams): Promise<void>;
140
- reshareWalletAccountShares({ accountAddress, thresholdSignatureScheme, password, }: import("@dynamic-labs/wallet-connector-core").ReshareWalletAccountSharesParams): Promise<void>;
139
+ reshareWalletAccountShares({ accountAddress, thresholdSignatureScheme, password, }: import("@dynamic-labs/wallet-connector-core").ReshareWalletAccountSharesParams): Promise<void>; /**
140
+ * Finds the credential that owns `address`, either as its primary (mainnet)
141
+ * address or as one of its network-tagged additional addresses.
142
+ *
143
+ * This connector is shared across every Bitcoin wallet of the user —
144
+ * `verifiedCredentials` holds them all — so the owning credential must be
145
+ * looked up by address. Reading `verifiedCredential` instead would always
146
+ * answer with the user's *first* wallet.
147
+ */
141
148
  revokeDelegation({ accountAddress, password, }: {
142
149
  accountAddress: string;
143
150
  password?: string | undefined;
@@ -435,6 +442,23 @@ export declare class DynamicWaasBitcoinConnector extends DynamicWaasBitcoinConne
435
442
  getWalletClientByAddress({ accountAddress }: {
436
443
  accountAddress: string;
437
444
  }): Promise<import("@dynamic-labs-wallet/browser-wallet-client").DynamicWalletClient>;
445
+ /**
446
+ * Rebinds the connector when the user switches primary wallet. One connector
447
+ * instance is shared by every BTC wallet, so without this the connector stays
448
+ * on whichever address it was first seeded with and every address-derived
449
+ * read — displayed address, deposit address, balance — reports that wallet.
450
+ *
451
+ * Guarded by isSameWalletAddress so switching to a wallet that is already
452
+ * active on a non-mainnet encoding does not reset it to the primary address.
453
+ */
454
+ afterWalletSelectHook(walletAddress: string): void;
455
+ /**
456
+ * Selecting a wallet hands us its primary (mainnet) address, so binding it
457
+ * verbatim would silently drop a switchNetwork the user already made. Map it
458
+ * onto the network that is currently active instead. Falls back to the given
459
+ * address when the wallet has no row for that network.
460
+ */
461
+ private resolveAddressForActiveNetwork;
438
462
  /**
439
463
  * Gets the currently active account address
440
464
  * @returns The active account address or undefined if not set
@@ -282,13 +282,15 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
282
282
  * address (wallets created before per-network registration).
283
283
  */
284
284
  getPaymentAddressForNetwork(network) {
285
- var _a, _b;
285
+ var _a, _b, _c;
286
286
  // Resolved against the wallet that is currently active. Reading
287
287
  // `verifiedCredential` alone would switch the network on the user's first
288
288
  // wallet, handing back an address that belongs to a different wallet.
289
289
  const credential = (_a = this.findCredentialForActiveAddress()) !== null && _a !== void 0 ? _a : this.verifiedCredential;
290
- const tagged = (_b = credential === null || credential === void 0 ? void 0 : credential.walletAdditionalAddresses) === null || _b === void 0 ? void 0 : _b.find((addr) => addr.type === 'payment' &&
291
- addr.network === network);
290
+ // Taproot wallets are minted with `ordinals` rows only, so a `payment`
291
+ // row is preferred but cannot be required or they lose testnet entirely.
292
+ const forNetwork = (_b = credential === null || credential === void 0 ? void 0 : credential.walletAdditionalAddresses) === null || _b === void 0 ? void 0 : _b.filter((addr) => addr.network === network);
293
+ const tagged = (_c = forNetwork === null || forNetwork === void 0 ? void 0 : forNetwork.find((addr) => addr.type === 'payment')) !== null && _c !== void 0 ? _c : forNetwork === null || forNetwork === void 0 ? void 0 : forNetwork.find((addr) => addr.type === 'ordinals');
292
294
  if (tagged === null || tagged === void 0 ? void 0 : tagged.address) {
293
295
  return tagged.address;
294
296
  }
@@ -547,6 +549,34 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
547
549
  }
548
550
  return this.getWaasWalletClient();
549
551
  }
552
+ /**
553
+ * Rebinds the connector when the user switches primary wallet. One connector
554
+ * instance is shared by every BTC wallet, so without this the connector stays
555
+ * on whichever address it was first seeded with and every address-derived
556
+ * read — displayed address, deposit address, balance — reports that wallet.
557
+ *
558
+ * Guarded by isSameWalletAddress so switching to a wallet that is already
559
+ * active on a non-mainnet encoding does not reset it to the primary address.
560
+ */
561
+ afterWalletSelectHook(walletAddress) {
562
+ if (!this.isSameWalletAddress(walletAddress)) {
563
+ this.setActiveAccountAddress(this.resolveAddressForActiveNetwork(walletAddress));
564
+ }
565
+ }
566
+ /**
567
+ * Selecting a wallet hands us its primary (mainnet) address, so binding it
568
+ * verbatim would silently drop a switchNetwork the user already made. Map it
569
+ * onto the network that is currently active instead. Falls back to the given
570
+ * address when the wallet has no row for that network.
571
+ */
572
+ resolveAddressForActiveNetwork(walletAddress) {
573
+ var _a, _b, _c, _d, _e, _f;
574
+ const network = this.activeNetworkId === BITCOIN_TESTNET_NETWORK_ID
575
+ ? 'testnet'
576
+ : 'mainnet';
577
+ const forNetwork = ((_b = (_a = this.findCredentialForAddress(walletAddress)) === null || _a === void 0 ? void 0 : _a.walletAdditionalAddresses) !== null && _b !== void 0 ? _b : []).filter((addr) => addr.network === network);
578
+ return ((_f = (_d = (_c = forNetwork.find((addr) => addr.type === 'payment')) === null || _c === void 0 ? void 0 : _c.address) !== null && _d !== void 0 ? _d : (_e = forNetwork.find((addr) => addr.type === 'ordinals')) === null || _e === void 0 ? void 0 : _e.address) !== null && _f !== void 0 ? _f : walletAddress);
579
+ }
550
580
  /**
551
581
  * Gets the currently active account address
552
582
  * @returns The active account address or undefined if not set