@dynamic-labs/bitcoin 2.0.0-alpha.30 → 2.0.0-alpha.32
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,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2024-04-15)
|
|
3
|
+
|
|
4
|
+
## [2.0.0-alpha.31](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.30...v2.0.0-alpha.31) (2024-04-11)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* support adding email for recovery to existing embedded wallet ([#5128](https://github.com/dynamic-labs/DynamicAuth/issues/5128)) ([477fd81](https://github.com/dynamic-labs/DynamicAuth/commit/477fd81ac00864284d9d2183c0b8c078a0a23a2b))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* issue where customer also tries to use i18n.init ([#5267](https://github.com/dynamic-labs/DynamicAuth/issues/5267)) ([7f81f1e](https://github.com/dynamic-labs/DynamicAuth/commit/7f81f1e010fbc6408f6a5d6a37608235e947befa))
|
|
15
|
+
* smart wallet not loading correctly upon refresh when using non-embedded eoa wallet ([#5301](https://github.com/dynamic-labs/DynamicAuth/issues/5301)) ([e957317](https://github.com/dynamic-labs/DynamicAuth/commit/e9573173f6209773a0be5f4af37323f2be8d7906))
|
|
16
|
+
|
|
2
17
|
## [2.0.0-alpha.30](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.29...v2.0.0-alpha.30) (2024-04-11)
|
|
3
18
|
|
|
4
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/bitcoin",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.32",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@btckit/types": "0.0.19",
|
|
30
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
30
|
+
"@dynamic-labs/sdk-api-core": "0.0.418",
|
|
31
31
|
"@wallet-standard/app": "1.0.1",
|
|
32
32
|
"@wallet-standard/base": "1.0.1",
|
|
33
33
|
"bitcoinjs-lib": "6.1.5",
|
|
34
34
|
"sats-connect": "1.1.2",
|
|
35
|
-
"@dynamic-labs/utils": "2.0.0-alpha.
|
|
36
|
-
"@dynamic-labs/wallet-book": "2.0.0-alpha.
|
|
37
|
-
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.
|
|
35
|
+
"@dynamic-labs/utils": "2.0.0-alpha.32",
|
|
36
|
+
"@dynamic-labs/wallet-book": "2.0.0-alpha.32",
|
|
37
|
+
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.32",
|
|
38
38
|
"stream": "0.0.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {}
|
|
@@ -42,13 +42,19 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
getBalance() {
|
|
45
|
+
var _a;
|
|
45
46
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
46
47
|
const [connectedAddress] = yield this.getConnectedAccounts();
|
|
47
48
|
if (!connectedAddress) {
|
|
48
49
|
throw new utils.DynamicError('getBalance - No connected address found!');
|
|
49
50
|
}
|
|
50
|
-
const
|
|
51
|
-
const
|
|
51
|
+
const additionalAddresses = yield this.getAdditionalAddresses(connectedAddress);
|
|
52
|
+
const paymentAddress = (_a = additionalAddresses.find((address) => address.type === sdkApiCore.WalletAddressType.Payment)) === null || _a === void 0 ? void 0 : _a.address;
|
|
53
|
+
if (!paymentAddress) {
|
|
54
|
+
throw new utils.DynamicError('getBalance - No payment address found!');
|
|
55
|
+
}
|
|
56
|
+
const API_URL = getMempoolApiUrl.getMempoolApiUrl(paymentAddress);
|
|
57
|
+
const response = yield fetch(`${API_URL}/address/${paymentAddress}`);
|
|
52
58
|
if (!response.ok) {
|
|
53
59
|
// if the request fails due to rate limits, return cached value
|
|
54
60
|
if (response.status === _const.HTTP_STATUS_TOO_MANY_REQUESTS) {
|
|
@@ -38,13 +38,19 @@ class BitcoinWalletConnector extends WalletConnectorBase {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
getBalance() {
|
|
41
|
+
var _a;
|
|
41
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
43
|
const [connectedAddress] = yield this.getConnectedAccounts();
|
|
43
44
|
if (!connectedAddress) {
|
|
44
45
|
throw new DynamicError('getBalance - No connected address found!');
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
-
const
|
|
47
|
+
const additionalAddresses = yield this.getAdditionalAddresses(connectedAddress);
|
|
48
|
+
const paymentAddress = (_a = additionalAddresses.find((address) => address.type === WalletAddressType.Payment)) === null || _a === void 0 ? void 0 : _a.address;
|
|
49
|
+
if (!paymentAddress) {
|
|
50
|
+
throw new DynamicError('getBalance - No payment address found!');
|
|
51
|
+
}
|
|
52
|
+
const API_URL = getMempoolApiUrl(paymentAddress);
|
|
53
|
+
const response = yield fetch(`${API_URL}/address/${paymentAddress}`);
|
|
48
54
|
if (!response.ok) {
|
|
49
55
|
// if the request fails due to rate limits, return cached value
|
|
50
56
|
if (response.status === HTTP_STATUS_TOO_MANY_REQUESTS) {
|