bitmask-core 1.0.4-beta.10 → 1.0.5-beta.10
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 +41 -41
- package/bitmask_core.js +324 -325
- package/bitmask_core_bg.wasm +0 -0
- package/bitmask_core_bg.wasm.d.ts +23 -23
- package/package.json +1 -1
- package/rgb.d.ts +4 -0
package/bitmask_core.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function store(secret_key: string, name: string, data: Uint8Array, force: boolean, metadata?: Uint8Array | null): Promise<any>;
|
|
4
|
-
export function retrieve(secret_key: string, name: string): Promise<any>;
|
|
5
|
-
export function retrieve_metadata(secret_key: string, name: string): Promise<any>;
|
|
6
|
-
export function encode_hex(bytes: Uint8Array): string;
|
|
7
|
-
export function encode_base64(bytes: Uint8Array): string;
|
|
8
|
-
export function decode_hex(string: string): Uint8Array;
|
|
9
|
-
export function decode_base64(string: string): Uint8Array;
|
|
10
3
|
export function convert_contract_amount_raw(decimal: string, precision: number): string;
|
|
11
4
|
export function convert_contract_amount_string(amount: bigint, precision: number): string;
|
|
12
5
|
export function parse_contract_amount(amount: string): any;
|
|
13
6
|
export function parse_contract_amount_precision(amount: string, precision: number): string;
|
|
14
7
|
export function version(): any;
|
|
8
|
+
export function fund_rgb_vault(sk: string, fee_rate: number, secrets: any, broadcast: boolean, fund_value: bigint | null | undefined, coordinator_fee: boolean): Promise<any>;
|
|
9
|
+
export function transfer_sats(sk: string, address: string, sats: bigint, fee_rate: number, secrets: any): Promise<any>;
|
|
10
|
+
export function get_btc_wallet(sk: string): Promise<any>;
|
|
11
|
+
export function backup_btc_data(nostr_hex_sk: string): Promise<any>;
|
|
12
|
+
export function recover_funds_from_bad_wallets(seed: string, pass_phrase: string, recover_address: string): Promise<any>;
|
|
13
|
+
export function restore_btc_data(nostr_hex_sk: string): Promise<any>;
|
|
14
|
+
export function get_network(): Promise<any>;
|
|
15
|
+
export function switch_network(network_str: string): Promise<any>;
|
|
16
|
+
export function get_env(key: string): Promise<any>;
|
|
17
|
+
export function set_env(key: string, value: string): Promise<any>;
|
|
18
|
+
export function sleep(ms: number): Promise<any>;
|
|
15
19
|
export function create_watcher(nostr_hex_sk: string, request: any): Promise<any>;
|
|
16
20
|
export function recover_watcher(nostr_hex_sk: string, request: any): Promise<any>;
|
|
17
21
|
export function destroy_watcher(nostr_hex_sk: string): Promise<any>;
|
|
@@ -20,6 +24,13 @@ export function check_watcher(nostr_hex_sk: string): Promise<any>;
|
|
|
20
24
|
export function watcher_next_address(nostr_hex_sk: string, request: string): Promise<any>;
|
|
21
25
|
export function watcher_next_utxo(nostr_hex_sk: string, request: string): Promise<any>;
|
|
22
26
|
export function watcher_unspent_utxos(nostr_hex_sk: string, request: string): Promise<any>;
|
|
27
|
+
export function store(secret_key: string, name: string, data: Uint8Array, force: boolean, metadata?: Uint8Array | null): Promise<any>;
|
|
28
|
+
export function retrieve(secret_key: string, name: string): Promise<any>;
|
|
29
|
+
export function retrieve_metadata(secret_key: string, name: string): Promise<any>;
|
|
30
|
+
export function encode_hex(bytes: Uint8Array): string;
|
|
31
|
+
export function encode_base64(bytes: Uint8Array): string;
|
|
32
|
+
export function decode_hex(string: string): Uint8Array;
|
|
33
|
+
export function decode_base64(string: string): Uint8Array;
|
|
23
34
|
export function get_rgb_version(): string;
|
|
24
35
|
export function get_rgb_wallet(nostr_hex_sk: string): Promise<any>;
|
|
25
36
|
export function get_contract(nostr_hex_sk: string, request: string): Promise<any>;
|
|
@@ -69,19 +80,8 @@ export function pay_invoice(payment_request: string, token: string): Promise<any
|
|
|
69
80
|
export function check_payment(payment_hash: string): Promise<any>;
|
|
70
81
|
export function swap_btc_ln(token: string, ln_address?: string | null): Promise<any>;
|
|
71
82
|
export function swap_ln_btc(address: string, amount: bigint, token: string): Promise<any>;
|
|
72
|
-
export function get_network(): Promise<any>;
|
|
73
|
-
export function switch_network(network_str: string): Promise<any>;
|
|
74
|
-
export function get_env(key: string): Promise<any>;
|
|
75
|
-
export function set_env(key: string, value: string): Promise<any>;
|
|
76
|
-
export function sleep(ms: number): Promise<any>;
|
|
77
83
|
export function new_nostr_pubkey(pubkey: string, token: string): Promise<any>;
|
|
78
84
|
export function update_nostr_pubkey(pubkey: string, token: string): Promise<any>;
|
|
79
|
-
export function fund_rgb_vault(sk: string, fee_rate: number, secrets: any, broadcast: boolean, fund_value: bigint | null | undefined, coordinator_fee: boolean): Promise<any>;
|
|
80
|
-
export function transfer_sats(sk: string, address: string, sats: bigint, fee_rate: number, secrets: any): Promise<any>;
|
|
81
|
-
export function get_btc_wallet(sk: string): Promise<any>;
|
|
82
|
-
export function backup_btc_data(nostr_hex_sk: string): Promise<any>;
|
|
83
|
-
export function recover_funds_from_bad_wallets(seed: string, pass_phrase: string, recover_address: string): Promise<any>;
|
|
84
|
-
export function restore_btc_data(nostr_hex_sk: string): Promise<any>;
|
|
85
85
|
export function hash_password(password: string): string;
|
|
86
86
|
export function new_mnemonic(password: string): Promise<any>;
|
|
87
87
|
export function save_mnemonic(seed: string, password: string): Promise<any>;
|
|
@@ -104,18 +104,22 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
104
104
|
|
|
105
105
|
export interface InitOutput {
|
|
106
106
|
readonly memory: WebAssembly.Memory;
|
|
107
|
-
readonly store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
108
|
-
readonly retrieve: (a: number, b: number, c: number, d: number) => any;
|
|
109
|
-
readonly retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
|
|
110
|
-
readonly encode_hex: (a: number, b: number) => [number, number];
|
|
111
|
-
readonly encode_base64: (a: number, b: number) => [number, number];
|
|
112
|
-
readonly decode_hex: (a: number, b: number) => [number, number, number, number];
|
|
113
|
-
readonly decode_base64: (a: number, b: number) => [number, number, number, number];
|
|
114
107
|
readonly convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
|
|
115
108
|
readonly convert_contract_amount_string: (a: bigint, b: number) => [number, number];
|
|
116
109
|
readonly parse_contract_amount: (a: number, b: number) => any;
|
|
117
110
|
readonly parse_contract_amount_precision: (a: number, b: number, c: number) => [number, number];
|
|
118
111
|
readonly version: () => any;
|
|
112
|
+
readonly fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
|
|
113
|
+
readonly transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
|
|
114
|
+
readonly get_btc_wallet: (a: number, b: number) => any;
|
|
115
|
+
readonly backup_btc_data: (a: number, b: number) => any;
|
|
116
|
+
readonly recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
117
|
+
readonly restore_btc_data: (a: number, b: number) => any;
|
|
118
|
+
readonly get_network: () => any;
|
|
119
|
+
readonly switch_network: (a: number, b: number) => any;
|
|
120
|
+
readonly get_env: (a: number, b: number) => any;
|
|
121
|
+
readonly set_env: (a: number, b: number, c: number, d: number) => any;
|
|
122
|
+
readonly sleep: (a: number) => any;
|
|
119
123
|
readonly create_watcher: (a: number, b: number, c: any) => any;
|
|
120
124
|
readonly recover_watcher: (a: number, b: number, c: any) => any;
|
|
121
125
|
readonly destroy_watcher: (a: number, b: number) => any;
|
|
@@ -124,6 +128,13 @@ export interface InitOutput {
|
|
|
124
128
|
readonly watcher_next_address: (a: number, b: number, c: number, d: number) => any;
|
|
125
129
|
readonly watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
|
|
126
130
|
readonly watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
|
|
131
|
+
readonly store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
132
|
+
readonly retrieve: (a: number, b: number, c: number, d: number) => any;
|
|
133
|
+
readonly retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
|
|
134
|
+
readonly encode_hex: (a: number, b: number) => [number, number];
|
|
135
|
+
readonly encode_base64: (a: number, b: number) => [number, number];
|
|
136
|
+
readonly decode_hex: (a: number, b: number) => [number, number, number, number];
|
|
137
|
+
readonly decode_base64: (a: number, b: number) => [number, number, number, number];
|
|
127
138
|
readonly get_rgb_version: () => [number, number];
|
|
128
139
|
readonly get_rgb_wallet: (a: number, b: number) => any;
|
|
129
140
|
readonly get_contract: (a: number, b: number, c: number, d: number) => any;
|
|
@@ -169,19 +180,8 @@ export interface InitOutput {
|
|
|
169
180
|
readonly check_payment: (a: number, b: number) => any;
|
|
170
181
|
readonly swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
|
|
171
182
|
readonly swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
|
|
172
|
-
readonly get_network: () => any;
|
|
173
|
-
readonly switch_network: (a: number, b: number) => any;
|
|
174
|
-
readonly get_env: (a: number, b: number) => any;
|
|
175
|
-
readonly set_env: (a: number, b: number, c: number, d: number) => any;
|
|
176
|
-
readonly sleep: (a: number) => any;
|
|
177
183
|
readonly new_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
|
|
178
184
|
readonly update_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
|
|
179
|
-
readonly fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
|
|
180
|
-
readonly transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
|
|
181
|
-
readonly get_btc_wallet: (a: number, b: number) => any;
|
|
182
|
-
readonly backup_btc_data: (a: number, b: number) => any;
|
|
183
|
-
readonly recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
184
|
-
readonly restore_btc_data: (a: number, b: number) => any;
|
|
185
185
|
readonly hash_password: (a: number, b: number) => [number, number];
|
|
186
186
|
readonly new_mnemonic: (a: number, b: number) => any;
|
|
187
187
|
readonly save_mnemonic: (a: number, b: number, c: number, d: number) => any;
|
|
@@ -224,12 +224,12 @@ export interface InitOutput {
|
|
|
224
224
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
225
225
|
readonly __wbindgen_export_7: WebAssembly.Table;
|
|
226
226
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
227
|
-
readonly
|
|
228
|
-
readonly
|
|
229
|
-
readonly
|
|
227
|
+
readonly closure1928_externref_shim: (a: number, b: number, c: any) => void;
|
|
228
|
+
readonly closure2690_externref_shim: (a: number, b: number, c: any) => void;
|
|
229
|
+
readonly closure2721_externref_shim: (a: number, b: number, c: any) => void;
|
|
230
230
|
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ceba1bc0c075797: (a: number, b: number) => void;
|
|
231
|
-
readonly
|
|
232
|
-
readonly
|
|
231
|
+
readonly closure3901_externref_shim: (a: number, b: number, c: any) => void;
|
|
232
|
+
readonly closure4193_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
233
233
|
readonly __wbindgen_start: () => void;
|
|
234
234
|
}
|
|
235
235
|
|
package/bitmask_core.js
CHANGED
|
@@ -213,137 +213,6 @@ function debugString(val) {
|
|
|
213
213
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
214
214
|
return className;
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
218
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
219
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
220
|
-
WASM_VECTOR_LEN = arg.length;
|
|
221
|
-
return ptr;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* @param {string} secret_key
|
|
225
|
-
* @param {string} name
|
|
226
|
-
* @param {Uint8Array} data
|
|
227
|
-
* @param {boolean} force
|
|
228
|
-
* @param {Uint8Array | null} [metadata]
|
|
229
|
-
* @returns {Promise<any>}
|
|
230
|
-
*/
|
|
231
|
-
export function store(secret_key, name, data, force, metadata) {
|
|
232
|
-
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
|
-
const len0 = WASM_VECTOR_LEN;
|
|
234
|
-
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
235
|
-
const len1 = WASM_VECTOR_LEN;
|
|
236
|
-
const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
237
|
-
const len2 = WASM_VECTOR_LEN;
|
|
238
|
-
var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
|
|
239
|
-
var len3 = WASM_VECTOR_LEN;
|
|
240
|
-
const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
|
|
241
|
-
return ret;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* @param {string} secret_key
|
|
246
|
-
* @param {string} name
|
|
247
|
-
* @returns {Promise<any>}
|
|
248
|
-
*/
|
|
249
|
-
export function retrieve(secret_key, name) {
|
|
250
|
-
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
251
|
-
const len0 = WASM_VECTOR_LEN;
|
|
252
|
-
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
253
|
-
const len1 = WASM_VECTOR_LEN;
|
|
254
|
-
const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
|
|
255
|
-
return ret;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* @param {string} secret_key
|
|
260
|
-
* @param {string} name
|
|
261
|
-
* @returns {Promise<any>}
|
|
262
|
-
*/
|
|
263
|
-
export function retrieve_metadata(secret_key, name) {
|
|
264
|
-
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
-
const len0 = WASM_VECTOR_LEN;
|
|
266
|
-
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
267
|
-
const len1 = WASM_VECTOR_LEN;
|
|
268
|
-
const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
|
|
269
|
-
return ret;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* @param {Uint8Array} bytes
|
|
274
|
-
* @returns {string}
|
|
275
|
-
*/
|
|
276
|
-
export function encode_hex(bytes) {
|
|
277
|
-
let deferred2_0;
|
|
278
|
-
let deferred2_1;
|
|
279
|
-
try {
|
|
280
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
281
|
-
const len0 = WASM_VECTOR_LEN;
|
|
282
|
-
const ret = wasm.encode_hex(ptr0, len0);
|
|
283
|
-
deferred2_0 = ret[0];
|
|
284
|
-
deferred2_1 = ret[1];
|
|
285
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
286
|
-
} finally {
|
|
287
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* @param {Uint8Array} bytes
|
|
293
|
-
* @returns {string}
|
|
294
|
-
*/
|
|
295
|
-
export function encode_base64(bytes) {
|
|
296
|
-
let deferred2_0;
|
|
297
|
-
let deferred2_1;
|
|
298
|
-
try {
|
|
299
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
300
|
-
const len0 = WASM_VECTOR_LEN;
|
|
301
|
-
const ret = wasm.encode_base64(ptr0, len0);
|
|
302
|
-
deferred2_0 = ret[0];
|
|
303
|
-
deferred2_1 = ret[1];
|
|
304
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
305
|
-
} finally {
|
|
306
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function takeFromExternrefTable0(idx) {
|
|
311
|
-
const value = wasm.__wbindgen_export_4.get(idx);
|
|
312
|
-
wasm.__externref_table_dealloc(idx);
|
|
313
|
-
return value;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* @param {string} string
|
|
317
|
-
* @returns {Uint8Array}
|
|
318
|
-
*/
|
|
319
|
-
export function decode_hex(string) {
|
|
320
|
-
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
321
|
-
const len0 = WASM_VECTOR_LEN;
|
|
322
|
-
const ret = wasm.decode_hex(ptr0, len0);
|
|
323
|
-
if (ret[3]) {
|
|
324
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
325
|
-
}
|
|
326
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
327
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
328
|
-
return v2;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* @param {string} string
|
|
333
|
-
* @returns {Uint8Array}
|
|
334
|
-
*/
|
|
335
|
-
export function decode_base64(string) {
|
|
336
|
-
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
337
|
-
const len0 = WASM_VECTOR_LEN;
|
|
338
|
-
const ret = wasm.decode_base64(ptr0, len0);
|
|
339
|
-
if (ret[3]) {
|
|
340
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
341
|
-
}
|
|
342
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
343
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
344
|
-
return v2;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
216
|
/**
|
|
348
217
|
* @param {string} decimal
|
|
349
218
|
* @param {number} precision
|
|
@@ -421,6 +290,142 @@ export function version() {
|
|
|
421
290
|
return ret;
|
|
422
291
|
}
|
|
423
292
|
|
|
293
|
+
/**
|
|
294
|
+
* @param {string} sk
|
|
295
|
+
* @param {number} fee_rate
|
|
296
|
+
* @param {any} secrets
|
|
297
|
+
* @param {boolean} broadcast
|
|
298
|
+
* @param {bigint | null | undefined} fund_value
|
|
299
|
+
* @param {boolean} coordinator_fee
|
|
300
|
+
* @returns {Promise<any>}
|
|
301
|
+
*/
|
|
302
|
+
export function fund_rgb_vault(sk, fee_rate, secrets, broadcast, fund_value, coordinator_fee) {
|
|
303
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
304
|
+
const len0 = WASM_VECTOR_LEN;
|
|
305
|
+
const ret = wasm.fund_rgb_vault(ptr0, len0, fee_rate, secrets, broadcast, !isLikeNone(fund_value), isLikeNone(fund_value) ? BigInt(0) : fund_value, coordinator_fee);
|
|
306
|
+
return ret;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* @param {string} sk
|
|
311
|
+
* @param {string} address
|
|
312
|
+
* @param {bigint} sats
|
|
313
|
+
* @param {number} fee_rate
|
|
314
|
+
* @param {any} secrets
|
|
315
|
+
* @returns {Promise<any>}
|
|
316
|
+
*/
|
|
317
|
+
export function transfer_sats(sk, address, sats, fee_rate, secrets) {
|
|
318
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
319
|
+
const len0 = WASM_VECTOR_LEN;
|
|
320
|
+
const ptr1 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
321
|
+
const len1 = WASM_VECTOR_LEN;
|
|
322
|
+
const ret = wasm.transfer_sats(ptr0, len0, ptr1, len1, sats, fee_rate, secrets);
|
|
323
|
+
return ret;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* @param {string} sk
|
|
328
|
+
* @returns {Promise<any>}
|
|
329
|
+
*/
|
|
330
|
+
export function get_btc_wallet(sk) {
|
|
331
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
332
|
+
const len0 = WASM_VECTOR_LEN;
|
|
333
|
+
const ret = wasm.get_btc_wallet(ptr0, len0);
|
|
334
|
+
return ret;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* @param {string} nostr_hex_sk
|
|
339
|
+
* @returns {Promise<any>}
|
|
340
|
+
*/
|
|
341
|
+
export function backup_btc_data(nostr_hex_sk) {
|
|
342
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
343
|
+
const len0 = WASM_VECTOR_LEN;
|
|
344
|
+
const ret = wasm.backup_btc_data(ptr0, len0);
|
|
345
|
+
return ret;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* @param {string} seed
|
|
350
|
+
* @param {string} pass_phrase
|
|
351
|
+
* @param {string} recover_address
|
|
352
|
+
* @returns {Promise<any>}
|
|
353
|
+
*/
|
|
354
|
+
export function recover_funds_from_bad_wallets(seed, pass_phrase, recover_address) {
|
|
355
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
356
|
+
const len0 = WASM_VECTOR_LEN;
|
|
357
|
+
const ptr1 = passStringToWasm0(pass_phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
358
|
+
const len1 = WASM_VECTOR_LEN;
|
|
359
|
+
const ptr2 = passStringToWasm0(recover_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
360
|
+
const len2 = WASM_VECTOR_LEN;
|
|
361
|
+
const ret = wasm.recover_funds_from_bad_wallets(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
362
|
+
return ret;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* @param {string} nostr_hex_sk
|
|
367
|
+
* @returns {Promise<any>}
|
|
368
|
+
*/
|
|
369
|
+
export function restore_btc_data(nostr_hex_sk) {
|
|
370
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
371
|
+
const len0 = WASM_VECTOR_LEN;
|
|
372
|
+
const ret = wasm.restore_btc_data(ptr0, len0);
|
|
373
|
+
return ret;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* @returns {Promise<any>}
|
|
378
|
+
*/
|
|
379
|
+
export function get_network() {
|
|
380
|
+
const ret = wasm.get_network();
|
|
381
|
+
return ret;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* @param {string} network_str
|
|
386
|
+
* @returns {Promise<any>}
|
|
387
|
+
*/
|
|
388
|
+
export function switch_network(network_str) {
|
|
389
|
+
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
390
|
+
const len0 = WASM_VECTOR_LEN;
|
|
391
|
+
const ret = wasm.switch_network(ptr0, len0);
|
|
392
|
+
return ret;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @param {string} key
|
|
397
|
+
* @returns {Promise<any>}
|
|
398
|
+
*/
|
|
399
|
+
export function get_env(key) {
|
|
400
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
401
|
+
const len0 = WASM_VECTOR_LEN;
|
|
402
|
+
const ret = wasm.get_env(ptr0, len0);
|
|
403
|
+
return ret;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @param {string} key
|
|
408
|
+
* @param {string} value
|
|
409
|
+
* @returns {Promise<any>}
|
|
410
|
+
*/
|
|
411
|
+
export function set_env(key, value) {
|
|
412
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
413
|
+
const len0 = WASM_VECTOR_LEN;
|
|
414
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
415
|
+
const len1 = WASM_VECTOR_LEN;
|
|
416
|
+
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
417
|
+
return ret;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @param {number} ms
|
|
422
|
+
* @returns {Promise<any>}
|
|
423
|
+
*/
|
|
424
|
+
export function sleep(ms) {
|
|
425
|
+
const ret = wasm.sleep(ms);
|
|
426
|
+
return ret;
|
|
427
|
+
}
|
|
428
|
+
|
|
424
429
|
/**
|
|
425
430
|
* @param {string} nostr_hex_sk
|
|
426
431
|
* @param {any} request
|
|
@@ -446,78 +451,208 @@ export function recover_watcher(nostr_hex_sk, request) {
|
|
|
446
451
|
}
|
|
447
452
|
|
|
448
453
|
/**
|
|
449
|
-
* @param {string} nostr_hex_sk
|
|
454
|
+
* @param {string} nostr_hex_sk
|
|
455
|
+
* @returns {Promise<any>}
|
|
456
|
+
*/
|
|
457
|
+
export function destroy_watcher(nostr_hex_sk) {
|
|
458
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
459
|
+
const len0 = WASM_VECTOR_LEN;
|
|
460
|
+
const ret = wasm.destroy_watcher(ptr0, len0);
|
|
461
|
+
return ret;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* @param {string} nostr_hex_sk
|
|
466
|
+
* @returns {Promise<any>}
|
|
467
|
+
*/
|
|
468
|
+
export function destroy_recover_watcher(nostr_hex_sk) {
|
|
469
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
470
|
+
const len0 = WASM_VECTOR_LEN;
|
|
471
|
+
const ret = wasm.destroy_recover_watcher(ptr0, len0);
|
|
472
|
+
return ret;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @param {string} nostr_hex_sk
|
|
477
|
+
* @returns {Promise<any>}
|
|
478
|
+
*/
|
|
479
|
+
export function check_watcher(nostr_hex_sk) {
|
|
480
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
481
|
+
const len0 = WASM_VECTOR_LEN;
|
|
482
|
+
const ret = wasm.check_watcher(ptr0, len0);
|
|
483
|
+
return ret;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* @param {string} nostr_hex_sk
|
|
488
|
+
* @param {string} request
|
|
489
|
+
* @returns {Promise<any>}
|
|
490
|
+
*/
|
|
491
|
+
export function watcher_next_address(nostr_hex_sk, request) {
|
|
492
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
493
|
+
const len0 = WASM_VECTOR_LEN;
|
|
494
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
495
|
+
const len1 = WASM_VECTOR_LEN;
|
|
496
|
+
const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
|
|
497
|
+
return ret;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* @param {string} nostr_hex_sk
|
|
502
|
+
* @param {string} request
|
|
503
|
+
* @returns {Promise<any>}
|
|
504
|
+
*/
|
|
505
|
+
export function watcher_next_utxo(nostr_hex_sk, request) {
|
|
506
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
507
|
+
const len0 = WASM_VECTOR_LEN;
|
|
508
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
509
|
+
const len1 = WASM_VECTOR_LEN;
|
|
510
|
+
const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
|
|
511
|
+
return ret;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* @param {string} nostr_hex_sk
|
|
516
|
+
* @param {string} request
|
|
517
|
+
* @returns {Promise<any>}
|
|
518
|
+
*/
|
|
519
|
+
export function watcher_unspent_utxos(nostr_hex_sk, request) {
|
|
520
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
521
|
+
const len0 = WASM_VECTOR_LEN;
|
|
522
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
523
|
+
const len1 = WASM_VECTOR_LEN;
|
|
524
|
+
const ret = wasm.watcher_unspent_utxos(ptr0, len0, ptr1, len1);
|
|
525
|
+
return ret;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
529
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
530
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
531
|
+
WASM_VECTOR_LEN = arg.length;
|
|
532
|
+
return ptr;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* @param {string} secret_key
|
|
536
|
+
* @param {string} name
|
|
537
|
+
* @param {Uint8Array} data
|
|
538
|
+
* @param {boolean} force
|
|
539
|
+
* @param {Uint8Array | null} [metadata]
|
|
540
|
+
* @returns {Promise<any>}
|
|
541
|
+
*/
|
|
542
|
+
export function store(secret_key, name, data, force, metadata) {
|
|
543
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
544
|
+
const len0 = WASM_VECTOR_LEN;
|
|
545
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
546
|
+
const len1 = WASM_VECTOR_LEN;
|
|
547
|
+
const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
548
|
+
const len2 = WASM_VECTOR_LEN;
|
|
549
|
+
var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
|
|
550
|
+
var len3 = WASM_VECTOR_LEN;
|
|
551
|
+
const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
|
|
552
|
+
return ret;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* @param {string} secret_key
|
|
557
|
+
* @param {string} name
|
|
450
558
|
* @returns {Promise<any>}
|
|
451
559
|
*/
|
|
452
|
-
export function
|
|
453
|
-
const ptr0 = passStringToWasm0(
|
|
560
|
+
export function retrieve(secret_key, name) {
|
|
561
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
454
562
|
const len0 = WASM_VECTOR_LEN;
|
|
455
|
-
const
|
|
563
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
564
|
+
const len1 = WASM_VECTOR_LEN;
|
|
565
|
+
const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
|
|
456
566
|
return ret;
|
|
457
567
|
}
|
|
458
568
|
|
|
459
569
|
/**
|
|
460
|
-
* @param {string}
|
|
570
|
+
* @param {string} secret_key
|
|
571
|
+
* @param {string} name
|
|
461
572
|
* @returns {Promise<any>}
|
|
462
573
|
*/
|
|
463
|
-
export function
|
|
464
|
-
const ptr0 = passStringToWasm0(
|
|
574
|
+
export function retrieve_metadata(secret_key, name) {
|
|
575
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
465
576
|
const len0 = WASM_VECTOR_LEN;
|
|
466
|
-
const
|
|
577
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
578
|
+
const len1 = WASM_VECTOR_LEN;
|
|
579
|
+
const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
|
|
467
580
|
return ret;
|
|
468
581
|
}
|
|
469
582
|
|
|
470
583
|
/**
|
|
471
|
-
* @param {
|
|
472
|
-
* @returns {
|
|
584
|
+
* @param {Uint8Array} bytes
|
|
585
|
+
* @returns {string}
|
|
473
586
|
*/
|
|
474
|
-
export function
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
587
|
+
export function encode_hex(bytes) {
|
|
588
|
+
let deferred2_0;
|
|
589
|
+
let deferred2_1;
|
|
590
|
+
try {
|
|
591
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
592
|
+
const len0 = WASM_VECTOR_LEN;
|
|
593
|
+
const ret = wasm.encode_hex(ptr0, len0);
|
|
594
|
+
deferred2_0 = ret[0];
|
|
595
|
+
deferred2_1 = ret[1];
|
|
596
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
597
|
+
} finally {
|
|
598
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
599
|
+
}
|
|
479
600
|
}
|
|
480
601
|
|
|
481
602
|
/**
|
|
482
|
-
* @param {
|
|
483
|
-
* @
|
|
484
|
-
* @returns {Promise<any>}
|
|
603
|
+
* @param {Uint8Array} bytes
|
|
604
|
+
* @returns {string}
|
|
485
605
|
*/
|
|
486
|
-
export function
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
606
|
+
export function encode_base64(bytes) {
|
|
607
|
+
let deferred2_0;
|
|
608
|
+
let deferred2_1;
|
|
609
|
+
try {
|
|
610
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
611
|
+
const len0 = WASM_VECTOR_LEN;
|
|
612
|
+
const ret = wasm.encode_base64(ptr0, len0);
|
|
613
|
+
deferred2_0 = ret[0];
|
|
614
|
+
deferred2_1 = ret[1];
|
|
615
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
616
|
+
} finally {
|
|
617
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
618
|
+
}
|
|
493
619
|
}
|
|
494
620
|
|
|
621
|
+
function takeFromExternrefTable0(idx) {
|
|
622
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
623
|
+
wasm.__externref_table_dealloc(idx);
|
|
624
|
+
return value;
|
|
625
|
+
}
|
|
495
626
|
/**
|
|
496
|
-
* @param {string}
|
|
497
|
-
* @
|
|
498
|
-
* @returns {Promise<any>}
|
|
627
|
+
* @param {string} string
|
|
628
|
+
* @returns {Uint8Array}
|
|
499
629
|
*/
|
|
500
|
-
export function
|
|
501
|
-
const ptr0 = passStringToWasm0(
|
|
630
|
+
export function decode_hex(string) {
|
|
631
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
502
632
|
const len0 = WASM_VECTOR_LEN;
|
|
503
|
-
const
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
633
|
+
const ret = wasm.decode_hex(ptr0, len0);
|
|
634
|
+
if (ret[3]) {
|
|
635
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
636
|
+
}
|
|
637
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
638
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
639
|
+
return v2;
|
|
507
640
|
}
|
|
508
641
|
|
|
509
642
|
/**
|
|
510
|
-
* @param {string}
|
|
511
|
-
* @
|
|
512
|
-
* @returns {Promise<any>}
|
|
643
|
+
* @param {string} string
|
|
644
|
+
* @returns {Uint8Array}
|
|
513
645
|
*/
|
|
514
|
-
export function
|
|
515
|
-
const ptr0 = passStringToWasm0(
|
|
646
|
+
export function decode_base64(string) {
|
|
647
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
516
648
|
const len0 = WASM_VECTOR_LEN;
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
649
|
+
const ret = wasm.decode_base64(ptr0, len0);
|
|
650
|
+
if (ret[3]) {
|
|
651
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
652
|
+
}
|
|
653
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
654
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
655
|
+
return v2;
|
|
521
656
|
}
|
|
522
657
|
|
|
523
658
|
/**
|
|
@@ -1086,59 +1221,6 @@ export function swap_ln_btc(address, amount, token) {
|
|
|
1086
1221
|
return ret;
|
|
1087
1222
|
}
|
|
1088
1223
|
|
|
1089
|
-
/**
|
|
1090
|
-
* @returns {Promise<any>}
|
|
1091
|
-
*/
|
|
1092
|
-
export function get_network() {
|
|
1093
|
-
const ret = wasm.get_network();
|
|
1094
|
-
return ret;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
/**
|
|
1098
|
-
* @param {string} network_str
|
|
1099
|
-
* @returns {Promise<any>}
|
|
1100
|
-
*/
|
|
1101
|
-
export function switch_network(network_str) {
|
|
1102
|
-
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1103
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1104
|
-
const ret = wasm.switch_network(ptr0, len0);
|
|
1105
|
-
return ret;
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
/**
|
|
1109
|
-
* @param {string} key
|
|
1110
|
-
* @returns {Promise<any>}
|
|
1111
|
-
*/
|
|
1112
|
-
export function get_env(key) {
|
|
1113
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1114
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1115
|
-
const ret = wasm.get_env(ptr0, len0);
|
|
1116
|
-
return ret;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
/**
|
|
1120
|
-
* @param {string} key
|
|
1121
|
-
* @param {string} value
|
|
1122
|
-
* @returns {Promise<any>}
|
|
1123
|
-
*/
|
|
1124
|
-
export function set_env(key, value) {
|
|
1125
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1126
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1127
|
-
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1128
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1129
|
-
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
1130
|
-
return ret;
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
/**
|
|
1134
|
-
* @param {number} ms
|
|
1135
|
-
* @returns {Promise<any>}
|
|
1136
|
-
*/
|
|
1137
|
-
export function sleep(ms) {
|
|
1138
|
-
const ret = wasm.sleep(ms);
|
|
1139
|
-
return ret;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
1224
|
/**
|
|
1143
1225
|
* @param {string} pubkey
|
|
1144
1226
|
* @param {string} token
|
|
@@ -1167,89 +1249,6 @@ export function update_nostr_pubkey(pubkey, token) {
|
|
|
1167
1249
|
return ret;
|
|
1168
1250
|
}
|
|
1169
1251
|
|
|
1170
|
-
/**
|
|
1171
|
-
* @param {string} sk
|
|
1172
|
-
* @param {number} fee_rate
|
|
1173
|
-
* @param {any} secrets
|
|
1174
|
-
* @param {boolean} broadcast
|
|
1175
|
-
* @param {bigint | null | undefined} fund_value
|
|
1176
|
-
* @param {boolean} coordinator_fee
|
|
1177
|
-
* @returns {Promise<any>}
|
|
1178
|
-
*/
|
|
1179
|
-
export function fund_rgb_vault(sk, fee_rate, secrets, broadcast, fund_value, coordinator_fee) {
|
|
1180
|
-
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1181
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1182
|
-
const ret = wasm.fund_rgb_vault(ptr0, len0, fee_rate, secrets, broadcast, !isLikeNone(fund_value), isLikeNone(fund_value) ? BigInt(0) : fund_value, coordinator_fee);
|
|
1183
|
-
return ret;
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
/**
|
|
1187
|
-
* @param {string} sk
|
|
1188
|
-
* @param {string} address
|
|
1189
|
-
* @param {bigint} sats
|
|
1190
|
-
* @param {number} fee_rate
|
|
1191
|
-
* @param {any} secrets
|
|
1192
|
-
* @returns {Promise<any>}
|
|
1193
|
-
*/
|
|
1194
|
-
export function transfer_sats(sk, address, sats, fee_rate, secrets) {
|
|
1195
|
-
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1196
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1197
|
-
const ptr1 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1198
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1199
|
-
const ret = wasm.transfer_sats(ptr0, len0, ptr1, len1, sats, fee_rate, secrets);
|
|
1200
|
-
return ret;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
/**
|
|
1204
|
-
* @param {string} sk
|
|
1205
|
-
* @returns {Promise<any>}
|
|
1206
|
-
*/
|
|
1207
|
-
export function get_btc_wallet(sk) {
|
|
1208
|
-
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1209
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1210
|
-
const ret = wasm.get_btc_wallet(ptr0, len0);
|
|
1211
|
-
return ret;
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
/**
|
|
1215
|
-
* @param {string} nostr_hex_sk
|
|
1216
|
-
* @returns {Promise<any>}
|
|
1217
|
-
*/
|
|
1218
|
-
export function backup_btc_data(nostr_hex_sk) {
|
|
1219
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1220
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1221
|
-
const ret = wasm.backup_btc_data(ptr0, len0);
|
|
1222
|
-
return ret;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
/**
|
|
1226
|
-
* @param {string} seed
|
|
1227
|
-
* @param {string} pass_phrase
|
|
1228
|
-
* @param {string} recover_address
|
|
1229
|
-
* @returns {Promise<any>}
|
|
1230
|
-
*/
|
|
1231
|
-
export function recover_funds_from_bad_wallets(seed, pass_phrase, recover_address) {
|
|
1232
|
-
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1233
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1234
|
-
const ptr1 = passStringToWasm0(pass_phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1235
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1236
|
-
const ptr2 = passStringToWasm0(recover_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1237
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1238
|
-
const ret = wasm.recover_funds_from_bad_wallets(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1239
|
-
return ret;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
/**
|
|
1243
|
-
* @param {string} nostr_hex_sk
|
|
1244
|
-
* @returns {Promise<any>}
|
|
1245
|
-
*/
|
|
1246
|
-
export function restore_btc_data(nostr_hex_sk) {
|
|
1247
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1248
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1249
|
-
const ret = wasm.restore_btc_data(ptr0, len0);
|
|
1250
|
-
return ret;
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
1252
|
/**
|
|
1254
1253
|
* @param {string} password
|
|
1255
1254
|
* @returns {string}
|
|
@@ -1501,15 +1500,15 @@ export function psbt_publish_file(request) {
|
|
|
1501
1500
|
}
|
|
1502
1501
|
|
|
1503
1502
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
1504
|
-
wasm.
|
|
1503
|
+
wasm.closure1928_externref_shim(arg0, arg1, arg2);
|
|
1505
1504
|
}
|
|
1506
1505
|
|
|
1507
1506
|
function __wbg_adapter_57(arg0, arg1, arg2) {
|
|
1508
|
-
wasm.
|
|
1507
|
+
wasm.closure2690_externref_shim(arg0, arg1, arg2);
|
|
1509
1508
|
}
|
|
1510
1509
|
|
|
1511
1510
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
1512
|
-
wasm.
|
|
1511
|
+
wasm.closure2721_externref_shim(arg0, arg1, arg2);
|
|
1513
1512
|
}
|
|
1514
1513
|
|
|
1515
1514
|
function __wbg_adapter_63(arg0, arg1) {
|
|
@@ -1517,11 +1516,11 @@ function __wbg_adapter_63(arg0, arg1) {
|
|
|
1517
1516
|
}
|
|
1518
1517
|
|
|
1519
1518
|
function __wbg_adapter_66(arg0, arg1, arg2) {
|
|
1520
|
-
wasm.
|
|
1519
|
+
wasm.closure3901_externref_shim(arg0, arg1, arg2);
|
|
1521
1520
|
}
|
|
1522
1521
|
|
|
1523
1522
|
function __wbg_adapter_428(arg0, arg1, arg2, arg3) {
|
|
1524
|
-
wasm.
|
|
1523
|
+
wasm.closure4193_externref_shim(arg0, arg1, arg2, arg3);
|
|
1525
1524
|
}
|
|
1526
1525
|
|
|
1527
1526
|
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
@@ -2288,24 +2287,24 @@ function __wbg_get_imports() {
|
|
|
2288
2287
|
const ret = false;
|
|
2289
2288
|
return ret;
|
|
2290
2289
|
};
|
|
2291
|
-
imports.wbg.
|
|
2292
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2290
|
+
imports.wbg.__wbindgen_closure_wrapper11663 = function(arg0, arg1, arg2) {
|
|
2291
|
+
const ret = makeMutClosure(arg0, arg1, 2691, __wbg_adapter_57);
|
|
2293
2292
|
return ret;
|
|
2294
2293
|
};
|
|
2295
|
-
imports.wbg.
|
|
2296
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2294
|
+
imports.wbg.__wbindgen_closure_wrapper11745 = function(arg0, arg1, arg2) {
|
|
2295
|
+
const ret = makeMutClosure(arg0, arg1, 2722, __wbg_adapter_60);
|
|
2297
2296
|
return ret;
|
|
2298
2297
|
};
|
|
2299
|
-
imports.wbg.
|
|
2300
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2298
|
+
imports.wbg.__wbindgen_closure_wrapper11925 = function(arg0, arg1, arg2) {
|
|
2299
|
+
const ret = makeMutClosure(arg0, arg1, 2813, __wbg_adapter_63);
|
|
2301
2300
|
return ret;
|
|
2302
2301
|
};
|
|
2303
|
-
imports.wbg.
|
|
2304
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2302
|
+
imports.wbg.__wbindgen_closure_wrapper16315 = function(arg0, arg1, arg2) {
|
|
2303
|
+
const ret = makeMutClosure(arg0, arg1, 3902, __wbg_adapter_66);
|
|
2305
2304
|
return ret;
|
|
2306
2305
|
};
|
|
2307
|
-
imports.wbg.
|
|
2308
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2306
|
+
imports.wbg.__wbindgen_closure_wrapper7899 = function(arg0, arg1, arg2) {
|
|
2307
|
+
const ret = makeMutClosure(arg0, arg1, 1929, __wbg_adapter_54);
|
|
2309
2308
|
return ret;
|
|
2310
2309
|
};
|
|
2311
2310
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/bitmask_core_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
5
|
-
export const retrieve: (a: number, b: number, c: number, d: number) => any;
|
|
6
|
-
export const retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
|
|
7
|
-
export const encode_hex: (a: number, b: number) => [number, number];
|
|
8
|
-
export const encode_base64: (a: number, b: number) => [number, number];
|
|
9
|
-
export const decode_hex: (a: number, b: number) => [number, number, number, number];
|
|
10
|
-
export const decode_base64: (a: number, b: number) => [number, number, number, number];
|
|
11
4
|
export const convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
|
|
12
5
|
export const convert_contract_amount_string: (a: bigint, b: number) => [number, number];
|
|
13
6
|
export const parse_contract_amount: (a: number, b: number) => any;
|
|
14
7
|
export const parse_contract_amount_precision: (a: number, b: number, c: number) => [number, number];
|
|
15
8
|
export const version: () => any;
|
|
9
|
+
export const fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
|
|
10
|
+
export const transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
|
|
11
|
+
export const get_btc_wallet: (a: number, b: number) => any;
|
|
12
|
+
export const backup_btc_data: (a: number, b: number) => any;
|
|
13
|
+
export const recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
14
|
+
export const restore_btc_data: (a: number, b: number) => any;
|
|
15
|
+
export const get_network: () => any;
|
|
16
|
+
export const switch_network: (a: number, b: number) => any;
|
|
17
|
+
export const get_env: (a: number, b: number) => any;
|
|
18
|
+
export const set_env: (a: number, b: number, c: number, d: number) => any;
|
|
19
|
+
export const sleep: (a: number) => any;
|
|
16
20
|
export const create_watcher: (a: number, b: number, c: any) => any;
|
|
17
21
|
export const recover_watcher: (a: number, b: number, c: any) => any;
|
|
18
22
|
export const destroy_watcher: (a: number, b: number) => any;
|
|
@@ -21,6 +25,13 @@ export const check_watcher: (a: number, b: number) => any;
|
|
|
21
25
|
export const watcher_next_address: (a: number, b: number, c: number, d: number) => any;
|
|
22
26
|
export const watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
|
|
23
27
|
export const watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
|
|
28
|
+
export const store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
29
|
+
export const retrieve: (a: number, b: number, c: number, d: number) => any;
|
|
30
|
+
export const retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
|
|
31
|
+
export const encode_hex: (a: number, b: number) => [number, number];
|
|
32
|
+
export const encode_base64: (a: number, b: number) => [number, number];
|
|
33
|
+
export const decode_hex: (a: number, b: number) => [number, number, number, number];
|
|
34
|
+
export const decode_base64: (a: number, b: number) => [number, number, number, number];
|
|
24
35
|
export const get_rgb_version: () => [number, number];
|
|
25
36
|
export const get_rgb_wallet: (a: number, b: number) => any;
|
|
26
37
|
export const get_contract: (a: number, b: number, c: number, d: number) => any;
|
|
@@ -66,19 +77,8 @@ export const pay_invoice: (a: number, b: number, c: number, d: number) => any;
|
|
|
66
77
|
export const check_payment: (a: number, b: number) => any;
|
|
67
78
|
export const swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
|
|
68
79
|
export const swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
|
|
69
|
-
export const get_network: () => any;
|
|
70
|
-
export const switch_network: (a: number, b: number) => any;
|
|
71
|
-
export const get_env: (a: number, b: number) => any;
|
|
72
|
-
export const set_env: (a: number, b: number, c: number, d: number) => any;
|
|
73
|
-
export const sleep: (a: number) => any;
|
|
74
80
|
export const new_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
|
|
75
81
|
export const update_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
|
|
76
|
-
export const fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
|
|
77
|
-
export const transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
|
|
78
|
-
export const get_btc_wallet: (a: number, b: number) => any;
|
|
79
|
-
export const backup_btc_data: (a: number, b: number) => any;
|
|
80
|
-
export const recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
81
|
-
export const restore_btc_data: (a: number, b: number) => any;
|
|
82
82
|
export const hash_password: (a: number, b: number) => [number, number];
|
|
83
83
|
export const new_mnemonic: (a: number, b: number) => any;
|
|
84
84
|
export const save_mnemonic: (a: number, b: number, c: number, d: number) => any;
|
|
@@ -121,10 +121,10 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
121
121
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
122
122
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
123
123
|
export const __externref_table_dealloc: (a: number) => void;
|
|
124
|
-
export const
|
|
125
|
-
export const
|
|
126
|
-
export const
|
|
124
|
+
export const closure1928_externref_shim: (a: number, b: number, c: any) => void;
|
|
125
|
+
export const closure2690_externref_shim: (a: number, b: number, c: any) => void;
|
|
126
|
+
export const closure2721_externref_shim: (a: number, b: number, c: any) => void;
|
|
127
127
|
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ceba1bc0c075797: (a: number, b: number) => void;
|
|
128
|
-
export const
|
|
129
|
-
export const
|
|
128
|
+
export const closure3901_externref_shim: (a: number, b: number, c: any) => void;
|
|
129
|
+
export const closure4193_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
130
130
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
package/rgb.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WalletBalance } from "./bitcoin";
|
|
1
2
|
export declare const getVersion: () => string;
|
|
2
3
|
export declare const getContract: (nostrHexSk: string, request: string) => Promise<ContractResponse>;
|
|
3
4
|
export declare const listContracts: (nostrHexSk: string, hidden: boolean) => Promise<ContractResponse[]>;
|
|
@@ -229,10 +230,13 @@ export interface WatcherStatusResponse {
|
|
|
229
230
|
export interface WatcherWalletResponse {
|
|
230
231
|
nextUtxo?: string;
|
|
231
232
|
nextUtxoValue?: number;
|
|
233
|
+
vaultBalance?: WalletBalance;
|
|
232
234
|
nextAddress?: string;
|
|
233
235
|
listContracts: ContractResponse[];
|
|
234
236
|
transfers: RgbTransferItem[];
|
|
235
237
|
invoices: RgbInvoiceStatusItem[];
|
|
238
|
+
offers: RgbOfferResponse[];
|
|
239
|
+
bids: RgbBidResponse[];
|
|
236
240
|
}
|
|
237
241
|
export interface NextUtxoResponse {
|
|
238
242
|
utxo?: string;
|