bitmask-core 0.1.2 → 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/README.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  Core functionality for the BitMask wallet - <https://bitmask.app>
4
4
 
5
+ [![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)
6
+ [![Crates.io](https://img.shields.io/crates/v/bitmask-core?style=flat-square)](https://docs.rs/bitmask-core/latest/bitmask-core/)
7
+ [![npm: bitmask-core](https://img.shields.io/npm/v/bitmask-core?style=flat-square)](https://www.npmjs.com/package/bitmask-core)
8
+ [![License: MIT+APACHE](https://img.shields.io/crates/l/bitmask-core?style=flat-square)](https://mit-license.org)
9
+ ![Lines of code](https://img.shields.io/tokei/lines/github/diba-io/bitmask-core?style=flat-square)
10
+ [![Telegram: rust_in_bitcoin](https://img.shields.io/badge/telegram-rust_in_bitcoin-blue?style=flat-square)](https://t.me/rust_in_bitcoin)
11
+
5
12
  ## Uses
6
13
 
7
14
  - [bdk](https://github.com/bitcoindevkit/bdk) - Bitcoin Dev Kit
@@ -19,4 +26,4 @@ If there are issues compiling, be sure to check you're compiling with the latest
19
26
  ## Test
20
27
 
21
28
  1. Lint against wasm32: `cargo clippy --target wasm32-unknown-unknown`
22
- 2. Run tests in browser: `wasm-pack test --headless --chrome`
29
+ 2. Run tests in browser: `TEST_WALLET_SEED="replace with a 12 word mnemonic for a wallet containing testnet sats" wasm-pack test --headless --chrome`
package/bitmask_core.d.ts CHANGED
@@ -2,9 +2,10 @@
2
2
  /* eslint-disable */
3
3
  /**
4
4
  * @param {string} password
5
+ * @param {string} encrypted_descriptors
5
6
  * @returns {Promise<any>}
6
7
  */
7
- export function get_vault(password: string): Promise<any>;
8
+ export function get_vault(password: string, encrypted_descriptors: string): Promise<any>;
8
9
  /**
9
10
  * @param {string} encryption_password
10
11
  * @param {string} seed_password
@@ -20,26 +21,26 @@ export function get_mnemonic_seed(encryption_password: string, seed_password: st
20
21
  export function save_mnemonic_seed(mnemonic: string, encryption_password: string, seed_password: string): Promise<any>;
21
22
  /**
22
23
  * @param {string} descriptor
23
- * @param {string} change_descriptor
24
+ * @param {string | undefined} change_descriptor
24
25
  * @returns {Promise<any>}
25
26
  */
26
- export function get_wallet_data(descriptor: string, change_descriptor: string): Promise<any>;
27
+ export function get_wallet_data(descriptor: string, change_descriptor?: string): Promise<any>;
27
28
  /**
28
29
  * @returns {Promise<any>}
29
30
  */
30
31
  export function import_list_assets(): Promise<any>;
31
32
  /**
32
- * @param {string} descriptor
33
- * @param {string} change_descriptor
33
+ * @param {string} rgb_tokens_descriptor
34
34
  * @param {string | undefined} asset
35
35
  * @param {string | undefined} genesis
36
36
  * @returns {Promise<any>}
37
37
  */
38
- export function import_asset(descriptor: string, change_descriptor: string, asset?: string, genesis?: string): Promise<any>;
38
+ export function import_asset(rgb_tokens_descriptor: string, asset?: string, genesis?: string): Promise<any>;
39
39
  /**
40
+ * @param {string} utxo_string
40
41
  * @returns {Promise<any>}
41
42
  */
42
- export function set_blinded_utxos(): Promise<any>;
43
+ export function set_blinded_utxo(utxo_string: string): Promise<any>;
43
44
  /**
44
45
  * @param {string} descriptor
45
46
  * @param {string} change_descriptor
@@ -51,21 +52,21 @@ export function send_sats(descriptor: string, change_descriptor: string, address
51
52
  /**
52
53
  * @param {string} descriptor
53
54
  * @param {string} change_descriptor
54
- * @param {string} blinded_utxo
55
- * @param {BigInt} amount
56
- * @param {string} asset
55
+ * @param {string} address
56
+ * @param {string} uda_address
57
57
  * @returns {Promise<any>}
58
58
  */
59
- export function send_tokens(descriptor: string, change_descriptor: string, blinded_utxo: string, amount: BigInt, asset: string): Promise<any>;
59
+ export function fund_wallet(descriptor: string, change_descriptor: string, address: string, uda_address: string): Promise<any>;
60
60
  /**
61
- * @param {string} descriptor
62
- * @param {string} change_descriptor
63
- * @param {string} utxo
61
+ * @param {string} btc_descriptor
62
+ * @param {string} btc_change_descriptor
63
+ * @param {string} rgb_tokens_descriptor
64
+ * @param {string} blinded_utxo
64
65
  * @param {BigInt} amount
65
66
  * @param {string} asset
66
67
  * @returns {Promise<any>}
67
68
  */
68
- export function send_tokens_full(descriptor: string, change_descriptor: string, utxo: string, amount: BigInt, asset: string): Promise<any>;
69
+ export function send_tokens(btc_descriptor: string, btc_change_descriptor: string, rgb_tokens_descriptor: string, blinded_utxo: string, amount: BigInt, asset: string): Promise<any>;
69
70
  /**
70
71
  * @param {string} consignment
71
72
  * @returns {Promise<any>}
@@ -75,51 +76,11 @@ export function validate_transaction(consignment: string): Promise<any>;
75
76
  * @param {string} consignment
76
77
  * @param {string} txid
77
78
  * @param {number} vout
78
- * @param {BigInt} blinding
79
+ * @param {string} blinding
79
80
  * @returns {Promise<any>}
80
81
  */
81
- export function accept_transaction(consignment: string, txid: string, vout: number, blinding: BigInt): Promise<any>;
82
+ export function accept_transaction(consignment: string, txid: string, vout: number, blinding: string): Promise<any>;
82
83
  /**
83
84
  * @param {string} network_str
84
85
  */
85
86
  export function switch_network(network_str: string): void;
86
-
87
- export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
88
-
89
- export interface InitOutput {
90
- readonly memory: WebAssembly.Memory;
91
- readonly get_vault: (a: number, b: number) => number;
92
- readonly get_mnemonic_seed: (a: number, b: number, c: number, d: number) => number;
93
- readonly save_mnemonic_seed: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
94
- readonly get_wallet_data: (a: number, b: number, c: number, d: number) => number;
95
- readonly import_list_assets: () => number;
96
- readonly import_asset: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
97
- readonly send_sats: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
98
- readonly send_tokens: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
99
- readonly send_tokens_full: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
100
- readonly validate_transaction: (a: number, b: number) => number;
101
- readonly accept_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
102
- readonly switch_network: (a: number, b: number) => void;
103
- readonly set_blinded_utxos: () => number;
104
- readonly rustsecp256k1_v0_4_1_context_create: (a: number) => number;
105
- readonly rustsecp256k1_v0_4_1_context_destroy: (a: number) => void;
106
- readonly rustsecp256k1_v0_4_1_default_illegal_callback_fn: (a: number, b: number) => void;
107
- readonly rustsecp256k1_v0_4_1_default_error_callback_fn: (a: number, b: number) => void;
108
- readonly __wbindgen_malloc: (a: number) => number;
109
- readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
110
- readonly __wbindgen_export_2: WebAssembly.Table;
111
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h866a074843749e7a: (a: number, b: number, c: number) => void;
112
- readonly __wbindgen_exn_store: (a: number) => void;
113
- readonly __wbindgen_free: (a: number, b: number) => void;
114
- readonly wasm_bindgen__convert__closures__invoke2_mut__h989d4d5a38951b01: (a: number, b: number, c: number, d: number) => void;
115
- }
116
-
117
- /**
118
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
119
- * for everything else, calls `WebAssembly.instantiate` directly.
120
- *
121
- * @param {InitInput | Promise<InitInput>} module_or_path
122
- *
123
- * @returns {Promise<InitOutput>}
124
- */
125
- export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;