@dynamic-labs/bitcoin 4.20.0 → 4.20.2
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 +22 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +6 -6
- package/src/connectors/BitcoinWalletConnector.cjs +16 -0
- package/src/connectors/BitcoinWalletConnector.d.ts +1 -0
- package/src/connectors/BitcoinWalletConnector.js +17 -1
- package/src/connectors/OkxConnector/OkxConnector.cjs +2 -13
- package/src/connectors/OkxConnector/OkxConnector.js +2 -13
- package/src/connectors/OneKeyConnector/OneKeyConnector.cjs +2 -12
- package/src/connectors/OneKeyConnector/OneKeyConnector.js +2 -12
- package/src/connectors/UnisatConnector/UnisatConnector.cjs +4 -0
- package/src/connectors/UnisatConnector/UnisatConnector.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.20.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.1...v4.20.2) (2025-06-11)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* auto-creation for only missing v3 wallets ([#8928](https://github.com/dynamic-labs/dynamic-auth/issues/8928)) ([845a01b](https://github.com/dynamic-labs/dynamic-auth/commit/845a01b1c7661d4858913006b2dd303ded19b462))
|
|
8
|
+
* don't logout when unlinking last wallet ([#8932](https://github.com/dynamic-labs/dynamic-auth/issues/8932)) ([ae91d68](https://github.com/dynamic-labs/dynamic-auth/commit/ae91d682ac69a267be3b1f9ae4cf2bb46cae8c6b))
|
|
9
|
+
* fetch nonce before attempting zksync account upgrade to avoid nonce collision ([#8924](https://github.com/dynamic-labs/dynamic-auth/issues/8924)) ([12aa982](https://github.com/dynamic-labs/dynamic-auth/commit/12aa98224c30ded0f7b83f3eabc6fa9a923b72cd))
|
|
10
|
+
* remove max session expiration restraint for zksync sessions ([#8922](https://github.com/dynamic-labs/dynamic-auth/issues/8922)) ([abb92e0](https://github.com/dynamic-labs/dynamic-auth/commit/abb92e009ff9c5485e4856a39d03c4035b7a6ee2))
|
|
11
|
+
|
|
12
|
+
### [4.20.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.0...v4.20.1) (2025-06-09)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **global-wallet:** new createKernelClient method to native api ([#8883](https://github.com/dynamic-labs/dynamic-auth/issues/8883)) ([005b34c](https://github.com/dynamic-labs/dynamic-auth/commit/005b34c230ceb5e945547e129231c108a6cec444))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* default embedded wallet chain enum ([#8917](https://github.com/dynamic-labs/dynamic-auth/issues/8917)) ([e9fd715](https://github.com/dynamic-labs/dynamic-auth/commit/e9fd715506598bfabbc71454421885d05a06a3ec))
|
|
23
|
+
|
|
2
24
|
## [4.20.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.7...v4.20.0) (2025-06-09)
|
|
3
25
|
|
|
4
26
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/bitcoin",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.2",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"bitcoinjs-lib": "6.1.5",
|
|
26
26
|
"sats-connect": "3.0.1",
|
|
27
27
|
"jsontokens": "4.0.1",
|
|
28
|
-
"@dynamic-labs/assert-package-version": "4.20.
|
|
29
|
-
"@dynamic-labs/types": "4.20.
|
|
30
|
-
"@dynamic-labs/utils": "4.20.
|
|
31
|
-
"@dynamic-labs/wallet-book": "4.20.
|
|
32
|
-
"@dynamic-labs/wallet-connector-core": "4.20.
|
|
28
|
+
"@dynamic-labs/assert-package-version": "4.20.2",
|
|
29
|
+
"@dynamic-labs/types": "4.20.2",
|
|
30
|
+
"@dynamic-labs/utils": "4.20.2",
|
|
31
|
+
"@dynamic-labs/wallet-book": "4.20.2",
|
|
32
|
+
"@dynamic-labs/wallet-connector-core": "4.20.2",
|
|
33
33
|
"eventemitter3": "5.0.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {}
|
|
@@ -327,6 +327,22 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
327
327
|
return ['https://btcscan.org/'];
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
+
openInAppBrowserIfRequired() {
|
|
331
|
+
var _a;
|
|
332
|
+
if (this.isInstalledOnBrowser() ||
|
|
333
|
+
!utils.isMobile() ||
|
|
334
|
+
!((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) ||
|
|
335
|
+
this.mobileExperience === 'redirect') {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
const inAppBrowserCompiledTemplate = utils.template(this.metadata.inAppBrowserUrl);
|
|
339
|
+
const deepLink = inAppBrowserCompiledTemplate({
|
|
340
|
+
// TODO: use PlatformService
|
|
341
|
+
encodedDappURI: encodeURIComponent(window.location.toString()),
|
|
342
|
+
});
|
|
343
|
+
utils.PlatformService.openURL(deepLink);
|
|
344
|
+
return true;
|
|
345
|
+
}
|
|
330
346
|
}
|
|
331
347
|
|
|
332
348
|
exports.BitcoinWalletConnector = BitcoinWalletConnector;
|
|
@@ -54,4 +54,5 @@ export declare abstract class BitcoinWalletConnector extends WalletConnectorBase
|
|
|
54
54
|
}): Promise<string | undefined>;
|
|
55
55
|
proveOwnership(address: string, messageToSign: string): Promise<string | undefined>;
|
|
56
56
|
getBlockExplorerUrlsForCurrentNetwork(): Promise<string[]>;
|
|
57
|
+
protected openInAppBrowserIfRequired(): boolean;
|
|
57
58
|
}
|
|
@@ -3,7 +3,7 @@ import { __awaiter } from '../../_virtual/_tslib.js';
|
|
|
3
3
|
import { AddressPurpose } from 'sats-connect';
|
|
4
4
|
import { WalletConnectorBase, isConnectorMethodSupported, eventListenerHandlers, logger } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
6
|
-
import { isLedgerAddressViaVerifiedCredentials, DynamicError } from '@dynamic-labs/utils';
|
|
6
|
+
import { isLedgerAddressViaVerifiedCredentials, isMobile, template, PlatformService, DynamicError } from '@dynamic-labs/utils';
|
|
7
7
|
import { WalletAddressType } from '@dynamic-labs/sdk-api-core';
|
|
8
8
|
import { BitcoinLocalStorageCache } from '../BitcoinLocalStorageCache.js';
|
|
9
9
|
import { BitcoinProviderHelper } from '../bitcoinProviderHelper.js';
|
|
@@ -323,6 +323,22 @@ class BitcoinWalletConnector extends WalletConnectorBase {
|
|
|
323
323
|
return ['https://btcscan.org/'];
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
+
openInAppBrowserIfRequired() {
|
|
327
|
+
var _a;
|
|
328
|
+
if (this.isInstalledOnBrowser() ||
|
|
329
|
+
!isMobile() ||
|
|
330
|
+
!((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) ||
|
|
331
|
+
this.mobileExperience === 'redirect') {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
const inAppBrowserCompiledTemplate = template(this.metadata.inAppBrowserUrl);
|
|
335
|
+
const deepLink = inAppBrowserCompiledTemplate({
|
|
336
|
+
// TODO: use PlatformService
|
|
337
|
+
encodedDappURI: encodeURIComponent(window.location.toString()),
|
|
338
|
+
});
|
|
339
|
+
PlatformService.openURL(deepLink);
|
|
340
|
+
return true;
|
|
341
|
+
}
|
|
326
342
|
}
|
|
327
343
|
|
|
328
344
|
export { BitcoinWalletConnector };
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../_virtual/_tslib.cjs');
|
|
7
7
|
var bitcoinjsLib = require('bitcoinjs-lib');
|
|
8
|
-
var utils = require('@dynamic-labs/utils');
|
|
9
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
9
|
var BitcoinWalletConnector = require('../BitcoinWalletConnector.cjs');
|
|
11
10
|
var createSignPsbtOptions = require('../../utils/psbt/createSignPsbtOptions.cjs');
|
|
@@ -17,18 +16,8 @@ class OkxConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
|
|
|
17
16
|
}
|
|
18
17
|
getAddress() {
|
|
19
18
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
utils.isMobile() &&
|
|
23
|
-
((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) &&
|
|
24
|
-
this.mobileExperience === 'in-app-browser') {
|
|
25
|
-
const inAppBrowserCompiledTemplate = utils.template(this.metadata.inAppBrowserUrl);
|
|
26
|
-
const deepLink = inAppBrowserCompiledTemplate({
|
|
27
|
-
// TODO: use PlatformService
|
|
28
|
-
encodedDappURI: encodeURIComponent(window.location.toString()),
|
|
29
|
-
});
|
|
30
|
-
// TODO: use PlatformService
|
|
31
|
-
window.location.assign(deepLink);
|
|
19
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
20
|
+
if (didOpenInAppBrowser) {
|
|
32
21
|
return;
|
|
33
22
|
}
|
|
34
23
|
const provider = this.getProvider();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../_virtual/_tslib.js';
|
|
3
3
|
import { Psbt } from 'bitcoinjs-lib';
|
|
4
|
-
import { isMobile, template } from '@dynamic-labs/utils';
|
|
5
4
|
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
6
5
|
import { BitcoinWalletConnector } from '../BitcoinWalletConnector.js';
|
|
7
6
|
import { createPsbtOptions } from '../../utils/psbt/createSignPsbtOptions.js';
|
|
@@ -13,18 +12,8 @@ class OkxConnector extends BitcoinWalletConnector {
|
|
|
13
12
|
}
|
|
14
13
|
getAddress() {
|
|
15
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
isMobile() &&
|
|
19
|
-
((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) &&
|
|
20
|
-
this.mobileExperience === 'in-app-browser') {
|
|
21
|
-
const inAppBrowserCompiledTemplate = template(this.metadata.inAppBrowserUrl);
|
|
22
|
-
const deepLink = inAppBrowserCompiledTemplate({
|
|
23
|
-
// TODO: use PlatformService
|
|
24
|
-
encodedDappURI: encodeURIComponent(window.location.toString()),
|
|
25
|
-
});
|
|
26
|
-
// TODO: use PlatformService
|
|
27
|
-
window.location.assign(deepLink);
|
|
15
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
16
|
+
if (didOpenInAppBrowser) {
|
|
28
17
|
return;
|
|
29
18
|
}
|
|
30
19
|
const provider = this.getProvider();
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../_virtual/_tslib.cjs');
|
|
7
7
|
var bitcoinjsLib = require('bitcoinjs-lib');
|
|
8
|
-
var utils = require('@dynamic-labs/utils');
|
|
9
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
9
|
var BitcoinWalletConnector = require('../BitcoinWalletConnector.cjs');
|
|
11
10
|
var createSignPsbtOptions = require('../../utils/psbt/createSignPsbtOptions.cjs');
|
|
@@ -17,17 +16,8 @@ class OneKeyConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
|
|
|
17
16
|
}
|
|
18
17
|
getAddress() {
|
|
19
18
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
utils.isMobile() &&
|
|
23
|
-
((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) &&
|
|
24
|
-
this.mobileExperience === 'in-app-browser') {
|
|
25
|
-
const inAppBrowserCompiledTemplate = utils.template(this.metadata.inAppBrowserUrl);
|
|
26
|
-
const deepLink = inAppBrowserCompiledTemplate({
|
|
27
|
-
// TODO: use PlatformService
|
|
28
|
-
encodedDappURI: encodeURIComponent(window.location.toString()),
|
|
29
|
-
});
|
|
30
|
-
utils.PlatformService.openURL(deepLink);
|
|
19
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
20
|
+
if (didOpenInAppBrowser) {
|
|
31
21
|
return;
|
|
32
22
|
}
|
|
33
23
|
const provider = this.getProvider();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../_virtual/_tslib.js';
|
|
3
3
|
import { Psbt } from 'bitcoinjs-lib';
|
|
4
|
-
import { isMobile, template, PlatformService } from '@dynamic-labs/utils';
|
|
5
4
|
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
6
5
|
import { BitcoinWalletConnector } from '../BitcoinWalletConnector.js';
|
|
7
6
|
import { createPsbtOptions } from '../../utils/psbt/createSignPsbtOptions.js';
|
|
@@ -13,17 +12,8 @@ class OneKeyConnector extends BitcoinWalletConnector {
|
|
|
13
12
|
}
|
|
14
13
|
getAddress() {
|
|
15
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
isMobile() &&
|
|
19
|
-
((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) &&
|
|
20
|
-
this.mobileExperience === 'in-app-browser') {
|
|
21
|
-
const inAppBrowserCompiledTemplate = template(this.metadata.inAppBrowserUrl);
|
|
22
|
-
const deepLink = inAppBrowserCompiledTemplate({
|
|
23
|
-
// TODO: use PlatformService
|
|
24
|
-
encodedDappURI: encodeURIComponent(window.location.toString()),
|
|
25
|
-
});
|
|
26
|
-
PlatformService.openURL(deepLink);
|
|
15
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
16
|
+
if (didOpenInAppBrowser) {
|
|
27
17
|
return;
|
|
28
18
|
}
|
|
29
19
|
const provider = this.getProvider();
|
|
@@ -23,6 +23,10 @@ class UnisatConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
|
|
|
23
23
|
}
|
|
24
24
|
getAddress() {
|
|
25
25
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
27
|
+
if (didOpenInAppBrowser) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
26
30
|
const provider = this.getProvider();
|
|
27
31
|
if (!provider) {
|
|
28
32
|
return;
|
|
@@ -19,6 +19,10 @@ class UnisatConnector extends BitcoinWalletConnector {
|
|
|
19
19
|
}
|
|
20
20
|
getAddress() {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
23
|
+
if (didOpenInAppBrowser) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
22
26
|
const provider = this.getProvider();
|
|
23
27
|
if (!provider) {
|
|
24
28
|
return;
|