@dynamic-labs/bitcoin 2.6.1 → 2.6.3

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,20 @@
1
1
 
2
+ ### [2.6.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.6.2...v2.6.3) (2024-09-16)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * deeplinking on magic eden evm and bitcoin ([#6920](https://github.com/dynamic-labs/DynamicAuth/issues/6920)) ([b00c358](https://github.com/dynamic-labs/DynamicAuth/commit/b00c35843ace58e4898abd9404568aebcc44c0e5))
8
+ * sendBitcoin for unisat ([#6904](https://github.com/dynamic-labs/DynamicAuth/issues/6904)) ([d9a8388](https://github.com/dynamic-labs/DynamicAuth/commit/d9a8388748e2c998567b101f874b20fab65e54ab))
9
+
10
+ ### [2.6.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.6.1...v2.6.2) (2024-09-11)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * add missing bitcoin wallets to wallet-book fallback ([#6872](https://github.com/dynamic-labs/DynamicAuth/issues/6872)) ([4dec35c](https://github.com/dynamic-labs/DynamicAuth/commit/4dec35c9a457081944231c64432b1966bc7f938b))
16
+ * stop infinite rerendering when wagmi config error is thrown ([#6862](https://github.com/dynamic-labs/DynamicAuth/issues/6862)) ([#6864](https://github.com/dynamic-labs/DynamicAuth/issues/6864)) ([8fe2cf0](https://github.com/dynamic-labs/DynamicAuth/commit/8fe2cf0d592c3067af6edfe8aa4ea8d3fc8278a7))
17
+
2
18
  ### [2.6.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.6.0...v2.6.1) (2024-09-11)
3
19
 
4
20
  ## [2.6.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.5.3...v2.6.0) (2024-09-03)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/bitcoin",
3
- "version": "2.6.1",
3
+ "version": "2.6.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -32,9 +32,9 @@
32
32
  "@wallet-standard/base": "1.0.1",
33
33
  "bitcoinjs-lib": "6.1.5",
34
34
  "sats-connect": "2.0.0",
35
- "@dynamic-labs/utils": "2.6.1",
36
- "@dynamic-labs/wallet-book": "2.6.1",
37
- "@dynamic-labs/wallet-connector-core": "2.6.1",
35
+ "@dynamic-labs/utils": "2.6.3",
36
+ "@dynamic-labs/wallet-book": "2.6.3",
37
+ "@dynamic-labs/wallet-connector-core": "2.6.3",
38
38
  "stream": "0.0.2"
39
39
  },
40
40
  "peerDependencies": {}
@@ -143,7 +143,7 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
143
143
  connectedAccount = yield this.getAddressPromise;
144
144
  }
145
145
  catch (error) {
146
- walletConnectorCore.logger.error(`${this.key} getConnectedAccounts - error fetching connected account`);
146
+ walletConnectorCore.logger.error(`${this.key} getConnectedAccounts - error fetching connected account`, error);
147
147
  //don't throw error just return empty array after clearing the promise
148
148
  }
149
149
  this.getAddressPromise = undefined;
@@ -139,7 +139,7 @@ class BitcoinWalletConnector extends WalletConnectorBase {
139
139
  connectedAccount = yield this.getAddressPromise;
140
140
  }
141
141
  catch (error) {
142
- logger.error(`${this.key} getConnectedAccounts - error fetching connected account`);
142
+ logger.error(`${this.key} getConnectedAccounts - error fetching connected account`, error);
143
143
  //don't throw error just return empty array after clearing the promise
144
144
  }
145
145
  this.getAddressPromise = undefined;
@@ -51,7 +51,7 @@ class UnisatConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
51
51
  if (!connectedAddress || !provider) {
52
52
  return;
53
53
  }
54
- return provider.sendBitcoin(transaction.recipientAddress, transaction.amount.toString());
54
+ return provider.sendBitcoin(transaction.recipientAddress, Number(transaction.amount));
55
55
  });
56
56
  }
57
57
  signPsbt(request) {
@@ -47,7 +47,7 @@ class UnisatConnector extends BitcoinWalletConnector {
47
47
  if (!connectedAddress || !provider) {
48
48
  return;
49
49
  }
50
- return provider.sendBitcoin(transaction.recipientAddress, transaction.amount.toString());
50
+ return provider.sendBitcoin(transaction.recipientAddress, Number(transaction.amount));
51
51
  });
