@dynamic-labs/bitcoin 3.0.2 → 3.0.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,12 @@
|
|
|
1
1
|
|
|
2
|
+
### [3.0.3](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.2...v3.0.3) (2024-09-16)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* deeplinking for magic eden ethereum and btc ([#6919](https://github.com/dynamic-labs/DynamicAuth/issues/6919)) ([822efaa](https://github.com/dynamic-labs/DynamicAuth/commit/822efaabdec4415a031afabeef13b66ae7d3cd7c))
|
|
8
|
+
* sendBitcoin for unisat ([#6903](https://github.com/dynamic-labs/DynamicAuth/issues/6903)) ([71f726d](https://github.com/dynamic-labs/DynamicAuth/commit/71f726df7d8ff8307048ba1390c4847a9b16ce64))
|
|
9
|
+
|
|
2
10
|
### [3.0.2](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.1...v3.0.2) (2024-09-13)
|
|
3
11
|
|
|
4
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/bitcoin",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -32,10 +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/types": "3.0.
|
|
36
|
-
"@dynamic-labs/utils": "3.0.
|
|
37
|
-
"@dynamic-labs/wallet-book": "3.0.
|
|
38
|
-
"@dynamic-labs/wallet-connector-core": "3.0.
|
|
35
|
+
"@dynamic-labs/types": "3.0.3",
|
|
36
|
+
"@dynamic-labs/utils": "3.0.3",
|
|
37
|
+
"@dynamic-labs/wallet-book": "3.0.3",
|
|
38
|
+
"@dynamic-labs/wallet-connector-core": "3.0.3",
|
|
39
39
|
"stream": "0.0.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {}
|
|
@@ -50,7 +50,7 @@ class UnisatConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
|
|
|
50
50
|
if (!connectedAddress || !provider) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
return provider.sendBitcoin(transaction.recipientAddress, transaction.amount
|
|
53
|
+
return provider.sendBitcoin(transaction.recipientAddress, Number(transaction.amount));
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
signPsbt(request) {
|
|
@@ -46,7 +46,7 @@ class UnisatConnector extends BitcoinWalletConnector {
|
|
|
46
46
|
if (!connectedAddress || !provider) {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
return provider.sendBitcoin(transaction.recipientAddress, transaction.amount
|
|
49
|
+
return provider.sendBitcoin(transaction.recipientAddress, Number(transaction.amount));
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
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;
|