bitmask-core 1.0.0-beta.9 → 1.0.1-beta
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/bitcoin.js +31 -16
- package/bitmask_core.d.ts +79 -79
- package/bitmask_core.js +445 -441
- package/bitmask_core_bg.js +1701 -1378
- package/bitmask_core_bg.wasm +0 -0
- package/bitmask_core_bg.wasm.d.ts +42 -42
- package/bp.js +17 -7
- package/carbonado.js +17 -7
- package/constants.d.ts +8 -3
- package/constants.js +42 -15
- package/index.js +17 -7
- package/lightning.js +17 -7
- package/nostr.js +17 -7
- package/package.json +47 -107
- package/rgb.d.ts +1 -1
- package/rgb.js +17 -7
- package/wallet.js +17 -7
- package/bitcoin.d.ts.map +0 -1
- package/bitcoin.ts +0 -317
- package/bp.d.ts.map +0 -1
- package/bp.ts +0 -72
- package/carbonado.d.ts.map +0 -1
- package/carbonado.ts +0 -34
- package/constants.d.ts.map +0 -1
- package/constants.ts +0 -112
- package/index.d.ts.map +0 -1
- package/index.ts +0 -33
- package/lightning.d.ts.map +0 -1
- package/lightning.ts +0 -165
- package/nostr.d.ts.map +0 -1
- package/nostr.ts +0 -19
- package/rgb.d.ts.map +0 -1
- package/rgb.ts +0 -710
- package/wallet.d.ts.map +0 -1
- package/wallet.ts +0 -46
package/bitmask_core.js
CHANGED
|
@@ -213,135 +213,204 @@ 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
|
+
* @returns {Promise<any>}
|
|
218
|
+
*/
|
|
219
|
+
export function get_network() {
|
|
220
|
+
const ret = wasm.get_network();
|
|
221
|
+
return ret;
|
|
222
|
+
}
|
|
216
223
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
/**
|
|
225
|
+
* @param {string} network_str
|
|
226
|
+
* @returns {Promise<any>}
|
|
227
|
+
*/
|
|
228
|
+
export function switch_network(network_str) {
|
|
229
|
+
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
230
|
+
const len0 = WASM_VECTOR_LEN;
|
|
231
|
+
const ret = wasm.switch_network(ptr0, len0);
|
|
232
|
+
return ret;
|
|
222
233
|
}
|
|
234
|
+
|
|
223
235
|
/**
|
|
224
|
-
* @param {string}
|
|
225
|
-
* @param {string} name
|
|
226
|
-
* @param {Uint8Array} data
|
|
227
|
-
* @param {boolean} force
|
|
228
|
-
* @param {Uint8Array | null} [metadata]
|
|
236
|
+
* @param {string} key
|
|
229
237
|
* @returns {Promise<any>}
|
|
230
238
|
*/
|
|
231
|
-
export function
|
|
232
|
-
const ptr0 = passStringToWasm0(
|
|
239
|
+
export function get_env(key) {
|
|
240
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
241
|
const len0 = WASM_VECTOR_LEN;
|
|
234
|
-
const
|
|
242
|
+
const ret = wasm.get_env(ptr0, len0);
|
|
243
|
+
return ret;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @param {string} key
|
|
248
|
+
* @param {string} value
|
|
249
|
+
* @returns {Promise<any>}
|
|
250
|
+
*/
|
|
251
|
+
export function set_env(key, value) {
|
|
252
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
253
|
+
const len0 = WASM_VECTOR_LEN;
|
|
254
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
235
255
|
const len1 = WASM_VECTOR_LEN;
|
|
236
|
-
const
|
|
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);
|
|
256
|
+
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
241
257
|
return ret;
|
|
242
258
|
}
|
|
243
259
|
|
|
244
260
|
/**
|
|
245
|
-
* @param {
|
|
246
|
-
* @param {string} name
|
|
261
|
+
* @param {number} ms
|
|
247
262
|
* @returns {Promise<any>}
|
|
248
263
|
*/
|
|
249
|
-
export function
|
|
250
|
-
const
|
|
264
|
+
export function sleep(ms) {
|
|
265
|
+
const ret = wasm.sleep(ms);
|
|
266
|
+
return ret;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @param {string} username
|
|
271
|
+
* @param {string} password
|
|
272
|
+
* @returns {Promise<any>}
|
|
273
|
+
*/
|
|
274
|
+
export function create_wallet(username, password) {
|
|
275
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
251
276
|
const len0 = WASM_VECTOR_LEN;
|
|
252
|
-
const ptr1 = passStringToWasm0(
|
|
277
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
253
278
|
const len1 = WASM_VECTOR_LEN;
|
|
254
|
-
const ret = wasm.
|
|
279
|
+
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
255
280
|
return ret;
|
|
256
281
|
}
|
|
257
282
|
|
|
258
283
|
/**
|
|
259
|
-
* @param {string}
|
|
260
|
-
* @param {string}
|
|
284
|
+
* @param {string} username
|
|
285
|
+
* @param {string} password
|
|
261
286
|
* @returns {Promise<any>}
|
|
262
287
|
*/
|
|
263
|
-
export function
|
|
264
|
-
const ptr0 = passStringToWasm0(
|
|
288
|
+
export function auth(username, password) {
|
|
289
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
290
|
const len0 = WASM_VECTOR_LEN;
|
|
266
|
-
const ptr1 = passStringToWasm0(
|
|
291
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
267
292
|
const len1 = WASM_VECTOR_LEN;
|
|
268
|
-
const ret = wasm.
|
|
293
|
+
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
269
294
|
return ret;
|
|
270
295
|
}
|
|
271
296
|
|
|
272
297
|
/**
|
|
273
|
-
* @param {
|
|
274
|
-
* @
|
|
298
|
+
* @param {string} description
|
|
299
|
+
* @param {number} amount
|
|
300
|
+
* @param {string} token
|
|
301
|
+
* @returns {Promise<any>}
|
|
275
302
|
*/
|
|
276
|
-
export function
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
-
}
|
|
303
|
+
export function ln_create_invoice(description, amount, token) {
|
|
304
|
+
const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
305
|
+
const len0 = WASM_VECTOR_LEN;
|
|
306
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
307
|
+
const len1 = WASM_VECTOR_LEN;
|
|
308
|
+
const ret = wasm.ln_create_invoice(ptr0, len0, amount, ptr1, len1);
|
|
309
|
+
return ret;
|
|
289
310
|
}
|
|
290
311
|
|
|
291
312
|
/**
|
|
292
|
-
* @param {
|
|
293
|
-
* @returns {
|
|
313
|
+
* @param {string} token
|
|
314
|
+
* @returns {Promise<any>}
|
|
294
315
|
*/
|
|
295
|
-
export function
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
-
}
|
|
316
|
+
export function get_balance(token) {
|
|
317
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
318
|
+
const len0 = WASM_VECTOR_LEN;
|
|
319
|
+
const ret = wasm.get_balance(ptr0, len0);
|
|
320
|
+
return ret;
|
|
308
321
|
}
|
|
309
322
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
323
|
+
/**
|
|
324
|
+
* @param {string} token
|
|
325
|
+
* @returns {Promise<any>}
|
|
326
|
+
*/
|
|
327
|
+
export function get_txs(token) {
|
|
328
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
329
|
+
const len0 = WASM_VECTOR_LEN;
|
|
330
|
+
const ret = wasm.get_txs(ptr0, len0);
|
|
331
|
+
return ret;
|
|
314
332
|
}
|
|
333
|
+
|
|
315
334
|
/**
|
|
316
|
-
* @param {string}
|
|
317
|
-
* @
|
|
335
|
+
* @param {string} payment_request
|
|
336
|
+
* @param {string} token
|
|
337
|
+
* @returns {Promise<any>}
|
|
318
338
|
*/
|
|
319
|
-
export function
|
|
320
|
-
const ptr0 = passStringToWasm0(
|
|
339
|
+
export function pay_invoice(payment_request, token) {
|
|
340
|
+
const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
321
341
|
const len0 = WASM_VECTOR_LEN;
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
327
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
328
|
-
return v2;
|
|
342
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
343
|
+
const len1 = WASM_VECTOR_LEN;
|
|
344
|
+
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
345
|
+
return ret;
|
|
329
346
|
}
|
|
330
347
|
|
|
331
348
|
/**
|
|
332
|
-
* @param {string}
|
|
333
|
-
* @returns {
|
|
349
|
+
* @param {string} payment_hash
|
|
350
|
+
* @returns {Promise<any>}
|
|
334
351
|
*/
|
|
335
|
-
export function
|
|
336
|
-
const ptr0 = passStringToWasm0(
|
|
352
|
+
export function check_payment(payment_hash) {
|
|
353
|
+
const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
337
354
|
const len0 = WASM_VECTOR_LEN;
|
|
338
|
-
const ret = wasm.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
355
|
+
const ret = wasm.check_payment(ptr0, len0);
|
|
356
|
+
return ret;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @param {string} token
|
|
361
|
+
* @param {string | null} [ln_address]
|
|
362
|
+
* @returns {Promise<any>}
|
|
363
|
+
*/
|
|
364
|
+
export function swap_btc_ln(token, ln_address) {
|
|
365
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
367
|
+
var ptr1 = isLikeNone(ln_address) ? 0 : passStringToWasm0(ln_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
368
|
+
var len1 = WASM_VECTOR_LEN;
|
|
369
|
+
const ret = wasm.swap_btc_ln(ptr0, len0, ptr1, len1);
|
|
370
|
+
return ret;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @param {string} address
|
|
375
|
+
* @param {bigint} amount
|
|
376
|
+
* @param {string} token
|
|
377
|
+
* @returns {Promise<any>}
|
|
378
|
+
*/
|
|
379
|
+
export function swap_ln_btc(address, amount, token) {
|
|
380
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
381
|
+
const len0 = WASM_VECTOR_LEN;
|
|
382
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
383
|
+
const len1 = WASM_VECTOR_LEN;
|
|
384
|
+
const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
|
|
385
|
+
return ret;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* @param {string} pubkey
|
|
390
|
+
* @param {string} token
|
|
391
|
+
* @returns {Promise<any>}
|
|
392
|
+
*/
|
|
393
|
+
export function new_nostr_pubkey(pubkey, token) {
|
|
394
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
395
|
+
const len0 = WASM_VECTOR_LEN;
|
|
396
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
397
|
+
const len1 = WASM_VECTOR_LEN;
|
|
398
|
+
const ret = wasm.new_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
399
|
+
return ret;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* @param {string} pubkey
|
|
404
|
+
* @param {string} token
|
|
405
|
+
* @returns {Promise<any>}
|
|
406
|
+
*/
|
|
407
|
+
export function update_nostr_pubkey(pubkey, token) {
|
|
408
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
409
|
+
const len0 = WASM_VECTOR_LEN;
|
|
410
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
411
|
+
const len1 = WASM_VECTOR_LEN;
|
|
412
|
+
const ret = wasm.update_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
413
|
+
return ret;
|
|
345
414
|
}
|
|
346
415
|
|
|
347
416
|
/**
|
|
@@ -778,386 +847,134 @@ export function restore_rgb_data(nostr_hex_sk) {
|
|
|
778
847
|
return ret;
|
|
779
848
|
}
|
|
780
849
|
|
|
850
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
851
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
852
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
853
|
+
WASM_VECTOR_LEN = arg.length;
|
|
854
|
+
return ptr;
|
|
855
|
+
}
|
|
781
856
|
/**
|
|
782
|
-
* @param {string}
|
|
783
|
-
* @param {
|
|
857
|
+
* @param {string} secret_key
|
|
858
|
+
* @param {string} name
|
|
859
|
+
* @param {Uint8Array} data
|
|
860
|
+
* @param {boolean} force
|
|
861
|
+
* @param {Uint8Array | null} [metadata]
|
|
784
862
|
* @returns {Promise<any>}
|
|
785
863
|
*/
|
|
786
|
-
export function
|
|
787
|
-
const ptr0 = passStringToWasm0(
|
|
788
|
-
const len0 = WASM_VECTOR_LEN;
|
|
789
|
-
const ret = wasm.create_watcher(ptr0, len0, request);
|
|
790
|
-
return ret;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
* @param {string} nostr_hex_sk
|
|
795
|
-
* @param {any} request
|
|
796
|
-
* @returns {Promise<any>}
|
|
797
|
-
*/
|
|
798
|
-
export function recover_watcher(nostr_hex_sk, request) {
|
|
799
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
800
|
-
const len0 = WASM_VECTOR_LEN;
|
|
801
|
-
const ret = wasm.recover_watcher(ptr0, len0, request);
|
|
802
|
-
return ret;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
/**
|
|
806
|
-
* @param {string} nostr_hex_sk
|
|
807
|
-
* @returns {Promise<any>}
|
|
808
|
-
*/
|
|
809
|
-
export function destroy_watcher(nostr_hex_sk) {
|
|
810
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
811
|
-
const len0 = WASM_VECTOR_LEN;
|
|
812
|
-
const ret = wasm.destroy_watcher(ptr0, len0);
|
|
813
|
-
return ret;
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
/**
|
|
817
|
-
* @param {string} nostr_hex_sk
|
|
818
|
-
* @returns {Promise<any>}
|
|
819
|
-
*/
|
|
820
|
-
export function destroy_recover_watcher(nostr_hex_sk) {
|
|
821
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
822
|
-
const len0 = WASM_VECTOR_LEN;
|
|
823
|
-
const ret = wasm.destroy_recover_watcher(ptr0, len0);
|
|
824
|
-
return ret;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
/**
|
|
828
|
-
* @param {string} nostr_hex_sk
|
|
829
|
-
* @returns {Promise<any>}
|
|
830
|
-
*/
|
|
831
|
-
export function check_watcher(nostr_hex_sk) {
|
|
832
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
833
|
-
const len0 = WASM_VECTOR_LEN;
|
|
834
|
-
const ret = wasm.check_watcher(ptr0, len0);
|
|
835
|
-
return ret;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* @param {string} nostr_hex_sk
|
|
840
|
-
* @param {string} request
|
|
841
|
-
* @returns {Promise<any>}
|
|
842
|
-
*/
|
|
843
|
-
export function watcher_next_address(nostr_hex_sk, request) {
|
|
844
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
845
|
-
const len0 = WASM_VECTOR_LEN;
|
|
846
|
-
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
847
|
-
const len1 = WASM_VECTOR_LEN;
|
|
848
|
-
const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
|
|
849
|
-
return ret;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* @param {string} nostr_hex_sk
|
|
854
|
-
* @param {string} request
|
|
855
|
-
* @returns {Promise<any>}
|
|
856
|
-
*/
|
|
857
|
-
export function watcher_next_utxo(nostr_hex_sk, request) {
|
|
858
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
859
|
-
const len0 = WASM_VECTOR_LEN;
|
|
860
|
-
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
861
|
-
const len1 = WASM_VECTOR_LEN;
|
|
862
|
-
const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
|
|
863
|
-
return ret;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
/**
|
|
867
|
-
* @param {string} nostr_hex_sk
|
|
868
|
-
* @param {string} request
|
|
869
|
-
* @returns {Promise<any>}
|
|
870
|
-
*/
|
|
871
|
-
export function watcher_unspent_utxos(nostr_hex_sk, request) {
|
|
872
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
873
|
-
const len0 = WASM_VECTOR_LEN;
|
|
874
|
-
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
875
|
-
const len1 = WASM_VECTOR_LEN;
|
|
876
|
-
const ret = wasm.watcher_unspent_utxos(ptr0, len0, ptr1, len1);
|
|
877
|
-
return ret;
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* @returns {Promise<any>}
|
|
882
|
-
*/
|
|
883
|
-
export function get_network() {
|
|
884
|
-
const ret = wasm.get_network();
|
|
885
|
-
return ret;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
/**
|
|
889
|
-
* @param {string} network_str
|
|
890
|
-
* @returns {Promise<any>}
|
|
891
|
-
*/
|
|
892
|
-
export function switch_network(network_str) {
|
|
893
|
-
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
894
|
-
const len0 = WASM_VECTOR_LEN;
|
|
895
|
-
const ret = wasm.switch_network(ptr0, len0);
|
|
896
|
-
return ret;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
/**
|
|
900
|
-
* @param {string} key
|
|
901
|
-
* @returns {Promise<any>}
|
|
902
|
-
*/
|
|
903
|
-
export function get_env(key) {
|
|
904
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
905
|
-
const len0 = WASM_VECTOR_LEN;
|
|
906
|
-
const ret = wasm.get_env(ptr0, len0);
|
|
907
|
-
return ret;
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* @param {string} key
|
|
912
|
-
* @param {string} value
|
|
913
|
-
* @returns {Promise<any>}
|
|
914
|
-
*/
|
|
915
|
-
export function set_env(key, value) {
|
|
916
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
917
|
-
const len0 = WASM_VECTOR_LEN;
|
|
918
|
-
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
919
|
-
const len1 = WASM_VECTOR_LEN;
|
|
920
|
-
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
921
|
-
return ret;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* @param {number} ms
|
|
926
|
-
* @returns {Promise<any>}
|
|
927
|
-
*/
|
|
928
|
-
export function sleep(ms) {
|
|
929
|
-
const ret = wasm.sleep(ms);
|
|
930
|
-
return ret;
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
/**
|
|
934
|
-
* @param {string} username
|
|
935
|
-
* @param {string} password
|
|
936
|
-
* @returns {Promise<any>}
|
|
937
|
-
*/
|
|
938
|
-
export function create_wallet(username, password) {
|
|
939
|
-
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
940
|
-
const len0 = WASM_VECTOR_LEN;
|
|
941
|
-
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
942
|
-
const len1 = WASM_VECTOR_LEN;
|
|
943
|
-
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
944
|
-
return ret;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
/**
|
|
948
|
-
* @param {string} username
|
|
949
|
-
* @param {string} password
|
|
950
|
-
* @returns {Promise<any>}
|
|
951
|
-
*/
|
|
952
|
-
export function auth(username, password) {
|
|
953
|
-
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
954
|
-
const len0 = WASM_VECTOR_LEN;
|
|
955
|
-
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
956
|
-
const len1 = WASM_VECTOR_LEN;
|
|
957
|
-
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
958
|
-
return ret;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
/**
|
|
962
|
-
* @param {string} description
|
|
963
|
-
* @param {number} amount
|
|
964
|
-
* @param {string} token
|
|
965
|
-
* @returns {Promise<any>}
|
|
966
|
-
*/
|
|
967
|
-
export function ln_create_invoice(description, amount, token) {
|
|
968
|
-
const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
969
|
-
const len0 = WASM_VECTOR_LEN;
|
|
970
|
-
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
971
|
-
const len1 = WASM_VECTOR_LEN;
|
|
972
|
-
const ret = wasm.ln_create_invoice(ptr0, len0, amount, ptr1, len1);
|
|
973
|
-
return ret;
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
/**
|
|
977
|
-
* @param {string} token
|
|
978
|
-
* @returns {Promise<any>}
|
|
979
|
-
*/
|
|
980
|
-
export function get_balance(token) {
|
|
981
|
-
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
982
|
-
const len0 = WASM_VECTOR_LEN;
|
|
983
|
-
const ret = wasm.get_balance(ptr0, len0);
|
|
984
|
-
return ret;
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
/**
|
|
988
|
-
* @param {string} token
|
|
989
|
-
* @returns {Promise<any>}
|
|
990
|
-
*/
|
|
991
|
-
export function get_txs(token) {
|
|
992
|
-
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
993
|
-
const len0 = WASM_VECTOR_LEN;
|
|
994
|
-
const ret = wasm.get_txs(ptr0, len0);
|
|
995
|
-
return ret;
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
/**
|
|
999
|
-
* @param {string} payment_request
|
|
1000
|
-
* @param {string} token
|
|
1001
|
-
* @returns {Promise<any>}
|
|
1002
|
-
*/
|
|
1003
|
-
export function pay_invoice(payment_request, token) {
|
|
1004
|
-
const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
864
|
+
export function store(secret_key, name, data, force, metadata) {
|
|
865
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1005
866
|
const len0 = WASM_VECTOR_LEN;
|
|
1006
|
-
const ptr1 = passStringToWasm0(
|
|
867
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1007
868
|
const len1 = WASM_VECTOR_LEN;
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
* @param {string} payment_hash
|
|
1014
|
-
* @returns {Promise<any>}
|
|
1015
|
-
*/
|
|
1016
|
-
export function check_payment(payment_hash) {
|
|
1017
|
-
const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1018
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1019
|
-
const ret = wasm.check_payment(ptr0, len0);
|
|
1020
|
-
return ret;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
/**
|
|
1024
|
-
* @param {string} token
|
|
1025
|
-
* @param {string | null} [ln_address]
|
|
1026
|
-
* @returns {Promise<any>}
|
|
1027
|
-
*/
|
|
1028
|
-
export function swap_btc_ln(token, ln_address) {
|
|
1029
|
-
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1030
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1031
|
-
var ptr1 = isLikeNone(ln_address) ? 0 : passStringToWasm0(ln_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1032
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1033
|
-
const ret = wasm.swap_btc_ln(ptr0, len0, ptr1, len1);
|
|
869
|
+
const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
870
|
+
const len2 = WASM_VECTOR_LEN;
|
|
871
|
+
var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
|
|
872
|
+
var len3 = WASM_VECTOR_LEN;
|
|
873
|
+
const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
|
|
1034
874
|
return ret;
|
|
1035
875
|
}
|
|
1036
876
|
|
|
1037
877
|
/**
|
|
1038
|
-
* @param {string}
|
|
1039
|
-
* @param {
|
|
1040
|
-
* @param {string} token
|
|
878
|
+
* @param {string} secret_key
|
|
879
|
+
* @param {string} name
|
|
1041
880
|
* @returns {Promise<any>}
|
|
1042
881
|
*/
|
|
1043
|
-
export function
|
|
1044
|
-
const ptr0 = passStringToWasm0(
|
|
882
|
+
export function retrieve(secret_key, name) {
|
|
883
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1045
884
|
const len0 = WASM_VECTOR_LEN;
|
|
1046
|
-
const ptr1 = passStringToWasm0(
|
|
885
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1047
886
|
const len1 = WASM_VECTOR_LEN;
|
|
1048
|
-
const ret = wasm.
|
|
1049
|
-
return ret;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
/**
|
|
1053
|
-
* @param {string} sk
|
|
1054
|
-
* @param {number} fee_rate
|
|
1055
|
-
* @param {any} secrets
|
|
1056
|
-
* @param {boolean} broadcast
|
|
1057
|
-
* @param {bigint | null | undefined} fund_value
|
|
1058
|
-
* @param {boolean} coordinator_fee
|
|
1059
|
-
* @returns {Promise<any>}
|
|
1060
|
-
*/
|
|
1061
|
-
export function fund_rgb_vault(sk, fee_rate, secrets, broadcast, fund_value, coordinator_fee) {
|
|
1062
|
-
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1063
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1064
|
-
const ret = wasm.fund_rgb_vault(ptr0, len0, fee_rate, secrets, broadcast, !isLikeNone(fund_value), isLikeNone(fund_value) ? BigInt(0) : fund_value, coordinator_fee);
|
|
887
|
+
const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
|
|
1065
888
|
return ret;
|
|
1066
889
|
}
|
|
1067
890
|
|
|
1068
891
|
/**
|
|
1069
|
-
* @param {string}
|
|
1070
|
-
* @param {string}
|
|
1071
|
-
* @param {bigint} sats
|
|
1072
|
-
* @param {number} fee_rate
|
|
1073
|
-
* @param {any} secrets
|
|
892
|
+
* @param {string} secret_key
|
|
893
|
+
* @param {string} name
|
|
1074
894
|
* @returns {Promise<any>}
|
|
1075
895
|
*/
|
|
1076
|
-
export function
|
|
1077
|
-
const ptr0 = passStringToWasm0(
|
|
896
|
+
export function retrieve_metadata(secret_key, name) {
|
|
897
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1078
898
|
const len0 = WASM_VECTOR_LEN;
|
|
1079
|
-
const ptr1 = passStringToWasm0(
|
|
899
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1080
900
|
const len1 = WASM_VECTOR_LEN;
|
|
1081
|
-
const ret = wasm.
|
|
1082
|
-
return ret;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
/**
|
|
1086
|
-
* @param {string} sk
|
|
1087
|
-
* @returns {Promise<any>}
|
|
1088
|
-
*/
|
|
1089
|
-
export function get_btc_wallet(sk) {
|
|
1090
|
-
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1091
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1092
|
-
const ret = wasm.get_btc_wallet(ptr0, len0);
|
|
1093
|
-
return ret;
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
/**
|
|
1097
|
-
* @param {string} nostr_hex_sk
|
|
1098
|
-
* @returns {Promise<any>}
|
|
1099
|
-
*/
|
|
1100
|
-
export function backup_btc_data(nostr_hex_sk) {
|
|
1101
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1102
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1103
|
-
const ret = wasm.backup_btc_data(ptr0, len0);
|
|
901
|
+
const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
|
|
1104
902
|
return ret;
|
|
1105
903
|
}
|
|
1106
904
|
|
|
1107
905
|
/**
|
|
1108
|
-
* @param {
|
|
1109
|
-
* @
|
|
1110
|
-
* @param {string} recover_address
|
|
1111
|
-
* @returns {Promise<any>}
|
|
906
|
+
* @param {Uint8Array} bytes
|
|
907
|
+
* @returns {string}
|
|
1112
908
|
*/
|
|
1113
|
-
export function
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
909
|
+
export function encode_hex(bytes) {
|
|
910
|
+
let deferred2_0;
|
|
911
|
+
let deferred2_1;
|
|
912
|
+
try {
|
|
913
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
914
|
+
const len0 = WASM_VECTOR_LEN;
|
|
915
|
+
const ret = wasm.encode_hex(ptr0, len0);
|
|
916
|
+
deferred2_0 = ret[0];
|
|
917
|
+
deferred2_1 = ret[1];
|
|
918
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
919
|
+
} finally {
|
|
920
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
921
|
+
}
|
|
1122
922
|
}
|
|
1123
923
|
|
|
1124
924
|
/**
|
|
1125
|
-
* @param {
|
|
1126
|
-
* @returns {
|
|
925
|
+
* @param {Uint8Array} bytes
|
|
926
|
+
* @returns {string}
|
|
1127
927
|
*/
|
|
1128
|
-
export function
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
928
|
+
export function encode_base64(bytes) {
|
|
929
|
+
let deferred2_0;
|
|
930
|
+
let deferred2_1;
|
|
931
|
+
try {
|
|
932
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
933
|
+
const len0 = WASM_VECTOR_LEN;
|
|
934
|
+
const ret = wasm.encode_base64(ptr0, len0);
|
|
935
|
+
deferred2_0 = ret[0];
|
|
936
|
+
deferred2_1 = ret[1];
|
|
937
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
938
|
+
} finally {
|
|
939
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
940
|
+
}
|
|
1133
941
|
}
|
|
1134
942
|
|
|
943
|
+
function takeFromExternrefTable0(idx) {
|
|
944
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
945
|
+
wasm.__externref_table_dealloc(idx);
|
|
946
|
+
return value;
|
|
947
|
+
}
|
|
1135
948
|
/**
|
|
1136
|
-
* @param {string}
|
|
1137
|
-
* @
|
|
1138
|
-
* @returns {Promise<any>}
|
|
949
|
+
* @param {string} string
|
|
950
|
+
* @returns {Uint8Array}
|
|
1139
951
|
*/
|
|
1140
|
-
export function
|
|
1141
|
-
const ptr0 = passStringToWasm0(
|
|
952
|
+
export function decode_hex(string) {
|
|
953
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1142
954
|
const len0 = WASM_VECTOR_LEN;
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
955
|
+
const ret = wasm.decode_hex(ptr0, len0);
|
|
956
|
+
if (ret[3]) {
|
|
957
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
958
|
+
}
|
|
959
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
960
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
961
|
+
return v2;
|
|
1147
962
|
}
|
|
1148
963
|
|
|
1149
964
|
/**
|
|
1150
|
-
* @param {string}
|
|
1151
|
-
* @
|
|
1152
|
-
* @returns {Promise<any>}
|
|
965
|
+
* @param {string} string
|
|
966
|
+
* @returns {Uint8Array}
|
|
1153
967
|
*/
|
|
1154
|
-
export function
|
|
1155
|
-
const ptr0 = passStringToWasm0(
|
|
968
|
+
export function decode_base64(string) {
|
|
969
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1156
970
|
const len0 = WASM_VECTOR_LEN;
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
971
|
+
const ret = wasm.decode_base64(ptr0, len0);
|
|
972
|
+
if (ret[3]) {
|
|
973
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
974
|
+
}
|
|
975
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
976
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
977
|
+
return v2;
|
|
1161
978
|
}
|
|
1162
979
|
|
|
1163
980
|
/**
|
|
@@ -1410,6 +1227,89 @@ export function psbt_publish_file(request) {
|
|
|
1410
1227
|
return ret;
|
|
1411
1228
|
}
|
|
1412
1229
|
|
|
1230
|
+
/**
|
|
1231
|
+
* @param {string} sk
|
|
1232
|
+
* @param {number} fee_rate
|
|
1233
|
+
* @param {any} secrets
|
|
1234
|
+
* @param {boolean} broadcast
|
|
1235
|
+
* @param {bigint | null | undefined} fund_value
|
|
1236
|
+
* @param {boolean} coordinator_fee
|
|
1237
|
+
* @returns {Promise<any>}
|
|
1238
|
+
*/
|
|
1239
|
+
export function fund_rgb_vault(sk, fee_rate, secrets, broadcast, fund_value, coordinator_fee) {
|
|
1240
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1241
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1242
|
+
const ret = wasm.fund_rgb_vault(ptr0, len0, fee_rate, secrets, broadcast, !isLikeNone(fund_value), isLikeNone(fund_value) ? BigInt(0) : fund_value, coordinator_fee);
|
|
1243
|
+
return ret;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* @param {string} sk
|
|
1248
|
+
* @param {string} address
|
|
1249
|
+
* @param {bigint} sats
|
|
1250
|
+
* @param {number} fee_rate
|
|
1251
|
+
* @param {any} secrets
|
|
1252
|
+
* @returns {Promise<any>}
|
|
1253
|
+
*/
|
|
1254
|
+
export function transfer_sats(sk, address, sats, fee_rate, secrets) {
|
|
1255
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1257
|
+
const ptr1 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1258
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1259
|
+
const ret = wasm.transfer_sats(ptr0, len0, ptr1, len1, sats, fee_rate, secrets);
|
|
1260
|
+
return ret;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* @param {string} sk
|
|
1265
|
+
* @returns {Promise<any>}
|
|
1266
|
+
*/
|
|
1267
|
+
export function get_btc_wallet(sk) {
|
|
1268
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1269
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1270
|
+
const ret = wasm.get_btc_wallet(ptr0, len0);
|
|
1271
|
+
return ret;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* @param {string} nostr_hex_sk
|
|
1276
|
+
* @returns {Promise<any>}
|
|
1277
|
+
*/
|
|
1278
|
+
export function backup_btc_data(nostr_hex_sk) {
|
|
1279
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1280
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1281
|
+
const ret = wasm.backup_btc_data(ptr0, len0);
|
|
1282
|
+
return ret;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* @param {string} seed
|
|
1287
|
+
* @param {string} pass_phrase
|
|
1288
|
+
* @param {string} recover_address
|
|
1289
|
+
* @returns {Promise<any>}
|
|
1290
|
+
*/
|
|
1291
|
+
export function recover_funds_from_bad_wallets(seed, pass_phrase, recover_address) {
|
|
1292
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1293
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1294
|
+
const ptr1 = passStringToWasm0(pass_phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1295
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1296
|
+
const ptr2 = passStringToWasm0(recover_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1297
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1298
|
+
const ret = wasm.recover_funds_from_bad_wallets(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1299
|
+
return ret;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* @param {string} nostr_hex_sk
|
|
1304
|
+
* @returns {Promise<any>}
|
|
1305
|
+
*/
|
|
1306
|
+
export function restore_btc_data(nostr_hex_sk) {
|
|
1307
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1309
|
+
const ret = wasm.restore_btc_data(ptr0, len0);
|
|
1310
|
+
return ret;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1413
1313
|
/**
|
|
1414
1314
|
* @param {string} decimal
|
|
1415
1315
|
* @param {number} precision
|
|
@@ -1487,24 +1387,123 @@ export function version() {
|
|
|
1487
1387
|
return ret;
|
|
1488
1388
|
}
|
|
1489
1389
|
|
|
1390
|
+
/**
|
|
1391
|
+
* @param {string} nostr_hex_sk
|
|
1392
|
+
* @param {any} request
|
|
1393
|
+
* @returns {Promise<any>}
|
|
1394
|
+
*/
|
|
1395
|
+
export function create_watcher(nostr_hex_sk, request) {
|
|
1396
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1397
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1398
|
+
const ret = wasm.create_watcher(ptr0, len0, request);
|
|
1399
|
+
return ret;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* @param {string} nostr_hex_sk
|
|
1404
|
+
* @param {any} request
|
|
1405
|
+
* @returns {Promise<any>}
|
|
1406
|
+
*/
|
|
1407
|
+
export function recover_watcher(nostr_hex_sk, request) {
|
|
1408
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1409
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1410
|
+
const ret = wasm.recover_watcher(ptr0, len0, request);
|
|
1411
|
+
return ret;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
/**
|
|
1415
|
+
* @param {string} nostr_hex_sk
|
|
1416
|
+
* @returns {Promise<any>}
|
|
1417
|
+
*/
|
|
1418
|
+
export function destroy_watcher(nostr_hex_sk) {
|
|
1419
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1420
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1421
|
+
const ret = wasm.destroy_watcher(ptr0, len0);
|
|
1422
|
+
return ret;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
/**
|
|
1426
|
+
* @param {string} nostr_hex_sk
|
|
1427
|
+
* @returns {Promise<any>}
|
|
1428
|
+
*/
|
|
1429
|
+
export function destroy_recover_watcher(nostr_hex_sk) {
|
|
1430
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1431
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1432
|
+
const ret = wasm.destroy_recover_watcher(ptr0, len0);
|
|
1433
|
+
return ret;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* @param {string} nostr_hex_sk
|
|
1438
|
+
* @returns {Promise<any>}
|
|
1439
|
+
*/
|
|
1440
|
+
export function check_watcher(nostr_hex_sk) {
|
|
1441
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1442
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1443
|
+
const ret = wasm.check_watcher(ptr0, len0);
|
|
1444
|
+
return ret;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/**
|
|
1448
|
+
* @param {string} nostr_hex_sk
|
|
1449
|
+
* @param {string} request
|
|
1450
|
+
* @returns {Promise<any>}
|
|
1451
|
+
*/
|
|
1452
|
+
export function watcher_next_address(nostr_hex_sk, request) {
|
|
1453
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1454
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1455
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1456
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1457
|
+
const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
|
|
1458
|
+
return ret;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* @param {string} nostr_hex_sk
|
|
1463
|
+
* @param {string} request
|
|
1464
|
+
* @returns {Promise<any>}
|
|
1465
|
+
*/
|
|
1466
|
+
export function watcher_next_utxo(nostr_hex_sk, request) {
|
|
1467
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1468
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1469
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1470
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1471
|
+
const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
|
|
1472
|
+
return ret;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* @param {string} nostr_hex_sk
|
|
1477
|
+
* @param {string} request
|
|
1478
|
+
* @returns {Promise<any>}
|
|
1479
|
+
*/
|
|
1480
|
+
export function watcher_unspent_utxos(nostr_hex_sk, request) {
|
|
1481
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1482
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1483
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1484
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1485
|
+
const ret = wasm.watcher_unspent_utxos(ptr0, len0, ptr1, len1);
|
|
1486
|
+
return ret;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1490
1489
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
1491
|
-
wasm.
|
|
1490
|
+
wasm.closure1237_externref_shim(arg0, arg1, arg2);
|
|
1492
1491
|
}
|
|
1493
1492
|
|
|
1494
1493
|
function __wbg_adapter_57(arg0, arg1, arg2) {
|
|
1495
|
-
wasm.
|
|
1494
|
+
wasm.closure1999_externref_shim(arg0, arg1, arg2);
|
|
1496
1495
|
}
|
|
1497
1496
|
|
|
1498
1497
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
1499
|
-
wasm.
|
|
1498
|
+
wasm.closure2670_externref_shim(arg0, arg1, arg2);
|
|
1500
1499
|
}
|
|
1501
1500
|
|
|
1502
1501
|
function __wbg_adapter_63(arg0, arg1, arg2) {
|
|
1503
|
-
wasm.
|
|
1502
|
+
wasm.closure3841_externref_shim(arg0, arg1, arg2);
|
|
1504
1503
|
}
|
|
1505
1504
|
|
|
1506
|
-
function
|
|
1507
|
-
wasm.
|
|
1505
|
+
function __wbg_adapter_418(arg0, arg1, arg2, arg3) {
|
|
1506
|
+
wasm.closure4133_externref_shim(arg0, arg1, arg2, arg3);
|
|
1508
1507
|
}
|
|
1509
1508
|
|
|
1510
1509
|
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
@@ -1869,6 +1868,11 @@ function __wbg_get_imports() {
|
|
|
1869
1868
|
imports.wbg.__wbg_log_c222819a41e063d3 = function(arg0) {
|
|
1870
1869
|
console.log(arg0);
|
|
1871
1870
|
};
|
|
1871
|
+
imports.wbg.__wbg_log_c3d56bb0009edd6a = function(arg0, arg1) {
|
|
1872
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
1873
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
1874
|
+
console.log(...v0);
|
|
1875
|
+
};
|
|
1872
1876
|
imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
|
|
1873
1877
|
const ret = arg0.message;
|
|
1874
1878
|
return ret;
|
|
@@ -1900,7 +1904,7 @@ function __wbg_get_imports() {
|
|
|
1900
1904
|
const a = state0.a;
|
|
1901
1905
|
state0.a = 0;
|
|
1902
1906
|
try {
|
|
1903
|
-
return
|
|
1907
|
+
return __wbg_adapter_418(a, state0.b, arg0, arg1);
|
|
1904
1908
|
} finally {
|
|
1905
1909
|
state0.a = a;
|
|
1906
1910
|
}
|
|
@@ -2254,20 +2258,20 @@ function __wbg_get_imports() {
|
|
|
2254
2258
|
const ret = false;
|
|
2255
2259
|
return ret;
|
|
2256
2260
|
};
|
|
2257
|
-
imports.wbg.
|
|
2258
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2261
|
+
imports.wbg.__wbindgen_closure_wrapper11522 = function(arg0, arg1, arg2) {
|
|
2262
|
+
const ret = makeMutClosure(arg0, arg1, 2671, __wbg_adapter_60);
|
|
2259
2263
|
return ret;
|
|
2260
2264
|
};
|
|
2261
|
-
imports.wbg.
|
|
2262
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2265
|
+
imports.wbg.__wbindgen_closure_wrapper16047 = function(arg0, arg1, arg2) {
|
|
2266
|
+
const ret = makeMutClosure(arg0, arg1, 3842, __wbg_adapter_63);
|
|
2263
2267
|
return ret;
|
|
2264
2268
|
};
|
|
2265
|
-
imports.wbg.
|
|
2266
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2269
|
+
imports.wbg.__wbindgen_closure_wrapper5569 = function(arg0, arg1, arg2) {
|
|
2270
|
+
const ret = makeMutClosure(arg0, arg1, 1238, __wbg_adapter_54);
|
|
2267
2271
|
return ret;
|
|
2268
2272
|
};
|
|
2269
|
-
imports.wbg.
|
|
2270
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2273
|
+
imports.wbg.__wbindgen_closure_wrapper8091 = function(arg0, arg1, arg2) {
|
|
2274
|
+
const ret = makeMutClosure(arg0, arg1, 2000, __wbg_adapter_57);
|
|
2271
2275
|
return ret;
|
|
2272
2276
|
};
|
|
2273
2277
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|