@dynamic-labs/bitcoin 5.4.0 → 5.4.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,16 @@
1
1
 
2
+ ### [5.4.1](https://github.com/dynamic-labs/dynamic-auth/compare/v5.4.0...v5.4.1) (2026-08-26)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **webview-controller:** resolve which keychain key a session belongs to ([#12246](https://github.com/dynamic-labs/dynamic-auth/issues/12246)) ([3d110db](https://github.com/dynamic-labs/dynamic-auth/commit/3d110db831c6e9d82d07d86841f5c7733924b17e))
8
+ * **bitcoin:** forward the password through the BTC importPrivateKey override ([#12278](https://github.com/dynamic-labs/dynamic-auth/issues/12278)) ([21e1df3](https://github.com/dynamic-labs/dynamic-auth/commit/21e1df3e33e96e2efdb15ffa0fd29a441056202e))
9
+ * **react-native-extension:** recover 4.x expo-secure-store sessions on keychain miss ([#12254](https://github.com/dynamic-labs/dynamic-auth/issues/12254)) ([217e991](https://github.com/dynamic-labs/dynamic-auth/commit/217e991838f3073c12e2d2fab7a2e12830faad9e)), closes [#12092](https://github.com/dynamic-labs/dynamic-auth/issues/12092) [#12092](https://github.com/dynamic-labs/dynamic-auth/issues/12092) [#12092](https://github.com/dynamic-labs/dynamic-auth/issues/12092) [#12092](https://github.com/dynamic-labs/dynamic-auth/issues/12092) [#12242](https://github.com/dynamic-labs/dynamic-auth/issues/12242) [#12242](https://github.com/dynamic-labs/dynamic-auth/issues/12242)
10
+ * **transaction-card:** use walletConnector prop for network/fee instead of primaryWallet ([#12063](https://github.com/dynamic-labs/dynamic-auth/issues/12063)) ([81314d2](https://github.com/dynamic-labs/dynamic-auth/commit/81314d25fba4b20ab89631bc2d9ceeb9e2b6b2ac))
11
+ * **waas-svm:** instrument sponsorship retry attempts ([#12281](https://github.com/dynamic-labs/dynamic-auth/issues/12281)) ([7273a4b](https://github.com/dynamic-labs/dynamic-auth/commit/7273a4bc456cad512c0e9fbcd2abd66532a2f7df))
12
+ * **webview-controller:** recover 4.x secure-storage sessions and surface init failures ([#12242](https://github.com/dynamic-labs/dynamic-auth/issues/12242)) ([b51605c](https://github.com/dynamic-labs/dynamic-auth/commit/b51605cc9bdbb5d695173192c502a58d899bbbdd)), closes [#12094](https://github.com/dynamic-labs/dynamic-auth/issues/12094) [#12095](https://github.com/dynamic-labs/dynamic-auth/issues/12095) [#12098](https://github.com/dynamic-labs/dynamic-auth/issues/12098) [dynamic-labs/flutter-sdk#256](https://github.com/dynamic-labs/flutter-sdk/issues/256)
13
+
2
14
  ## [5.4.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.3.2...v5.4.0) (2026-08-25)
3
15
 
4
16
 
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.0";
6
+ var version = "5.4.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "5.4.0";
2
+ var version = "5.4.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": "5.4.0",
3
+ "version": "5.4.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",
@@ -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.0",
33
- "@dynamic-labs/logger": "5.4.0",
34
- "@dynamic-labs/types": "5.4.0",
35
- "@dynamic-labs/utils": "5.4.0",
36
- "@dynamic-labs/waas": "5.4.0",
37
- "@dynamic-labs/wallet-book": "5.4.0",
38
- "@dynamic-labs/wallet-connector-core": "5.4.0",
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",
39
39
  "eventemitter3": "5.0.1"
40
40
  },
41
41
  "peerDependencies": {}
@@ -500,33 +500,29 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
500
500
  const _super = Object.create(null, {
501
501
  createWalletAccount: { get: () => super.createWalletAccount }
502
502
  });
503
- return _tslib.__awaiter(this, arguments, void 0, function* ({ thresholdSignatureScheme = 'TWO_OF_TWO', password, bitcoinConfig, } = {}) {
504
- var _a;
503
+ return _tslib.__awaiter(this, arguments, void 0, function* (params = {}) {
504
+ var _a, _b;
505
505
  const finalBitcoinConfig = {
506
- addressType: ((_a = bitcoinConfig === null || bitcoinConfig === void 0 ? void 0 : bitcoinConfig.addressType) !== null && _a !== void 0 ? _a : 'native_segwit'),
506
+ addressType: ((_b = (_a = params.bitcoinConfig) === null || _a === void 0 ? void 0 : _a.addressType) !== null && _b !== void 0 ? _b : 'native_segwit'),
507
507
  network: yield this.getBitcoinNetworkEnum(),
508
508
  };
509
- return _super.createWalletAccount.call(this, {
510
- bitcoinConfig: finalBitcoinConfig,
511
- password,
512
- thresholdSignatureScheme,
513
- });
509
+ // Spread, so a field added to CreateWalletAccountParams later still
510
+ // reaches the base instead of being silently dropped here.
511
+ return _super.createWalletAccount.call(this, Object.assign(Object.assign({}, params), { bitcoinConfig: finalBitcoinConfig }));
514
512
  });
515
513
  }
516
514
  /**
517
- * Override importPrivateKey to require and validate addressType for Bitcoin
518
- * @param privateKey - The private key to import (WIF format for Bitcoin)
519
- * @param thresholdSignatureScheme - The threshold signature scheme (default: 'TWO_OF_TWO')
520
- * @param publicAddressCheck - Optional public address to verify against
521
- * @param addressType - Required address type for Bitcoin ('native_segwit' or 'taproot')
522
- * @param legacyWalletId - Optional ID of the legacy wallet being upgraded
515
+ * Requires and validates `addressType` for Bitcoin, then delegates.
516
+ * @param params - See ImportPrivateKeyParams. `addressType` is mandatory
517
+ * here ('native_segwit' or 'taproot') and `privateKey` is WIF.
523
518
  * @throws {DynamicError} If addressType is missing or invalid for BTC
524
519
  */
525
- importPrivateKey(_a) {
520
+ importPrivateKey(params) {
526
521
  const _super = Object.create(null, {
527
522
  importPrivateKey: { get: () => super.importPrivateKey }
528
523
  });
529
- return _tslib.__awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', publicAddressCheck, addressType, legacyWalletId, }) {
524
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
525
+ const { addressType } = params;
530
526
  if (!addressType) {
531
527
  throw new utils.DynamicError('addressType is required for BTC importPrivateKey', 'addresstype_is_required_for_btc_importprivatekey');
532
528
  }
@@ -534,13 +530,10 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
534
530
  if (!validAddressTypes.includes(addressType)) {
535
531
  throw new utils.DynamicError(`Invalid addressType: ${addressType}. Must be one of: ${validAddressTypes.join(', ')}`, 'invalid_addresstype_must_be_one_of');
536
532
  }
537
- return _super.importPrivateKey.call(this, {
538
- addressType,
539
- legacyWalletId,
540
- privateKey,
541
- publicAddressCheck,
542
- thresholdSignatureScheme,
543
- });
533
+ // Forwarded whole, never field-by-field: a re-declared parameter list is
534
+ // how `password` silently stopped reaching the base (see
535
+ // ImportPrivateKeyParams).
536
+ return _super.importPrivateKey.call(this, params);
544
537
  });
545
538
  }
546
539
  /**
@@ -1,8 +1,7 @@
1
- import { BitcoinConfig } from '@dynamic-labs-wallet/browser-wallet-client';
2
1
  import { Logger } from '@dynamic-labs/logger';
3
2
  import { JwtVerifiedCredential, MFAAction, SignMessageContext, TokenScope } from '@dynamic-labs/sdk-api-core';
4
3
  import { GenericNetwork, IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
5
- import { BitcoinSignPsbtResponse, Chain, IDynamicWaasConnector, ISendBalanceWalletConnector, InternalWalletConnector } from '@dynamic-labs/wallet-connector-core';
4
+ import { BitcoinSignPsbtResponse, Chain, CreateWalletAccountParams, IDynamicWaasConnector, ISendBalanceWalletConnector, ImportPrivateKeyParams, InternalWalletConnector } from '@dynamic-labs/wallet-connector-core';
6
5
  import type { DynamicWaasBitcoinConnectorProps, ParsedTransaction } from '../../types';
7
6
  import { BitcoinTransaction, EmbeddedWalletSignPsbtRequest } from '../../types';
8
7
  import { BitcoinWalletConnector } from '../BitcoinWalletConnector';
@@ -67,12 +66,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
67
66
  getWaasWalletClient(traceContext?: import("dist/packages/waas/utils/instrumentation").TraceContext | undefined, { forceRebuild }?: {
68
67
  forceRebuild?: boolean | undefined;
69
68
  } | undefined): Promise<import("@dynamic-labs-wallet/browser-wallet-client").DynamicWalletClient>;
70
- createWalletAccount({ thresholdSignatureScheme, password, bitcoinConfig, businessAccountId, }?: {
71
- thresholdSignatureScheme?: string | undefined;
72
- password?: string | undefined;
73
- bitcoinConfig?: BitcoinConfig | undefined;
74
- businessAccountId?: string | undefined;
75
- } | undefined): Promise<{
69
+ createWalletAccount({ thresholdSignatureScheme, password, bitcoinConfig, businessAccountId, }?: CreateWalletAccountParams | undefined): Promise<{
76
70
  chainName: string;
77
71
  accountAddress: string;
78
72
  publicKeyHex: string;
@@ -92,15 +86,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
92
86
  }): Promise<{
93
87
  shareSetId: string;
94
88
  }>;
95
- importPrivateKey({ privateKey, thresholdSignatureScheme, publicAddressCheck, addressType, legacyWalletId, password, isRawScalarImport, }: {
96
- privateKey: string;
97
- thresholdSignatureScheme?: string | undefined;
98
- publicAddressCheck?: string | undefined;
99
- addressType?: string | undefined;
100
- legacyWalletId?: string | undefined;
101
- password?: string | undefined;
102
- isRawScalarImport?: boolean | undefined;
103
- }): Promise<void>;
89
+ importPrivateKey({ privateKey, thresholdSignatureScheme, publicAddressCheck, addressType, legacyWalletId, password, isRawScalarImport, }: ImportPrivateKeyParams): Promise<void>;
104
90
  migrateFromFireblocks({ deviceId, jwt, walletPassword, ncwStorage, expectedAddresses, coinTypes, password, }: {
105
91
  deviceId: string;
106
92
  jwt: string;
@@ -109,7 +95,9 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
109
95
  expectedAddresses: Record<string, string>;
110
96
  coinTypes?: Record<string, number> | undefined;
111
97
  password?: string | undefined;
112
- }): Promise<Record<string, unknown>>;
98
+ }): Promise<Record<string, unknown>>; /**
99
+ * Gets the current Bitcoin network id (1 mainnet, 2 testnet)
100
+ */
113
101
  exportPrivateKey({ accountAddress, displayContainer, password, }?: {
114
102
  accountAddress?: string | undefined;
115
103
  displayContainer?: HTMLIFrameElement | undefined;
@@ -118,10 +106,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
118
106
  getExportHandler(): {
119
107
  clear: () => void;
120
108
  };
121
- exportClientKeyshares({ accountAddress, password, }: {
122
- accountAddress: string;
123
- password?: string | undefined;
124
- }): Promise<void>;
109
+ exportClientKeyshares({ accountAddress, password, }: import("@dynamic-labs/wallet-connector-core").ExportClientKeysharesParams): Promise<void>;
125
110
  runBackupLifecycle({ provider, accountAddress, password, performBackup, }: {
126
111
  provider: string;
127
112
  accountAddress: string;
@@ -137,11 +122,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
137
122
  };
138
123
  }) => Promise<void>;
139
124
  }): Promise<void>;
140
- backupKeySharesToGoogleDrive({ accountAddress, password, googleDriveAccessToken, }: {
141
- accountAddress: string;
142
- password?: string | undefined;
143
- googleDriveAccessToken?: string | undefined;
144
- }): Promise<void>;
125
+ backupKeySharesToGoogleDrive({ accountAddress, password, googleDriveAccessToken, }: import("@dynamic-labs/wallet-connector-core").BackupKeySharesToGoogleDriveParams): Promise<void>;
145
126
  exportClientKeysharesFromGoogleDrive({ accountAddress, password, }: {
146
127
  accountAddress: string;
147
128
  password?: string | undefined;
@@ -155,24 +136,13 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
155
136
  }): Promise<void>;
156
137
  hideICloudSignIn(): Promise<void>;
157
138
  isICloudAuthenticated(): Promise<boolean>;
158
- refreshWalletAccountShares({ accountAddress, password, }: {
159
- accountAddress: string;
160
- password?: string | undefined;
161
- }): Promise<void>;
162
- reshareWalletAccountShares({ accountAddress, thresholdSignatureScheme, password, }: {
163
- accountAddress: string;
164
- thresholdSignatureScheme: string;
165
- password?: string | undefined;
166
- }): Promise<void>;
139
+ 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>;
167
141
  revokeDelegation({ accountAddress, password, }: {
168
142
  accountAddress: string;
169
143
  password?: string | undefined;
170
144
  }): Promise<void>;
171
- updatePassword({ accountAddress, existingPassword, newPassword, }: {
172
- accountAddress: string;
173
- existingPassword?: string | undefined;
174
- newPassword: string;
175
- }): Promise<void>;
145
+ updatePassword({ accountAddress, existingPassword, newPassword, }: import("@dynamic-labs/wallet-connector-core").UpdatePasswordParams): Promise<void>;
176
146
  setPassword({ accountAddress, newPassword, }: {
177
147
  accountAddress: string;
178
148
  newPassword: string;
@@ -202,18 +172,7 @@ declare const DynamicWaasBitcoinConnector_base: (abstract new (...args: any[]) =
202
172
  generateTraceId(): string;
203
173
  buildErrorInstrumentContext(error: unknown): {
204
174
  errorCode: string | import("@dynamic-labs/utils").ErrorCode;
205
- errorMessage: string; /**
206
- * Wallet identity: keyshares/wallet records are keyed by the wallet's
207
- * primary (mainnet) address. On testnet the active address is the same
208
- * wallet's per-network encoding — WaaS lookups (password, signing) must use
209
- * the primary address (the same key signs both encodings).
210
- *
211
- * Resolved from the credential that owns the active address, so a user with
212
- * several Bitcoin wallets gets the identity of the wallet being spent from.
213
- * Never falls back to another wallet's address: a substituted key produces a
214
- * signature that looks valid locally and is rejected by the network, so the
215
- * failure has to surface here instead.
216
- */
175
+ errorMessage: string;
217
176
  errorType: string | undefined;
218
177
  } | {
219
178
  errorCode: string;
@@ -451,32 +410,19 @@ export declare class DynamicWaasBitcoinConnector extends DynamicWaasBitcoinConne
451
410
  * @param bitcoinConfig - Bitcoin configuration (addressType, network)
452
411
  * @returns The created wallet account information
453
412
  */
454
- createWalletAccount({ thresholdSignatureScheme, password, bitcoinConfig, }?: {
455
- thresholdSignatureScheme?: string;
456
- password?: string;
457
- bitcoinConfig?: BitcoinConfig;
458
- }): Promise<{
413
+ createWalletAccount(params?: CreateWalletAccountParams): Promise<{
459
414
  chainName: string;
460
415
  accountAddress: string;
461
416
  publicKeyHex: string;
462
417
  rawPublicKey: string | Uint8Array | undefined;
463
418
  }>;
464
419
  /**
465
- * Override importPrivateKey to require and validate addressType for Bitcoin
466
- * @param privateKey - The private key to import (WIF format for Bitcoin)
467
- * @param thresholdSignatureScheme - The threshold signature scheme (default: 'TWO_OF_TWO')
468
- * @param publicAddressCheck - Optional public address to verify against
469
- * @param addressType - Required address type for Bitcoin ('native_segwit' or 'taproot')
470
- * @param legacyWalletId - Optional ID of the legacy wallet being upgraded
420
+ * Requires and validates `addressType` for Bitcoin, then delegates.
421
+ * @param params - See ImportPrivateKeyParams. `addressType` is mandatory
422
+ * here ('native_segwit' or 'taproot') and `privateKey` is WIF.
471
423
  * @throws {DynamicError} If addressType is missing or invalid for BTC
472
424
  */
473
- importPrivateKey({ privateKey, thresholdSignatureScheme, publicAddressCheck, addressType, legacyWalletId, }: {
474
- privateKey: string;
475
- thresholdSignatureScheme?: string;
476
- publicAddressCheck?: string;
477
- addressType?: string;
478
- legacyWalletId?: string;
479
- }): Promise<void>;
425
+ importPrivateKey(params: ImportPrivateKeyParams): Promise<void>;
480
426
  /**
481
427
  * Gets the wallet client for a specific account address and sets it as
482
428
  * active — unless `accountAddress` is just a different network-tagged
@@ -496,33 +496,29 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
496
496
  const _super = Object.create(null, {
497
497
  createWalletAccount: { get: () => super.createWalletAccount }
498
498
  });
499
- return __awaiter(this, arguments, void 0, function* ({ thresholdSignatureScheme = 'TWO_OF_TWO', password, bitcoinConfig, } = {}) {
500
- var _a;
499
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
500
+ var _a, _b;
501
501
  const finalBitcoinConfig = {
502
- addressType: ((_a = bitcoinConfig === null || bitcoinConfig === void 0 ? void 0 : bitcoinConfig.addressType) !== null && _a !== void 0 ? _a : 'native_segwit'),
502
+ addressType: ((_b = (_a = params.bitcoinConfig) === null || _a === void 0 ? void 0 : _a.addressType) !== null && _b !== void 0 ? _b : 'native_segwit'),
503
503
  network: yield this.getBitcoinNetworkEnum(),
504
504
  };
505
- return _super.createWalletAccount.call(this, {
506
- bitcoinConfig: finalBitcoinConfig,
507
- password,
508
- thresholdSignatureScheme,
509
- });
505
+ // Spread, so a field added to CreateWalletAccountParams later still
506
+ // reaches the base instead of being silently dropped here.
507
+ return _super.createWalletAccount.call(this, Object.assign(Object.assign({}, params), { bitcoinConfig: finalBitcoinConfig }));
510
508
  });
511
509
  }
512
510
  /**
513
- * Override importPrivateKey to require and validate addressType for Bitcoin
514
- * @param privateKey - The private key to import (WIF format for Bitcoin)
515
- * @param thresholdSignatureScheme - The threshold signature scheme (default: 'TWO_OF_TWO')
516
- * @param publicAddressCheck - Optional public address to verify against
517
- * @param addressType - Required address type for Bitcoin ('native_segwit' or 'taproot')
518
- * @param legacyWalletId - Optional ID of the legacy wallet being upgraded
511
+ * Requires and validates `addressType` for Bitcoin, then delegates.
512
+ * @param params - See ImportPrivateKeyParams. `addressType` is mandatory
513
+ * here ('native_segwit' or 'taproot') and `privateKey` is WIF.
519
514
  * @throws {DynamicError} If addressType is missing or invalid for BTC
520
515
  */
521
- importPrivateKey(_a) {
516
+ importPrivateKey(params) {
522
517
  const _super = Object.create(null, {
523
518
  importPrivateKey: { get: () => super.importPrivateKey }
524
519
  });
525
- return __awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', publicAddressCheck, addressType, legacyWalletId, }) {
520
+ return __awaiter(this, void 0, void 0, function* () {
521
+ const { addressType } = params;
526
522
  if (!addressType) {
527
523
  throw new DynamicError('addressType is required for BTC importPrivateKey', 'addresstype_is_required_for_btc_importprivatekey');
528
524
  }
@@ -530,13 +526,10 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
530
526
  if (!validAddressTypes.includes(addressType)) {
531
527
  throw new DynamicError(`Invalid addressType: ${addressType}. Must be one of: ${validAddressTypes.join(', ')}`, 'invalid_addresstype_must_be_one_of');
532
528
  }
533
- return _super.importPrivateKey.call(this, {
534
- addressType,
535
- legacyWalletId,
536
- privateKey,
537
- publicAddressCheck,
538
- thresholdSignatureScheme,
539
- });
529
+ // Forwarded whole, never field-by-field: a re-declared parameter list is
530
+ // how `password` silently stopped reaching the base (see
531
+ // ImportPrivateKeyParams).
532
+ return _super.importPrivateKey.call(this, params);
540
533
  });
541
534
  }
542
535
  /**