btc-wallet 0.0.7 → 0.0.8
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/index.js +7 -8
- package/dist/index.js.map +2 -2
- package/dist/utils/initWalletButton.d.ts +1 -1
- package/esm/index.js +7 -8
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2557,8 +2557,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
|
2557
2557
|
const accountId = state.getAccount();
|
|
2558
2558
|
initWalletButton(options.network.networkId, accountId, wallet);
|
|
2559
2559
|
context.on("updatePublicKey", (btcPublicKey) => __async(void 0, null, function* () {
|
|
2560
|
-
const { nearTempAddress
|
|
2561
|
-
removeWalletButton();
|
|
2560
|
+
const { nearTempAddress } = yield getNearAccountByBtcPublicKey(btcPublicKey);
|
|
2562
2561
|
setTimeout(() => {
|
|
2563
2562
|
initWalletButton(options.network.networkId, nearTempAddress, wallet);
|
|
2564
2563
|
}, 1e3);
|
|
@@ -2576,7 +2575,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
|
2576
2575
|
});
|
|
2577
2576
|
}));
|
|
2578
2577
|
if ("autoConnect" in metadata && metadata.autoConnect && localStorage.getItem("near-wallet-selector:selectedWalletId") === '"btc-wallet"') {
|
|
2579
|
-
btcContext.autoConnect();
|
|
2578
|
+
yield btcContext.autoConnect();
|
|
2580
2579
|
}
|
|
2581
2580
|
clearInterval(inter);
|
|
2582
2581
|
}
|
|
@@ -2813,13 +2812,13 @@ function toHex(originalString) {
|
|
|
2813
2812
|
}
|
|
2814
2813
|
function initWalletButton(network, accountId, wallet) {
|
|
2815
2814
|
const checkAndSetupWalletButton = () => {
|
|
2816
|
-
if (accountId
|
|
2815
|
+
if (accountId) {
|
|
2817
2816
|
setupWalletButton(network, wallet, window.btcContext);
|
|
2818
|
-
|
|
2819
|
-
removeWalletButton();
|
|
2820
|
-
setTimeout(() => {
|
|
2817
|
+
!window.btcContext.account && setTimeout(() => {
|
|
2821
2818
|
checkAndSetupWalletButton();
|
|
2822
2819
|
}, 5e3);
|
|
2820
|
+
} else {
|
|
2821
|
+
removeWalletButton();
|
|
2823
2822
|
}
|
|
2824
2823
|
};
|
|
2825
2824
|
checkAndSetupWalletButton();
|
|
@@ -2872,7 +2871,7 @@ function pollTransactionStatuses(network, hashes) {
|
|
|
2872
2871
|
|
|
2873
2872
|
// src/index.ts
|
|
2874
2873
|
var getVersion = () => {
|
|
2875
|
-
return "0.0.
|
|
2874
|
+
return "0.0.8";
|
|
2876
2875
|
};
|
|
2877
2876
|
if (typeof window !== "undefined") {
|
|
2878
2877
|
window.__PARTICLE_BTC_CONNECT_VERSION = getVersion();
|