btc-wallet 0.2.1 → 0.2.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/dist/index.js +11 -5
- package/dist/index.js.map +2 -2
- package/esm/index.js +11 -5
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -2358,12 +2358,17 @@ var import_bs58 = __toESM(require("bs58"), 1);
|
|
2358
2358
|
var import_js_sha256 = require("js-sha256");
|
2359
2359
|
|
2360
2360
|
// src/utils/initWalletButton.ts
|
2361
|
+
var walletUrlConfig = {
|
2362
|
+
dev: "https://wallet-dev.satoshibridge.top",
|
2363
|
+
testnet: "https://wallet-test.satoshibridge.top",
|
2364
|
+
mainnet: "https://wallet.satoshibridge.top"
|
2365
|
+
};
|
2361
2366
|
function setupWalletButton(network, wallet, originalWallet) {
|
2362
2367
|
if (document.getElementById("satoshi-wallet-button")) {
|
2363
2368
|
return;
|
2364
2369
|
}
|
2365
2370
|
const iframe = createIframe({
|
2366
|
-
iframeUrl: network
|
2371
|
+
iframeUrl: walletUrlConfig[network],
|
2367
2372
|
iframeStyle: { width: "400px", height: "650px" }
|
2368
2373
|
});
|
2369
2374
|
iframe.addEventListener("mouseenter", () => {
|
@@ -2566,7 +2571,8 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
2566
2571
|
signAndSendTransactions
|
2567
2572
|
};
|
2568
2573
|
const currentConfig = "isDev" in metadata && metadata.isDev ? config.dev : config[options.network.networkId];
|
2569
|
-
|
2574
|
+
const walletNetwork = "isDev" in metadata && metadata.isDev ? "dev" : options.network.networkId;
|
2575
|
+
initWalletButton(walletNetwork, wallet);
|
2570
2576
|
if (!inter) {
|
2571
2577
|
inter = setInterval(() => __async(void 0, null, function* () {
|
2572
2578
|
const btcContext = window.btcContext;
|
@@ -2576,7 +2582,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
2576
2582
|
context.on("updatePublicKey", (btcPublicKey) => __async(void 0, null, function* () {
|
2577
2583
|
const { nearTempAddress } = yield getNearAccountByBtcPublicKey(btcPublicKey);
|
2578
2584
|
removeWalletButton();
|
2579
|
-
initWalletButton(
|
2585
|
+
initWalletButton(walletNetwork, wallet);
|
2580
2586
|
emitter.emit("accountsChanged", {
|
2581
2587
|
accounts: [
|
2582
2588
|
{
|
@@ -2633,7 +2639,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
2633
2639
|
const accountId = state.getAccount();
|
2634
2640
|
const publicKey = state.getPublicKey();
|
2635
2641
|
const btcContext = window.btcContext;
|
2636
|
-
initWalletButton(
|
2642
|
+
initWalletButton(walletNetwork, wallet);
|
2637
2643
|
if (accountId && publicKey) {
|
2638
2644
|
return [
|
2639
2645
|
{
|
@@ -2895,7 +2901,7 @@ function pollTransactionStatuses(network, hashes) {
|
|
2895
2901
|
|
2896
2902
|
// src/index.ts
|
2897
2903
|
var getVersion = () => {
|
2898
|
-
return "0.2.
|
2904
|
+
return "0.2.2";
|
2899
2905
|
};
|
2900
2906
|
if (typeof window !== "undefined") {
|
2901
2907
|
window.__PARTICLE_BTC_CONNECT_VERSION = getVersion();
|