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 +1 -3
- package/bitmask_core.d.ts +10 -16
- package/bitmask_core_bg.js +39 -49
- package/bitmask_core_bg.wasm +0 -0
- package/package.json +1 -1
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
|
-
[](https://github.com/diba-io/bitmask-core/actions/workflows/Rust.yml)
|
|
8
7
|
[](https://docs.rs/bitmask-core/latest/bitmask-core/)
|
|
9
8
|
[](https://www.npmjs.com/package/bitmask-core)
|
|
10
9
|
[](https://mit-license.org)
|
|
11
|
-
](https://t.me/rust_in_bitcoin)
|
|
10
|
+
[](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}
|
|
119
|
+
* @param {string} username
|
|
118
120
|
* @param {string} password
|
|
119
121
|
* @returns {Promise<any>}
|
|
120
122
|
*/
|
|
121
|
-
export function ln_auth(
|
|
123
|
+
export function ln_auth(username: string, password: string): Promise<any>;
|
|
122
124
|
/**
|
|
123
125
|
* @param {string} description
|
|
124
|
-
* @param {
|
|
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
|
|
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
|
|
140
|
+
export function ln_get_txs(token: string): Promise<any>;
|
|
147
141
|
/**
|
|
148
|
-
* @param {string}
|
|
142
|
+
* @param {string} payment_request
|
|
149
143
|
* @param {string} token
|
|
150
144
|
* @returns {Promise<any>}
|
|
151
145
|
*/
|
|
152
|
-
export function ln_pay_invoice(
|
|
146
|
+
export function ln_pay_invoice(payment_request: string, token: string): Promise<any>;
|
package/bitmask_core_bg.js
CHANGED
|
@@ -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.
|
|
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
|
|
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}
|
|
474
|
+
* @param {string} username
|
|
469
475
|
* @param {string} password
|
|
470
476
|
* @returns {Promise<any>}
|
|
471
477
|
*/
|
|
472
|
-
export function ln_auth(
|
|
473
|
-
const ptr0 = passStringToWasm0(
|
|
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 {
|
|
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
|
|
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
|
|
520
|
+
const ret = wasm.ln_get_txs(ptr0, len0);
|
|
531
521
|
return takeObject(ret);
|
|
532
522
|
}
|
|
533
523
|
|
|
534
524
|
/**
|
|
535
|
-
* @param {string}
|
|
525
|
+
* @param {string} payment_request
|
|
536
526
|
* @param {string} token
|
|
537
527
|
* @returns {Promise<any>}
|
|
538
528
|
*/
|
|
539
|
-
export function ln_pay_invoice(
|
|
540
|
-
const ptr0 = passStringToWasm0(
|
|
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
|
|
579
|
-
wasm.
|
|
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
|
|
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
|
|
1033
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
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
|
|
package/bitmask_core_bg.wasm
CHANGED
|
Binary file
|