@dynamic-labs/bitcoin 1.1.0-alpha.20 → 1.1.0-alpha.22

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,25 @@
1
1
 
2
+ ## [1.1.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.21...v1.1.0-alpha.22) (2024-02-01)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * onAuthFlowClose not being called ([#4563](https://github.com/dynamic-labs/DynamicAuth/issues/4563)) ([c4b2648](https://github.com/dynamic-labs/DynamicAuth/commit/c4b264885b7dba6e204ef49bf642d25c7d287b04))
8
+
9
+ ## [1.1.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.20...v1.1.0-alpha.21) (2024-02-01)
10
+
11
+
12
+ ### Features
13
+
14
+ * add phantom redirect handling context ([#4479](https://github.com/dynamic-labs/DynamicAuth/issues/4479)) ([e0218ee](https://github.com/dynamic-labs/DynamicAuth/commit/e0218eec1a67787f5c0e7483d542a5f773e911ef))
15
+ * add signPsbt method to bitcoin wallet connectors ([dfdc0fe](https://github.com/dynamic-labs/DynamicAuth/commit/dfdc0fe0e6894c1307b286e89b43a4c58a8808f3))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * relax passkey feature detection check in sdk to avoid false nega… ([#4556](https://github.com/dynamic-labs/DynamicAuth/issues/4556)) ([4554f7d](https://github.com/dynamic-labs/DynamicAuth/commit/4554f7d7c5339859481cdecca95a9c07fae4ba5c))
21
+ * workaround braavos undefined selectedWallet on chainChange event ([#4552](https://github.com/dynamic-labs/DynamicAuth/issues/4552)) ([aa35df0](https://github.com/dynamic-labs/DynamicAuth/commit/aa35df0e894feafa0606aa1c87bd3d3879ebc594))
22
+
2
23
  ## [1.1.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.19...v1.1.0-alpha.20) (2024-01-31)
3
24
 
4
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/bitcoin",
3
- "version": "1.1.0-alpha.20",
3
+ "version": "1.1.0-alpha.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -30,9 +30,9 @@
30
30
  "@wallet-standard/app": "^1.0.1",
31
31
  "@wallet-standard/base": "^1.0.1",
32
32
  "sats-connect": "^1.1.2",
33
- "@dynamic-labs/utils": "1.1.0-alpha.20",
34
- "@dynamic-labs/wallet-book": "1.1.0-alpha.20",
35
- "@dynamic-labs/wallet-connector-core": "1.1.0-alpha.20",
33
+ "@dynamic-labs/utils": "1.1.0-alpha.22",
34
+ "@dynamic-labs/wallet-book": "1.1.0-alpha.22",
35
+ "@dynamic-labs/wallet-connector-core": "1.1.0-alpha.22",
36
36
  "stream": "0.0.2"
37
37
  },
38
38
  "peerDependencies": {}
@@ -92,10 +92,10 @@ class BitcoinSatsConnectConnector extends BitcoinWalletConnector.BitcoinWalletCo
92
92
  });
93
93
  }
94
94
  sendBitcoin(transaction) {
95
- var _a, _b;
95
+ var _a;
96
96
  return _tslib.__awaiter(this, void 0, void 0, function* () {
97
97
  const mainAddress = yield this.fetchPublicAddress();
98
- const senderAddress = (_b = (_a = (yield this.getAdditionalAddresses(mainAddress))) === null || _a === void 0 ? void 0 : _a.find((address) => address.type === 'payment')) === null || _b === void 0 ? void 0 : _b.address;
98
+ const senderAddress = (_a = (yield this.getAdditionalAddresses(mainAddress)).find((address) => address.type === 'payment')) === null || _a === void 0 ? void 0 : _a.address;
99
99
  if (!senderAddress || !supportsSatsConnect.supportsSatsConnect(this)) {
100
100
  return;
101
101
  }
@@ -88,10 +88,10 @@ class BitcoinSatsConnectConnector extends BitcoinWalletConnector {
88
88
  });
89
89
  }
90
90
  sendBitcoin(transaction) {
91
- var _a, _b;
91
+ var _a;
92
92
  return __awaiter(this, void 0, void 0, function* () {
93
93
  const mainAddress = yield this.fetchPublicAddress();
94
- const senderAddress = (_b = (_a = (yield this.getAdditionalAddresses(mainAddress))) === null || _a === void 0 ? void 0 : _a.find((address) => address.type === 'payment')) === null || _b === void 0 ? void 0 : _b.address;
94
+ const senderAddress = (_a = (yield this.getAdditionalAddresses(mainAddress)).find((address) => address.type === 'payment')) === null || _a === void 0 ? void 0 : _a.address;
95
95
  if (!senderAddress || !supportsSatsConnect(this)) {
96
96
  return;
97
97
  }
@@ -100,15 +100,12 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
100
100
  });
101
101
  }
102
102
  getAdditionalAddresses(mainAddress) {
103
- var _a;
104
103
  return _tslib.__awaiter(this, void 0, void 0, function* () {
105
104
  if (!mainAddress) {
106
- return;
105
+ return [];
107
106
  }
108
107
  const currentAccount = yield this.cache.getConnectedAccount(mainAddress);
109
- return ((_a = currentAccount === null || currentAccount === void 0 ? void 0 : currentAccount.additionalAddresses) === null || _a === void 0 ? void 0 : _a.length)
110
- ? currentAccount.additionalAddresses
111
- : undefined;
108
+ return (currentAccount === null || currentAccount === void 0 ? void 0 : currentAccount.additionalAddresses) || [];
112
109
  });
113
110
  }
114
111
  setAdditionalAddresses(mainAddress, additionalAddresses) {
@@ -25,7 +25,7 @@ export declare abstract class BitcoinWalletConnector extends WalletConnectorBase
25
25
  getBalance(): Promise<string | undefined>;
26
26
  private getConnectedAccountsFromCache;
27
27
  getConnectedAccounts(): Promise<string[]>;
28
- getAdditionalAddresses(mainAddress?: string): Promise<WalletAdditionalAddress[] | undefined>;
28
+ getAdditionalAddresses(mainAddress?: string): Promise<WalletAdditionalAddress[]>;
29
29
  setAdditionalAddresses(mainAddress: string, additionalAddresses: WalletAdditionalAddress[]): Promise<void>;
30
30
  sendRawTransaction(rawTransaction: string): Promise<string | undefined>;
31
31
  abstract sendBitcoin(transaction: BitcoinTransaction): Promise<string | undefined>;
@@ -96,15 +96,12 @@ class BitcoinWalletConnector extends WalletConnectorBase {
96
96
  });
97
97
  }
98
98
  getAdditionalAddresses(mainAddress) {
99
- var _a;
100
99
  return __awaiter(this, void 0, void 0, function* () {
101
100
  if (!mainAddress) {
102
- return;
101
+ return [];
103
102
  }
104
103
  const currentAccount = yield this.cache.getConnectedAccount(mainAddress);
105
- return ((_a = currentAccount === null || currentAccount === void 0 ? void 0 : currentAccount.additionalAddresses) === null || _a === void 0 ? void 0 : _a.length)
106
- ? currentAccount.additionalAddresses
107
- : undefined;
104
+ return (currentAccount === null || currentAccount === void 0 ? void 0 : currentAccount.additionalAddresses) || [];
108
105
  });
109
106
  }
110
107
  setAdditionalAddresses(mainAddress, additionalAddresses) {