bitmask-core 0.4.1 → 0.4.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/README.md CHANGED
@@ -4,12 +4,10 @@ Core functionality for the BitMask wallet - <https://bitmask.app>
4
4
  **BitMask** is a bitcoin wallet and a browser extension for accessing decentralized web applications on the Bitcoin blokchain. It is designed to support UTXO based smart contracting protocols such as RGB, with planned support for Omni layer, TARO and many others.
5
5
 
6
6
 
7
- [![Build Status](https://img.shields.io/github/workflow/status/diba-io/bitmask-core/Rust?style=flat-square)](https://github.com/diba-io/bitmask-core/actions/workflows/Rust.yml)
8
7
  [![Crates.io](https://img.shields.io/crates/v/bitmask-core?style=flat-square)](https://docs.rs/bitmask-core/latest/bitmask-core/)
9
8
  [![npm: bitmask-core](https://img.shields.io/npm/v/bitmask-core?style=flat-square)](https://www.npmjs.com/package/bitmask-core)
10
9
  [![License: MIT+APACHE](https://img.shields.io/crates/l/bitmask-core?style=flat-square)](https://mit-license.org)
11
- ![Lines of code](https://img.shields.io/tokei/lines/github/diba-io/bitmask-core?style=flat-square)
12
- [![Telegram: rust_in_bitcoin](https://img.shields.io/badge/telegram-rust_in_bitcoin-blue?style=flat-square)](https://t.me/rust_in_bitcoin)
10
+ [![Telegram](https://img.shields.io/badge/telegram-invite-blue?style=flat-square)](https://t.me/+eQk5aQ5--iUxYzVk)
13
11
 
14
12
  ## Uses
15
13
 
package/bitmask_core.d.ts CHANGED
@@ -110,28 +110,24 @@ export function get_endpoint(path: string): Promise<any>;
110
110
  */
111
111
  export function switch_host(host: string): Promise<any>;
112
112
  /**
113
+ * @param {string} username
114
+ * @param {string} password
113
115
  * @returns {Promise<any>}
114
116
  */
115
- export function ln_create_wallet(): Promise<any>;
117
+ export function ln_create_wallet(username: string, password: string): Promise<any>;
116
118
  /**
117
- * @param {string} login
119
+ * @param {string} username
118
120
  * @param {string} password
119
121
  * @returns {Promise<any>}
120
122
  */
121
- export function ln_auth(login: string, password: string): Promise<any>;
123
+ export function ln_auth(username: string, password: string): Promise<any>;
122
124
  /**
123
125
  * @param {string} description
124
- * @param {bigint} amount
125
- * @param {string} token
126
- * @returns {Promise<any>}
127
- */
128
- export function ln_create_invoice(description: string, amount: bigint, token: string): Promise<any>;
129
- /**
130
- * @param {string} invoice
126
+ * @param {number} amount
131
127
  * @param {string} token
132
128
  * @returns {Promise<any>}
133
129
  */
134
- export function ln_decode_invoice(invoice: string, token: string): Promise<any>;
130
+ export function ln_create_invoice(description: string, amount: number, token: string): Promise<any>;
135
131
  /**
136
132
  * @param {string} token
137
133
  * @returns {Promise<any>}
@@ -139,14 +135,12 @@ export function ln_decode_invoice(invoice: string, token: string): Promise<any>;
139
135
  export function ln_get_balance(token: string): Promise<any>;
140
136
  /**
141
137
  * @param {string} token
142
- * @param {number} limit
143
- * @param {number} offset
144
138
  * @returns {Promise<any>}
145
139
  */
146
- export function ln_get_txs(token: string, limit: number, offset: number): Promise<any>;
140
+ export function ln_get_txs(token: string): Promise<any>;
147
141
  /**
148
- * @param {string} invoice
142
+ * @param {string} payment_request
149
143
  * @param {string} token
150
144
  * @returns {Promise<any>}
151
145
  */
152
- export function ln_pay_invoice(invoice: string, token: string): Promise<any>;
146
+ export function ln_pay_invoice(payment_request: string, token: string): Promise<any>;
@@ -208,7 +208,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
208
208
  return real;
209
209
  }
210
210
  function __wbg_adapter_28(arg0, arg1, arg2) {
211
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he216dadcc2c1c2c1(arg0, arg1, addHeapObject(arg2));
211
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3796fc407ba133cc(arg0, arg1, addHeapObject(arg2));
212
212
  }
213
213
 
214
214
  /**
@@ -457,20 +457,26 @@ export function switch_host(host) {
457
457
  }
458
458
 
459
459
  /**
460
+ * @param {string} username
461
+ * @param {string} password
460
462
  * @returns {Promise<any>}
461
463
  */
462
- export function ln_create_wallet() {
463
- const ret = wasm.ln_create_wallet();
464
+ export function ln_create_wallet(username, password) {
465
+ const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
466
+ const len0 = WASM_VECTOR_LEN;
467
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
468
+ const len1 = WASM_VECTOR_LEN;
469
+ const ret = wasm.ln_create_wallet(ptr0, len0, ptr1, len1);
464
470
  return takeObject(ret);
465
471
  }
466
472
 
467
473
  /**
468
- * @param {string} login
474
+ * @param {string} username
469
475
  * @param {string} password
470
476
  * @returns {Promise<any>}
471
477
  */
472
- export function ln_auth(login, password) {
473
- const ptr0 = passStringToWasm0(login, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
478
+ export function ln_auth(username, password) {
479
+ const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
474
480
  const len0 = WASM_VECTOR_LEN;
475
481
  const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
476
482
  const len1 = WASM_VECTOR_LEN;
@@ -480,7 +486,7 @@ export function ln_auth(login, password) {
480
486
 
481
487
  /**
482
488
  * @param {string} description
483
- * @param {bigint} amount
489
+ * @param {number} amount
484
490
  * @param {string} token
485
491
  * @returns {Promise<any>}
486
492
  */
@@ -493,20 +499,6 @@ export function ln_create_invoice(description, amount, token) {
493
499
  return takeObject(ret);
494
500
  }
495
501
 
496
- /**
497
- * @param {string} invoice
498
- * @param {string} token
499
- * @returns {Promise<any>}
500
- */
501
- export function ln_decode_invoice(invoice, token) {
502
- const ptr0 = passStringToWasm0(invoice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
503
- const len0 = WASM_VECTOR_LEN;
504
- const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
505
- const len1 = WASM_VECTOR_LEN;
506
- const ret = wasm.ln_decode_invoice(ptr0, len0, ptr1, len1);
507
- return takeObject(ret);
508
- }
509
-
510
502
  /**
511
503
  * @param {string} token
512
504
  * @returns {Promise<any>}
@@ -520,24 +512,22 @@ export function ln_get_balance(token) {
520
512
 
521
513
  /**
522
514
  * @param {string} token
523
- * @param {number} limit
524
- * @param {number} offset
525
515
  * @returns {Promise<any>}
526
516
  */
527
- export function ln_get_txs(token, limit, offset) {
517
+ export function ln_get_txs(token) {
528
518
  const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
529
519
  const len0 = WASM_VECTOR_LEN;
530
- const ret = wasm.ln_get_txs(ptr0, len0, limit, offset);
520
+ const ret = wasm.ln_get_txs(ptr0, len0);
531
521
  return takeObject(ret);
532
522
  }
533
523
 
534
524
  /**
535
- * @param {string} invoice
525
+ * @param {string} payment_request
536
526
  * @param {string} token
537
527
  * @returns {Promise<any>}
538
528
  */
539
- export function ln_pay_invoice(invoice, token) {
540
- const ptr0 = passStringToWasm0(invoice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
529
+ export function ln_pay_invoice(payment_request, token) {
530
+ const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
541
531
  const len0 = WASM_VECTOR_LEN;
542
532
  const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
543
533
  const len1 = WASM_VECTOR_LEN;
@@ -575,8 +565,8 @@ function handleError(f, args) {
575
565
  function getArrayU8FromWasm0(ptr, len) {
576
566
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
577
567
  }
578
- function __wbg_adapter_138(arg0, arg1, arg2, arg3) {
579
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h1c65fdf212299b92(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
568
+ function __wbg_adapter_137(arg0, arg1, arg2, arg3) {
569
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h15f50af40ffe315b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
580
570
  }
581
571
 
582
572
  export function __wbindgen_string_new(arg0, arg1) {
@@ -646,14 +636,6 @@ export function __wbg_trace_fe50dc146726736b(arg0, arg1) {
646
636
  console.trace(...v0);
647
637
  };
648
638
 
649
- export function __wbg_randomFillSync_6894564c2c334c42() { return handleError(function (arg0, arg1, arg2) {
650
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
651
- }, arguments) };
652
-
653
- export function __wbg_getRandomValues_805f1c3d65988a5a() { return handleError(function (arg0, arg1) {
654
- getObject(arg0).getRandomValues(getObject(arg1));
655
- }, arguments) };
656
-
657
639
  export function __wbg_crypto_e1d53a1d73fb10b8(arg0) {
658
640
  const ret = getObject(arg0).crypto;
659
641
  return addHeapObject(ret);
@@ -700,6 +682,14 @@ export function __wbindgen_is_function(arg0) {
700
682
  return ret;
701
683
  };
702
684
 
685
+ export function __wbg_getRandomValues_805f1c3d65988a5a() { return handleError(function (arg0, arg1) {
686
+ getObject(arg0).getRandomValues(getObject(arg1));
687
+ }, arguments) };
688
+
689
+ export function __wbg_randomFillSync_6894564c2c334c42() { return handleError(function (arg0, arg1, arg2) {
690
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
691
+ }, arguments) };
692
+
703
693
  export function __wbg_randomFillSync_85b3f4c52c56c313(arg0, arg1, arg2) {
704
694
  getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
705
695
  };
@@ -893,7 +883,7 @@ export function __wbg_new_9962f939219f1820(arg0, arg1) {
893
883
  const a = state0.a;
894
884
  state0.a = 0;
895
885
  try {
896
- return __wbg_adapter_138(a, state0.b, arg0, arg1);
886
+ return __wbg_adapter_137(a, state0.b, arg0, arg1);
897
887
  } finally {
898
888
  state0.a = a;
899
889
  }
@@ -969,14 +959,6 @@ export function __wbg_stringify_d6471d300ded9b68() { return handleError(function
969
959
  return addHeapObject(ret);
970
960
  }, arguments) };
971
961
 
972
- export function __wbg_getRandomValues_02639197c8166a96(arg0, arg1, arg2) {
973
- getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2));
974
- };
975
-
976
- export function __wbg_randomFillSync_dd2297de5917c74e(arg0, arg1, arg2) {
977
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
978
- };
979
-
980
962
  export function __wbg_new_d87f272aec784ec0(arg0, arg1) {
981
963
  const ret = new Function(getStringFromWasm0(arg0, arg1));
982
964
  return addHeapObject(ret);
@@ -1012,6 +994,14 @@ export function __wbg_require_0993fe224bf8e202(arg0, arg1) {
1012
994
  return addHeapObject(ret);
1013
995
  };
1014
996
 
997
+ export function __wbg_randomFillSync_dd2297de5917c74e(arg0, arg1, arg2) {
998
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
999
+ };
1000
+
1001
+ export function __wbg_getRandomValues_02639197c8166a96(arg0, arg1, arg2) {
1002
+ getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2));
1003
+ };
1004
+
1015
1005
  export function __wbindgen_debug_string(arg0, arg1) {
1016
1006
  const ret = debugString(getObject(arg1));
1017
1007
  const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1029,8 +1019,8 @@ export function __wbindgen_memory() {
1029
1019
  return addHeapObject(ret);
1030
1020
  };
1031
1021
 
1032
- export function __wbindgen_closure_wrapper3075(arg0, arg1, arg2) {
1033
- const ret = makeMutClosure(arg0, arg1, 968, __wbg_adapter_28);
1022
+ export function __wbindgen_closure_wrapper3005(arg0, arg1, arg2) {
1023
+ const ret = makeMutClosure(arg0, arg1, 941, __wbg_adapter_28);
1034
1024
  return addHeapObject(ret);
1035
1025
  };
1036
1026
 
Binary file
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "Francisco Calderón <francisco@diba.io>"
7
7
  ],
8
8
  "description": "Core functionality for the BitMask wallet",
9
- "version": "0.4.1",
9
+ "version": "0.4.2",
10
10
  "license": "MIT",
11
11
  "repository": {
12
12
  "type": "git",