@ibearua/bitmask-core-dev 1.0.0-beta.18 → 1.0.0-beta.20

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/bitmask_core.d.ts CHANGED
@@ -218,7 +218,7 @@ export interface InitOutput {
218
218
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
219
219
  readonly __wbindgen_export_7: WebAssembly.Table;
220
220
  readonly __externref_table_dealloc: (a: number) => void;
221
- readonly closure1856_externref_shim: (a: number, b: number, c: any) => void;
221
+ readonly closure1855_externref_shim: (a: number, b: number, c: any) => void;
222
222
  readonly closure1997_externref_shim: (a: number, b: number, c: any) => void;
223
223
  readonly closure2665_externref_shim: (a: number, b: number, c: any) => void;
224
224
  readonly closure3825_externref_shim: (a: number, b: number, c: any) => void;
package/bitmask_core.js CHANGED
@@ -1490,7 +1490,7 @@ export function psbt_publish_file(request) {
1490
1490
  }
1491
1491
 
1492
1492
  function __wbg_adapter_54(arg0, arg1, arg2) {
1493
- wasm.closure1856_externref_shim(arg0, arg1, arg2);
1493
+ wasm.closure1855_externref_shim(arg0, arg1, arg2);
1494
1494
  }
1495
1495
 
1496
1496
  function __wbg_adapter_57(arg0, arg1, arg2) {
@@ -2256,19 +2256,19 @@ function __wbg_get_imports() {
2256
2256
  const ret = false;
2257
2257
  return ret;
2258
2258
  };
2259
- imports.wbg.__wbindgen_closure_wrapper11536 = function(arg0, arg1, arg2) {
2259
+ imports.wbg.__wbindgen_closure_wrapper11530 = function(arg0, arg1, arg2) {
2260
2260
  const ret = makeMutClosure(arg0, arg1, 2666, __wbg_adapter_60);
2261
2261
  return ret;
2262
2262
  };
2263
- imports.wbg.__wbindgen_closure_wrapper15965 = function(arg0, arg1, arg2) {
2263
+ imports.wbg.__wbindgen_closure_wrapper15959 = function(arg0, arg1, arg2) {
2264
2264
  const ret = makeMutClosure(arg0, arg1, 3826, __wbg_adapter_63);
2265
2265
  return ret;
2266
2266
  };
2267
- imports.wbg.__wbindgen_closure_wrapper7704 = function(arg0, arg1, arg2) {
2268
- const ret = makeMutClosure(arg0, arg1, 1857, __wbg_adapter_54);
2267
+ imports.wbg.__wbindgen_closure_wrapper7697 = function(arg0, arg1, arg2) {
2268
+ const ret = makeMutClosure(arg0, arg1, 1856, __wbg_adapter_54);
2269
2269
  return ret;
2270
2270
  };
2271
- imports.wbg.__wbindgen_closure_wrapper8151 = function(arg0, arg1, arg2) {
2271
+ imports.wbg.__wbindgen_closure_wrapper8145 = function(arg0, arg1, arg2) {
2272
2272
  const ret = makeMutClosure(arg0, arg1, 1998, __wbg_adapter_57);
2273
2273
  return ret;
2274
2274
  };
@@ -15,7 +15,7 @@ function getUint8ArrayMemory0() {
15
15
  return cachedUint8ArrayMemory0;
16
16
  }
17
17
 
18
- const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
18
+ const lTextEncoder = new TextEncoder('utf-8');
19
19
 
20
20
  let cachedTextEncoder = new lTextEncoder('utf-8');
21
21
 
@@ -80,7 +80,7 @@ function getDataViewMemory0() {
80
80
  return cachedDataViewMemory0;
81
81
  }
82
82
 
83
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
83
+ const lTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
84
84
 
85
85
  let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
86
86
 
@@ -1496,7 +1496,7 @@ export function psbt_publish_file(request) {
1496
1496
  }
1497
1497
 
1498
1498
  function __wbg_adapter_54(arg0, arg1, arg2) {
1499
- wasm.closure1855_externref_shim(arg0, arg1, arg2);
1499
+ wasm.closure1856_externref_shim(arg0, arg1, arg2);
1500
1500
  }
1501
1501
 
1502
1502
  function __wbg_adapter_57(arg0, arg1, arg2) {
@@ -2104,8 +2104,7 @@ export function __wbg_randomFillSync_e2ae5c896c5ec592() { return handleError(fun
2104
2104
  }, arguments) };
2105
2105
 
2106
2106
  export function __wbg_require_d3a2417979c32e11() { return handleError(function () {
2107
- const ret = module.require;
2108
- return ret;
2107
+ throw new Error('module.require is not available in browser');
2109
2108
  }, arguments) };
2110
2109
 
2111
2110
  export function __wbg_resolve_4851785c9c5f573d(arg0) {
@@ -2394,8 +2393,8 @@ export function __wbindgen_closure_wrapper15965(arg0, arg1, arg2) {
2394
2393
  return ret;
2395
2394
  };
2396
2395
 
2397
- export function __wbindgen_closure_wrapper7702(arg0, arg1, arg2) {
2398
- const ret = makeMutClosure(arg0, arg1, 1856, __wbg_adapter_54);
2396
+ export function __wbindgen_closure_wrapper7704(arg0, arg1, arg2) {
2397
+ const ret = makeMutClosure(arg0, arg1, 1857, __wbg_adapter_54);
2399
2398
  return ret;
2400
2399
  };
2401
2400
 
Binary file
@@ -120,7 +120,7 @@ export const __externref_drop_slice: (a: number, b: number) => void;
120
120
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
121
121
  export const __wbindgen_export_7: WebAssembly.Table;
122
122
  export const __externref_table_dealloc: (a: number) => void;
123
- export const closure1856_externref_shim: (a: number, b: number, c: any) => void;
123
+ export const closure1855_externref_shim: (a: number, b: number, c: any) => void;
124
124
  export const closure1997_externref_shim: (a: number, b: number, c: any) => void;
125
125
  export const closure2665_externref_shim: (a: number, b: number, c: any) => void;
126
126
  export const closure3825_externref_shim: (a: number, b: number, c: any) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,QAAa,QAAQ,MAAM,CACb,CAAC;AAEtC,eAAO,MAAM,aAAa,YAAmB,OAAO,KAAG,QAAQ,IAAI,CAC3B,CAAC;AAEzC,eAAO,MAAM,MAAM,QAAe,MAAM,KAAG,QAAQ,MAAM,CACrB,CAAC;AAErC,eAAO,MAAM,MAAM,QAAe,MAAM,SAAS,MAAM,KAAG,QAAQ,IAAI,CAC7C,CAAC;AAE1B,oBAAY,OAAO;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAID,eAAO,MAAM,UAAU,kBACkC,CAAC;AAC1D,eAAO,IAAI,OAAO,SAAQ,CAAC;AAC3B,eAAO,IAAI,SAAS,SAAQ,CAAC;AAC7B,eAAO,IAAI,OAAO,SAAQ,CAAC;AAE3B,eAAO,MAAM,IAAI,qBAA4B,MAAM,kBAsElD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,QAAa,QAAQ,MAAM,CACb,CAAC;AAEtC,eAAO,MAAM,aAAa,YAAmB,OAAO,KAAG,QAAQ,IAAI,CAC3B,CAAC;AAEzC,eAAO,MAAM,MAAM,QAAe,MAAM,KAAG,QAAQ,MAAM,CACrB,CAAC;AAErC,eAAO,MAAM,MAAM,QAAe,MAAM,SAAS,MAAM,KAAG,QAAQ,IAAI,CAC7C,CAAC;AAE1B,oBAAY,OAAO;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAID,eAAO,MAAM,UAAU,kBACkC,CAAC;AAC1D,eAAO,IAAI,OAAO,SAAQ,CAAC;AAC3B,eAAO,IAAI,SAAS,SAAQ,CAAC;AAC7B,eAAO,IAAI,OAAO,SAAQ,CAAC;AAE3B,eAAO,MAAM,IAAI,qBAA4B,MAAM,kBAqElD,CAAC"}
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 bitmask_core_1 = __importStar(require("./bitmask_core")), BMC = bitmask_core_1;
39
+ const BMC = __importStar(require("./bitmask_core"));
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()); });
@@ -61,7 +61,6 @@ const init = (networkOverride) => __awaiter(void 0, void 0, void 0, function* ()
61
61
  if (networkOverride) {
62
62
  yield (0, exports.switchNetwork)(Network[networkOverride]);
63
63
  }
64
- yield (0, bitmask_core_1.default)();
65
64
  const network = yield (0, exports.getNetwork)();
66
65
  if (network === "bitcoin" && process.env.PROD_LNDHUB_ENDPOINT) {
67
66
  yield (0, exports.setEnv)("LNDHUB_ENDPOINT", process.env.PROD_LNDHUB_ENDPOINT);
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 initBMC, * as BMC from "./bitmask_core";
4
+ import * as BMC from "./bitmask_core";
5
5
 
6
6
  export const getNetwork = async (): Promise<string> =>
7
7
  JSON.parse(await BMC.get_network());
@@ -35,7 +35,6 @@ export const init = async (networkOverride?: string) => {
35
35
  if (networkOverride) {
36
36
  await switchNetwork(Network[networkOverride as NetworkKeyType]);
37
37
  }
38
- await initBMC();
39
38
 
40
39
  const network = await getNetwork();
41
40
  if (network === "bitcoin" && process.env.PROD_LNDHUB_ENDPOINT) {
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.18",
10
+ "version": "1.0.0-beta.20",
11
11
  "license": "MIT",
12
12
  "repository": {
13
13
  "type": "git",