bitmask-core 0.2.2 → 0.3.0

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
@@ -26,29 +26,32 @@ export function save_mnemonic_seed(mnemonic: string, encryption_password: string
26
26
  */
27
27
  export function get_wallet_data(descriptor: string, change_descriptor?: string): Promise<any>;
28
28
  /**
29
+ * @param {string | undefined} node_url
29
30
  * @returns {Promise<any>}
30
31
  */
31
- export function import_list_assets(): Promise<any>;
32
+ export function import_list_assets(node_url?: string): Promise<any>;
32
33
  /**
33
34
  * @param {string} rgb_tokens_descriptor
34
35
  * @param {string | undefined} asset
35
36
  * @param {string | undefined} genesis
37
+ * @param {string | undefined} node_url
36
38
  * @returns {Promise<any>}
37
39
  */
38
- export function import_asset(rgb_tokens_descriptor: string, asset?: string, genesis?: string): Promise<any>;
40
+ export function import_asset(rgb_tokens_descriptor: string, asset?: string, genesis?: string, node_url?: string): Promise<any>;
39
41
  /**
40
42
  * @param {string} utxo_string
43
+ * @param {string | undefined} node_url
41
44
  * @returns {Promise<any>}
42
45
  */
43
- export function set_blinded_utxo(utxo_string: string): Promise<any>;
46
+ export function set_blinded_utxo(utxo_string: string, node_url?: string): Promise<any>;
44
47
  /**
45
48
  * @param {string} descriptor
46
49
  * @param {string} change_descriptor
47
50
  * @param {string} address
48
- * @param {BigInt} amount
51
+ * @param {bigint} amount
49
52
  * @returns {Promise<any>}
50
53
  */
51
- export function send_sats(descriptor: string, change_descriptor: string, address: string, amount: BigInt): Promise<any>;
54
+ export function send_sats(descriptor: string, change_descriptor: string, address: string, amount: bigint): Promise<any>;
52
55
  /**
53
56
  * @param {string} descriptor
54
57
  * @param {string} change_descriptor
@@ -62,25 +65,89 @@ export function fund_wallet(descriptor: string, change_descriptor: string, addre
62
65
  * @param {string} btc_change_descriptor
63
66
  * @param {string} rgb_tokens_descriptor
64
67
  * @param {string} blinded_utxo
65
- * @param {BigInt} amount
68
+ * @param {bigint} amount
66
69
  * @param {string} asset
70
+ * @param {string | undefined} node_url
67
71
  * @returns {Promise<any>}
68
72
  */
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>;
73
+ export function send_tokens(btc_descriptor: string, btc_change_descriptor: string, rgb_tokens_descriptor: string, blinded_utxo: string, amount: bigint, asset: string, node_url?: string): Promise<any>;
70
74
  /**
71
75
  * @param {string} consignment
76
+ * @param {string | undefined} node_url
72
77
  * @returns {Promise<any>}
73
78
  */
74
- export function validate_transaction(consignment: string): Promise<any>;
79
+ export function validate_transaction(consignment: string, node_url?: string): Promise<any>;
75
80
  /**
76
81
  * @param {string} consignment
77
82
  * @param {string} txid
78
83
  * @param {number} vout
79
84
  * @param {string} blinding
85
+ * @param {string | undefined} node_url
80
86
  * @returns {Promise<any>}
81
87
  */
82
- export function accept_transaction(consignment: string, txid: string, vout: number, blinding: string): Promise<any>;
88
+ export function accept_transaction(consignment: string, txid: string, vout: number, blinding: string, node_url?: string): Promise<any>;
89
+ /**
90
+ * @param {string} rgb_tokens_descriptor
91
+ * @param {string} asset
92
+ * @param {string} consignment
93
+ * @param {string} txid
94
+ * @param {number} vout
95
+ * @param {string} blinding
96
+ * @param {string | undefined} node_url
97
+ * @returns {Promise<any>}
98
+ */
99
+ export function import_accept(rgb_tokens_descriptor: string, asset: string, consignment: string, txid: string, vout: number, blinding: string, node_url?: string): Promise<any>;
83
100
  /**
84
101
  * @param {string} network_str
85
102
  */
86
103
  export function switch_network(network_str: string): void;
104
+
105
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
106
+
107
+ export interface InitOutput {
108
+ readonly memory: WebAssembly.Memory;
109
+ readonly get_vault: (a: number, b: number, c: number, d: number) => number;
110
+ readonly get_mnemonic_seed: (a: number, b: number, c: number, d: number) => number;
111
+ readonly save_mnemonic_seed: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
112
+ readonly get_wallet_data: (a: number, b: number, c: number, d: number) => number;
113
+ readonly import_list_assets: (a: number, b: number) => number;
114
+ readonly import_asset: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
115
+ readonly set_blinded_utxo: (a: number, b: number, c: number, d: number) => number;
116
+ readonly send_sats: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
117
+ readonly fund_wallet: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
118
+ readonly send_tokens: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => number;
119
+ readonly validate_transaction: (a: number, b: number, c: number, d: number) => number;
120
+ readonly accept_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
121
+ readonly import_accept: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => number;
122
+ readonly switch_network: (a: number, b: number) => void;
123
+ readonly rustsecp256k1_v0_4_1_context_create: (a: number) => number;
124
+ readonly rustsecp256k1_v0_4_1_context_destroy: (a: number) => void;
125
+ readonly rustsecp256k1_v0_4_1_default_illegal_callback_fn: (a: number, b: number) => void;
126
+ readonly rustsecp256k1_v0_4_1_default_error_callback_fn: (a: number, b: number) => void;
127
+ readonly __wbindgen_malloc: (a: number) => number;
128
+ readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
129
+ readonly __wbindgen_export_2: WebAssembly.Table;
130
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5a095e721c93f87: (a: number, b: number, c: number) => void;
131
+ readonly __wbindgen_exn_store: (a: number) => void;
132
+ readonly __wbindgen_free: (a: number, b: number) => void;
133
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h2ea55aec2c4d5fb4: (a: number, b: number, c: number, d: number) => void;
134
+ }
135
+
136
+ /**
137
+ * Synchronously compiles the given `bytes` and instantiates the WebAssembly module.
138
+ *
139
+ * @param {BufferSource} bytes
140
+ *
141
+ * @returns {InitOutput}
142
+ */
143
+ export function initSync(bytes: BufferSource): InitOutput;
144
+
145
+ /**
146
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
147
+ * for everything else, calls `WebAssembly.instantiate` directly.
148
+ *
149
+ * @param {InitInput | Promise<InitInput>} module_or_path
150
+ *
151
+ * @returns {Promise<InitOutput>}
152
+ */
153
+ export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;