52
52
  }
53
53
  signPsbt(request) {
@@ -3,22 +3,27 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
+ var walletBook = require('@dynamic-labs/wallet-book');
6
7
  var _const = require('../const.cjs');
7
8
  require('@dynamic-labs/utils');
8
9
  require('../../_virtual/_tslib.cjs');
9
10
  require('sats-connect');
10
11
  require('bitcoinjs-lib');
11
12
  require('@dynamic-labs/wallet-connector-core');
12
- require('@dynamic-labs/wallet-book');
13
13
  require('@dynamic-labs/sdk-api-core');
14
14
  require('@wallet-standard/app');
15
15
  var hasSatsConnectFeature = require('./hasSatsConnectFeature.cjs');
16
16
 
17
17
  const supportsSatsConnect = (connector) => {
18
+ var _a, _b, _c, _d;
18
19
  if (connector.key === _const.XVERSE_KEY) {
19
20
  return true;
20
21
  }
21
- if (connector.wallet && hasSatsConnectFeature.hasSatsConnectFeature(connector.wallet.features)) {
22
+ // Grabbing the wallet standard from the fallback wallet
23
+ // due to wallet standard not being available on mobile
24
+ const fallbackWalletWalletStandard = (_c = (_b = (_a = walletBook.findWalletBookWallet(connector.walletBook, connector.key)) === null || _a === void 0 ? void 0 : _a.injectedConfig) === null || _b === void 0 ? void 0 : _b.find((config) => config.chain === 'btc')) === null || _c === void 0 ? void 0 : _c.walletStandard;
25
+ if ((connector.wallet && hasSatsConnectFeature.hasSatsConnectFeature(connector.wallet.features)) ||
26
+ ((_d = fallbackWalletWalletStandard === null || fallbackWalletWalletStandard === void 0 ? void 0 : fallbackWalletWalletStandard.features) === null || _d === void 0 ? void 0 : _d.includes(_const.SATSCONNECT_FEATURE))) {
22
27
  return true;
23
28
  }
24
29
  return false;
@@ -1,20 +1,25 @@
1
1
  'use client'
2
- import { XVERSE_KEY } from '../const.js';
2
+ import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
3
+ import { XVERSE_KEY, SATSCONNECT_FEATURE } from '../const.js';
3
4
  import '@dynamic-labs/utils';
4
5
  import '../../_virtual/_tslib.js';
5
6
  import 'sats-connect';
6
7
  import 'bitcoinjs-lib';
7
8
  import '@dynamic-labs/wallet-connector-core';
8
- import '@dynamic-labs/wallet-book';
9
9
  import '@dynamic-labs/sdk-api-core';
10
10
  import '@wallet-standard/app';
11
11
  import { hasSatsConnectFeature } from './hasSatsConnectFeature.js';
12
12
 
13
13
  const supportsSatsConnect = (connector) => {
14
+ var _a, _b, _c, _d;
14
15
  if (connector.key === XVERSE_KEY) {
15
16
  return true;
16
17
  }
17
- if (connector.wallet && hasSatsConnectFeature(connector.wallet.features)) {
18
+ // Grabbing the wallet standard from the fallback wallet
19
+ // due to wallet standard not being available on mobile
20
+ const fallbackWalletWalletStandard = (_c = (_b = (_a = findWalletBookWallet(connector.walletBook, connector.key)) === null || _a === void 0 ? void 0 : _a.injectedConfig) === null || _b === void 0 ? void 0 : _b.find((config) => config.chain === 'btc')) === null || _c === void 0 ? void 0 : _c.walletStandard;
21
+ if ((connector.wallet && hasSatsConnectFeature(connector.wallet.features)) ||
22
+ ((_d = fallbackWalletWalletStandard === null || fallbackWalletWalletStandard === void 0 ? void 0 : fallbackWalletWalletStandard.features) === null || _d === void 0 ? void 0 : _d.includes(SATSCONNECT_FEATURE))) {
18
23
  return true;
19
24
  }
20
25
  return false;