bitmask-core 0.6.0-beta.0 → 0.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitmask_core.d.ts +57 -51
- package/bitmask_core_bg.js +188 -171
- package/bitmask_core_bg.wasm +0 -0
- package/package.json +1 -1
package/bitmask_core.d.ts
CHANGED
|
@@ -74,57 +74,6 @@ export function store(secret_key: string, name: string, data: Uint8Array): Promi
|
|
|
74
74
|
*/
|
|
75
75
|
export function retrieve(secret_key: string, name: string): Promise<any>;
|
|
76
76
|
/**
|
|
77
|
-
* @param {string} password
|
|
78
|
-
* @param {string} encrypted_descriptors
|
|
79
|
-
* @returns {Promise<any>}
|
|
80
|
-
*/
|
|
81
|
-
export function get_encrypted_wallet(password: string, encrypted_descriptors: string): Promise<any>;
|
|
82
|
-
/**
|
|
83
|
-
* @param {string} encryption_password
|
|
84
|
-
* @param {string} seed_password
|
|
85
|
-
* @returns {Promise<any>}
|
|
86
|
-
*/
|
|
87
|
-
export function get_mnemonic_seed(encryption_password: string, seed_password: string): Promise<any>;
|
|
88
|
-
/**
|
|
89
|
-
* @param {string} mnemonic
|
|
90
|
-
* @param {string} encryption_password
|
|
91
|
-
* @param {string} seed_password
|
|
92
|
-
* @returns {Promise<any>}
|
|
93
|
-
*/
|
|
94
|
-
export function save_mnemonic_seed(mnemonic: string, encryption_password: string, seed_password: string): Promise<any>;
|
|
95
|
-
/**
|
|
96
|
-
* @param {string} descriptor
|
|
97
|
-
* @param {string | undefined} change_descriptor
|
|
98
|
-
* @returns {Promise<any>}
|
|
99
|
-
*/
|
|
100
|
-
export function get_wallet_data(descriptor: string, change_descriptor?: string): Promise<any>;
|
|
101
|
-
/**
|
|
102
|
-
* @param {string} descriptor
|
|
103
|
-
* @param {string} change_descriptor
|
|
104
|
-
* @param {string} destination
|
|
105
|
-
* @param {bigint} amount
|
|
106
|
-
* @param {number | undefined} fee_rate
|
|
107
|
-
* @returns {Promise<any>}
|
|
108
|
-
*/
|
|
109
|
-
export function send_sats(descriptor: string, change_descriptor: string, destination: string, amount: bigint, fee_rate?: number): Promise<any>;
|
|
110
|
-
/**
|
|
111
|
-
* @param {string} descriptor
|
|
112
|
-
* @param {string} change_descriptor
|
|
113
|
-
* @param {string} address
|
|
114
|
-
* @param {string} uda_address
|
|
115
|
-
* @param {bigint} asset_amount
|
|
116
|
-
* @param {bigint} uda_amount
|
|
117
|
-
* @param {number | undefined} fee_rate
|
|
118
|
-
* @returns {Promise<any>}
|
|
119
|
-
*/
|
|
120
|
-
export function fund_vault(descriptor: string, change_descriptor: string, address: string, uda_address: string, asset_amount: bigint, uda_amount: bigint, fee_rate?: number): Promise<any>;
|
|
121
|
-
/**
|
|
122
|
-
* @param {string} rgb_assets_descriptor_xpub
|
|
123
|
-
* @param {string} rgb_udas_descriptor_xpub
|
|
124
|
-
* @returns {Promise<any>}
|
|
125
|
-
*/
|
|
126
|
-
export function get_assets_vault(rgb_assets_descriptor_xpub: string, rgb_udas_descriptor_xpub: string): Promise<any>;
|
|
127
|
-
/**
|
|
128
77
|
* @param {string} nostr_hex_sk
|
|
129
78
|
* @param {string} ticker
|
|
130
79
|
* @param {string} name
|
|
@@ -178,3 +127,60 @@ export function list_interfaces(nostr_hex_sk: string): Promise<any>;
|
|
|
178
127
|
* @returns {Promise<any>}
|
|
179
128
|
*/
|
|
180
129
|
export function list_schemas(nostr_hex_sk: string): Promise<any>;
|
|
130
|
+
/**
|
|
131
|
+
* @param {string} nostr_hex_sk
|
|
132
|
+
* @param {any} request
|
|
133
|
+
* @returns {Promise<any>}
|
|
134
|
+
*/
|
|
135
|
+
export function import_contract(nostr_hex_sk: string, request: any): Promise<any>;
|
|
136
|
+
/**
|
|
137
|
+
* @param {string} password
|
|
138
|
+
* @param {string} encrypted_descriptors
|
|
139
|
+
* @returns {Promise<any>}
|
|
140
|
+
*/
|
|
141
|
+
export function get_encrypted_wallet(password: string, encrypted_descriptors: string): Promise<any>;
|
|
142
|
+
/**
|
|
143
|
+
* @param {string} encryption_password
|
|
144
|
+
* @param {string} seed_password
|
|
145
|
+
* @returns {Promise<any>}
|
|
146
|
+
*/
|
|
147
|
+
export function get_mnemonic_seed(encryption_password: string, seed_password: string): Promise<any>;
|
|
148
|
+
/**
|
|
149
|
+
* @param {string} mnemonic
|
|
150
|
+
* @param {string} encryption_password
|
|
151
|
+
* @param {string} seed_password
|
|
152
|
+
* @returns {Promise<any>}
|
|
153
|
+
*/
|
|
154
|
+
export function save_mnemonic_seed(mnemonic: string, encryption_password: string, seed_password: string): Promise<any>;
|
|
155
|
+
/**
|
|
156
|
+
* @param {string} descriptor
|
|
157
|
+
* @param {string | undefined} change_descriptor
|
|
158
|
+
* @returns {Promise<any>}
|
|
159
|
+
*/
|
|
160
|
+
export function get_wallet_data(descriptor: string, change_descriptor?: string): Promise<any>;
|
|
161
|
+
/**
|
|
162
|
+
* @param {string} descriptor
|
|
163
|
+
* @param {string} change_descriptor
|
|
164
|
+
* @param {string} destination
|
|
165
|
+
* @param {bigint} amount
|
|
166
|
+
* @param {number | undefined} fee_rate
|
|
167
|
+
* @returns {Promise<any>}
|
|
168
|
+
*/
|
|
169
|
+
export function send_sats(descriptor: string, change_descriptor: string, destination: string, amount: bigint, fee_rate?: number): Promise<any>;
|
|
170
|
+
/**
|
|
171
|
+
* @param {string} descriptor
|
|
172
|
+
* @param {string} change_descriptor
|
|
173
|
+
* @param {string} address
|
|
174
|
+
* @param {string} uda_address
|
|
175
|
+
* @param {bigint} asset_amount
|
|
176
|
+
* @param {bigint} uda_amount
|
|
177
|
+
* @param {number | undefined} fee_rate
|
|
178
|
+
* @returns {Promise<any>}
|
|
179
|
+
*/
|
|
180
|
+
export function fund_vault(descriptor: string, change_descriptor: string, address: string, uda_address: string, asset_amount: bigint, uda_amount: bigint, fee_rate?: number): Promise<any>;
|
|
181
|
+
/**
|
|
182
|
+
* @param {string} rgb_assets_descriptor_xpub
|
|
183
|
+
* @param {string} rgb_udas_descriptor_xpub
|
|
184
|
+
* @returns {Promise<any>}
|
|
185
|
+
*/
|
|
186
|
+
export function get_assets_vault(rgb_assets_descriptor_xpub: string, rgb_udas_descriptor_xpub: string): Promise<any>;
|
package/bitmask_core_bg.js
CHANGED
|
@@ -10,20 +10,6 @@ heap.push(undefined, null, true, false);
|
|
|
10
10
|
|
|
11
11
|
function getObject(idx) { return heap[idx]; }
|
|
12
12
|
|
|
13
|
-
let heap_next = heap.length;
|
|
14
|
-
|
|
15
|
-
function dropObject(idx) {
|
|
16
|
-
if (idx < 132) return;
|
|
17
|
-
heap[idx] = heap_next;
|
|
18
|
-
heap_next = idx;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function takeObject(idx) {
|
|
22
|
-
const ret = getObject(idx);
|
|
23
|
-
dropObject(idx);
|
|
24
|
-
return ret;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
13
|
let WASM_VECTOR_LEN = 0;
|
|
28
14
|
|
|
29
15
|
let cachedUint8Memory0 = null;
|
|
@@ -103,14 +89,18 @@ function getInt32Memory0() {
|
|
|
103
89
|
return cachedInt32Memory0;
|
|
104
90
|
}
|
|
105
91
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
92
|
+
let heap_next = heap.length;
|
|
109
93
|
|
|
110
|
-
|
|
94
|
+
function dropObject(idx) {
|
|
95
|
+
if (idx < 132) return;
|
|
96
|
+
heap[idx] = heap_next;
|
|
97
|
+
heap_next = idx;
|
|
98
|
+
}
|
|
111
99
|
|
|
112
|
-
function
|
|
113
|
-
|
|
100
|
+
function takeObject(idx) {
|
|
101
|
+
const ret = getObject(idx);
|
|
102
|
+
dropObject(idx);
|
|
103
|
+
return ret;
|
|
114
104
|
}
|
|
115
105
|
|
|
116
106
|
function addHeapObject(obj) {
|
|
@@ -122,6 +112,16 @@ function addHeapObject(obj) {
|
|
|
122
112
|
return idx;
|
|
123
113
|
}
|
|
124
114
|
|
|
115
|
+
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
116
|
+
|
|
117
|
+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
118
|
+
|
|
119
|
+
cachedTextDecoder.decode();
|
|
120
|
+
|
|
121
|
+
function getStringFromWasm0(ptr, len) {
|
|
122
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
125
|
let cachedFloat64Memory0 = null;
|
|
126
126
|
|
|
127
127
|
function getFloat64Memory0() {
|
|
@@ -230,7 +230,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
230
230
|
return real;
|
|
231
231
|
}
|
|
232
232
|
function __wbg_adapter_44(arg0, arg1, arg2) {
|
|
233
|
-
wasm.
|
|
233
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7b84be60ca8b9fd3(arg0, arg1, addHeapObject(arg2));
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
/**
|
|
@@ -404,121 +404,6 @@ export function retrieve(secret_key, name) {
|
|
|
404
404
|
return takeObject(ret);
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
/**
|
|
408
|
-
* @param {string} password
|
|
409
|
-
* @param {string} encrypted_descriptors
|
|
410
|
-
* @returns {Promise<any>}
|
|
411
|
-
*/
|
|
412
|
-
export function get_encrypted_wallet(password, encrypted_descriptors) {
|
|
413
|
-
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
414
|
-
const len0 = WASM_VECTOR_LEN;
|
|
415
|
-
const ptr1 = passStringToWasm0(encrypted_descriptors, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
416
|
-
const len1 = WASM_VECTOR_LEN;
|
|
417
|
-
const ret = wasm.get_encrypted_wallet(ptr0, len0, ptr1, len1);
|
|
418
|
-
return takeObject(ret);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* @param {string} encryption_password
|
|
423
|
-
* @param {string} seed_password
|
|
424
|
-
* @returns {Promise<any>}
|
|
425
|
-
*/
|
|
426
|
-
export function get_mnemonic_seed(encryption_password, seed_password) {
|
|
427
|
-
const ptr0 = passStringToWasm0(encryption_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
428
|
-
const len0 = WASM_VECTOR_LEN;
|
|
429
|
-
const ptr1 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
430
|
-
const len1 = WASM_VECTOR_LEN;
|
|
431
|
-
const ret = wasm.get_mnemonic_seed(ptr0, len0, ptr1, len1);
|
|
432
|
-
return takeObject(ret);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* @param {string} mnemonic
|
|
437
|
-
* @param {string} encryption_password
|
|
438
|
-
* @param {string} seed_password
|
|
439
|
-
* @returns {Promise<any>}
|
|
440
|
-
*/
|
|
441
|
-
export function save_mnemonic_seed(mnemonic, encryption_password, seed_password) {
|
|
442
|
-
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
443
|
-
const len0 = WASM_VECTOR_LEN;
|
|
444
|
-
const ptr1 = passStringToWasm0(encryption_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
445
|
-
const len1 = WASM_VECTOR_LEN;
|
|
446
|
-
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
447
|
-
const len2 = WASM_VECTOR_LEN;
|
|
448
|
-
const ret = wasm.save_mnemonic_seed(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
449
|
-
return takeObject(ret);
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* @param {string} descriptor
|
|
454
|
-
* @param {string | undefined} change_descriptor
|
|
455
|
-
* @returns {Promise<any>}
|
|
456
|
-
*/
|
|
457
|
-
export function get_wallet_data(descriptor, change_descriptor) {
|
|
458
|
-
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
459
|
-
const len0 = WASM_VECTOR_LEN;
|
|
460
|
-
var ptr1 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
461
|
-
var len1 = WASM_VECTOR_LEN;
|
|
462
|
-
const ret = wasm.get_wallet_data(ptr0, len0, ptr1, len1);
|
|
463
|
-
return takeObject(ret);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* @param {string} descriptor
|
|
468
|
-
* @param {string} change_descriptor
|
|
469
|
-
* @param {string} destination
|
|
470
|
-
* @param {bigint} amount
|
|
471
|
-
* @param {number | undefined} fee_rate
|
|
472
|
-
* @returns {Promise<any>}
|
|
473
|
-
*/
|
|
474
|
-
export function send_sats(descriptor, change_descriptor, destination, amount, fee_rate) {
|
|
475
|
-
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
476
|
-
const len0 = WASM_VECTOR_LEN;
|
|
477
|
-
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
478
|
-
const len1 = WASM_VECTOR_LEN;
|
|
479
|
-
const ptr2 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
480
|
-
const len2 = WASM_VECTOR_LEN;
|
|
481
|
-
const ret = wasm.send_sats(ptr0, len0, ptr1, len1, ptr2, len2, amount, !isLikeNone(fee_rate), isLikeNone(fee_rate) ? 0 : fee_rate);
|
|
482
|
-
return takeObject(ret);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* @param {string} descriptor
|
|
487
|
-
* @param {string} change_descriptor
|
|
488
|
-
* @param {string} address
|
|
489
|
-
* @param {string} uda_address
|
|
490
|
-
* @param {bigint} asset_amount
|
|
491
|
-
* @param {bigint} uda_amount
|
|
492
|
-
* @param {number | undefined} fee_rate
|
|
493
|
-
* @returns {Promise<any>}
|
|
494
|
-
*/
|
|
495
|
-
export function fund_vault(descriptor, change_descriptor, address, uda_address, asset_amount, uda_amount, fee_rate) {
|
|
496
|
-
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
497
|
-
const len0 = WASM_VECTOR_LEN;
|
|
498
|
-
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
|
-
const len1 = WASM_VECTOR_LEN;
|
|
500
|
-
const ptr2 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
501
|
-
const len2 = WASM_VECTOR_LEN;
|
|
502
|
-
const ptr3 = passStringToWasm0(uda_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
503
|
-
const len3 = WASM_VECTOR_LEN;
|
|
504
|
-
const ret = wasm.fund_vault(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, asset_amount, uda_amount, !isLikeNone(fee_rate), isLikeNone(fee_rate) ? 0 : fee_rate);
|
|
505
|
-
return takeObject(ret);
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* @param {string} rgb_assets_descriptor_xpub
|
|
510
|
-
* @param {string} rgb_udas_descriptor_xpub
|
|
511
|
-
* @returns {Promise<any>}
|
|
512
|
-
*/
|
|
513
|
-
export function get_assets_vault(rgb_assets_descriptor_xpub, rgb_udas_descriptor_xpub) {
|
|
514
|
-
const ptr0 = passStringToWasm0(rgb_assets_descriptor_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
515
|
-
const len0 = WASM_VECTOR_LEN;
|
|
516
|
-
const ptr1 = passStringToWasm0(rgb_udas_descriptor_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
517
|
-
const len1 = WASM_VECTOR_LEN;
|
|
518
|
-
const ret = wasm.get_assets_vault(ptr0, len0, ptr1, len1);
|
|
519
|
-
return takeObject(ret);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
407
|
/**
|
|
523
408
|
* @param {string} nostr_hex_sk
|
|
524
409
|
* @param {string} ticker
|
|
@@ -637,6 +522,133 @@ export function list_schemas(nostr_hex_sk) {
|
|
|
637
522
|
return takeObject(ret);
|
|
638
523
|
}
|
|
639
524
|
|
|
525
|
+
/**
|
|
526
|
+
* @param {string} nostr_hex_sk
|
|
527
|
+
* @param {any} request
|
|
528
|
+
* @returns {Promise<any>}
|
|
529
|
+
*/
|
|
530
|
+
export function import_contract(nostr_hex_sk, request) {
|
|
531
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
532
|
+
const len0 = WASM_VECTOR_LEN;
|
|
533
|
+
const ret = wasm.import_contract(ptr0, len0, addHeapObject(request));
|
|
534
|
+
return takeObject(ret);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* @param {string} password
|
|
539
|
+
* @param {string} encrypted_descriptors
|
|
540
|
+
* @returns {Promise<any>}
|
|
541
|
+
*/
|
|
542
|
+
export function get_encrypted_wallet(password, encrypted_descriptors) {
|
|
543
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
544
|
+
const len0 = WASM_VECTOR_LEN;
|
|
545
|
+
const ptr1 = passStringToWasm0(encrypted_descriptors, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
546
|
+
const len1 = WASM_VECTOR_LEN;
|
|
547
|
+
const ret = wasm.get_encrypted_wallet(ptr0, len0, ptr1, len1);
|
|
548
|
+
return takeObject(ret);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* @param {string} encryption_password
|
|
553
|
+
* @param {string} seed_password
|
|
554
|
+
* @returns {Promise<any>}
|
|
555
|
+
*/
|
|
556
|
+
export function get_mnemonic_seed(encryption_password, seed_password) {
|
|
557
|
+
const ptr0 = passStringToWasm0(encryption_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
558
|
+
const len0 = WASM_VECTOR_LEN;
|
|
559
|
+
const ptr1 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
560
|
+
const len1 = WASM_VECTOR_LEN;
|
|
561
|
+
const ret = wasm.get_mnemonic_seed(ptr0, len0, ptr1, len1);
|
|
562
|
+
return takeObject(ret);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* @param {string} mnemonic
|
|
567
|
+
* @param {string} encryption_password
|
|
568
|
+
* @param {string} seed_password
|
|
569
|
+
* @returns {Promise<any>}
|
|
570
|
+
*/
|
|
571
|
+
export function save_mnemonic_seed(mnemonic, encryption_password, seed_password) {
|
|
572
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
573
|
+
const len0 = WASM_VECTOR_LEN;
|
|
574
|
+
const ptr1 = passStringToWasm0(encryption_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
575
|
+
const len1 = WASM_VECTOR_LEN;
|
|
576
|
+
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
577
|
+
const len2 = WASM_VECTOR_LEN;
|
|
578
|
+
const ret = wasm.save_mnemonic_seed(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
579
|
+
return takeObject(ret);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* @param {string} descriptor
|
|
584
|
+
* @param {string | undefined} change_descriptor
|
|
585
|
+
* @returns {Promise<any>}
|
|
586
|
+
*/
|
|
587
|
+
export function get_wallet_data(descriptor, change_descriptor) {
|
|
588
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
589
|
+
const len0 = WASM_VECTOR_LEN;
|
|
590
|
+
var ptr1 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
591
|
+
var len1 = WASM_VECTOR_LEN;
|
|
592
|
+
const ret = wasm.get_wallet_data(ptr0, len0, ptr1, len1);
|
|
593
|
+
return takeObject(ret);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* @param {string} descriptor
|
|
598
|
+
* @param {string} change_descriptor
|
|
599
|
+
* @param {string} destination
|
|
600
|
+
* @param {bigint} amount
|
|
601
|
+
* @param {number | undefined} fee_rate
|
|
602
|
+
* @returns {Promise<any>}
|
|
603
|
+
*/
|
|
604
|
+
export function send_sats(descriptor, change_descriptor, destination, amount, fee_rate) {
|
|
605
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
606
|
+
const len0 = WASM_VECTOR_LEN;
|
|
607
|
+
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
608
|
+
const len1 = WASM_VECTOR_LEN;
|
|
609
|
+
const ptr2 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
610
|
+
const len2 = WASM_VECTOR_LEN;
|
|
611
|
+
const ret = wasm.send_sats(ptr0, len0, ptr1, len1, ptr2, len2, amount, !isLikeNone(fee_rate), isLikeNone(fee_rate) ? 0 : fee_rate);
|
|
612
|
+
return takeObject(ret);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* @param {string} descriptor
|
|
617
|
+
* @param {string} change_descriptor
|
|
618
|
+
* @param {string} address
|
|
619
|
+
* @param {string} uda_address
|
|
620
|
+
* @param {bigint} asset_amount
|
|
621
|
+
* @param {bigint} uda_amount
|
|
622
|
+
* @param {number | undefined} fee_rate
|
|
623
|
+
* @returns {Promise<any>}
|
|
624
|
+
*/
|
|
625
|
+
export function fund_vault(descriptor, change_descriptor, address, uda_address, asset_amount, uda_amount, fee_rate) {
|
|
626
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
627
|
+
const len0 = WASM_VECTOR_LEN;
|
|
628
|
+
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
629
|
+
const len1 = WASM_VECTOR_LEN;
|
|
630
|
+
const ptr2 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
|
+
const len2 = WASM_VECTOR_LEN;
|
|
632
|
+
const ptr3 = passStringToWasm0(uda_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
633
|
+
const len3 = WASM_VECTOR_LEN;
|
|
634
|
+
const ret = wasm.fund_vault(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, asset_amount, uda_amount, !isLikeNone(fee_rate), isLikeNone(fee_rate) ? 0 : fee_rate);
|
|
635
|
+
return takeObject(ret);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* @param {string} rgb_assets_descriptor_xpub
|
|
640
|
+
* @param {string} rgb_udas_descriptor_xpub
|
|
641
|
+
* @returns {Promise<any>}
|
|
642
|
+
*/
|
|
643
|
+
export function get_assets_vault(rgb_assets_descriptor_xpub, rgb_udas_descriptor_xpub) {
|
|
644
|
+
const ptr0 = passStringToWasm0(rgb_assets_descriptor_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
645
|
+
const len0 = WASM_VECTOR_LEN;
|
|
646
|
+
const ptr1 = passStringToWasm0(rgb_udas_descriptor_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
647
|
+
const len1 = WASM_VECTOR_LEN;
|
|
648
|
+
const ret = wasm.get_assets_vault(ptr0, len0, ptr1, len1);
|
|
649
|
+
return takeObject(ret);
|
|
650
|
+
}
|
|
651
|
+
|
|
640
652
|
let cachedUint32Memory0 = null;
|
|
641
653
|
|
|
642
654
|
function getUint32Memory0() {
|
|
@@ -663,14 +675,10 @@ function handleError(f, args) {
|
|
|
663
675
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
664
676
|
}
|
|
665
677
|
}
|
|
666
|
-
function
|
|
667
|
-
wasm.
|
|
678
|
+
function __wbg_adapter_166(arg0, arg1, arg2, arg3) {
|
|
679
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h5827c7de3ecaf54f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
668
680
|
}
|
|
669
681
|
|
|
670
|
-
export function __wbindgen_object_drop_ref(arg0) {
|
|
671
|
-
takeObject(arg0);
|
|
672
|
-
};
|
|
673
|
-
|
|
674
682
|
export function __wbindgen_string_get(arg0, arg1) {
|
|
675
683
|
const obj = getObject(arg1);
|
|
676
684
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -680,14 +688,13 @@ export function __wbindgen_string_get(arg0, arg1) {
|
|
|
680
688
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
681
689
|
};
|
|
682
690
|
|
|
683
|
-
export function
|
|
684
|
-
|
|
685
|
-
return addHeapObject(ret);
|
|
691
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
692
|
+
takeObject(arg0);
|
|
686
693
|
};
|
|
687
694
|
|
|
688
|
-
export function
|
|
689
|
-
const ret =
|
|
690
|
-
return
|
|
695
|
+
export function __wbindgen_is_string(arg0) {
|
|
696
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
697
|
+
return ret;
|
|
691
698
|
};
|
|
692
699
|
|
|
693
700
|
export function __wbindgen_is_object(arg0) {
|
|
@@ -721,6 +728,11 @@ export function __wbindgen_jsval_eq(arg0, arg1) {
|
|
|
721
728
|
return ret;
|
|
722
729
|
};
|
|
723
730
|
|
|
731
|
+
export function __wbindgen_string_new(arg0, arg1) {
|
|
732
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
733
|
+
return addHeapObject(ret);
|
|
734
|
+
};
|
|
735
|
+
|
|
724
736
|
export function __wbindgen_cb_drop(arg0) {
|
|
725
737
|
const obj = takeObject(arg0).original;
|
|
726
738
|
if (obj.cnt-- == 1) {
|
|
@@ -731,6 +743,11 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
731
743
|
return ret;
|
|
732
744
|
};
|
|
733
745
|
|
|
746
|
+
export function __wbindgen_error_new(arg0, arg1) {
|
|
747
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
748
|
+
return addHeapObject(ret);
|
|
749
|
+
};
|
|
750
|
+
|
|
734
751
|
export function __wbindgen_jsval_loose_eq(arg0, arg1) {
|
|
735
752
|
const ret = getObject(arg0) == getObject(arg1);
|
|
736
753
|
return ret;
|
|
@@ -804,11 +821,25 @@ export function __wbg_trace_fe50dc146726736b(arg0, arg1) {
|
|
|
804
821
|
console.trace(...v0);
|
|
805
822
|
};
|
|
806
823
|
|
|
807
|
-
export function
|
|
824
|
+
export function __wbg_fetch_cf75ae0b20981e3e(arg0) {
|
|
808
825
|
const ret = fetch(getObject(arg0));
|
|
809
826
|
return addHeapObject(ret);
|
|
810
827
|
};
|
|
811
828
|
|
|
829
|
+
export function __wbg_newwithstrandinit_c45f0dc6da26fd03() { return handleError(function (arg0, arg1, arg2) {
|
|
830
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
831
|
+
return addHeapObject(ret);
|
|
832
|
+
}, arguments) };
|
|
833
|
+
|
|
834
|
+
export function __wbg_new_f1c3a9c2533a55b8() { return handleError(function () {
|
|
835
|
+
const ret = new Headers();
|
|
836
|
+
return addHeapObject(ret);
|
|
837
|
+
}, arguments) };
|
|
838
|
+
|
|
839
|
+
export function __wbg_append_1be1d651f9ecf2eb() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
840
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
841
|
+
}, arguments) };
|
|
842
|
+
|
|
812
843
|
export function __wbg_signal_686bf5a4acff74a1(arg0) {
|
|
813
844
|
const ret = getObject(arg0).signal;
|
|
814
845
|
return addHeapObject(ret);
|
|
@@ -867,20 +898,6 @@ export function __wbg_text_f61464d781b099f0() { return handleError(function (arg
|
|
|
867
898
|
return addHeapObject(ret);
|
|
868
899
|
}, arguments) };
|
|
869
900
|
|
|
870
|
-
export function __wbg_new_f1c3a9c2533a55b8() { return handleError(function () {
|
|
871
|
-
const ret = new Headers();
|
|
872
|
-
return addHeapObject(ret);
|
|
873
|
-
}, arguments) };
|
|
874
|
-
|
|
875
|
-
export function __wbg_append_1be1d651f9ecf2eb() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
876
|
-
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
877
|
-
}, arguments) };
|
|
878
|
-
|
|
879
|
-
export function __wbg_newwithstrandinit_c45f0dc6da26fd03() { return handleError(function (arg0, arg1, arg2) {
|
|
880
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
881
|
-
return addHeapObject(ret);
|
|
882
|
-
}, arguments) };
|
|
883
|
-
|
|
884
901
|
export function __wbg_getRandomValues_3774744e221a22ad() { return handleError(function (arg0, arg1) {
|
|
885
902
|
getObject(arg0).getRandomValues(getObject(arg1));
|
|
886
903
|
}, arguments) };
|
|
@@ -909,11 +926,6 @@ export function __wbg_node_6a9d28205ed5b0d8(arg0) {
|
|
|
909
926
|
return addHeapObject(ret);
|
|
910
927
|
};
|
|
911
928
|
|
|
912
|
-
export function __wbindgen_is_string(arg0) {
|
|
913
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
914
|
-
return ret;
|
|
915
|
-
};
|
|
916
|
-
|
|
917
929
|
export function __wbg_msCrypto_adbc770ec9eca9c7(arg0) {
|
|
918
930
|
const ret = getObject(arg0).msCrypto;
|
|
919
931
|
return addHeapObject(ret);
|
|
@@ -1035,6 +1047,11 @@ export function __wbg_now_931686b195a14f9d() {
|
|
|
1035
1047
|
return ret;
|
|
1036
1048
|
};
|
|
1037
1049
|
|
|
1050
|
+
export function __wbg_entries_4e1315b774245952(arg0) {
|
|
1051
|
+
const ret = Object.entries(getObject(arg0));
|
|
1052
|
+
return addHeapObject(ret);
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1038
1055
|
export function __wbg_new_9d3a9ce4282a18a8(arg0, arg1) {
|
|
1039
1056
|
try {
|
|
1040
1057
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -1042,7 +1059,7 @@ export function __wbg_new_9d3a9ce4282a18a8(arg0, arg1) {
|
|
|
1042
1059
|
const a = state0.a;
|
|
1043
1060
|
state0.a = 0;
|
|
1044
1061
|
try {
|
|
1045
|
-
return
|
|
1062
|
+
return __wbg_adapter_166(a, state0.b, arg0, arg1);
|
|
1046
1063
|
} finally {
|
|
1047
1064
|
state0.a = a;
|
|
1048
1065
|
}
|
|
@@ -1153,8 +1170,8 @@ export function __wbindgen_memory() {
|
|
|
1153
1170
|
return addHeapObject(ret);
|
|
1154
1171
|
};
|
|
1155
1172
|
|
|
1156
|
-
export function
|
|
1157
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1173
|
+
export function __wbindgen_closure_wrapper10310(arg0, arg1, arg2) {
|
|
1174
|
+
const ret = makeMutClosure(arg0, arg1, 2650, __wbg_adapter_44);
|
|
1158
1175
|
return addHeapObject(ret);
|
|
1159
1176
|
};
|
|
1160
1177
|
|
package/bitmask_core_bg.wasm
CHANGED
|
Binary file
|