@dynamic-labs/bitcoin 4.93.0 → 4.94.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 +19 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/connectors/BitcoinWalletConnector.d.ts +1 -0
- package/src/connectors/DynamicWaasBitcoinConnector/DynamicWaasBitcoinConnector.cjs +24 -0
- package/src/connectors/DynamicWaasBitcoinConnector/DynamicWaasBitcoinConnector.d.ts +1 -0
- package/src/connectors/DynamicWaasBitcoinConnector/DynamicWaasBitcoinConnector.js +24 -0
- package/src/wallet/BitcoinWallet.cjs +15 -0
- package/src/wallet/BitcoinWallet.d.ts +7 -0
- package/src/wallet/BitcoinWallet.js +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.94.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.93.1...v4.94.0) (2026-07-24)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **bitcoin:** add sendBitcoinWithConfirmation to show confirm modal on BTC sends ([#12023](https://github.com/dynamic-labs/dynamic-auth/issues/12023)) ([22a8b14](https://github.com/dynamic-labs/dynamic-auth/commit/22a8b14286b5612f37591ddba5507dd8f3c87cd3))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* replace deprecated polygon-rpc.com RPC with polygon.drpc.org (v4) ([#12033](https://github.com/dynamic-labs/dynamic-auth/issues/12033)) ([d64623d](https://github.com/dynamic-labs/dynamic-auth/commit/d64623d89f63084eb0b040f4466f057b833b9293))
|
|
13
|
+
|
|
14
|
+
### [4.93.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.93.0...v4.93.1) (2026-07-22)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **wallet-connect:** recover WalletConnect IndexedDB store when object store is missing ([#12048](https://github.com/dynamic-labs/dynamic-auth/issues/12048)) ([#12052](https://github.com/dynamic-labs/dynamic-auth/issues/12052)) ([48286d2](https://github.com/dynamic-labs/dynamic-auth/commit/48286d2beecb11ebe53489a25b83fbf73c9dd5f1))
|
|
20
|
+
|
|
2
21
|
## [4.93.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.92.4...v4.93.0) (2026-07-20)
|
|
3
22
|
|
|
4
23
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/bitcoin",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.94.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",
|
|
@@ -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": "4.
|
|
33
|
-
"@dynamic-labs/logger": "4.
|
|
34
|
-
"@dynamic-labs/types": "4.
|
|
35
|
-
"@dynamic-labs/utils": "4.
|
|
36
|
-
"@dynamic-labs/waas": "4.
|
|
37
|
-
"@dynamic-labs/wallet-book": "4.
|
|
38
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
32
|
+
"@dynamic-labs/assert-package-version": "4.94.0",
|
|
33
|
+
"@dynamic-labs/logger": "4.94.0",
|
|
34
|
+
"@dynamic-labs/types": "4.94.0",
|
|
35
|
+
"@dynamic-labs/utils": "4.94.0",
|
|
36
|
+
"@dynamic-labs/waas": "4.94.0",
|
|
37
|
+
"@dynamic-labs/wallet-book": "4.94.0",
|
|
38
|
+
"@dynamic-labs/wallet-connector-core": "4.94.0",
|
|
39
39
|
"eventemitter3": "5.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {}
|
|
@@ -41,6 +41,7 @@ export declare abstract class BitcoinWalletConnector extends WalletConnectorBase
|
|
|
41
41
|
setAdditionalAddresses(mainAddress: string, additionalAddresses: WalletAdditionalAddress[]): Promise<void>;
|
|
42
42
|
sendRawTransaction(rawTransaction: string): Promise<string>;
|
|
43
43
|
sendBitcoin(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
44
|
+
sendBitcoinWithConfirmation?(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
44
45
|
buildPsbt(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
45
46
|
getProvider<T>(): T & EventEmitter<string | symbol, any>;
|
|
46
47
|
abstract signPsbt(request: BitcoinSignPsbtRequest | EmbeddedWalletSignPsbtRequest): Promise<BitcoinSignPsbtResponse | undefined>;
|
|
@@ -353,6 +353,30 @@ class DynamicWaasBitcoinConnector extends waas.withDynamicWaas(BitcoinWalletConn
|
|
|
353
353
|
return this.sendRawTransaction(signedTransactionHex);
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
+
sendBitcoinWithConfirmation(transaction) {
|
|
357
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
358
|
+
if (!this.activeAccountAddress) {
|
|
359
|
+
throw new utils.DynamicError('Active account address is required', 'active_account_address_is_required');
|
|
360
|
+
}
|
|
361
|
+
const uiTransaction = new BitcoinUiTransaction.BitcoinUiTransaction({
|
|
362
|
+
from: this.activeAccountAddress,
|
|
363
|
+
mempoolApiService: this.mempoolApiService,
|
|
364
|
+
onSubmit: (tx) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
365
|
+
const txHash = yield this.sendBitcoin(tx);
|
|
366
|
+
if (!txHash) {
|
|
367
|
+
throw new utils.DynamicError('Failed to send Bitcoin transaction', 'send_bitcoin_transaction');
|
|
368
|
+
}
|
|
369
|
+
return txHash;
|
|
370
|
+
}),
|
|
371
|
+
});
|
|
372
|
+
uiTransaction.to = transaction.recipientAddress;
|
|
373
|
+
uiTransaction.value = transaction.amount;
|
|
374
|
+
if (transaction.feePriority) {
|
|
375
|
+
uiTransaction.feePriority = transaction.feePriority;
|
|
376
|
+
}
|
|
377
|
+
return this.walletUiUtils.sendTransaction(this, uiTransaction);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
356
380
|
/**
|
|
357
381
|
* Creates a new Bitcoin wallet account with Bitcoin-specific defaults.
|
|
358
382
|
* If `bitcoinConfig.addressType` is not provided, the underlying BTC client
|
|
@@ -346,6 +346,7 @@ export declare class DynamicWaasBitcoinConnector extends DynamicWaasBitcoinConne
|
|
|
346
346
|
* @throws {DynamicError} If any step in the process fails
|
|
347
347
|
*/
|
|
348
348
|
sendBitcoin(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
349
|
+
sendBitcoinWithConfirmation(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
349
350
|
/**
|
|
350
351
|
* Creates a new Bitcoin wallet account with Bitcoin-specific defaults.
|
|
351
352
|
* If `bitcoinConfig.addressType` is not provided, the underlying BTC client
|
|
@@ -349,6 +349,30 @@ class DynamicWaasBitcoinConnector extends withDynamicWaas(BitcoinWalletConnector
|
|
|
349
349
|
return this.sendRawTransaction(signedTransactionHex);
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
+
sendBitcoinWithConfirmation(transaction) {
|
|
353
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
354
|
+
if (!this.activeAccountAddress) {
|
|
355
|
+
throw new DynamicError('Active account address is required', 'active_account_address_is_required');
|
|
356
|
+
}
|
|
357
|
+
const uiTransaction = new BitcoinUiTransaction({
|
|
358
|
+
from: this.activeAccountAddress,
|
|
359
|
+
mempoolApiService: this.mempoolApiService,
|
|
360
|
+
onSubmit: (tx) => __awaiter(this, void 0, void 0, function* () {
|
|
361
|
+
const txHash = yield this.sendBitcoin(tx);
|
|
362
|
+
if (!txHash) {
|
|
363
|
+
throw new DynamicError('Failed to send Bitcoin transaction', 'send_bitcoin_transaction');
|
|
364
|
+
}
|
|
365
|
+
return txHash;
|
|
366
|
+
}),
|
|
367
|
+
});
|
|
368
|
+
uiTransaction.to = transaction.recipientAddress;
|
|
369
|
+
uiTransaction.value = transaction.amount;
|
|
370
|
+
if (transaction.feePriority) {
|
|
371
|
+
uiTransaction.feePriority = transaction.feePriority;
|
|
372
|
+
}
|
|
373
|
+
return this.walletUiUtils.sendTransaction(this, uiTransaction);
|
|
374
|
+
});
|
|
375
|
+
}
|
|
352
376
|
/**
|
|
353
377
|
* Creates a new Bitcoin wallet account with Bitcoin-specific defaults.
|
|
354
378
|
* If `bitcoinConfig.addressType` is not provided, the underlying BTC client
|
|
@@ -42,6 +42,21 @@ class BitcoinWallet extends walletConnectorCore.Wallet {
|
|
|
42
42
|
return this._connector.sendBitcoin(transaction);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Sends satoshis to a bitcoin address, showing a confirmation modal when
|
|
47
|
+
* the connector supports it (e.g. DynamicWaasBitcoinConnector). Falls back
|
|
48
|
+
* to sendBitcoin for connectors that have no confirmation UI.
|
|
49
|
+
* @returns A promise that resolves to the transaction id
|
|
50
|
+
*/
|
|
51
|
+
sendBitcoinWithConfirmation(transaction) {
|
|
52
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
yield this.sync();
|
|
54
|
+
if (this._connector.sendBitcoinWithConfirmation) {
|
|
55
|
+
return this._connector.sendBitcoinWithConfirmation(transaction);
|
|
56
|
+
}
|
|
57
|
+
return this._connector.sendBitcoin(transaction);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
45
60
|
/**
|
|
46
61
|
* Signs a message using a specific address type (payment or ordinals).
|
|
47
62
|
* @param messageToSign - The message to sign.
|
|
@@ -23,6 +23,13 @@ export declare class BitcoinWallet extends Wallet<BitcoinWalletConnector> {
|
|
|
23
23
|
* @returns A promise that resolves to the transaction id
|
|
24
24
|
*/
|
|
25
25
|
sendBitcoin(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* Sends satoshis to a bitcoin address, showing a confirmation modal when
|
|
28
|
+
* the connector supports it (e.g. DynamicWaasBitcoinConnector). Falls back
|
|
29
|
+
* to sendBitcoin for connectors that have no confirmation UI.
|
|
30
|
+
* @returns A promise that resolves to the transaction id
|
|
31
|
+
*/
|
|
32
|
+
sendBitcoinWithConfirmation(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
26
33
|
/**
|
|
27
34
|
* Signs a message using a specific address type (payment or ordinals).
|
|
28
35
|
* @param messageToSign - The message to sign.
|
|
@@ -38,6 +38,21 @@ class BitcoinWallet extends Wallet {
|
|
|
38
38
|
return this._connector.sendBitcoin(transaction);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Sends satoshis to a bitcoin address, showing a confirmation modal when
|
|
43
|
+
* the connector supports it (e.g. DynamicWaasBitcoinConnector). Falls back
|
|
44
|
+
* to sendBitcoin for connectors that have no confirmation UI.
|
|
45
|
+
* @returns A promise that resolves to the transaction id
|
|
46
|
+
*/
|
|
47
|
+
sendBitcoinWithConfirmation(transaction) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
yield this.sync();
|
|
50
|
+
if (this._connector.sendBitcoinWithConfirmation) {
|
|
51
|
+
return this._connector.sendBitcoinWithConfirmation(transaction);
|
|
52
|
+
}
|
|
53
|
+
return this._connector.sendBitcoin(transaction);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
41
56
|
/**
|
|
42
57
|
* Signs a message using a specific address type (payment or ordinals).
|
|
43
58
|
* @param messageToSign - The message to sign.
|