@ibearua/bitmask-core-dev 1.0.0-beta.21 → 1.0.0-beta.23

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/constants.js CHANGED
@@ -36,7 +36,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
36
36
  var _a;
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  exports.init = exports.BITMASK = exports.CARBONADO = exports.LNDHUBX = exports.DISABLE_LN = exports.Network = exports.setEnv = exports.getEnv = exports.switchNetwork = exports.getNetwork = void 0;
39
- const BMC = __importStar(require("./bitmask_core"));
39
+ const bitmask_core_1 = __importStar(require("./bitmask_core")), BMC = bitmask_core_1;
40
40
  const getNetwork = () => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.get_network()); });
41
41
  exports.getNetwork = getNetwork;
42
42
  const switchNetwork = (network) => __awaiter(void 0, void 0, void 0, function* () { return BMC.switch_network(network.toString()); });
@@ -122,6 +122,10 @@ const init = (networkOverride) => __awaiter(void 0, void 0, void 0, function* ()
122
122
  console.debug("Using bitmaskd endpoint:", bitmask);
123
123
  });
124
124
  exports.init = init;
125
+ // Initialize WASM immediately
126
+ (() => __awaiter(void 0, void 0, void 0, function* () {
127
+ yield (0, bitmask_core_1.default)();
128
+ }))();
125
129
  const networkOverride = process.env.NETWORK_OVERRIDE;
126
130
  if (networkOverride) {
127
131
  const network = Network[networkOverride.toLowerCase()];
package/constants.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Methods meant to work with bitmask-core constants defined within the web::constants module from bitmask-core:
2
2
  // https://github.com/diba-io/bitmask-core/blob/development/src/web.rs
3
3
 
4
- import * as BMC from "./bitmask_core";
4
+ import initBMC, * as BMC from "./bitmask_core";
5
5
 
6
6
  export const getNetwork = async (): Promise<string> =>
7
7
  JSON.parse(await BMC.get_network());
@@ -101,6 +101,11 @@ export const init = async (networkOverride?: string) => {
101
101
  console.debug("Using bitmaskd endpoint:", bitmask);
102
102
  };
103
103
 
104
+ // Initialize WASM immediately
105
+ (async () => {
106
+ await initBMC();
107
+ })();
108
+
104
109
  const networkOverride = process.env.NETWORK_OVERRIDE;
105
110
 
106
111
  if (networkOverride) {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "Armando Dutra <armando@diba.io>"
8
8
  ],
9
9
  "description": "Core functionality for the BitMask wallet",
10
- "version": "1.0.0-beta.21",
10
+ "version": "1.0.0-beta.23",
11
11
  "license": "MIT",
12
12
  "repository": {
13
13
  "type": "git",