@multiplechain/bitcoin 0.1.14 → 0.1.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/dist/bitcoin-provider.js +1 -1
- package/package.json +1 -1
- package/src/adapters/unisat.js +4 -2
- package/src/provider.js +12 -18
package/package.json
CHANGED
package/src/adapters/unisat.js
CHANGED
|
@@ -3,8 +3,10 @@ module.exports = (provider) => {
|
|
|
3
3
|
const wallet = window.unisat;
|
|
4
4
|
const network = provider.testnet ? 'testnet' : 'livenet';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
if (wallet) {
|
|
7
|
+
wallet.getAddress = async () => {
|
|
8
|
+
return (await wallet.getAccounts())[0];
|
|
9
|
+
}
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
const connect = async () => {
|
package/src/provider.js
CHANGED
|
@@ -41,7 +41,7 @@ class Provider {
|
|
|
41
41
|
/**
|
|
42
42
|
* @var {Object}
|
|
43
43
|
*/
|
|
44
|
-
supportedWallets
|
|
44
|
+
supportedWallets;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* @var {Object}
|
|
@@ -76,8 +76,6 @@ class Provider {
|
|
|
76
76
|
this.wsUrl = "wss://ws.blockchain.info/inv";
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
this.initSupportedWallets();
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
getWalletOpenLink(address, amount) {
|
|
@@ -175,26 +173,22 @@ class Provider {
|
|
|
175
173
|
});
|
|
176
174
|
}
|
|
177
175
|
|
|
178
|
-
/**
|
|
179
|
-
* @returns {void}
|
|
180
|
-
*/
|
|
181
|
-
initSupportedWallets() {
|
|
182
|
-
const Wallet = require('./wallet');
|
|
183
|
-
|
|
184
|
-
this.supportedWallets = {
|
|
185
|
-
unisat: new Wallet('unisat', this),
|
|
186
|
-
xverse: new Wallet('xverse', this),
|
|
187
|
-
leather: new Wallet('leather', this),
|
|
188
|
-
trustwallet: new Wallet('trustwallet', this),
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
176
|
/**
|
|
194
177
|
* @param {Array|null} filter
|
|
195
178
|
* @returns {Array}
|
|
196
179
|
*/
|
|
197
180
|
getSupportedWallets(filter) {
|
|
181
|
+
if (!this.supportedWallets) {
|
|
182
|
+
const Wallet = require('./wallet');
|
|
183
|
+
|
|
184
|
+
this.supportedWallets = {
|
|
185
|
+
unisat: new Wallet('unisat', this),
|
|
186
|
+
xverse: new Wallet('xverse', this),
|
|
187
|
+
leather: new Wallet('leather', this),
|
|
188
|
+
trustwallet: new Wallet('trustwallet', this),
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
198
192
|
return Object.fromEntries(Object.entries(this.supportedWallets).filter(([key]) => {
|
|
199
193
|
return !filter ? true : filter.includes(key);
|
|
200
194
|
}));
|