@dynamic-labs/bitcoin 1.1.0-alpha.14 → 1.1.0-alpha.16
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 +27 -0
- package/package.json +6 -5
- package/src/BitcoinLocalStorageCache.cjs +6 -0
- package/src/BitcoinLocalStorageCache.d.ts +5 -0
- package/src/BitcoinLocalStorageCache.js +6 -0
- package/src/BitcoinWalletConnector.cjs +43 -2
- package/src/BitcoinWalletConnector.d.ts +6 -1
- package/src/BitcoinWalletConnector.js +44 -3
- package/src/OkxConnector.cjs +1 -0
- package/src/OkxConnector.d.ts +1 -0
- package/src/OkxConnector.js +1 -0
- package/src/UnisatConnector.cjs +1 -0
- package/src/UnisatConnector.d.ts +1 -0
- package/src/UnisatConnector.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.15...v1.1.0-alpha.16) (2024-01-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* add fallback to getWalletBookWallet for customers still passing in name, add deprecation warn ([#4518](https://github.com/dynamic-labs/DynamicAuth/issues/4518)) ([b233ea1](https://github.com/dynamic-labs/DynamicAuth/commit/b233ea1cd640d8d9d94c52ab230787f3d869151a))
|
|
8
|
+
* handle braavos network change to account which doesn not exist ([#4519](https://github.com/dynamic-labs/DynamicAuth/issues/4519)) ([486020f](https://github.com/dynamic-labs/DynamicAuth/commit/486020fb09a274388ba34c8d1b37ac3a1ff3dba6))
|
|
9
|
+
|
|
10
|
+
## [1.1.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.14...v1.1.0-alpha.15) (2024-01-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add wallet group override to wallet book ([#4488](https://github.com/dynamic-labs/DynamicAuth/issues/4488)) ([cb19ad3](https://github.com/dynamic-labs/DynamicAuth/commit/cb19ad3ea82de488752ceceeaf0e1458a388df6e))
|
|
16
|
+
* enable solana embedded wallets ([#4457](https://github.com/dynamic-labs/DynamicAuth/issues/4457)) ([b0c47f4](https://github.com/dynamic-labs/DynamicAuth/commit/b0c47f4475baa12f52076da46ef993c13bd2c243))
|
|
17
|
+
* group ArgentX wallets ([#4495](https://github.com/dynamic-labs/DynamicAuth/issues/4495)) ([b10d79a](https://github.com/dynamic-labs/DynamicAuth/commit/b10d79a668efecedca37ddb358e6adf95319650d))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* add support for newest backpack extension ([#4468](https://github.com/dynamic-labs/DynamicAuth/issues/4468)) ([a219f32](https://github.com/dynamic-labs/DynamicAuth/commit/a219f325be672599e50b07f6751234a7fc98286e))
|
|
23
|
+
* bump timeout for slower connections ([#4475](https://github.com/dynamic-labs/DynamicAuth/issues/4475)) ([7a07ff5](https://github.com/dynamic-labs/DynamicAuth/commit/7a07ff589eaaf3b28a94d277df3eedabbca60702))
|
|
24
|
+
* change out getWalletBookWallet for findWalletBookWallet to avoid throwing during lookup ([#4477](https://github.com/dynamic-labs/DynamicAuth/issues/4477)) ([4648040](https://github.com/dynamic-labs/DynamicAuth/commit/4648040c166e73dd2c31b0e27897713339436c2f))
|
|
25
|
+
* connect to wallet with wallet connect even if network is not supported ([#4465](https://github.com/dynamic-labs/DynamicAuth/issues/4465)) ([9dbca3e](https://github.com/dynamic-labs/DynamicAuth/commit/9dbca3eb4d4990ee4be642677c1604170b425dc3))
|
|
26
|
+
* pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([2bf2f04](https://github.com/dynamic-labs/DynamicAuth/commit/2bf2f0487f5b1be936dd279107c11fe5d2b42666))
|
|
27
|
+
* switching wallet in extension caused connected flag to be false temporarily ([#4454](https://github.com/dynamic-labs/DynamicAuth/issues/4454)) ([3650f6e](https://github.com/dynamic-labs/DynamicAuth/commit/3650f6ec471a7c779f4d304ab94c9350dd55055b))
|
|
28
|
+
|
|
2
29
|
## [1.1.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.13...v1.1.0-alpha.14) (2024-01-23)
|
|
3
30
|
|
|
4
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/bitcoin",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.16",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -26,13 +26,14 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
29
|
+
"@dynamic-labs/sdk-api": "0.0.356",
|
|
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.
|
|
34
|
-
"@dynamic-labs/wallet-book": "1.1.0-alpha.
|
|
35
|
-
"@dynamic-labs/wallet-connector-core": "1.1.0-alpha.
|
|
33
|
+
"@dynamic-labs/utils": "1.1.0-alpha.16",
|
|
34
|
+
"@dynamic-labs/wallet-book": "1.1.0-alpha.16",
|
|
35
|
+
"@dynamic-labs/wallet-connector-core": "1.1.0-alpha.16",
|
|
36
|
+
"stream": "0.0.2"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {}
|
|
38
39
|
}
|
|
@@ -26,6 +26,12 @@ class BitcoinLocalStorageCache {
|
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
getConnectedAccounts() {
|
|
30
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const connectedAccounts = yield utils.getItemAsync(this.CONNECTED_ACCOUNTS_KEY);
|
|
32
|
+
return connectedAccounts;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
29
35
|
getConnectedAccount(address) {
|
|
30
36
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
31
37
|
const connectedAccounts = yield utils.getItemAsync(this.CONNECTED_ACCOUNTS_KEY);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { WalletAdditionalAddress } from '@dynamic-labs/sdk-api';
|
|
2
2
|
import { BitcoinConnectedAccount } from './types';
|
|
3
|
+
type BitcoinConnectedAccounts = {
|
|
4
|
+
[key: string]: BitcoinConnectedAccount;
|
|
5
|
+
};
|
|
3
6
|
type BitcoinActiveAccount = {
|
|
4
7
|
address: string;
|
|
5
8
|
additionalAddresses: WalletAdditionalAddress[];
|
|
@@ -9,6 +12,7 @@ export declare class BitcoinLocalStorageCache implements IBitcoinSessionCache {
|
|
|
9
12
|
private readonly LAST_BALANCE_KEY;
|
|
10
13
|
constructor(key: string);
|
|
11
14
|
getActiveAccount(): Promise<BitcoinActiveAccount | undefined>;
|
|
15
|
+
getConnectedAccounts(): Promise<BitcoinConnectedAccounts | undefined>;
|
|
12
16
|
getConnectedAccount(address: string): Promise<BitcoinConnectedAccount | undefined>;
|
|
13
17
|
setConnectedAccount(addess: string, account: BitcoinConnectedAccount): Promise<void>;
|
|
14
18
|
clearConnectedAcccounts(): Promise<void>;
|
|
@@ -20,6 +24,7 @@ export interface IBitcoinSessionCache {
|
|
|
20
24
|
clearConnectedAcccounts(): Promise<void>;
|
|
21
25
|
getActiveAccount(): Promise<BitcoinActiveAccount | undefined>;
|
|
22
26
|
getConnectedAccount(address: string): Promise<BitcoinConnectedAccount | undefined>;
|
|
27
|
+
getConnectedAccounts(): Promise<BitcoinConnectedAccounts | undefined>;
|
|
23
28
|
setConnectedAccount(addess: string, account: BitcoinConnectedAccount): Promise<void>;
|
|
24
29
|
clearLastBalance(): Promise<void>;
|
|
25
30
|
getLastBalance(): Promise<string | undefined>;
|
|
@@ -22,6 +22,12 @@ class BitcoinLocalStorageCache {
|
|
|
22
22
|
};
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
getConnectedAccounts() {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const connectedAccounts = yield getItemAsync(this.CONNECTED_ACCOUNTS_KEY);
|
|
28
|
+
return connectedAccounts;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
25
31
|
getConnectedAccount(address) {
|
|
26
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
33
|
const connectedAccounts = yield getItemAsync(this.CONNECTED_ACCOUNTS_KEY);
|
|
@@ -17,6 +17,8 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
17
17
|
super(opts);
|
|
18
18
|
this.connectedChain = 'BTC';
|
|
19
19
|
this.supportedChains = ['BTC'];
|
|
20
|
+
// some wallets don't support fetching connected accounts without prompting for a connection
|
|
21
|
+
this.canFetchConnectedAccounts = false;
|
|
20
22
|
// this is the key from the wallet book entry so that we don't purely rely on the normalized name
|
|
21
23
|
this.overrideKey = (_a = opts.overrideKey) !== null && _a !== void 0 ? _a : this.key;
|
|
22
24
|
this.bitcoinProviderHelper = new bitcoinProviderHelper.BitcoinProviderHelper(opts.walletData || walletBook.getWalletBookWallet(this.walletBook, this.key));
|
|
@@ -70,13 +72,32 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
70
72
|
return balance.toString();
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
|
-
|
|
75
|
+
getConnectedAccountsFromCache() {
|
|
76
|
+
var _a;
|
|
74
77
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
75
78
|
const currentAccount = yield this.cache.getActiveAccount();
|
|
79
|
+
const allAccounts = yield this.cache.getConnectedAccounts();
|
|
80
|
+
const allConnectedAddresses = (_a = Object.keys(allAccounts || {})) !== null && _a !== void 0 ? _a : [];
|
|
76
81
|
if (!(currentAccount === null || currentAccount === void 0 ? void 0 : currentAccount.address)) {
|
|
82
|
+
return allConnectedAddresses;
|
|
83
|
+
}
|
|
84
|
+
// return all connected accounts with the current account as the first item
|
|
85
|
+
return [
|
|
86
|
+
currentAccount.address,
|
|
87
|
+
...allConnectedAddresses.filter((address) => address !== currentAccount.address),
|
|
88
|
+
];
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
getConnectedAccounts() {
|
|
92
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
if (!this.canFetchConnectedAccounts) {
|
|
94
|
+
return this.getConnectedAccountsFromCache();
|
|
95
|
+
}
|
|
96
|
+
const connectedAccounts = yield this.fetchPublicAddress();
|
|
97
|
+
if (!connectedAccounts) {
|
|
77
98
|
return [];
|
|
78
99
|
}
|
|
79
|
-
return [
|
|
100
|
+
return [connectedAccounts];
|
|
80
101
|
});
|
|
81
102
|
}
|
|
82
103
|
getAdditionalAddresses(mainAddress) {
|
|
@@ -128,6 +149,26 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
128
149
|
});
|
|
129
150
|
});
|
|
130
151
|
}
|
|
152
|
+
setupEventListeners() {
|
|
153
|
+
const provider = this.getProvider();
|
|
154
|
+
if (!(provider === null || provider === void 0 ? void 0 : provider.on)) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(this);
|
|
158
|
+
provider.on('accountsChanged', handleAccountChange);
|
|
159
|
+
provider.on('networkChanged', handleChainChange);
|
|
160
|
+
provider.on('disconnect', handleDisconnect);
|
|
161
|
+
const tearDownEventListeners = () => {
|
|
162
|
+
const provider = this.getProvider();
|
|
163
|
+
if (!(provider === null || provider === void 0 ? void 0 : provider.removeListener)) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
provider.removeListener('accountsChanged', handleAccountChange);
|
|
167
|
+
provider.removeListener('networkChanged', handleChainChange);
|
|
168
|
+
provider.removeListener('disconnect', handleDisconnect);
|
|
169
|
+
};
|
|
170
|
+
this.teardownEventListeners = tearDownEventListeners;
|
|
171
|
+
}
|
|
131
172
|
}
|
|
132
173
|
|
|
133
174
|
exports.BitcoinWalletConnector = BitcoinWalletConnector;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'stream';
|
|
1
3
|
import type { Wallet } from '@wallet-standard/base';
|
|
2
4
|
import { Chain, IBitcoinWalletConnector, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
3
5
|
import { WalletBookSchema, WalletSchema } from '@dynamic-labs/wallet-book';
|
|
@@ -15,15 +17,18 @@ export declare abstract class BitcoinWalletConnector extends WalletConnectorBase
|
|
|
15
17
|
supportedChains: Chain[];
|
|
16
18
|
private bitcoinProviderHelper;
|
|
17
19
|
wallet: Wallet | undefined;
|
|
20
|
+
canFetchConnectedAccounts: boolean;
|
|
18
21
|
constructor(opts: BitcoinWalletConnectorOpts);
|
|
19
22
|
isInstalledOnBrowser(): boolean;
|
|
20
23
|
getDeepLink(): string | undefined;
|
|
21
24
|
endSession(): Promise<void>;
|
|
22
25
|
getBalance(): Promise<string | undefined>;
|
|
26
|
+
private getConnectedAccountsFromCache;
|
|
23
27
|
getConnectedAccounts(): Promise<string[]>;
|
|
24
28
|
getAdditionalAddresses(mainAddress?: string): Promise<WalletAdditionalAddress[] | undefined>;
|
|
25
29
|
setAdditionalAddresses(mainAddress: string, additionalAddresses: WalletAdditionalAddress[]): Promise<void>;
|
|
26
30
|
abstract sendBitcoin(transaction: BitcoinTransaction): Promise<string | undefined>;
|
|
27
|
-
getProvider<T>(): T;
|
|
31
|
+
getProvider<T>(): T & EventEmitter;
|
|
28
32
|
setConnectedAccountWithAddresses(mainAddress?: string, ordinalsAddress?: BitcoinAddress, paymentAddress?: BitcoinAddress, active?: boolean): Promise<void>;
|
|
33
|
+
setupEventListeners(): void;
|
|
29
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from '../_virtual/_tslib.js';
|
|
2
|
-
import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
import { WalletConnectorBase, eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
4
4
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
5
5
|
import { WalletAddressType } from '@dynamic-labs/sdk-api';
|
|
@@ -13,6 +13,8 @@ class BitcoinWalletConnector extends WalletConnectorBase {
|
|
|
13
13
|
super(opts);
|
|
14
14
|
this.connectedChain = 'BTC';
|
|
15
15
|
this.supportedChains = ['BTC'];
|
|
16
|
+
// some wallets don't support fetching connected accounts without prompting for a connection
|
|
17
|
+
this.canFetchConnectedAccounts = false;
|
|
16
18
|
// this is the key from the wallet book entry so that we don't purely rely on the normalized name
|
|
17
19
|
this.overrideKey = (_a = opts.overrideKey) !== null && _a !== void 0 ? _a : this.key;
|
|
18
20
|
this.bitcoinProviderHelper = new BitcoinProviderHelper(opts.walletData || getWalletBookWallet(this.walletBook, this.key));
|
|
@@ -66,13 +68,32 @@ class BitcoinWalletConnector extends WalletConnectorBase {
|
|
|
66
68
|
return balance.toString();
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
|
-
|
|
71
|
+
getConnectedAccountsFromCache() {
|
|
72
|
+
var _a;
|
|
70
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
74
|
const currentAccount = yield this.cache.getActiveAccount();
|
|
75
|
+
const allAccounts = yield this.cache.getConnectedAccounts();
|
|
76
|
+
const allConnectedAddresses = (_a = Object.keys(allAccounts || {})) !== null && _a !== void 0 ? _a : [];
|
|
72
77
|
if (!(currentAccount === null || currentAccount === void 0 ? void 0 : currentAccount.address)) {
|
|
78
|
+
return allConnectedAddresses;
|
|
79
|
+
}
|
|
80
|
+
// return all connected accounts with the current account as the first item
|
|
81
|
+
return [
|
|
82
|
+
currentAccount.address,
|
|
83
|
+
...allConnectedAddresses.filter((address) => address !== currentAccount.address),
|
|
84
|
+
];
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
getConnectedAccounts() {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
if (!this.canFetchConnectedAccounts) {
|
|
90
|
+
return this.getConnectedAccountsFromCache();
|
|
91
|
+
}
|
|
92
|
+
const connectedAccounts = yield this.fetchPublicAddress();
|
|
93
|
+
if (!connectedAccounts) {
|
|
73
94
|
return [];
|
|
74
95
|
}
|
|
75
|
-
return [
|
|
96
|
+
return [connectedAccounts];
|
|
76
97
|
});
|
|
77
98
|
}
|
|
78
99
|
getAdditionalAddresses(mainAddress) {
|
|
@@ -124,6 +145,26 @@ class BitcoinWalletConnector extends WalletConnectorBase {
|
|
|
124
145
|
});
|
|
125
146
|
});
|
|
126
147
|
}
|
|
148
|
+
setupEventListeners() {
|
|
149
|
+
const provider = this.getProvider();
|
|
150
|
+
if (!(provider === null || provider === void 0 ? void 0 : provider.on)) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(this);
|
|
154
|
+
provider.on('accountsChanged', handleAccountChange);
|
|
155
|
+
provider.on('networkChanged', handleChainChange);
|
|
156
|
+
provider.on('disconnect', handleDisconnect);
|
|
157
|
+
const tearDownEventListeners = () => {
|
|
158
|
+
const provider = this.getProvider();
|
|
159
|
+
if (!(provider === null || provider === void 0 ? void 0 : provider.removeListener)) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
provider.removeListener('accountsChanged', handleAccountChange);
|
|
163
|
+
provider.removeListener('networkChanged', handleChainChange);
|
|
164
|
+
provider.removeListener('disconnect', handleDisconnect);
|
|
165
|
+
};
|
|
166
|
+
this.teardownEventListeners = tearDownEventListeners;
|
|
167
|
+
}
|
|
127
168
|
}
|
|
128
169
|
|
|
129
170
|
export { BitcoinWalletConnector };
|
package/src/OkxConnector.cjs
CHANGED
|
@@ -9,6 +9,7 @@ class OkxConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
|
|
|
9
9
|
constructor(opts) {
|
|
10
10
|
super(Object.assign(Object.assign({}, opts), { overrideKey: 'okxwalletbtc' }));
|
|
11
11
|
this.name = 'OKX Wallet (Bitcoin)';
|
|
12
|
+
this.canFetchConnectedAccounts = true;
|
|
12
13
|
}
|
|
13
14
|
fetchPublicAddress() {
|
|
14
15
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
package/src/OkxConnector.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { BitcoinWalletConnector, BitcoinWalletConnectorOpts } from './BitcoinWal
|
|
|
2
2
|
import { BitcoinTransaction } from './types';
|
|
3
3
|
export declare class OkxConnector extends BitcoinWalletConnector {
|
|
4
4
|
name: string;
|
|
5
|
+
canFetchConnectedAccounts: boolean;
|
|
5
6
|
constructor(opts: BitcoinWalletConnectorOpts);
|
|
6
7
|
fetchPublicAddress(): Promise<string | undefined>;
|
|
7
8
|
signMessage(messageToSign: string): Promise<string | undefined>;
|
package/src/OkxConnector.js
CHANGED
|
@@ -5,6 +5,7 @@ class OkxConnector extends BitcoinWalletConnector {
|
|
|
5
5
|
constructor(opts) {
|
|
6
6
|
super(Object.assign(Object.assign({}, opts), { overrideKey: 'okxwalletbtc' }));
|
|
7
7
|
this.name = 'OKX Wallet (Bitcoin)';
|
|
8
|
+
this.canFetchConnectedAccounts = true;
|
|
8
9
|
}
|
|
9
10
|
fetchPublicAddress() {
|
|
10
11
|
return __awaiter(this, void 0, void 0, function* () {
|
package/src/UnisatConnector.cjs
CHANGED
|
@@ -9,6 +9,7 @@ class UnisatConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
|
|
|
9
9
|
constructor(opts) {
|
|
10
10
|
super(Object.assign(Object.assign({}, opts), { overrideKey: 'unisat' }));
|
|
11
11
|
this.name = 'UniSat';
|
|
12
|
+
this.canFetchConnectedAccounts = true;
|
|
12
13
|
}
|
|
13
14
|
fetchPublicAddress() {
|
|
14
15
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
package/src/UnisatConnector.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { BitcoinWalletConnector, BitcoinWalletConnectorOpts } from './BitcoinWal
|
|
|
2
2
|
import { BitcoinTransaction } from './types';
|
|
3
3
|
export declare class UnisatConnector extends BitcoinWalletConnector {
|
|
4
4
|
name: string;
|
|
5
|
+
canFetchConnectedAccounts: boolean;
|
|
5
6
|
constructor(opts: BitcoinWalletConnectorOpts);
|
|
6
7
|
fetchPublicAddress(): Promise<string | undefined>;
|
|
7
8
|
signMessage(messageToSign: string): Promise<string | undefined>;
|
package/src/UnisatConnector.js
CHANGED
|
@@ -5,6 +5,7 @@ class UnisatConnector extends BitcoinWalletConnector {
|
|
|
5
5
|
constructor(opts) {
|
|
6
6
|
super(Object.assign(Object.assign({}, opts), { overrideKey: 'unisat' }));
|
|
7
7
|
this.name = 'UniSat';
|
|
8
|
+
this.canFetchConnectedAccounts = true;
|
|
8
9
|
}
|
|
9
10
|
fetchPublicAddress() {
|
|
10
11
|
return __awaiter(this, void 0, void 0, function* () {
|