bitmask-core 1.0.0-beta.8 → 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.d.ts +0 -11
- package/bitcoin.js +33 -27
- package/bitmask_core.d.ts +100 -100
- package/bitmask_core.js +637 -622
- package/bitmask_core_bg.js +1495 -1535
- package/bitmask_core_bg.wasm +0 -0
- package/bitmask_core_bg.wasm.d.ts +53 -53
- package/bp.d.ts +1 -1
- package/bp.js +19 -9
- 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 -332
- 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
|
@@ -214,285 +214,213 @@ function debugString(val) {
|
|
|
214
214
|
return className;
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
|
-
* @
|
|
218
|
-
* @returns {string}
|
|
217
|
+
* @returns {Promise<any>}
|
|
219
218
|
*/
|
|
220
|
-
export function
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
try {
|
|
224
|
-
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
225
|
-
const len0 = WASM_VECTOR_LEN;
|
|
226
|
-
const ret = wasm.hash_password(ptr0, len0);
|
|
227
|
-
deferred2_0 = ret[0];
|
|
228
|
-
deferred2_1 = ret[1];
|
|
229
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
230
|
-
} finally {
|
|
231
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
232
|
-
}
|
|
219
|
+
export function get_network() {
|
|
220
|
+
const ret = wasm.get_network();
|
|
221
|
+
return ret;
|
|
233
222
|
}
|
|
234
223
|
|
|
235
224
|
/**
|
|
236
|
-
* @param {string}
|
|
225
|
+
* @param {string} network_str
|
|
237
226
|
* @returns {Promise<any>}
|
|
238
227
|
*/
|
|
239
|
-
export function
|
|
240
|
-
const ptr0 = passStringToWasm0(
|
|
228
|
+
export function switch_network(network_str) {
|
|
229
|
+
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
241
230
|
const len0 = WASM_VECTOR_LEN;
|
|
242
|
-
const ret = wasm.
|
|
231
|
+
const ret = wasm.switch_network(ptr0, len0);
|
|
243
232
|
return ret;
|
|
244
233
|
}
|
|
245
234
|
|
|
246
235
|
/**
|
|
247
|
-
* @param {string}
|
|
248
|
-
* @param {string} password
|
|
236
|
+
* @param {string} key
|
|
249
237
|
* @returns {Promise<any>}
|
|
250
238
|
*/
|
|
251
|
-
export function
|
|
252
|
-
const ptr0 = passStringToWasm0(
|
|
239
|
+
export function get_env(key) {
|
|
240
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
253
241
|
const len0 = WASM_VECTOR_LEN;
|
|
254
|
-
const
|
|
255
|
-
const len1 = WASM_VECTOR_LEN;
|
|
256
|
-
const ret = wasm.save_mnemonic(ptr0, len0, ptr1, len1);
|
|
242
|
+
const ret = wasm.get_env(ptr0, len0);
|
|
257
243
|
return ret;
|
|
258
244
|
}
|
|
259
245
|
|
|
260
246
|
/**
|
|
261
|
-
* @param {string}
|
|
262
|
-
* @param {string}
|
|
263
|
-
* @param {string} seed_password
|
|
247
|
+
* @param {string} key
|
|
248
|
+
* @param {string} value
|
|
264
249
|
* @returns {Promise<any>}
|
|
265
250
|
*/
|
|
266
|
-
export function
|
|
267
|
-
const ptr0 = passStringToWasm0(
|
|
251
|
+
export function set_env(key, value) {
|
|
252
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
268
253
|
const len0 = WASM_VECTOR_LEN;
|
|
269
|
-
const ptr1 = passStringToWasm0(
|
|
254
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
270
255
|
const len1 = WASM_VECTOR_LEN;
|
|
271
|
-
const
|
|
272
|
-
const len2 = WASM_VECTOR_LEN;
|
|
273
|
-
const ret = wasm.decrypt_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
256
|
+
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
274
257
|
return ret;
|
|
275
258
|
}
|
|
276
259
|
|
|
277
260
|
/**
|
|
278
|
-
* @param {
|
|
279
|
-
* @param {string} encrypted_descriptors
|
|
280
|
-
* @param {string} seed_password
|
|
261
|
+
* @param {number} ms
|
|
281
262
|
* @returns {Promise<any>}
|
|
282
263
|
*/
|
|
283
|
-
export function
|
|
284
|
-
const
|
|
285
|
-
const len0 = WASM_VECTOR_LEN;
|
|
286
|
-
const ptr1 = passStringToWasm0(encrypted_descriptors, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
287
|
-
const len1 = WASM_VECTOR_LEN;
|
|
288
|
-
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
289
|
-
const len2 = WASM_VECTOR_LEN;
|
|
290
|
-
const ret = wasm.upgrade_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
264
|
+
export function sleep(ms) {
|
|
265
|
+
const ret = wasm.sleep(ms);
|
|
291
266
|
return ret;
|
|
292
267
|
}
|
|
293
268
|
|
|
294
269
|
/**
|
|
295
|
-
* @param {string}
|
|
296
|
-
* @param {string}
|
|
270
|
+
* @param {string} username
|
|
271
|
+
* @param {string} password
|
|
297
272
|
* @returns {Promise<any>}
|
|
298
273
|
*/
|
|
299
|
-
export function
|
|
300
|
-
const ptr0 = passStringToWasm0(
|
|
274
|
+
export function create_wallet(username, password) {
|
|
275
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
301
276
|
const len0 = WASM_VECTOR_LEN;
|
|
302
|
-
const ptr1 = passStringToWasm0(
|
|
277
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
303
278
|
const len1 = WASM_VECTOR_LEN;
|
|
304
|
-
const ret = wasm.
|
|
279
|
+
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
305
280
|
return ret;
|
|
306
281
|
}
|
|
307
282
|
|
|
308
283
|
/**
|
|
309
|
-
* @param {string}
|
|
310
|
-
* @param {string}
|
|
311
|
-
* @param {string} seed_password
|
|
284
|
+
* @param {string} username
|
|
285
|
+
* @param {string} password
|
|
312
286
|
* @returns {Promise<any>}
|
|
313
287
|
*/
|
|
314
|
-
export function
|
|
315
|
-
const ptr0 = passStringToWasm0(
|
|
288
|
+
export function auth(username, password) {
|
|
289
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
316
290
|
const len0 = WASM_VECTOR_LEN;
|
|
317
|
-
const ptr1 = passStringToWasm0(
|
|
291
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
318
292
|
const len1 = WASM_VECTOR_LEN;
|
|
319
|
-
const
|
|
320
|
-
const len2 = WASM_VECTOR_LEN;
|
|
321
|
-
const ret = wasm.encrypt_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
293
|
+
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
322
294
|
return ret;
|
|
323
295
|
}
|
|
324
296
|
|
|
325
297
|
/**
|
|
326
|
-
* @param {string}
|
|
327
|
-
* @param {
|
|
298
|
+
* @param {string} description
|
|
299
|
+
* @param {number} amount
|
|
300
|
+
* @param {string} token
|
|
328
301
|
* @returns {Promise<any>}
|
|
329
302
|
*/
|
|
330
|
-
export function
|
|
331
|
-
const ptr0 = passStringToWasm0(
|
|
303
|
+
export function ln_create_invoice(description, amount, token) {
|
|
304
|
+
const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
332
305
|
const len0 = WASM_VECTOR_LEN;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
const ret = wasm.
|
|
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);
|
|
336
309
|
return ret;
|
|
337
310
|
}
|
|
338
311
|
|
|
339
312
|
/**
|
|
313
|
+
* @param {string} token
|
|
340
314
|
* @returns {Promise<any>}
|
|
341
315
|
*/
|
|
342
|
-
export function
|
|
343
|
-
const
|
|
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);
|
|
344
320
|
return ret;
|
|
345
321
|
}
|
|
346
322
|
|
|
347
323
|
/**
|
|
348
|
-
* @param {string}
|
|
349
|
-
* @param {string | null} [change_descriptor]
|
|
324
|
+
* @param {string} token
|
|
350
325
|
* @returns {Promise<any>}
|
|
351
326
|
*/
|
|
352
|
-
export function
|
|
353
|
-
const ptr0 = passStringToWasm0(
|
|
327
|
+
export function get_txs(token) {
|
|
328
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
354
329
|
const len0 = WASM_VECTOR_LEN;
|
|
355
|
-
|
|
356
|
-
var len1 = WASM_VECTOR_LEN;
|
|
357
|
-
const ret = wasm.get_new_address(ptr0, len0, ptr1, len1);
|
|
330
|
+
const ret = wasm.get_txs(ptr0, len0);
|
|
358
331
|
return ret;
|
|
359
332
|
}
|
|
360
333
|
|
|
361
334
|
/**
|
|
362
|
-
* @param {string}
|
|
363
|
-
* @param {string}
|
|
364
|
-
* @param {string} destination
|
|
365
|
-
* @param {bigint} amount
|
|
366
|
-
* @param {boolean} broadcast
|
|
367
|
-
* @param {number | null} [fee_rate]
|
|
335
|
+
* @param {string} payment_request
|
|
336
|
+
* @param {string} token
|
|
368
337
|
* @returns {Promise<any>}
|
|
369
338
|
*/
|
|
370
|
-
export function
|
|
371
|
-
const ptr0 = passStringToWasm0(
|
|
339
|
+
export function pay_invoice(payment_request, token) {
|
|
340
|
+
const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
372
341
|
const len0 = WASM_VECTOR_LEN;
|
|
373
|
-
const ptr1 = passStringToWasm0(
|
|
342
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
374
343
|
const len1 = WASM_VECTOR_LEN;
|
|
375
|
-
const
|
|
376
|
-
const len2 = WASM_VECTOR_LEN;
|
|
377
|
-
const ret = wasm.send_sats(ptr0, len0, ptr1, len1, ptr2, len2, amount, broadcast, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
344
|
+
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
378
345
|
return ret;
|
|
379
346
|
}
|
|
380
347
|
|
|
381
348
|
/**
|
|
382
|
-
* @param {string}
|
|
383
|
-
* @param {string} change_descriptor
|
|
384
|
-
* @param {string} rgb_address
|
|
385
|
-
* @param {boolean} broadcast
|
|
386
|
-
* @param {number | null} [fee_rate]
|
|
349
|
+
* @param {string} payment_hash
|
|
387
350
|
* @returns {Promise<any>}
|
|
388
351
|
*/
|
|
389
|
-
export function
|
|
390
|
-
const ptr0 = passStringToWasm0(
|
|
352
|
+
export function check_payment(payment_hash) {
|
|
353
|
+
const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
391
354
|
const len0 = WASM_VECTOR_LEN;
|
|
392
|
-
const
|
|
393
|
-
const len1 = WASM_VECTOR_LEN;
|
|
394
|
-
const ptr2 = passStringToWasm0(rgb_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
395
|
-
const len2 = WASM_VECTOR_LEN;
|
|
396
|
-
const ret = wasm.fund_vault(ptr0, len0, ptr1, len1, ptr2, len2, broadcast, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
355
|
+
const ret = wasm.check_payment(ptr0, len0);
|
|
397
356
|
return ret;
|
|
398
357
|
}
|
|
399
358
|
|
|
400
359
|
/**
|
|
401
|
-
* @param {string}
|
|
360
|
+
* @param {string} token
|
|
361
|
+
* @param {string | null} [ln_address]
|
|
402
362
|
* @returns {Promise<any>}
|
|
403
363
|
*/
|
|
404
|
-
export function
|
|
405
|
-
const ptr0 = passStringToWasm0(
|
|
364
|
+
export function swap_btc_ln(token, ln_address) {
|
|
365
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
406
366
|
const len0 = WASM_VECTOR_LEN;
|
|
407
|
-
|
|
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);
|
|
408
370
|
return ret;
|
|
409
371
|
}
|
|
410
372
|
|
|
411
373
|
/**
|
|
412
|
-
* @param {string}
|
|
413
|
-
* @param {
|
|
414
|
-
* @param {string
|
|
415
|
-
* @param {number | null} [fee_rate]
|
|
374
|
+
* @param {string} address
|
|
375
|
+
* @param {bigint} amount
|
|
376
|
+
* @param {string} token
|
|
416
377
|
* @returns {Promise<any>}
|
|
417
378
|
*/
|
|
418
|
-
export function
|
|
419
|
-
const ptr0 = passStringToWasm0(
|
|
379
|
+
export function swap_ln_btc(address, amount, token) {
|
|
380
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
420
381
|
const len0 = WASM_VECTOR_LEN;
|
|
421
|
-
const ptr1 = passStringToWasm0(
|
|
382
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
422
383
|
const len1 = WASM_VECTOR_LEN;
|
|
423
|
-
|
|
424
|
-
var len2 = WASM_VECTOR_LEN;
|
|
425
|
-
const ret = wasm.drain_wallet(ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
384
|
+
const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
|
|
426
385
|
return ret;
|
|
427
386
|
}
|
|
428
387
|
|
|
429
388
|
/**
|
|
430
|
-
* @param {string}
|
|
431
|
-
* @param {
|
|
432
|
-
* @param {string} descriptor
|
|
433
|
-
* @param {string | null | undefined} change_descriptor
|
|
434
|
-
* @param {boolean} broadcast
|
|
389
|
+
* @param {string} pubkey
|
|
390
|
+
* @param {string} token
|
|
435
391
|
* @returns {Promise<any>}
|
|
436
392
|
*/
|
|
437
|
-
export function
|
|
438
|
-
const ptr0 = passStringToWasm0(
|
|
393
|
+
export function new_nostr_pubkey(pubkey, token) {
|
|
394
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
439
395
|
const len0 = WASM_VECTOR_LEN;
|
|
440
|
-
const ptr1 = passStringToWasm0(
|
|
396
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
441
397
|
const len1 = WASM_VECTOR_LEN;
|
|
442
|
-
|
|
443
|
-
var len2 = WASM_VECTOR_LEN;
|
|
444
|
-
const ret = wasm.bump_fee(ptr0, len0, fee_rate, ptr1, len1, ptr2, len2, broadcast);
|
|
445
|
-
return ret;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* @param {any} request
|
|
450
|
-
* @returns {Promise<any>}
|
|
451
|
-
*/
|
|
452
|
-
export function psbt_sign_and_publish_file(request) {
|
|
453
|
-
const ret = wasm.psbt_sign_and_publish_file(request);
|
|
398
|
+
const ret = wasm.new_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
454
399
|
return ret;
|
|
455
400
|
}
|
|
456
401
|
|
|
457
402
|
/**
|
|
458
|
-
* @param {
|
|
403
|
+
* @param {string} pubkey
|
|
404
|
+
* @param {string} token
|
|
459
405
|
* @returns {Promise<any>}
|
|
460
406
|
*/
|
|
461
|
-
export function
|
|
462
|
-
const
|
|
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);
|
|
463
413
|
return ret;
|
|
464
414
|
}
|
|
465
415
|
|
|
466
416
|
/**
|
|
467
|
-
* @param {string} decimal
|
|
468
|
-
* @param {number} precision
|
|
469
|
-
* @returns {string}
|
|
470
|
-
*/
|
|
471
|
-
export function convert_contract_amount_raw(decimal, precision) {
|
|
472
|
-
let deferred2_0;
|
|
473
|
-
let deferred2_1;
|
|
474
|
-
try {
|
|
475
|
-
const ptr0 = passStringToWasm0(decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
476
|
-
const len0 = WASM_VECTOR_LEN;
|
|
477
|
-
const ret = wasm.convert_contract_amount_raw(ptr0, len0, precision);
|
|
478
|
-
deferred2_0 = ret[0];
|
|
479
|
-
deferred2_1 = ret[1];
|
|
480
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
481
|
-
} finally {
|
|
482
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* @param {bigint} amount
|
|
488
|
-
* @param {number} precision
|
|
489
417
|
* @returns {string}
|
|
490
418
|
*/
|
|
491
|
-
export function
|
|
419
|
+
export function get_rgb_version() {
|
|
492
420
|
let deferred1_0;
|
|
493
421
|
let deferred1_1;
|
|
494
422
|
try {
|
|
495
|
-
const ret = wasm.
|
|
423
|
+
const ret = wasm.get_rgb_version();
|
|
496
424
|
deferred1_0 = ret[0];
|
|
497
425
|
deferred1_1 = ret[1];
|
|
498
426
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -502,189 +430,174 @@ export function convert_contract_amount_string(amount, precision) {
|
|
|
502
430
|
}
|
|
503
431
|
|
|
504
432
|
/**
|
|
505
|
-
* @param {string}
|
|
506
|
-
* @returns {any}
|
|
433
|
+
* @param {string} nostr_hex_sk
|
|
434
|
+
* @returns {Promise<any>}
|
|
507
435
|
*/
|
|
508
|
-
export function
|
|
509
|
-
const ptr0 = passStringToWasm0(
|
|
436
|
+
export function get_rgb_wallet(nostr_hex_sk) {
|
|
437
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
510
438
|
const len0 = WASM_VECTOR_LEN;
|
|
511
|
-
const ret = wasm.
|
|
439
|
+
const ret = wasm.get_rgb_wallet(ptr0, len0);
|
|
512
440
|
return ret;
|
|
513
441
|
}
|
|
514
442
|
|
|
515
443
|
/**
|
|
516
|
-
* @param {string}
|
|
517
|
-
* @param {
|
|
518
|
-
* @returns {
|
|
519
|
-
*/
|
|
520
|
-
export function parse_contract_amount_precision(amount, precision) {
|
|
521
|
-
let deferred2_0;
|
|
522
|
-
let deferred2_1;
|
|
523
|
-
try {
|
|
524
|
-
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
525
|
-
const len0 = WASM_VECTOR_LEN;
|
|
526
|
-
const ret = wasm.parse_contract_amount_precision(ptr0, len0, precision);
|
|
527
|
-
deferred2_0 = ret[0];
|
|
528
|
-
deferred2_1 = ret[1];
|
|
529
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
530
|
-
} finally {
|
|
531
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* @returns {any}
|
|
444
|
+
* @param {string} nostr_hex_sk
|
|
445
|
+
* @param {string} request
|
|
446
|
+
* @returns {Promise<any>}
|
|
537
447
|
*/
|
|
538
|
-
export function
|
|
539
|
-
const
|
|
448
|
+
export function get_contract(nostr_hex_sk, request) {
|
|
449
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
450
|
+
const len0 = WASM_VECTOR_LEN;
|
|
451
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
452
|
+
const len1 = WASM_VECTOR_LEN;
|
|
453
|
+
const ret = wasm.get_contract(ptr0, len0, ptr1, len1);
|
|
540
454
|
return ret;
|
|
541
455
|
}
|
|
542
456
|
|
|
543
457
|
/**
|
|
458
|
+
* @param {string} nostr_hex_sk
|
|
459
|
+
* @param {boolean} arg1
|
|
544
460
|
* @returns {Promise<any>}
|
|
545
461
|
*/
|
|
546
|
-
export function
|
|
547
|
-
const
|
|
462
|
+
export function list_contracts(nostr_hex_sk, arg1) {
|
|
463
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
464
|
+
const len0 = WASM_VECTOR_LEN;
|
|
465
|
+
const ret = wasm.list_contracts(ptr0, len0, arg1);
|
|
548
466
|
return ret;
|
|
549
467
|
}
|
|
550
468
|
|
|
551
469
|
/**
|
|
552
|
-
* @param {string}
|
|
470
|
+
* @param {string} nostr_hex_sk
|
|
471
|
+
* @param {string} request
|
|
553
472
|
* @returns {Promise<any>}
|
|
554
473
|
*/
|
|
555
|
-
export function
|
|
556
|
-
const ptr0 = passStringToWasm0(
|
|
474
|
+
export function import_contract(nostr_hex_sk, request) {
|
|
475
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
557
476
|
const len0 = WASM_VECTOR_LEN;
|
|
558
|
-
const
|
|
477
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
478
|
+
const len1 = WASM_VECTOR_LEN;
|
|
479
|
+
const ret = wasm.import_contract(ptr0, len0, ptr1, len1);
|
|
559
480
|
return ret;
|
|
560
481
|
}
|
|
561
482
|
|
|
562
483
|
/**
|
|
563
|
-
* @param {string}
|
|
484
|
+
* @param {string} nostr_hex_sk
|
|
485
|
+
* @param {any} request
|
|
564
486
|
* @returns {Promise<any>}
|
|
565
487
|
*/
|
|
566
|
-
export function
|
|
567
|
-
const ptr0 = passStringToWasm0(
|
|
488
|
+
export function issue_contract(nostr_hex_sk, request) {
|
|
489
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
568
490
|
const len0 = WASM_VECTOR_LEN;
|
|
569
|
-
const ret = wasm.
|
|
491
|
+
const ret = wasm.issue_contract(ptr0, len0, request);
|
|
570
492
|
return ret;
|
|
571
493
|
}
|
|
572
494
|
|
|
573
495
|
/**
|
|
574
|
-
* @param {string}
|
|
575
|
-
* @param {
|
|
496
|
+
* @param {string} nostr_hex_sk
|
|
497
|
+
* @param {any} request
|
|
576
498
|
* @returns {Promise<any>}
|
|
577
499
|
*/
|
|
578
|
-
export function
|
|
579
|
-
const ptr0 = passStringToWasm0(
|
|
500
|
+
export function issue_contract_proxy(nostr_hex_sk, request) {
|
|
501
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
580
502
|
const len0 = WASM_VECTOR_LEN;
|
|
581
|
-
const
|
|
582
|
-
const len1 = WASM_VECTOR_LEN;
|
|
583
|
-
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
503
|
+
const ret = wasm.issue_contract_proxy(ptr0, len0, request);
|
|
584
504
|
return ret;
|
|
585
505
|
}
|
|
586
506
|
|
|
587
507
|
/**
|
|
588
|
-
* @param {
|
|
508
|
+
* @param {string} nostr_hex_sk
|
|
509
|
+
* @param {any} request
|
|
589
510
|
* @returns {Promise<any>}
|
|
590
511
|
*/
|
|
591
|
-
export function
|
|
592
|
-
const
|
|
512
|
+
export function create_rgb_invoice(nostr_hex_sk, request) {
|
|
513
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
514
|
+
const len0 = WASM_VECTOR_LEN;
|
|
515
|
+
const ret = wasm.create_rgb_invoice(ptr0, len0, request);
|
|
593
516
|
return ret;
|
|
594
517
|
}
|
|
595
518
|
|
|
596
519
|
/**
|
|
597
|
-
* @param {string}
|
|
598
|
-
* @param {
|
|
599
|
-
* @param {any} secrets
|
|
600
|
-
* @param {boolean} broadcast
|
|
601
|
-
* @param {bigint | null | undefined} fund_value
|
|
602
|
-
* @param {boolean} onetime_fee
|
|
520
|
+
* @param {string} nostr_hex_sk
|
|
521
|
+
* @param {string} request
|
|
603
522
|
* @returns {Promise<any>}
|
|
604
523
|
*/
|
|
605
|
-
export function
|
|
606
|
-
const ptr0 = passStringToWasm0(
|
|
524
|
+
export function remove_rgb_invoice(nostr_hex_sk, request) {
|
|
525
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
607
526
|
const len0 = WASM_VECTOR_LEN;
|
|
608
|
-
const
|
|
527
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
528
|
+
const len1 = WASM_VECTOR_LEN;
|
|
529
|
+
const ret = wasm.remove_rgb_invoice(ptr0, len0, ptr1, len1);
|
|
609
530
|
return ret;
|
|
610
531
|
}
|
|
611
532
|
|
|
612
533
|
/**
|
|
613
|
-
* @param {string}
|
|
614
|
-
* @param {string} address
|
|
615
|
-
* @param {bigint} sats
|
|
616
|
-
* @param {number} fee_rate
|
|
617
|
-
* @param {any} secrets
|
|
534
|
+
* @param {string} nostr_hex_sk
|
|
618
535
|
* @returns {Promise<any>}
|
|
619
536
|
*/
|
|
620
|
-
export function
|
|
621
|
-
const ptr0 = passStringToWasm0(
|
|
537
|
+
export function list_rgb_invoices(nostr_hex_sk) {
|
|
538
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
622
539
|
const len0 = WASM_VECTOR_LEN;
|
|
623
|
-
const
|
|
624
|
-
const len1 = WASM_VECTOR_LEN;
|
|
625
|
-
const ret = wasm.transfer_sats(ptr0, len0, ptr1, len1, sats, fee_rate, secrets);
|
|
540
|
+
const ret = wasm.list_rgb_invoices(ptr0, len0);
|
|
626
541
|
return ret;
|
|
627
542
|
}
|
|
628
543
|
|
|
629
544
|
/**
|
|
630
|
-
* @param {string}
|
|
545
|
+
* @param {string} invoice
|
|
631
546
|
* @returns {Promise<any>}
|
|
632
547
|
*/
|
|
633
|
-
export function
|
|
634
|
-
const ptr0 = passStringToWasm0(
|
|
548
|
+
export function decode_rgb_invoice(invoice) {
|
|
549
|
+
const ptr0 = passStringToWasm0(invoice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
635
550
|
const len0 = WASM_VECTOR_LEN;
|
|
636
|
-
const ret = wasm.
|
|
551
|
+
const ret = wasm.decode_rgb_invoice(ptr0, len0);
|
|
637
552
|
return ret;
|
|
638
553
|
}
|
|
639
554
|
|
|
640
555
|
/**
|
|
641
556
|
* @param {string} nostr_hex_sk
|
|
557
|
+
* @param {any} request
|
|
642
558
|
* @returns {Promise<any>}
|
|
643
559
|
*/
|
|
644
|
-
export function
|
|
560
|
+
export function can_create_transfer_contract(nostr_hex_sk, request) {
|
|
645
561
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
646
562
|
const len0 = WASM_VECTOR_LEN;
|
|
647
|
-
const ret = wasm.
|
|
563
|
+
const ret = wasm.can_create_transfer_contract(ptr0, len0, request);
|
|
648
564
|
return ret;
|
|
649
565
|
}
|
|
650
566
|
|
|
651
567
|
/**
|
|
652
|
-
* @param {string}
|
|
653
|
-
* @param {
|
|
654
|
-
* @param {string} recover_address
|
|
568
|
+
* @param {string} nostr_hex_sk
|
|
569
|
+
* @param {any} request
|
|
655
570
|
* @returns {Promise<any>}
|
|
656
571
|
*/
|
|
657
|
-
export function
|
|
658
|
-
const ptr0 = passStringToWasm0(
|
|
572
|
+
export function create_rgb_transfer(nostr_hex_sk, request) {
|
|
573
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
659
574
|
const len0 = WASM_VECTOR_LEN;
|
|
660
|
-
const
|
|
661
|
-
const len1 = WASM_VECTOR_LEN;
|
|
662
|
-
const ptr2 = passStringToWasm0(recover_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
663
|
-
const len2 = WASM_VECTOR_LEN;
|
|
664
|
-
const ret = wasm.recover_funds_from_bad_wallets(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
575
|
+
const ret = wasm.create_rgb_transfer(ptr0, len0, request);
|
|
665
576
|
return ret;
|
|
666
577
|
}
|
|
667
578
|
|
|
668
579
|
/**
|
|
669
580
|
* @param {string} nostr_hex_sk
|
|
581
|
+
* @param {any} request
|
|
582
|
+
* @param {any} secrets
|
|
670
583
|
* @returns {Promise<any>}
|
|
671
584
|
*/
|
|
672
|
-
export function
|
|
585
|
+
export function create_and_publish_rgb_transfer(nostr_hex_sk, request, secrets) {
|
|
673
586
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
674
587
|
const len0 = WASM_VECTOR_LEN;
|
|
675
|
-
const ret = wasm.
|
|
588
|
+
const ret = wasm.create_and_publish_rgb_transfer(ptr0, len0, request, secrets);
|
|
676
589
|
return ret;
|
|
677
590
|
}
|
|
678
591
|
|
|
679
592
|
/**
|
|
680
|
-
* @param {string}
|
|
593
|
+
* @param {string} _nostr_hex_sk
|
|
681
594
|
* @param {any} request
|
|
682
595
|
* @returns {Promise<any>}
|
|
683
596
|
*/
|
|
684
|
-
export function
|
|
685
|
-
const ptr0 = passStringToWasm0(
|
|
597
|
+
export function psbt_sign_file(_nostr_hex_sk, request) {
|
|
598
|
+
const ptr0 = passStringToWasm0(_nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
686
599
|
const len0 = WASM_VECTOR_LEN;
|
|
687
|
-
const ret = wasm.
|
|
600
|
+
const ret = wasm.psbt_sign_file(ptr0, len0, request);
|
|
688
601
|
return ret;
|
|
689
602
|
}
|
|
690
603
|
|
|
@@ -693,21 +606,22 @@ export function create_watcher(nostr_hex_sk, request) {
|
|
|
693
606
|
* @param {any} request
|
|
694
607
|
* @returns {Promise<any>}
|
|
695
608
|
*/
|
|
696
|
-
export function
|
|
609
|
+
export function accept_transfer(nostr_hex_sk, request) {
|
|
697
610
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
698
611
|
const len0 = WASM_VECTOR_LEN;
|
|
699
|
-
const ret = wasm.
|
|
612
|
+
const ret = wasm.accept_transfer(ptr0, len0, request);
|
|
700
613
|
return ret;
|
|
701
614
|
}
|
|
702
615
|
|
|
703
616
|
/**
|
|
704
617
|
* @param {string} nostr_hex_sk
|
|
618
|
+
* @param {any} request
|
|
705
619
|
* @returns {Promise<any>}
|
|
706
620
|
*/
|
|
707
|
-
export function
|
|
621
|
+
export function save_transfer(nostr_hex_sk, request) {
|
|
708
622
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
709
623
|
const len0 = WASM_VECTOR_LEN;
|
|
710
|
-
const ret = wasm.
|
|
624
|
+
const ret = wasm.save_transfer(ptr0, len0, request);
|
|
711
625
|
return ret;
|
|
712
626
|
}
|
|
713
627
|
|
|
@@ -715,10 +629,10 @@ export function destroy_watcher(nostr_hex_sk) {
|
|
|
715
629
|
* @param {string} nostr_hex_sk
|
|
716
630
|
* @returns {Promise<any>}
|
|
717
631
|
*/
|
|
718
|
-
export function
|
|
632
|
+
export function list_transfers(nostr_hex_sk) {
|
|
719
633
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
720
634
|
const len0 = WASM_VECTOR_LEN;
|
|
721
|
-
const ret = wasm.
|
|
635
|
+
const ret = wasm.list_transfers(ptr0, len0);
|
|
722
636
|
return ret;
|
|
723
637
|
}
|
|
724
638
|
|
|
@@ -726,119 +640,97 @@ export function destroy_recover_watcher(nostr_hex_sk) {
|
|
|
726
640
|
* @param {string} nostr_hex_sk
|
|
727
641
|
* @returns {Promise<any>}
|
|
728
642
|
*/
|
|
729
|
-
export function
|
|
643
|
+
export function verify_transfers(nostr_hex_sk) {
|
|
730
644
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
731
645
|
const len0 = WASM_VECTOR_LEN;
|
|
732
|
-
const ret = wasm.
|
|
646
|
+
const ret = wasm.verify_transfers(ptr0, len0);
|
|
733
647
|
return ret;
|
|
734
648
|
}
|
|
735
649
|
|
|
736
650
|
/**
|
|
737
651
|
* @param {string} nostr_hex_sk
|
|
738
|
-
* @param {string} request
|
|
739
652
|
* @returns {Promise<any>}
|
|
740
653
|
*/
|
|
741
|
-
export function
|
|
654
|
+
export function list_offers(nostr_hex_sk) {
|
|
742
655
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
743
656
|
const len0 = WASM_VECTOR_LEN;
|
|
744
|
-
const
|
|
745
|
-
const len1 = WASM_VECTOR_LEN;
|
|
746
|
-
const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
|
|
657
|
+
const ret = wasm.list_offers(ptr0, len0);
|
|
747
658
|
return ret;
|
|
748
659
|
}
|
|
749
660
|
|
|
750
661
|
/**
|
|
751
662
|
* @param {string} nostr_hex_sk
|
|
752
|
-
* @param {string} request
|
|
753
663
|
* @returns {Promise<any>}
|
|
754
664
|
*/
|
|
755
|
-
export function
|
|
665
|
+
export function offers(nostr_hex_sk) {
|
|
756
666
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
757
667
|
const len0 = WASM_VECTOR_LEN;
|
|
758
|
-
const
|
|
759
|
-
const len1 = WASM_VECTOR_LEN;
|
|
760
|
-
const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
|
|
668
|
+
const ret = wasm.offers(ptr0, len0);
|
|
761
669
|
return ret;
|
|
762
670
|
}
|
|
763
671
|
|
|
764
672
|
/**
|
|
765
673
|
* @param {string} nostr_hex_sk
|
|
766
|
-
* @param {string} request
|
|
767
674
|
* @returns {Promise<any>}
|
|
768
675
|
*/
|
|
769
|
-
export function
|
|
676
|
+
export function bids(nostr_hex_sk) {
|
|
770
677
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
771
678
|
const len0 = WASM_VECTOR_LEN;
|
|
772
|
-
const
|
|
773
|
-
const len1 = WASM_VECTOR_LEN;
|
|
774
|
-
const ret = wasm.watcher_unspent_utxos(ptr0, len0, ptr1, len1);
|
|
679
|
+
const ret = wasm.bids(ptr0, len0);
|
|
775
680
|
return ret;
|
|
776
681
|
}
|
|
777
682
|
|
|
778
|
-
/**
|
|
779
|
-
* @returns {string}
|
|
780
|
-
*/
|
|
781
|
-
export function get_rgb_version() {
|
|
782
|
-
let deferred1_0;
|
|
783
|
-
let deferred1_1;
|
|
784
|
-
try {
|
|
785
|
-
const ret = wasm.get_rgb_version();
|
|
786
|
-
deferred1_0 = ret[0];
|
|
787
|
-
deferred1_1 = ret[1];
|
|
788
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
789
|
-
} finally {
|
|
790
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
|
|
794
683
|
/**
|
|
795
684
|
* @param {string} nostr_hex_sk
|
|
685
|
+
* @param {string} offer_id
|
|
796
686
|
* @returns {Promise<any>}
|
|
797
687
|
*/
|
|
798
|
-
export function
|
|
688
|
+
export function offer_swap_suppl(nostr_hex_sk, offer_id) {
|
|
799
689
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
800
690
|
const len0 = WASM_VECTOR_LEN;
|
|
801
|
-
const
|
|
691
|
+
const ptr1 = passStringToWasm0(offer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
692
|
+
const len1 = WASM_VECTOR_LEN;
|
|
693
|
+
const ret = wasm.offer_swap_suppl(ptr0, len0, ptr1, len1);
|
|
802
694
|
return ret;
|
|
803
695
|
}
|
|
804
696
|
|
|
805
697
|
/**
|
|
806
698
|
* @param {string} nostr_hex_sk
|
|
807
|
-
* @param {string}
|
|
699
|
+
* @param {string} bid_id
|
|
808
700
|
* @returns {Promise<any>}
|
|
809
701
|
*/
|
|
810
|
-
export function
|
|
702
|
+
export function bid_swap_suppl(nostr_hex_sk, bid_id) {
|
|
811
703
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
812
704
|
const len0 = WASM_VECTOR_LEN;
|
|
813
|
-
const ptr1 = passStringToWasm0(
|
|
705
|
+
const ptr1 = passStringToWasm0(bid_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
814
706
|
const len1 = WASM_VECTOR_LEN;
|
|
815
|
-
const ret = wasm.
|
|
707
|
+
const ret = wasm.bid_swap_suppl(ptr0, len0, ptr1, len1);
|
|
816
708
|
return ret;
|
|
817
709
|
}
|
|
818
710
|
|
|
819
711
|
/**
|
|
820
712
|
* @param {string} nostr_hex_sk
|
|
821
|
-
* @param {
|
|
713
|
+
* @param {any} request
|
|
714
|
+
* @param {any} secrets
|
|
822
715
|
* @returns {Promise<any>}
|
|
823
716
|
*/
|
|
824
|
-
export function
|
|
717
|
+
export function can_create_offer(nostr_hex_sk, request, secrets) {
|
|
825
718
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
826
719
|
const len0 = WASM_VECTOR_LEN;
|
|
827
|
-
const ret = wasm.
|
|
720
|
+
const ret = wasm.can_create_offer(ptr0, len0, request, secrets);
|
|
828
721
|
return ret;
|
|
829
722
|
}
|
|
830
723
|
|
|
831
724
|
/**
|
|
832
725
|
* @param {string} nostr_hex_sk
|
|
833
|
-
* @param {
|
|
726
|
+
* @param {any} request
|
|
727
|
+
* @param {any} secrets
|
|
834
728
|
* @returns {Promise<any>}
|
|
835
729
|
*/
|
|
836
|
-
export function
|
|
730
|
+
export function create_offer(nostr_hex_sk, request, secrets) {
|
|
837
731
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
838
732
|
const len0 = WASM_VECTOR_LEN;
|
|
839
|
-
const
|
|
840
|
-
const len1 = WASM_VECTOR_LEN;
|
|
841
|
-
const ret = wasm.import_contract(ptr0, len0, ptr1, len1);
|
|
733
|
+
const ret = wasm.create_offer(ptr0, len0, request, secrets);
|
|
842
734
|
return ret;
|
|
843
735
|
}
|
|
844
736
|
|
|
@@ -847,82 +739,65 @@ export function import_contract(nostr_hex_sk, request) {
|
|
|
847
739
|
* @param {any} request
|
|
848
740
|
* @returns {Promise<any>}
|
|
849
741
|
*/
|
|
850
|
-
export function
|
|
742
|
+
export function cancel_offer(nostr_hex_sk, request) {
|
|
851
743
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
852
744
|
const len0 = WASM_VECTOR_LEN;
|
|
853
|
-
const ret = wasm.
|
|
745
|
+
const ret = wasm.cancel_offer(ptr0, len0, request);
|
|
854
746
|
return ret;
|
|
855
747
|
}
|
|
856
748
|
|
|
857
749
|
/**
|
|
858
750
|
* @param {string} nostr_hex_sk
|
|
859
751
|
* @param {any} request
|
|
752
|
+
* @param {any} secrets
|
|
860
753
|
* @returns {Promise<any>}
|
|
861
754
|
*/
|
|
862
|
-
export function
|
|
755
|
+
export function can_create_bid(nostr_hex_sk, request, secrets) {
|
|
863
756
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
864
757
|
const len0 = WASM_VECTOR_LEN;
|
|
865
|
-
const ret = wasm.
|
|
758
|
+
const ret = wasm.can_create_bid(ptr0, len0, request, secrets);
|
|
866
759
|
return ret;
|
|
867
760
|
}
|
|
868
761
|
|
|
869
762
|
/**
|
|
870
763
|
* @param {string} nostr_hex_sk
|
|
871
764
|
* @param {any} request
|
|
765
|
+
* @param {any} secrets
|
|
872
766
|
* @returns {Promise<any>}
|
|
873
767
|
*/
|
|
874
|
-
export function
|
|
768
|
+
export function create_bid(nostr_hex_sk, request, secrets) {
|
|
875
769
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
876
770
|
const len0 = WASM_VECTOR_LEN;
|
|
877
|
-
const ret = wasm.
|
|
878
|
-
return ret;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* @param {string} nostr_hex_sk
|
|
883
|
-
* @param {string} request
|
|
884
|
-
* @returns {Promise<any>}
|
|
885
|
-
*/
|
|
886
|
-
export function remove_rgb_invoice(nostr_hex_sk, request) {
|
|
887
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
888
|
-
const len0 = WASM_VECTOR_LEN;
|
|
889
|
-
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
890
|
-
const len1 = WASM_VECTOR_LEN;
|
|
891
|
-
const ret = wasm.remove_rgb_invoice(ptr0, len0, ptr1, len1);
|
|
771
|
+
const ret = wasm.create_bid(ptr0, len0, request, secrets);
|
|
892
772
|
return ret;
|
|
893
773
|
}
|
|
894
774
|
|
|
895
775
|
/**
|
|
896
776
|
* @param {string} nostr_hex_sk
|
|
777
|
+
* @param {any} request
|
|
897
778
|
* @returns {Promise<any>}
|
|
898
779
|
*/
|
|
899
|
-
export function
|
|
780
|
+
export function cancel_bid(nostr_hex_sk, request) {
|
|
900
781
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
901
782
|
const len0 = WASM_VECTOR_LEN;
|
|
902
|
-
const ret = wasm.
|
|
903
|
-
return ret;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
/**
|
|
907
|
-
* @param {string} invoice
|
|
908
|
-
* @returns {Promise<any>}
|
|
909
|
-
*/
|
|
910
|
-
export function decode_rgb_invoice(invoice) {
|
|
911
|
-
const ptr0 = passStringToWasm0(invoice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
912
|
-
const len0 = WASM_VECTOR_LEN;
|
|
913
|
-
const ret = wasm.decode_rgb_invoice(ptr0, len0);
|
|
783
|
+
const ret = wasm.cancel_bid(ptr0, len0, request);
|
|
914
784
|
return ret;
|
|
915
785
|
}
|
|
916
786
|
|
|
917
787
|
/**
|
|
918
788
|
* @param {string} nostr_hex_sk
|
|
919
789
|
* @param {any} request
|
|
790
|
+
* @param {any} secrets
|
|
791
|
+
* @param {bigint} fee
|
|
792
|
+
* @param {string} max_claim
|
|
920
793
|
* @returns {Promise<any>}
|
|
921
794
|
*/
|
|
922
|
-
export function
|
|
795
|
+
export function create_airdrop(nostr_hex_sk, request, secrets, fee, max_claim) {
|
|
923
796
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
924
797
|
const len0 = WASM_VECTOR_LEN;
|
|
925
|
-
const
|
|
798
|
+
const ptr1 = passStringToWasm0(max_claim, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
799
|
+
const len1 = WASM_VECTOR_LEN;
|
|
800
|
+
const ret = wasm.create_airdrop(ptr0, len0, request, secrets, fee, ptr1, len1);
|
|
926
801
|
return ret;
|
|
927
802
|
}
|
|
928
803
|
|
|
@@ -931,469 +806,522 @@ export function can_create_transfer_contract(nostr_hex_sk, request) {
|
|
|
931
806
|
* @param {any} request
|
|
932
807
|
* @returns {Promise<any>}
|
|
933
808
|
*/
|
|
934
|
-
export function
|
|
809
|
+
export function create_airdrop_claim(nostr_hex_sk, request) {
|
|
935
810
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
936
811
|
const len0 = WASM_VECTOR_LEN;
|
|
937
|
-
const ret = wasm.
|
|
812
|
+
const ret = wasm.create_airdrop_claim(ptr0, len0, request);
|
|
938
813
|
return ret;
|
|
939
814
|
}
|
|
940
815
|
|
|
941
816
|
/**
|
|
942
817
|
* @param {string} nostr_hex_sk
|
|
943
818
|
* @param {any} request
|
|
944
|
-
* @param {any} secrets
|
|
945
819
|
* @returns {Promise<any>}
|
|
946
820
|
*/
|
|
947
|
-
export function
|
|
821
|
+
export function close_airdrop(nostr_hex_sk, request) {
|
|
948
822
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
949
823
|
const len0 = WASM_VECTOR_LEN;
|
|
950
|
-
const ret = wasm.
|
|
951
|
-
return ret;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
/**
|
|
955
|
-
* @param {string} _nostr_hex_sk
|
|
956
|
-
* @param {any} request
|
|
957
|
-
* @returns {Promise<any>}
|
|
958
|
-
*/
|
|
959
|
-
export function psbt_sign_file(_nostr_hex_sk, request) {
|
|
960
|
-
const ptr0 = passStringToWasm0(_nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
961
|
-
const len0 = WASM_VECTOR_LEN;
|
|
962
|
-
const ret = wasm.psbt_sign_file(ptr0, len0, request);
|
|
824
|
+
const ret = wasm.close_airdrop(ptr0, len0, request);
|
|
963
825
|
return ret;
|
|
964
826
|
}
|
|
965
827
|
|
|
966
828
|
/**
|
|
967
829
|
* @param {string} nostr_hex_sk
|
|
968
|
-
* @param {any} request
|
|
969
830
|
* @returns {Promise<any>}
|
|
970
831
|
*/
|
|
971
|
-
export function
|
|
832
|
+
export function backup_rgb_data(nostr_hex_sk) {
|
|
972
833
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
973
834
|
const len0 = WASM_VECTOR_LEN;
|
|
974
|
-
const ret = wasm.
|
|
835
|
+
const ret = wasm.backup_rgb_data(ptr0, len0);
|
|
975
836
|
return ret;
|
|
976
837
|
}
|
|
977
838
|
|
|
978
839
|
/**
|
|
979
840
|
* @param {string} nostr_hex_sk
|
|
980
|
-
* @param {any} request
|
|
981
841
|
* @returns {Promise<any>}
|
|
982
842
|
*/
|
|
983
|
-
export function
|
|
843
|
+
export function restore_rgb_data(nostr_hex_sk) {
|
|
984
844
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
985
845
|
const len0 = WASM_VECTOR_LEN;
|
|
986
|
-
const ret = wasm.
|
|
846
|
+
const ret = wasm.restore_rgb_data(ptr0, len0);
|
|
987
847
|
return ret;
|
|
988
848
|
}
|
|
989
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
|
+
}
|
|
990
856
|
/**
|
|
991
|
-
* @param {string}
|
|
857
|
+
* @param {string} secret_key
|
|
858
|
+
* @param {string} name
|
|
859
|
+
* @param {Uint8Array} data
|
|
860
|
+
* @param {boolean} force
|
|
861
|
+
* @param {Uint8Array | null} [metadata]
|
|
992
862
|
* @returns {Promise<any>}
|
|
993
863
|
*/
|
|
994
|
-
export function
|
|
995
|
-
const ptr0 = passStringToWasm0(
|
|
864
|
+
export function store(secret_key, name, data, force, metadata) {
|
|
865
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
996
866
|
const len0 = WASM_VECTOR_LEN;
|
|
997
|
-
const
|
|
867
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
868
|
+
const len1 = WASM_VECTOR_LEN;
|
|
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);
|
|
998
874
|
return ret;
|
|
999
875
|
}
|
|
1000
876
|
|
|
1001
877
|
/**
|
|
1002
|
-
* @param {string}
|
|
878
|
+
* @param {string} secret_key
|
|
879
|
+
* @param {string} name
|
|
1003
880
|
* @returns {Promise<any>}
|
|
1004
881
|
*/
|
|
1005
|
-
export function
|
|
1006
|
-
const ptr0 = passStringToWasm0(
|
|
882
|
+
export function retrieve(secret_key, name) {
|
|
883
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1007
884
|
const len0 = WASM_VECTOR_LEN;
|
|
1008
|
-
const
|
|
885
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
886
|
+
const len1 = WASM_VECTOR_LEN;
|
|
887
|
+
const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
|
|
1009
888
|
return ret;
|
|
1010
889
|
}
|
|
1011
890
|
|
|
1012
891
|
/**
|
|
1013
|
-
* @param {string}
|
|
892
|
+
* @param {string} secret_key
|
|
893
|
+
* @param {string} name
|
|
1014
894
|
* @returns {Promise<any>}
|
|
1015
895
|
*/
|
|
1016
|
-
export function
|
|
1017
|
-
const ptr0 = passStringToWasm0(
|
|
896
|
+
export function retrieve_metadata(secret_key, name) {
|
|
897
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1018
898
|
const len0 = WASM_VECTOR_LEN;
|
|
1019
|
-
const
|
|
899
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
900
|
+
const len1 = WASM_VECTOR_LEN;
|
|
901
|
+
const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
|
|
1020
902
|
return ret;
|
|
1021
903
|
}
|
|
1022
904
|
|
|
1023
905
|
/**
|
|
1024
|
-
* @param {
|
|
1025
|
-
* @returns {
|
|
906
|
+
* @param {Uint8Array} bytes
|
|
907
|
+
* @returns {string}
|
|
1026
908
|
*/
|
|
1027
|
-
export function
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
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
|
+
}
|
|
1032
922
|
}
|
|
1033
923
|
|
|
1034
924
|
/**
|
|
1035
|
-
* @param {
|
|
1036
|
-
* @returns {
|
|
925
|
+
* @param {Uint8Array} bytes
|
|
926
|
+
* @returns {string}
|
|
1037
927
|
*/
|
|
1038
|
-
export function
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
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
|
+
}
|
|
1043
941
|
}
|
|
1044
942
|
|
|
943
|
+
function takeFromExternrefTable0(idx) {
|
|
944
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
945
|
+
wasm.__externref_table_dealloc(idx);
|
|
946
|
+
return value;
|
|
947
|
+
}
|
|
1045
948
|
/**
|
|
1046
|
-
* @param {string}
|
|
1047
|
-
* @
|
|
1048
|
-
* @returns {Promise<any>}
|
|
949
|
+
* @param {string} string
|
|
950
|
+
* @returns {Uint8Array}
|
|
1049
951
|
*/
|
|
1050
|
-
export function
|
|
1051
|
-
const ptr0 = passStringToWasm0(
|
|
952
|
+
export function decode_hex(string) {
|
|
953
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1052
954
|
const len0 = WASM_VECTOR_LEN;
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
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;
|
|
1057
962
|
}
|
|
1058
963
|
|
|
1059
964
|
/**
|
|
1060
|
-
* @param {string}
|
|
1061
|
-
* @
|
|
1062
|
-
* @returns {Promise<any>}
|
|
965
|
+
* @param {string} string
|
|
966
|
+
* @returns {Uint8Array}
|
|
1063
967
|
*/
|
|
1064
|
-
export function
|
|
1065
|
-
const ptr0 = passStringToWasm0(
|
|
968
|
+
export function decode_base64(string) {
|
|
969
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1066
970
|
const len0 = WASM_VECTOR_LEN;
|
|
1067
|
-
const
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
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;
|
|
1071
978
|
}
|
|
1072
979
|
|
|
1073
980
|
/**
|
|
1074
|
-
* @param {string}
|
|
1075
|
-
* @
|
|
1076
|
-
* @param {any} secrets
|
|
1077
|
-
* @returns {Promise<any>}
|
|
981
|
+
* @param {string} password
|
|
982
|
+
* @returns {string}
|
|
1078
983
|
*/
|
|
1079
|
-
export function
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
984
|
+
export function hash_password(password) {
|
|
985
|
+
let deferred2_0;
|
|
986
|
+
let deferred2_1;
|
|
987
|
+
try {
|
|
988
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
989
|
+
const len0 = WASM_VECTOR_LEN;
|
|
990
|
+
const ret = wasm.hash_password(ptr0, len0);
|
|
991
|
+
deferred2_0 = ret[0];
|
|
992
|
+
deferred2_1 = ret[1];
|
|
993
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
994
|
+
} finally {
|
|
995
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
996
|
+
}
|
|
1084
997
|
}
|
|
1085
998
|
|
|
1086
999
|
/**
|
|
1087
|
-
* @param {string}
|
|
1088
|
-
* @param {any} request
|
|
1089
|
-
* @param {any} secrets
|
|
1000
|
+
* @param {string} password
|
|
1090
1001
|
* @returns {Promise<any>}
|
|
1091
1002
|
*/
|
|
1092
|
-
export function
|
|
1093
|
-
const ptr0 = passStringToWasm0(
|
|
1003
|
+
export function new_mnemonic(password) {
|
|
1004
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1094
1005
|
const len0 = WASM_VECTOR_LEN;
|
|
1095
|
-
const ret = wasm.
|
|
1006
|
+
const ret = wasm.new_mnemonic(ptr0, len0);
|
|
1096
1007
|
return ret;
|
|
1097
1008
|
}
|
|
1098
1009
|
|
|
1099
1010
|
/**
|
|
1100
|
-
* @param {string}
|
|
1101
|
-
* @param {
|
|
1011
|
+
* @param {string} seed
|
|
1012
|
+
* @param {string} password
|
|
1102
1013
|
* @returns {Promise<any>}
|
|
1103
1014
|
*/
|
|
1104
|
-
export function
|
|
1105
|
-
const ptr0 = passStringToWasm0(
|
|
1015
|
+
export function save_mnemonic(seed, password) {
|
|
1016
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1106
1017
|
const len0 = WASM_VECTOR_LEN;
|
|
1107
|
-
const
|
|
1018
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1019
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1020
|
+
const ret = wasm.save_mnemonic(ptr0, len0, ptr1, len1);
|
|
1108
1021
|
return ret;
|
|
1109
1022
|
}
|
|
1110
1023
|
|
|
1111
1024
|
/**
|
|
1112
|
-
* @param {string}
|
|
1113
|
-
* @param {
|
|
1114
|
-
* @param {
|
|
1025
|
+
* @param {string} hash
|
|
1026
|
+
* @param {string} encrypted_descriptors
|
|
1027
|
+
* @param {string} seed_password
|
|
1115
1028
|
* @returns {Promise<any>}
|
|
1116
1029
|
*/
|
|
1117
|
-
export function
|
|
1118
|
-
const ptr0 = passStringToWasm0(
|
|
1030
|
+
export function decrypt_wallet(hash, encrypted_descriptors, seed_password) {
|
|
1031
|
+
const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1119
1032
|
const len0 = WASM_VECTOR_LEN;
|
|
1120
|
-
const
|
|
1033
|
+
const ptr1 = passStringToWasm0(encrypted_descriptors, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1034
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1035
|
+
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1036
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1037
|
+
const ret = wasm.decrypt_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1121
1038
|
return ret;
|
|
1122
1039
|
}
|
|
1123
1040
|
|
|
1124
1041
|
/**
|
|
1125
|
-
* @param {string}
|
|
1126
|
-
* @param {
|
|
1127
|
-
* @param {
|
|
1042
|
+
* @param {string} hash
|
|
1043
|
+
* @param {string} encrypted_descriptors
|
|
1044
|
+
* @param {string} seed_password
|
|
1128
1045
|
* @returns {Promise<any>}
|
|
1129
1046
|
*/
|
|
1130
|
-
export function
|
|
1131
|
-
const ptr0 = passStringToWasm0(
|
|
1047
|
+
export function upgrade_wallet(hash, encrypted_descriptors, seed_password) {
|
|
1048
|
+
const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1132
1049
|
const len0 = WASM_VECTOR_LEN;
|
|
1133
|
-
const
|
|
1050
|
+
const ptr1 = passStringToWasm0(encrypted_descriptors, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1051
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1052
|
+
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1053
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1054
|
+
const ret = wasm.upgrade_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1134
1055
|
return ret;
|
|
1135
1056
|
}
|
|
1136
1057
|
|
|
1137
1058
|
/**
|
|
1138
|
-
* @param {string}
|
|
1139
|
-
* @param {
|
|
1059
|
+
* @param {string} hash
|
|
1060
|
+
* @param {string} seed_password
|
|
1140
1061
|
* @returns {Promise<any>}
|
|
1141
1062
|
*/
|
|
1142
|
-
export function
|
|
1143
|
-
const ptr0 = passStringToWasm0(
|
|
1063
|
+
export function new_wallet(hash, seed_password) {
|
|
1064
|
+
const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1144
1065
|
const len0 = WASM_VECTOR_LEN;
|
|
1145
|
-
const
|
|
1066
|
+
const ptr1 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1067
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1068
|
+
const ret = wasm.new_wallet(ptr0, len0, ptr1, len1);
|
|
1146
1069
|
return ret;
|
|
1147
1070
|
}
|
|
1148
1071
|
|
|
1149
1072
|
/**
|
|
1150
|
-
* @param {string}
|
|
1151
|
-
* @param {
|
|
1152
|
-
* @param {
|
|
1153
|
-
* @param {bigint} fee
|
|
1154
|
-
* @param {string} max_claim
|
|
1073
|
+
* @param {string} mnemonic
|
|
1074
|
+
* @param {string} hash
|
|
1075
|
+
* @param {string} seed_password
|
|
1155
1076
|
* @returns {Promise<any>}
|
|
1156
1077
|
*/
|
|
1157
|
-
export function
|
|
1158
|
-
const ptr0 = passStringToWasm0(
|
|
1078
|
+
export function encrypt_wallet(mnemonic, hash, seed_password) {
|
|
1079
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1159
1080
|
const len0 = WASM_VECTOR_LEN;
|
|
1160
|
-
const ptr1 = passStringToWasm0(
|
|
1081
|
+
const ptr1 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1161
1082
|
const len1 = WASM_VECTOR_LEN;
|
|
1162
|
-
const
|
|
1083
|
+
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1084
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1085
|
+
const ret = wasm.encrypt_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1163
1086
|
return ret;
|
|
1164
1087
|
}
|
|
1165
1088
|
|
|
1166
1089
|
/**
|
|
1167
|
-
* @param {string}
|
|
1168
|
-
* @param {
|
|
1090
|
+
* @param {string} descriptor
|
|
1091
|
+
* @param {string | null} [change_descriptor]
|
|
1169
1092
|
* @returns {Promise<any>}
|
|
1170
1093
|
*/
|
|
1171
|
-
export function
|
|
1172
|
-
const ptr0 = passStringToWasm0(
|
|
1094
|
+
export function get_wallet_data(descriptor, change_descriptor) {
|
|
1095
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1173
1096
|
const len0 = WASM_VECTOR_LEN;
|
|
1174
|
-
|
|
1097
|
+
var ptr1 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1098
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1099
|
+
const ret = wasm.get_wallet_data(ptr0, len0, ptr1, len1);
|
|
1175
1100
|
return ret;
|
|
1176
1101
|
}
|
|
1177
1102
|
|
|
1178
1103
|
/**
|
|
1179
|
-
* @param {string} nostr_hex_sk
|
|
1180
|
-
* @param {any} request
|
|
1181
1104
|
* @returns {Promise<any>}
|
|
1182
1105
|
*/
|
|
1183
|
-
export function
|
|
1184
|
-
const
|
|
1185
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1186
|
-
const ret = wasm.close_airdrop(ptr0, len0, request);
|
|
1106
|
+
export function sync_wallets() {
|
|
1107
|
+
const ret = wasm.sync_wallets();
|
|
1187
1108
|
return ret;
|
|
1188
1109
|
}
|
|
1189
1110
|
|
|
1190
1111
|
/**
|
|
1191
|
-
* @param {string}
|
|
1112
|
+
* @param {string} descriptor
|
|
1113
|
+
* @param {string | null} [change_descriptor]
|
|
1192
1114
|
* @returns {Promise<any>}
|
|
1193
1115
|
*/
|
|
1194
|
-
export function
|
|
1195
|
-
const ptr0 = passStringToWasm0(
|
|
1116
|
+
export function get_new_address(descriptor, change_descriptor) {
|
|
1117
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1196
1118
|
const len0 = WASM_VECTOR_LEN;
|
|
1197
|
-
|
|
1119
|
+
var ptr1 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1120
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1121
|
+
const ret = wasm.get_new_address(ptr0, len0, ptr1, len1);
|
|
1198
1122
|
return ret;
|
|
1199
1123
|
}
|
|
1200
1124
|
|
|
1201
1125
|
/**
|
|
1202
|
-
* @param {string}
|
|
1126
|
+
* @param {string} descriptor
|
|
1127
|
+
* @param {string} change_descriptor
|
|
1128
|
+
* @param {string} destination
|
|
1129
|
+
* @param {bigint} amount
|
|
1130
|
+
* @param {boolean} broadcast
|
|
1131
|
+
* @param {number | null} [fee_rate]
|
|
1203
1132
|
* @returns {Promise<any>}
|
|
1204
1133
|
*/
|
|
1205
|
-
export function
|
|
1206
|
-
const ptr0 = passStringToWasm0(
|
|
1134
|
+
export function send_sats(descriptor, change_descriptor, destination, amount, broadcast, fee_rate) {
|
|
1135
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1207
1136
|
const len0 = WASM_VECTOR_LEN;
|
|
1208
|
-
const
|
|
1137
|
+
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1138
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1139
|
+
const ptr2 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1140
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1141
|
+
const ret = wasm.send_sats(ptr0, len0, ptr1, len1, ptr2, len2, amount, broadcast, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
1209
1142
|
return ret;
|
|
1210
1143
|
}
|
|
1211
1144
|
|
|
1212
1145
|
/**
|
|
1213
|
-
* @param {string}
|
|
1214
|
-
* @param {string}
|
|
1146
|
+
* @param {string} descriptor
|
|
1147
|
+
* @param {string} change_descriptor
|
|
1148
|
+
* @param {string} rgb_address
|
|
1149
|
+
* @param {boolean} broadcast
|
|
1150
|
+
* @param {number | null} [fee_rate]
|
|
1215
1151
|
* @returns {Promise<any>}
|
|
1216
1152
|
*/
|
|
1217
|
-
export function
|
|
1218
|
-
const ptr0 = passStringToWasm0(
|
|
1153
|
+
export function fund_vault(descriptor, change_descriptor, rgb_address, broadcast, fee_rate) {
|
|
1154
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1219
1155
|
const len0 = WASM_VECTOR_LEN;
|
|
1220
|
-
const ptr1 = passStringToWasm0(
|
|
1156
|
+
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1221
1157
|
const len1 = WASM_VECTOR_LEN;
|
|
1222
|
-
const
|
|
1158
|
+
const ptr2 = passStringToWasm0(rgb_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1159
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1160
|
+
const ret = wasm.fund_vault(ptr0, len0, ptr1, len1, ptr2, len2, broadcast, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
1223
1161
|
return ret;
|
|
1224
1162
|
}
|
|
1225
1163
|
|
|
1226
1164
|
/**
|
|
1227
|
-
* @param {string}
|
|
1228
|
-
* @param {string} password
|
|
1165
|
+
* @param {string} rgb_descriptor_xpub
|
|
1229
1166
|
* @returns {Promise<any>}
|
|
1230
1167
|
*/
|
|
1231
|
-
export function
|
|
1232
|
-
const ptr0 = passStringToWasm0(
|
|
1168
|
+
export function get_assets_vault(rgb_descriptor_xpub) {
|
|
1169
|
+
const ptr0 = passStringToWasm0(rgb_descriptor_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1233
1170
|
const len0 = WASM_VECTOR_LEN;
|
|
1234
|
-
const
|
|
1235
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1236
|
-
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
1171
|
+
const ret = wasm.get_assets_vault(ptr0, len0);
|
|
1237
1172
|
return ret;
|
|
1238
1173
|
}
|
|
1239
1174
|
|
|
1240
1175
|
/**
|
|
1241
|
-
* @param {string}
|
|
1242
|
-
* @param {
|
|
1243
|
-
* @param {string}
|
|
1176
|
+
* @param {string} destination
|
|
1177
|
+
* @param {string} descriptor
|
|
1178
|
+
* @param {string | null} [change_descriptor]
|
|
1179
|
+
* @param {number | null} [fee_rate]
|
|
1244
1180
|
* @returns {Promise<any>}
|
|
1245
1181
|
*/
|
|
1246
|
-
export function
|
|
1247
|
-
const ptr0 = passStringToWasm0(
|
|
1182
|
+
export function drain_wallet(destination, descriptor, change_descriptor, fee_rate) {
|
|
1183
|
+
const ptr0 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1248
1184
|
const len0 = WASM_VECTOR_LEN;
|
|
1249
|
-
const ptr1 = passStringToWasm0(
|
|
1185
|
+
const ptr1 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1250
1186
|
const len1 = WASM_VECTOR_LEN;
|
|
1251
|
-
|
|
1187
|
+
var ptr2 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1188
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1189
|
+
const ret = wasm.drain_wallet(ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
1252
1190
|
return ret;
|
|
1253
1191
|
}
|
|
1254
1192
|
|
|
1255
1193
|
/**
|
|
1256
|
-
* @param {string}
|
|
1194
|
+
* @param {string} txid
|
|
1195
|
+
* @param {number} fee_rate
|
|
1196
|
+
* @param {string} descriptor
|
|
1197
|
+
* @param {string | null | undefined} change_descriptor
|
|
1198
|
+
* @param {boolean} broadcast
|
|
1257
1199
|
* @returns {Promise<any>}
|
|
1258
1200
|
*/
|
|
1259
|
-
export function
|
|
1260
|
-
const ptr0 = passStringToWasm0(
|
|
1201
|
+
export function bump_fee(txid, fee_rate, descriptor, change_descriptor, broadcast) {
|
|
1202
|
+
const ptr0 = passStringToWasm0(txid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1261
1203
|
const len0 = WASM_VECTOR_LEN;
|
|
1262
|
-
const
|
|
1204
|
+
const ptr1 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1205
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1206
|
+
var ptr2 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1207
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1208
|
+
const ret = wasm.bump_fee(ptr0, len0, fee_rate, ptr1, len1, ptr2, len2, broadcast);
|
|
1263
1209
|
return ret;
|
|
1264
1210
|
}
|
|
1265
1211
|
|
|
1266
1212
|
/**
|
|
1267
|
-
* @param {
|
|
1213
|
+
* @param {any} request
|
|
1268
1214
|
* @returns {Promise<any>}
|
|
1269
1215
|
*/
|
|
1270
|
-
export function
|
|
1271
|
-
const
|
|
1272
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1273
|
-
const ret = wasm.get_txs(ptr0, len0);
|
|
1216
|
+
export function psbt_sign_and_publish_file(request) {
|
|
1217
|
+
const ret = wasm.psbt_sign_and_publish_file(request);
|
|
1274
1218
|
return ret;
|
|
1275
1219
|
}
|
|
1276
1220
|
|
|
1277
1221
|
/**
|
|
1278
|
-
* @param {
|
|
1279
|
-
* @param {string} token
|
|
1222
|
+
* @param {any} request
|
|
1280
1223
|
* @returns {Promise<any>}
|
|
1281
1224
|
*/
|
|
1282
|
-
export function
|
|
1283
|
-
const
|
|
1284
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1285
|
-
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1286
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1287
|
-
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
1225
|
+
export function psbt_publish_file(request) {
|
|
1226
|
+
const ret = wasm.psbt_publish_file(request);
|
|
1288
1227
|
return ret;
|
|
1289
1228
|
}
|
|
1290
1229
|
|
|
1291
1230
|
/**
|
|
1292
|
-
* @param {string}
|
|
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
|
|
1293
1237
|
* @returns {Promise<any>}
|
|
1294
1238
|
*/
|
|
1295
|
-
export function
|
|
1296
|
-
const ptr0 = passStringToWasm0(
|
|
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);
|
|
1297
1241
|
const len0 = WASM_VECTOR_LEN;
|
|
1298
|
-
const ret = wasm.
|
|
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);
|
|
1299
1243
|
return ret;
|
|
1300
1244
|
}
|
|
1301
1245
|
|
|
1302
1246
|
/**
|
|
1303
|
-
* @param {string}
|
|
1304
|
-
* @param {string
|
|
1247
|
+
* @param {string} sk
|
|
1248
|
+
* @param {string} address
|
|
1249
|
+
* @param {bigint} sats
|
|
1250
|
+
* @param {number} fee_rate
|
|
1251
|
+
* @param {any} secrets
|
|
1305
1252
|
* @returns {Promise<any>}
|
|
1306
1253
|
*/
|
|
1307
|
-
export function
|
|
1308
|
-
const ptr0 = passStringToWasm0(
|
|
1254
|
+
export function transfer_sats(sk, address, sats, fee_rate, secrets) {
|
|
1255
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1309
1256
|
const len0 = WASM_VECTOR_LEN;
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
const ret = wasm.
|
|
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);
|
|
1313
1260
|
return ret;
|
|
1314
1261
|
}
|
|
1315
1262
|
|
|
1316
1263
|
/**
|
|
1317
|
-
* @param {string}
|
|
1318
|
-
* @param {bigint} amount
|
|
1319
|
-
* @param {string} token
|
|
1264
|
+
* @param {string} sk
|
|
1320
1265
|
* @returns {Promise<any>}
|
|
1321
1266
|
*/
|
|
1322
|
-
export function
|
|
1323
|
-
const ptr0 = passStringToWasm0(
|
|
1267
|
+
export function get_btc_wallet(sk) {
|
|
1268
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1324
1269
|
const len0 = WASM_VECTOR_LEN;
|
|
1325
|
-
const
|
|
1326
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1327
|
-
const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
|
|
1270
|
+
const ret = wasm.get_btc_wallet(ptr0, len0);
|
|
1328
1271
|
return ret;
|
|
1329
1272
|
}
|
|
1330
1273
|
|
|
1331
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
1332
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1333
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1334
|
-
WASM_VECTOR_LEN = arg.length;
|
|
1335
|
-
return ptr;
|
|
1336
|
-
}
|
|
1337
1274
|
/**
|
|
1338
|
-
* @param {string}
|
|
1339
|
-
* @param {string} name
|
|
1340
|
-
* @param {Uint8Array} data
|
|
1341
|
-
* @param {boolean} force
|
|
1342
|
-
* @param {Uint8Array | null} [metadata]
|
|
1275
|
+
* @param {string} nostr_hex_sk
|
|
1343
1276
|
* @returns {Promise<any>}
|
|
1344
1277
|
*/
|
|
1345
|
-
export function
|
|
1346
|
-
const ptr0 = passStringToWasm0(
|
|
1278
|
+
export function backup_btc_data(nostr_hex_sk) {
|
|
1279
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1347
1280
|
const len0 = WASM_VECTOR_LEN;
|
|
1348
|
-
const
|
|
1349
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1350
|
-
const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1351
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1352
|
-
var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
|
|
1353
|
-
var len3 = WASM_VECTOR_LEN;
|
|
1354
|
-
const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
|
|
1281
|
+
const ret = wasm.backup_btc_data(ptr0, len0);
|
|
1355
1282
|
return ret;
|
|
1356
1283
|
}
|
|
1357
1284
|
|
|
1358
1285
|
/**
|
|
1359
|
-
* @param {string}
|
|
1360
|
-
* @param {string}
|
|
1286
|
+
* @param {string} seed
|
|
1287
|
+
* @param {string} pass_phrase
|
|
1288
|
+
* @param {string} recover_address
|
|
1361
1289
|
* @returns {Promise<any>}
|
|
1362
1290
|
*/
|
|
1363
|
-
export function
|
|
1364
|
-
const ptr0 = passStringToWasm0(
|
|
1291
|
+
export function recover_funds_from_bad_wallets(seed, pass_phrase, recover_address) {
|
|
1292
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1365
1293
|
const len0 = WASM_VECTOR_LEN;
|
|
1366
|
-
const ptr1 = passStringToWasm0(
|
|
1294
|
+
const ptr1 = passStringToWasm0(pass_phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1367
1295
|
const len1 = WASM_VECTOR_LEN;
|
|
1368
|
-
const
|
|
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);
|
|
1369
1299
|
return ret;
|
|
1370
1300
|
}
|
|
1371
1301
|
|
|
1372
1302
|
/**
|
|
1373
|
-
* @param {string}
|
|
1374
|
-
* @param {string} name
|
|
1303
|
+
* @param {string} nostr_hex_sk
|
|
1375
1304
|
* @returns {Promise<any>}
|
|
1376
1305
|
*/
|
|
1377
|
-
export function
|
|
1378
|
-
const ptr0 = passStringToWasm0(
|
|
1306
|
+
export function restore_btc_data(nostr_hex_sk) {
|
|
1307
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1379
1308
|
const len0 = WASM_VECTOR_LEN;
|
|
1380
|
-
const
|
|
1381
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1382
|
-
const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
|
|
1309
|
+
const ret = wasm.restore_btc_data(ptr0, len0);
|
|
1383
1310
|
return ret;
|
|
1384
1311
|
}
|
|
1385
1312
|
|
|
1386
1313
|
/**
|
|
1387
|
-
* @param {
|
|
1314
|
+
* @param {string} decimal
|
|
1315
|
+
* @param {number} precision
|
|
1388
1316
|
* @returns {string}
|
|
1389
1317
|
*/
|
|
1390
|
-
export function
|
|
1318
|
+
export function convert_contract_amount_raw(decimal, precision) {
|
|
1391
1319
|
let deferred2_0;
|
|
1392
1320
|
let deferred2_1;
|
|
1393
1321
|
try {
|
|
1394
|
-
const ptr0 =
|
|
1322
|
+
const ptr0 = passStringToWasm0(decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1395
1323
|
const len0 = WASM_VECTOR_LEN;
|
|
1396
|
-
const ret = wasm.
|
|
1324
|
+
const ret = wasm.convert_contract_amount_raw(ptr0, len0, precision);
|
|
1397
1325
|
deferred2_0 = ret[0];
|
|
1398
1326
|
deferred2_1 = ret[1];
|
|
1399
1327
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1403,16 +1331,46 @@ export function encode_hex(bytes) {
|
|
|
1403
1331
|
}
|
|
1404
1332
|
|
|
1405
1333
|
/**
|
|
1406
|
-
* @param {
|
|
1334
|
+
* @param {bigint} amount
|
|
1335
|
+
* @param {number} precision
|
|
1407
1336
|
* @returns {string}
|
|
1408
1337
|
*/
|
|
1409
|
-
export function
|
|
1338
|
+
export function convert_contract_amount_string(amount, precision) {
|
|
1339
|
+
let deferred1_0;
|
|
1340
|
+
let deferred1_1;
|
|
1341
|
+
try {
|
|
1342
|
+
const ret = wasm.convert_contract_amount_string(amount, precision);
|
|
1343
|
+
deferred1_0 = ret[0];
|
|
1344
|
+
deferred1_1 = ret[1];
|
|
1345
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1346
|
+
} finally {
|
|
1347
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* @param {string} amount
|
|
1353
|
+
* @returns {any}
|
|
1354
|
+
*/
|
|
1355
|
+
export function parse_contract_amount(amount) {
|
|
1356
|
+
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1357
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1358
|
+
const ret = wasm.parse_contract_amount(ptr0, len0);
|
|
1359
|
+
return ret;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* @param {string} amount
|
|
1364
|
+
* @param {number} precision
|
|
1365
|
+
* @returns {string}
|
|
1366
|
+
*/
|
|
1367
|
+
export function parse_contract_amount_precision(amount, precision) {
|
|
1410
1368
|
let deferred2_0;
|
|
1411
1369
|
let deferred2_1;
|
|
1412
1370
|
try {
|
|
1413
|
-
const ptr0 =
|
|
1371
|
+
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1414
1372
|
const len0 = WASM_VECTOR_LEN;
|
|
1415
|
-
const ret = wasm.
|
|
1373
|
+
const ret = wasm.parse_contract_amount_precision(ptr0, len0, precision);
|
|
1416
1374
|
deferred2_0 = ret[0];
|
|
1417
1375
|
deferred2_1 = ret[1];
|
|
1418
1376
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1421,89 +1379,131 @@ export function encode_base64(bytes) {
|
|
|
1421
1379
|
}
|
|
1422
1380
|
}
|
|
1423
1381
|
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1382
|
+
/**
|
|
1383
|
+
* @returns {any}
|
|
1384
|
+
*/
|
|
1385
|
+
export function version() {
|
|
1386
|
+
const ret = wasm.version();
|
|
1387
|
+
return ret;
|
|
1428
1388
|
}
|
|
1389
|
+
|
|
1429
1390
|
/**
|
|
1430
|
-
* @param {string}
|
|
1431
|
-
* @
|
|
1391
|
+
* @param {string} nostr_hex_sk
|
|
1392
|
+
* @param {any} request
|
|
1393
|
+
* @returns {Promise<any>}
|
|
1432
1394
|
*/
|
|
1433
|
-
export function
|
|
1434
|
-
const ptr0 = passStringToWasm0(
|
|
1395
|
+
export function create_watcher(nostr_hex_sk, request) {
|
|
1396
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1435
1397
|
const len0 = WASM_VECTOR_LEN;
|
|
1436
|
-
const ret = wasm.
|
|
1437
|
-
|
|
1438
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1439
|
-
}
|
|
1440
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1441
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1442
|
-
return v2;
|
|
1398
|
+
const ret = wasm.create_watcher(ptr0, len0, request);
|
|
1399
|
+
return ret;
|
|
1443
1400
|
}
|
|
1444
1401
|
|
|
1445
1402
|
/**
|
|
1446
|
-
* @param {string}
|
|
1447
|
-
* @
|
|
1403
|
+
* @param {string} nostr_hex_sk
|
|
1404
|
+
* @param {any} request
|
|
1405
|
+
* @returns {Promise<any>}
|
|
1448
1406
|
*/
|
|
1449
|
-
export function
|
|
1450
|
-
const ptr0 = passStringToWasm0(
|
|
1407
|
+
export function recover_watcher(nostr_hex_sk, request) {
|
|
1408
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1451
1409
|
const len0 = WASM_VECTOR_LEN;
|
|
1452
|
-
const ret = wasm.
|
|
1453
|
-
|
|
1454
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1455
|
-
}
|
|
1456
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1457
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1458
|
-
return v2;
|
|
1410
|
+
const ret = wasm.recover_watcher(ptr0, len0, request);
|
|
1411
|
+
return ret;
|
|
1459
1412
|
}
|
|
1460
1413
|
|
|
1461
1414
|
/**
|
|
1462
|
-
* @param {string}
|
|
1463
|
-
* @param {string} token
|
|
1415
|
+
* @param {string} nostr_hex_sk
|
|
1464
1416
|
* @returns {Promise<any>}
|
|
1465
1417
|
*/
|
|
1466
|
-
export function
|
|
1467
|
-
const ptr0 = passStringToWasm0(
|
|
1418
|
+
export function destroy_watcher(nostr_hex_sk) {
|
|
1419
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1468
1420
|
const len0 = WASM_VECTOR_LEN;
|
|
1469
|
-
const
|
|
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);
|
|
1470
1456
|
const len1 = WASM_VECTOR_LEN;
|
|
1471
|
-
const ret = wasm.
|
|
1457
|
+
const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
|
|
1472
1458
|
return ret;
|
|
1473
1459
|
}
|
|
1474
1460
|
|
|
1475
1461
|
/**
|
|
1476
|
-
* @param {string}
|
|
1477
|
-
* @param {string}
|
|
1462
|
+
* @param {string} nostr_hex_sk
|
|
1463
|
+
* @param {string} request
|
|
1478
1464
|
* @returns {Promise<any>}
|
|
1479
1465
|
*/
|
|
1480
|
-
export function
|
|
1481
|
-
const ptr0 = passStringToWasm0(
|
|
1466
|
+
export function watcher_next_utxo(nostr_hex_sk, request) {
|
|
1467
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1482
1468
|
const len0 = WASM_VECTOR_LEN;
|
|
1483
|
-
const ptr1 = passStringToWasm0(
|
|
1469
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1484
1470
|
const len1 = WASM_VECTOR_LEN;
|
|
1485
|
-
const ret = wasm.
|
|
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
1486
|
return ret;
|
|
1487
1487
|
}
|
|
1488
1488
|
|
|
1489
1489
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
1490
|
-
wasm.
|
|
1490
|
+
wasm.closure1237_externref_shim(arg0, arg1, arg2);
|
|
1491
1491
|
}
|
|
1492
1492
|
|
|
1493
1493
|
function __wbg_adapter_57(arg0, arg1, arg2) {
|
|
1494
|
-
wasm.
|
|
1494
|
+
wasm.closure1999_externref_shim(arg0, arg1, arg2);
|
|
1495
1495
|
}
|
|
1496
1496
|
|
|
1497
1497
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
1498
|
-
wasm.
|
|
1498
|
+
wasm.closure2670_externref_shim(arg0, arg1, arg2);
|
|
1499
1499
|
}
|
|
1500
1500
|
|
|
1501
1501
|
function __wbg_adapter_63(arg0, arg1, arg2) {
|
|
1502
|
-
wasm.
|
|
1502
|
+
wasm.closure3841_externref_shim(arg0, arg1, arg2);
|
|
1503
1503
|
}
|
|
1504
1504
|
|
|
1505
|
-
function
|
|
1506
|
-
wasm.
|
|
1505
|
+
function __wbg_adapter_418(arg0, arg1, arg2, arg3) {
|
|
1506
|
+
wasm.closure4133_externref_shim(arg0, arg1, arg2, arg3);
|
|
1507
1507
|
}
|
|
1508
1508
|
|
|
1509
1509
|
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
@@ -1564,6 +1564,9 @@ function __wbg_get_imports() {
|
|
|
1564
1564
|
const ret = Promise.any(arg0);
|
|
1565
1565
|
return ret;
|
|
1566
1566
|
};
|
|
1567
|
+
imports.wbg.__wbg_append_299d5d48292c0495 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1568
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1569
|
+
}, arguments) };
|
|
1567
1570
|
imports.wbg.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1568
1571
|
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1569
1572
|
}, arguments) };
|
|
@@ -1670,7 +1673,7 @@ function __wbg_get_imports() {
|
|
|
1670
1673
|
const ret = arg0.fetch(arg1);
|
|
1671
1674
|
return ret;
|
|
1672
1675
|
};
|
|
1673
|
-
imports.wbg.
|
|
1676
|
+
imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
|
|
1674
1677
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1675
1678
|
}, arguments) };
|
|
1676
1679
|
imports.wbg.__wbg_getRandomValues_7b17ba35056bcdd1 = function() { return handleError(function (arg0, arg1) {
|
|
@@ -1862,6 +1865,14 @@ function __wbg_get_imports() {
|
|
|
1862
1865
|
const ret = arg0.length;
|
|
1863
1866
|
return ret;
|
|
1864
1867
|
};
|
|
1868
|
+
imports.wbg.__wbg_log_c222819a41e063d3 = function(arg0) {
|
|
1869
|
+
console.log(arg0);
|
|
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
|
+
};
|
|
1865
1876
|
imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
|
|
1866
1877
|
const ret = arg0.message;
|
|
1867
1878
|
return ret;
|
|
@@ -1893,7 +1904,7 @@ function __wbg_get_imports() {
|
|
|
1893
1904
|
const a = state0.a;
|
|
1894
1905
|
state0.a = 0;
|
|
1895
1906
|
try {
|
|
1896
|
-
return
|
|
1907
|
+
return __wbg_adapter_418(a, state0.b, arg0, arg1);
|
|
1897
1908
|
} finally {
|
|
1898
1909
|
state0.a = a;
|
|
1899
1910
|
}
|
|
@@ -1956,6 +1967,10 @@ function __wbg_get_imports() {
|
|
|
1956
1967
|
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
1957
1968
|
return ret;
|
|
1958
1969
|
}, arguments) };
|
|
1970
|
+
imports.wbg.__wbg_newwithu8arraysequence_1e24f242a67f6fdd = function() { return handleError(function (arg0) {
|
|
1971
|
+
const ret = new Blob(arg0);
|
|
1972
|
+
return ret;
|
|
1973
|
+
}, arguments) };
|
|
1959
1974
|
imports.wbg.__wbg_newwithu8arraysequenceandoptions_068570c487f69127 = function() { return handleError(function (arg0, arg1) {
|
|
1960
1975
|
const ret = new Blob(arg0, arg1);
|
|
1961
1976
|
return ret;
|
|
@@ -2243,20 +2258,20 @@ function __wbg_get_imports() {
|
|
|
2243
2258
|
const ret = false;
|
|
2244
2259
|
return ret;
|
|
2245
2260
|
};
|
|
2246
|
-
imports.wbg.
|
|
2247
|
-
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);
|
|
2248
2263
|
return ret;
|
|
2249
2264
|
};
|
|
2250
|
-
imports.wbg.
|
|
2251
|
-
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);
|
|
2252
2267
|
return ret;
|
|
2253
2268
|
};
|
|
2254
|
-
imports.wbg.
|
|
2255
|
-
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);
|
|
2256
2271
|
return ret;
|
|
2257
2272
|
};
|
|
2258
|
-
imports.wbg.
|
|
2259
|
-
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);
|
|
2260
2275
|
return ret;
|
|
2261
2276
|
};
|
|
2262
2277
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|