@dynamic-labs/bitcoin 3.0.0-alpha.65 → 3.0.0-alpha.66

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,18 @@
1
1
 
2
+ ## [3.0.0-alpha.66](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.65...v3.0.0-alpha.66) (2024-09-11)
3
+
4
+
5
+ ### Features
6
+
7
+ * add new method to BitcoinWallet to sign message with a specific address type ([#6861](https://github.com/dynamic-labs/DynamicAuth/issues/6861)) ([9284648](https://github.com/dynamic-labs/DynamicAuth/commit/92846488b4d60a498374dd60c4a0be3ab87e4e68))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * fix ethers-v6 exports ([#6863](https://github.com/dynamic-labs/DynamicAuth/issues/6863)) ([27a1aab](https://github.com/dynamic-labs/DynamicAuth/commit/27a1aabe6c5e6ed2501200f435b2cb5110836986))
13
+ * stop infinite rerendering when wagmi config error is thrown ([#6862](https://github.com/dynamic-labs/DynamicAuth/issues/6862)) ([9b2fac0](https://github.com/dynamic-labs/DynamicAuth/commit/9b2fac0a570246f4663057c1ff6c82a1adca64c6))
14
+ * update react-native packages to include correct dependencies ([#6859](https://github.com/dynamic-labs/DynamicAuth/issues/6859)) ([a6f6c1c](https://github.com/dynamic-labs/DynamicAuth/commit/a6f6c1c750d2d6916a94183059369e208ec9afa5))
15
+
2
16
  ## [3.0.0-alpha.65](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.64...v3.0.0-alpha.65) (2024-09-11)
3
17
 
4
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/bitcoin",
3
- "version": "3.0.0-alpha.65",
3
+ "version": "3.0.0-alpha.66",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -32,9 +32,10 @@
32
32
  "@wallet-standard/base": "1.0.1",
33
33
  "bitcoinjs-lib": "6.1.5",
34
34
  "sats-connect": "2.8.0",
35
- "@dynamic-labs/utils": "3.0.0-alpha.65",
36
- "@dynamic-labs/wallet-book": "3.0.0-alpha.65",
37
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.65",
35
+ "@dynamic-labs/types": "3.0.0-alpha.66",
36
+ "@dynamic-labs/utils": "3.0.0-alpha.66",
37
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.66",
38
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.66",
38
39
  "stream": "0.0.2"
39
40
  },
40
41
  "peerDependencies": {}
@@ -27,6 +27,21 @@ class BitcoinWallet extends walletConnectorCore.Wallet {
27
27
  return this._connector.sendBitcoin(transaction);
28
28
  });
29
29
  }
30
+ /**
31
+ * Signs a message using a specific address type (payment or ordinals).
32
+ * @param messageToSign - The message to sign.
33
+ * @param addressType - The type of address to sign the message with (payment or ordinals).
34
+ * @returns A promise that resolves to the signature of the message as a string,
35
+ * or undefined if the message cannot be signed.
36
+ */
37
+ signMessageWithAddress(messageToSign, addressType) {
38
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
39
+ var _a;
40
+ yield this.sync();
41
+ const address = ((_a = this.additionalAddresses.find((addr) => addr.type === addressType)) === null || _a === void 0 ? void 0 : _a.address) || this.address;
42
+ return this._connector.signMessage(messageToSign, address);
43
+ });
44
+ }
30
45
  /**
31
46
  * Sings a PSBT
32
47
  * @returns A promise that resolves to an object with the signed PSBT
@@ -1,4 +1,5 @@
1
1
  import { Wallet } from '@dynamic-labs/wallet-connector-core';
2
+ import type { WalletAddressType } from '@dynamic-labs/types';
2
3
  import { BitcoinWalletConnector } from '../connectors';
3
4
  import { BitcoinSignPsbtRequest, BitcoinSignPsbtResponse, BitcoinTransaction } from '../types';
4
5
  export declare class BitcoinWallet extends Wallet<BitcoinWalletConnector> {
@@ -12,6 +13,14 @@ export declare class BitcoinWallet extends Wallet<BitcoinWalletConnector> {
12
13
  * @returns A promise that resolves to the transaction id
13
14
  */
14
15
  sendBitcoin(transaction: BitcoinTransaction): Promise<string | undefined>;
16
+ /**
17
+ * Signs a message using a specific address type (payment or ordinals).
18
+ * @param messageToSign - The message to sign.
19
+ * @param addressType - The type of address to sign the message with (payment or ordinals).
20
+ * @returns A promise that resolves to the signature of the message as a string,
21
+ * or undefined if the message cannot be signed.
22
+ */
23
+ signMessageWithAddress(messageToSign: string, addressType: WalletAddressType): Promise<string | undefined>;
15
24
  /**
16
25
  * Sings a PSBT
17
26
  * @returns A promise that resolves to an object with the signed PSBT
@@ -23,6 +23,21 @@ class BitcoinWallet extends Wallet {
23
23
  return this._connector.sendBitcoin(transaction);
24
24
  });
25
25
  }
26
+ /**
27
+ * Signs a message using a specific address type (payment or ordinals).
28
+ * @param messageToSign - The message to sign.
29
+ * @param addressType - The type of address to sign the message with (payment or ordinals).
30
+ * @returns A promise that resolves to the signature of the message as a string,
31
+ * or undefined if the message cannot be signed.
32
+ */
33
+ signMessageWithAddress(messageToSign, addressType) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ var _a;
36
+ yield this.sync();
37
+ const address = ((_a = this.additionalAddresses.find((addr) => addr.type === addressType)) === null || _a === void 0 ? void 0 : _a.address) || this.address;
38
+ return this._connector.signMessage(messageToSign, address);
39
+ });
40
+ }
26
41
  /**
27
42
  * Sings a PSBT
28
43
  * @returns A promise that resolves to an object with the signed PSBT