bitmask-core 1.0.7-beta.14 → 1.0.7-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bitmask_core.d.ts CHANGED
@@ -1,23 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function convert_contract_amount_raw(decimal: string, precision: number): string;
4
- export function convert_contract_amount_string(amount: bigint, precision: number): string;
5
- export function parse_contract_amount(amount: string): any;
6
- export function parse_contract_amount_precision(amount: string, precision: number): string;
7
- export function version(): any;
8
- export function fund_rgb_vault(sk: string, fee_rate: number, secrets: any, broadcast: boolean, fund_value: bigint | null | undefined, coordinator_fee: boolean): Promise<any>;
9
- export function transfer_sats(sk: string, address: string, sats: bigint, fee_rate: number, secrets: any): Promise<any>;
10
- export function get_btc_wallet(sk: string): Promise<any>;
11
- export function backup_btc_data(nostr_hex_sk: string): Promise<any>;
12
- export function recover_funds_from_bad_wallets(seed: string, pass_phrase: string, recover_address: string): Promise<any>;
13
- export function restore_btc_data(nostr_hex_sk: string): Promise<any>;
14
- export function store(secret_key: string, name: string, data: Uint8Array, force: boolean, metadata?: Uint8Array | null): Promise<any>;
15
- export function retrieve(secret_key: string, name: string): Promise<any>;
16
- export function retrieve_metadata(secret_key: string, name: string): Promise<any>;
17
- export function encode_hex(bytes: Uint8Array): string;
18
- export function encode_base64(bytes: Uint8Array): string;
19
- export function decode_hex(string: string): Uint8Array;
20
- export function decode_base64(string: string): Uint8Array;
21
3
  export function get_network(): Promise<any>;
22
4
  export function switch_network(network_str: string): Promise<any>;
23
5
  export function get_env(key: string): Promise<any>;
@@ -40,14 +22,12 @@ export function drain_wallet(destination: string, descriptor: string, change_des
40
22
  export function bump_fee(txid: string, fee_rate: number, descriptor: string, change_descriptor: string | null | undefined, broadcast: boolean): Promise<any>;
41
23
  export function psbt_sign_and_publish_file(request: any): Promise<any>;
42
24
  export function psbt_publish_file(request: any): Promise<any>;
43
- export function create_watcher(nostr_hex_sk: string, request: any): Promise<any>;
44
- export function recover_watcher(nostr_hex_sk: string, request: any): Promise<any>;
45
- export function destroy_watcher(nostr_hex_sk: string): Promise<any>;
46
- export function destroy_recover_watcher(nostr_hex_sk: string): Promise<any>;
47
- export function check_watcher(nostr_hex_sk: string): Promise<any>;
48
- export function watcher_next_address(nostr_hex_sk: string, request: string): Promise<any>;
49
- export function watcher_next_utxo(nostr_hex_sk: string, request: string): Promise<any>;
50
- export function watcher_unspent_utxos(nostr_hex_sk: string, request: string): Promise<any>;
25
+ export function fund_rgb_vault(sk: string, fee_rate: number, secrets: any, broadcast: boolean, fund_value: bigint | null | undefined, coordinator_fee: boolean): Promise<any>;
26
+ export function transfer_sats(sk: string, address: string, sats: bigint, fee_rate: number, secrets: any): Promise<any>;
27
+ export function get_btc_wallet(sk: string): Promise<any>;
28
+ export function backup_btc_data(nostr_hex_sk: string): Promise<any>;
29
+ export function recover_funds_from_bad_wallets(seed: string, pass_phrase: string, recover_address: string): Promise<any>;
30
+ export function restore_btc_data(nostr_hex_sk: string): Promise<any>;
51
31
  export function create_wallet(username: string, password: string): Promise<any>;
52
32
  export function auth(username: string, password: string): Promise<any>;
53
33
  export function ln_create_invoice(description: string, amount: number, token: string): Promise<any>;
@@ -57,6 +37,19 @@ export function pay_invoice(payment_request: string, token: string): Promise<any
57
37
  export function check_payment(payment_hash: string): Promise<any>;
58
38
  export function swap_btc_ln(token: string, ln_address?: string | null): Promise<any>;
59
39
  export function swap_ln_btc(address: string, amount: bigint, token: string): Promise<any>;
40
+ export function create_watcher(nostr_hex_sk: string, request: any): Promise<any>;
41
+ export function recover_watcher(nostr_hex_sk: string, request: any): Promise<any>;
42
+ export function destroy_watcher(nostr_hex_sk: string): Promise<any>;
43
+ export function destroy_recover_watcher(nostr_hex_sk: string): Promise<any>;
44
+ export function check_watcher(nostr_hex_sk: string): Promise<any>;
45
+ export function watcher_next_address(nostr_hex_sk: string, request: string): Promise<any>;
46
+ export function watcher_next_utxo(nostr_hex_sk: string, request: string): Promise<any>;
47
+ export function watcher_unspent_utxos(nostr_hex_sk: string, request: string): Promise<any>;
48
+ export function convert_contract_amount_raw(decimal: string, precision: number): string;
49
+ export function convert_contract_amount_string(amount: bigint, precision: number): string;
50
+ export function parse_contract_amount(amount: string): any;
51
+ export function parse_contract_amount_precision(amount: string, precision: number): string;
52
+ export function version(): any;
60
53
  export function get_rgb_version(): string;
61
54
  export function get_rgb_wallet(nostr_hex_sk: string): Promise<any>;
62
55
  export function get_btc_wallet_data(nostr_hex_sk: string): Promise<any>;
@@ -99,6 +92,13 @@ export function create_airdrop_claim(nostr_hex_sk: string, request: any): Promis
99
92
  export function close_airdrop(nostr_hex_sk: string, request: any): Promise<any>;
100
93
  export function backup_rgb_data(nostr_hex_sk: string): Promise<any>;
101
94
  export function restore_rgb_data(nostr_hex_sk: string): Promise<any>;
95
+ export function store(secret_key: string, name: string, data: Uint8Array, force: boolean, metadata?: Uint8Array | null): Promise<any>;
96
+ export function retrieve(secret_key: string, name: string): Promise<any>;
97
+ export function retrieve_metadata(secret_key: string, name: string): Promise<any>;
98
+ export function encode_hex(bytes: Uint8Array): string;
99
+ export function encode_base64(bytes: Uint8Array): string;
100
+ export function decode_hex(string: string): Uint8Array;
101
+ export function decode_base64(string: string): Uint8Array;
102
102
  export function new_nostr_pubkey(pubkey: string, token: string): Promise<any>;
103
103
  export function update_nostr_pubkey(pubkey: string, token: string): Promise<any>;
104
104
 
@@ -106,24 +106,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
106
106
 
107
107
  export interface InitOutput {
108
108
  readonly memory: WebAssembly.Memory;
109
- readonly convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
110
- readonly convert_contract_amount_string: (a: bigint, b: number) => [number, number];
111
- readonly parse_contract_amount: (a: number, b: number) => any;
112
- readonly parse_contract_amount_precision: (a: number, b: number, c: number) => [number, number];
113
- readonly version: () => any;
114
- readonly fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
115
- readonly transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
116
- readonly get_btc_wallet: (a: number, b: number) => any;
117
- readonly backup_btc_data: (a: number, b: number) => any;
118
- readonly recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
119
- readonly restore_btc_data: (a: number, b: number) => any;
120
- readonly store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
121
- readonly retrieve: (a: number, b: number, c: number, d: number) => any;
122
- readonly retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
123
- readonly encode_hex: (a: number, b: number) => [number, number];
124
- readonly encode_base64: (a: number, b: number) => [number, number];
125
- readonly decode_hex: (a: number, b: number) => [number, number, number, number];
126
- readonly decode_base64: (a: number, b: number) => [number, number, number, number];
127
109
  readonly get_network: () => any;
128
110
  readonly switch_network: (a: number, b: number) => any;
129
111
  readonly get_env: (a: number, b: number) => any;
@@ -146,14 +128,12 @@ export interface InitOutput {
146
128
  readonly bump_fee: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
147
129
  readonly psbt_sign_and_publish_file: (a: any) => any;
148
130
  readonly psbt_publish_file: (a: any) => any;
149
- readonly create_watcher: (a: number, b: number, c: any) => any;
150
- readonly recover_watcher: (a: number, b: number, c: any) => any;
151
- readonly destroy_watcher: (a: number, b: number) => any;
152
- readonly destroy_recover_watcher: (a: number, b: number) => any;
153
- readonly check_watcher: (a: number, b: number) => any;
154
- readonly watcher_next_address: (a: number, b: number, c: number, d: number) => any;
155
- readonly watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
156
- readonly watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
131
+ readonly fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
132
+ readonly transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
133
+ readonly get_btc_wallet: (a: number, b: number) => any;
134
+ readonly backup_btc_data: (a: number, b: number) => any;
135
+ readonly recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
136
+ readonly restore_btc_data: (a: number, b: number) => any;
157
137
  readonly create_wallet: (a: number, b: number, c: number, d: number) => any;
158
138
  readonly auth: (a: number, b: number, c: number, d: number) => any;
159
139
  readonly ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => any;
@@ -163,6 +143,19 @@ export interface InitOutput {
163
143
  readonly check_payment: (a: number, b: number) => any;
164
144
  readonly swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
165
145
  readonly swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
146
+ readonly create_watcher: (a: number, b: number, c: any) => any;
147
+ readonly recover_watcher: (a: number, b: number, c: any) => any;
148
+ readonly destroy_watcher: (a: number, b: number) => any;
149
+ readonly destroy_recover_watcher: (a: number, b: number) => any;
150
+ readonly check_watcher: (a: number, b: number) => any;
151
+ readonly watcher_next_address: (a: number, b: number, c: number, d: number) => any;
152
+ readonly watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
153
+ readonly watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
154
+ readonly convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
155
+ readonly convert_contract_amount_string: (a: bigint, b: number) => [number, number];
156
+ readonly parse_contract_amount: (a: number, b: number) => any;
157
+ readonly parse_contract_amount_precision: (a: number, b: number, c: number) => [number, number];
158
+ readonly version: () => any;
166
159
  readonly get_rgb_version: () => [number, number];
167
160
  readonly get_rgb_wallet: (a: number, b: number) => any;
168
161
  readonly get_btc_wallet_data: (a: number, b: number) => any;
@@ -201,6 +194,13 @@ export interface InitOutput {
201
194
  readonly close_airdrop: (a: number, b: number, c: any) => any;
202
195
  readonly backup_rgb_data: (a: number, b: number) => any;
203
196
  readonly restore_rgb_data: (a: number, b: number) => any;
197
+ readonly store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
198
+ readonly retrieve: (a: number, b: number, c: number, d: number) => any;
199
+ readonly retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
200
+ readonly encode_hex: (a: number, b: number) => [number, number];
201
+ readonly encode_base64: (a: number, b: number) => [number, number];
202
+ readonly decode_hex: (a: number, b: number) => [number, number, number, number];
203
+ readonly decode_base64: (a: number, b: number) => [number, number, number, number];
204
204
  readonly new_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
205
205
  readonly update_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
206
206
  readonly rustsecp256k1_v0_9_2_context_create: (a: number) => number;
@@ -228,12 +228,12 @@ export interface InitOutput {
228
228
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
229
229
  readonly __wbindgen_export_7: WebAssembly.Table;
230
230
  readonly __externref_table_dealloc: (a: number) => void;
231
- readonly closure1936_externref_shim: (a: number, b: number, c: any) => void;
232
- readonly closure2726_externref_shim: (a: number, b: number, c: any) => void;
233
- readonly closure2757_externref_shim: (a: number, b: number, c: any) => void;
231
+ readonly closure752_externref_shim: (a: number, b: number, c: any) => void;
232
+ readonly closure2732_externref_shim: (a: number, b: number, c: any) => void;
233
+ readonly closure2763_externref_shim: (a: number, b: number, c: any) => void;
234
234
  readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ceba1bc0c075797: (a: number, b: number) => void;
235
- readonly closure3937_externref_shim: (a: number, b: number, c: any) => void;
236
- readonly closure4229_externref_shim: (a: number, b: number, c: any, d: any) => void;
235
+ readonly closure3938_externref_shim: (a: number, b: number, c: any) => void;
236
+ readonly closure4230_externref_shim: (a: number, b: number, c: any, d: any) => void;
237
237
  readonly __wbindgen_start: () => void;
238
238
  }
239
239
 
package/bitmask_core.js CHANGED
@@ -213,296 +213,6 @@ function debugString(val) {
213
213
  // TODO we could test for more things here, like `Set`s and `Map`s.
214
214
  return className;
215
215
  }
216
- /**
217
- * @param {string} decimal
218
- * @param {number} precision
219
- * @returns {string}
220
- */
221
- export function convert_contract_amount_raw(decimal, precision) {
222
- let deferred2_0;
223
- let deferred2_1;
224
- try {
225
- const ptr0 = passStringToWasm0(decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
226
- const len0 = WASM_VECTOR_LEN;
227
- const ret = wasm.convert_contract_amount_raw(ptr0, len0, precision);
228
- deferred2_0 = ret[0];
229
- deferred2_1 = ret[1];
230
- return getStringFromWasm0(ret[0], ret[1]);
231
- } finally {
232
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
233
- }
234
- }
235
-
236
- /**
237
- * @param {bigint} amount
238
- * @param {number} precision
239
- * @returns {string}
240
- */
241
- export function convert_contract_amount_string(amount, precision) {
242
- let deferred1_0;
243
- let deferred1_1;
244
- try {
245
- const ret = wasm.convert_contract_amount_string(amount, precision);
246
- deferred1_0 = ret[0];
247
- deferred1_1 = ret[1];
248
- return getStringFromWasm0(ret[0], ret[1]);
249
- } finally {
250
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
251
- }
252
- }
253
-
254
- /**
255
- * @param {string} amount
256
- * @returns {any}
257
- */
258
- export function parse_contract_amount(amount) {
259
- const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
260
- const len0 = WASM_VECTOR_LEN;
261
- const ret = wasm.parse_contract_amount(ptr0, len0);
262
- return ret;
263
- }
264
-
265
- /**
266
- * @param {string} amount
267
- * @param {number} precision
268
- * @returns {string}
269
- */
270
- export function parse_contract_amount_precision(amount, precision) {
271
- let deferred2_0;
272
- let deferred2_1;
273
- try {
274
- const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
275
- const len0 = WASM_VECTOR_LEN;
276
- const ret = wasm.parse_contract_amount_precision(ptr0, len0, precision);
277
- deferred2_0 = ret[0];
278
- deferred2_1 = ret[1];
279
- return getStringFromWasm0(ret[0], ret[1]);
280
- } finally {
281
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
282
- }
283
- }
284
-
285
- /**
286
- * @returns {any}
287
- */
288
- export function version() {
289
- const ret = wasm.version();
290
- return ret;
291
- }
292
-
293
- /**
294
- * @param {string} sk
295
- * @param {number} fee_rate
296
- * @param {any} secrets
297
- * @param {boolean} broadcast
298
- * @param {bigint | null | undefined} fund_value
299
- * @param {boolean} coordinator_fee
300
- * @returns {Promise<any>}
301
- */
302
- export function fund_rgb_vault(sk, fee_rate, secrets, broadcast, fund_value, coordinator_fee) {
303
- const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
304
- const len0 = WASM_VECTOR_LEN;
305
- const ret = wasm.fund_rgb_vault(ptr0, len0, fee_rate, secrets, broadcast, !isLikeNone(fund_value), isLikeNone(fund_value) ? BigInt(0) : fund_value, coordinator_fee);
306
- return ret;
307
- }
308
-
309
- /**
310
- * @param {string} sk
311
- * @param {string} address
312
- * @param {bigint} sats
313
- * @param {number} fee_rate
314
- * @param {any} secrets
315
- * @returns {Promise<any>}
316
- */
317
- export function transfer_sats(sk, address, sats, fee_rate, secrets) {
318
- const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
319
- const len0 = WASM_VECTOR_LEN;
320
- const ptr1 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
321
- const len1 = WASM_VECTOR_LEN;
322
- const ret = wasm.transfer_sats(ptr0, len0, ptr1, len1, sats, fee_rate, secrets);
323
- return ret;
324
- }
325
-
326
- /**
327
- * @param {string} sk
328
- * @returns {Promise<any>}
329
- */
330
- export function get_btc_wallet(sk) {
331
- const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
332
- const len0 = WASM_VECTOR_LEN;
333
- const ret = wasm.get_btc_wallet(ptr0, len0);
334
- return ret;
335
- }
336
-
337
- /**
338
- * @param {string} nostr_hex_sk
339
- * @returns {Promise<any>}
340
- */
341
- export function backup_btc_data(nostr_hex_sk) {
342
- const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
343
- const len0 = WASM_VECTOR_LEN;
344
- const ret = wasm.backup_btc_data(ptr0, len0);
345
- return ret;
346
- }
347
-
348
- /**
349
- * @param {string} seed
350
- * @param {string} pass_phrase
351
- * @param {string} recover_address
352
- * @returns {Promise<any>}
353
- */
354
- export function recover_funds_from_bad_wallets(seed, pass_phrase, recover_address) {
355
- const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356
- const len0 = WASM_VECTOR_LEN;
357
- const ptr1 = passStringToWasm0(pass_phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
358
- const len1 = WASM_VECTOR_LEN;
359
- const ptr2 = passStringToWasm0(recover_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
360
- const len2 = WASM_VECTOR_LEN;
361
- const ret = wasm.recover_funds_from_bad_wallets(ptr0, len0, ptr1, len1, ptr2, len2);
362
- return ret;
363
- }
364
-
365
- /**
366
- * @param {string} nostr_hex_sk
367
- * @returns {Promise<any>}
368
- */
369
- export function restore_btc_data(nostr_hex_sk) {
370
- const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
371
- const len0 = WASM_VECTOR_LEN;
372
- const ret = wasm.restore_btc_data(ptr0, len0);
373
- return ret;
374
- }
375
-
376
- function passArray8ToWasm0(arg, malloc) {
377
- const ptr = malloc(arg.length * 1, 1) >>> 0;
378
- getUint8ArrayMemory0().set(arg, ptr / 1);
379
- WASM_VECTOR_LEN = arg.length;
380
- return ptr;
381
- }
382
- /**
383
- * @param {string} secret_key
384
- * @param {string} name
385
- * @param {Uint8Array} data
386
- * @param {boolean} force
387
- * @param {Uint8Array | null} [metadata]
388
- * @returns {Promise<any>}
389
- */
390
- export function store(secret_key, name, data, force, metadata) {
391
- const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
392
- const len0 = WASM_VECTOR_LEN;
393
- const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
- const len1 = WASM_VECTOR_LEN;
395
- const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
396
- const len2 = WASM_VECTOR_LEN;
397
- var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
398
- var len3 = WASM_VECTOR_LEN;
399
- const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
400
- return ret;
401
- }
402
-
403
- /**
404
- * @param {string} secret_key
405
- * @param {string} name
406
- * @returns {Promise<any>}
407
- */
408
- export function retrieve(secret_key, name) {
409
- const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
410
- const len0 = WASM_VECTOR_LEN;
411
- const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
412
- const len1 = WASM_VECTOR_LEN;
413
- const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
414
- return ret;
415
- }
416
-
417
- /**
418
- * @param {string} secret_key
419
- * @param {string} name
420
- * @returns {Promise<any>}
421
- */
422
- export function retrieve_metadata(secret_key, name) {
423
- const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
424
- const len0 = WASM_VECTOR_LEN;
425
- const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
426
- const len1 = WASM_VECTOR_LEN;
427
- const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
428
- return ret;
429
- }
430
-
431
- /**
432
- * @param {Uint8Array} bytes
433
- * @returns {string}
434
- */
435
- export function encode_hex(bytes) {
436
- let deferred2_0;
437
- let deferred2_1;
438
- try {
439
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
440
- const len0 = WASM_VECTOR_LEN;
441
- const ret = wasm.encode_hex(ptr0, len0);
442
- deferred2_0 = ret[0];
443
- deferred2_1 = ret[1];
444
- return getStringFromWasm0(ret[0], ret[1]);
445
- } finally {
446
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
447
- }
448
- }
449
-
450
- /**
451
- * @param {Uint8Array} bytes
452
- * @returns {string}
453
- */
454
- export function encode_base64(bytes) {
455
- let deferred2_0;
456
- let deferred2_1;
457
- try {
458
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
459
- const len0 = WASM_VECTOR_LEN;
460
- const ret = wasm.encode_base64(ptr0, len0);
461
- deferred2_0 = ret[0];
462
- deferred2_1 = ret[1];
463
- return getStringFromWasm0(ret[0], ret[1]);
464
- } finally {
465
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
466
- }
467
- }
468
-
469
- function takeFromExternrefTable0(idx) {
470
- const value = wasm.__wbindgen_export_4.get(idx);
471
- wasm.__externref_table_dealloc(idx);
472
- return value;
473
- }
474
- /**
475
- * @param {string} string
476
- * @returns {Uint8Array}
477
- */
478
- export function decode_hex(string) {
479
- const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
480
- const len0 = WASM_VECTOR_LEN;
481
- const ret = wasm.decode_hex(ptr0, len0);
482
- if (ret[3]) {
483
- throw takeFromExternrefTable0(ret[2]);
484
- }
485
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
486
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
487
- return v2;
488
- }
489
-
490
- /**
491
- * @param {string} string
492
- * @returns {Uint8Array}
493
- */
494
- export function decode_base64(string) {
495
- const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
496
- const len0 = WASM_VECTOR_LEN;
497
- const ret = wasm.decode_base64(ptr0, len0);
498
- if (ret[3]) {
499
- throw takeFromExternrefTable0(ret[2]);
500
- }
501
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
502
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
503
- return v2;
504
- }
505
-
506
216
  /**
507
217
  * @returns {Promise<any>}
508
218
  */
@@ -807,101 +517,85 @@ export function psbt_publish_file(request) {
807
517
  }
808
518
 
809
519
  /**
810
- * @param {string} nostr_hex_sk
811
- * @param {any} request
812
- * @returns {Promise<any>}
813
- */
814
- export function create_watcher(nostr_hex_sk, request) {
815
- const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
816
- const len0 = WASM_VECTOR_LEN;
817
- const ret = wasm.create_watcher(ptr0, len0, request);
818
- return ret;
819
- }
820
-
821
- /**
822
- * @param {string} nostr_hex_sk
823
- * @param {any} request
824
- * @returns {Promise<any>}
825
- */
826
- export function recover_watcher(nostr_hex_sk, request) {
827
- const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
828
- const len0 = WASM_VECTOR_LEN;
829
- const ret = wasm.recover_watcher(ptr0, len0, request);
830
- return ret;
831
- }
832
-
833
- /**
834
- * @param {string} nostr_hex_sk
520
+ * @param {string} sk
521
+ * @param {number} fee_rate
522
+ * @param {any} secrets
523
+ * @param {boolean} broadcast
524
+ * @param {bigint | null | undefined} fund_value
525
+ * @param {boolean} coordinator_fee
835
526
  * @returns {Promise<any>}
836
527
  */
837
- export function destroy_watcher(nostr_hex_sk) {
838
- const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
528
+ export function fund_rgb_vault(sk, fee_rate, secrets, broadcast, fund_value, coordinator_fee) {
529
+ const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
839
530
  const len0 = WASM_VECTOR_LEN;
840
- const ret = wasm.destroy_watcher(ptr0, len0);
531
+ const ret = wasm.fund_rgb_vault(ptr0, len0, fee_rate, secrets, broadcast, !isLikeNone(fund_value), isLikeNone(fund_value) ? BigInt(0) : fund_value, coordinator_fee);
841
532
  return ret;
842
533
  }
843
534
 
844
535
  /**
845
- * @param {string} nostr_hex_sk
536
+ * @param {string} sk
537
+ * @param {string} address
538
+ * @param {bigint} sats
539
+ * @param {number} fee_rate
540
+ * @param {any} secrets
846
541
  * @returns {Promise<any>}
847
542
  */
848
- export function destroy_recover_watcher(nostr_hex_sk) {
849
- const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
543
+ export function transfer_sats(sk, address, sats, fee_rate, secrets) {
544
+ const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
850
545
  const len0 = WASM_VECTOR_LEN;
851
- const ret = wasm.destroy_recover_watcher(ptr0, len0);
546
+ const ptr1 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
547
+ const len1 = WASM_VECTOR_LEN;
548
+ const ret = wasm.transfer_sats(ptr0, len0, ptr1, len1, sats, fee_rate, secrets);
852
549
  return ret;
853
550
  }
854
551
 
855
552
  /**
856
- * @param {string} nostr_hex_sk
553
+ * @param {string} sk
857
554
  * @returns {Promise<any>}
858
555
  */
859
- export function check_watcher(nostr_hex_sk) {
860
- const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
556
+ export function get_btc_wallet(sk) {
557
+ const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
861
558
  const len0 = WASM_VECTOR_LEN;
862
- const ret = wasm.check_watcher(ptr0, len0);
559
+ const ret = wasm.get_btc_wallet(ptr0, len0);
863
560
  return ret;
864
561
  }
865
562
 
866
563
  /**
867
564
  * @param {string} nostr_hex_sk
868
- * @param {string} request
869
565
  * @returns {Promise<any>}
870
566
  */
871
- export function watcher_next_address(nostr_hex_sk, request) {
567
+ export function backup_btc_data(nostr_hex_sk) {
872
568
  const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
873
569
  const len0 = WASM_VECTOR_LEN;
874
- const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
875
- const len1 = WASM_VECTOR_LEN;
876
- const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
570
+ const ret = wasm.backup_btc_data(ptr0, len0);
877
571
  return ret;
878
572
  }
879
573
 
880
574
  /**
881
- * @param {string} nostr_hex_sk
882
- * @param {string} request
575
+ * @param {string} seed
576
+ * @param {string} pass_phrase
577
+ * @param {string} recover_address
883
578
  * @returns {Promise<any>}
884
579
  */
885
- export function watcher_next_utxo(nostr_hex_sk, request) {
886
- const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
580
+ export function recover_funds_from_bad_wallets(seed, pass_phrase, recover_address) {
581
+ const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
887
582
  const len0 = WASM_VECTOR_LEN;
888
- const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
583
+ const ptr1 = passStringToWasm0(pass_phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
889
584
  const len1 = WASM_VECTOR_LEN;
890
- const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
585
+ const ptr2 = passStringToWasm0(recover_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
586
+ const len2 = WASM_VECTOR_LEN;
587
+ const ret = wasm.recover_funds_from_bad_wallets(ptr0, len0, ptr1, len1, ptr2, len2);
891
588
  return ret;
892
589
  }
893
590
 
894
591
  /**
895
592
  * @param {string} nostr_hex_sk
896
- * @param {string} request
897
593
  * @returns {Promise<any>}
898
594
  */
899
- export function watcher_unspent_utxos(nostr_hex_sk, request) {
595
+ export function restore_btc_data(nostr_hex_sk) {
900
596
  const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
901
597
  const len0 = WASM_VECTOR_LEN;
902
- const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
903
- const len1 = WASM_VECTOR_LEN;
904
- const ret = wasm.watcher_unspent_utxos(ptr0, len0, ptr1, len1);
598
+ const ret = wasm.restore_btc_data(ptr0, len0);
905
599
  return ret;
906
600
  }
907
601
 
@@ -949,78 +643,254 @@ export function ln_create_invoice(description, amount, token) {
949
643
  }
950
644
 
951
645
  /**
952
- * @param {string} token
646
+ * @param {string} token
647
+ * @returns {Promise<any>}
648
+ */
649
+ export function get_balance(token) {
650
+ const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
651
+ const len0 = WASM_VECTOR_LEN;
652
+ const ret = wasm.get_balance(ptr0, len0);
653
+ return ret;
654
+ }
655
+
656
+ /**
657
+ * @param {string} token
658
+ * @returns {Promise<any>}
659
+ */
660
+ export function get_txs(token) {
661
+ const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
662
+ const len0 = WASM_VECTOR_LEN;
663
+ const ret = wasm.get_txs(ptr0, len0);
664
+ return ret;
665
+ }
666
+
667
+ /**
668
+ * @param {string} payment_request
669
+ * @param {string} token
670
+ * @returns {Promise<any>}
671
+ */
672
+ export function pay_invoice(payment_request, token) {
673
+ const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
674
+ const len0 = WASM_VECTOR_LEN;
675
+ const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
676
+ const len1 = WASM_VECTOR_LEN;
677
+ const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
678
+ return ret;
679
+ }
680
+
681
+ /**
682
+ * @param {string} payment_hash
683
+ * @returns {Promise<any>}
684
+ */
685
+ export function check_payment(payment_hash) {
686
+ const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
687
+ const len0 = WASM_VECTOR_LEN;
688
+ const ret = wasm.check_payment(ptr0, len0);
689
+ return ret;
690
+ }
691
+
692
+ /**
693
+ * @param {string} token
694
+ * @param {string | null} [ln_address]
695
+ * @returns {Promise<any>}
696
+ */
697
+ export function swap_btc_ln(token, ln_address) {
698
+ const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
699
+ const len0 = WASM_VECTOR_LEN;
700
+ var ptr1 = isLikeNone(ln_address) ? 0 : passStringToWasm0(ln_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
701
+ var len1 = WASM_VECTOR_LEN;
702
+ const ret = wasm.swap_btc_ln(ptr0, len0, ptr1, len1);
703
+ return ret;
704
+ }
705
+
706
+ /**
707
+ * @param {string} address
708
+ * @param {bigint} amount
709
+ * @param {string} token
710
+ * @returns {Promise<any>}
711
+ */
712
+ export function swap_ln_btc(address, amount, token) {
713
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
714
+ const len0 = WASM_VECTOR_LEN;
715
+ const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
716
+ const len1 = WASM_VECTOR_LEN;
717
+ const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
718
+ return ret;
719
+ }
720
+
721
+ /**
722
+ * @param {string} nostr_hex_sk
723
+ * @param {any} request
724
+ * @returns {Promise<any>}
725
+ */
726
+ export function create_watcher(nostr_hex_sk, request) {
727
+ const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
728
+ const len0 = WASM_VECTOR_LEN;
729
+ const ret = wasm.create_watcher(ptr0, len0, request);
730
+ return ret;
731
+ }
732
+
733
+ /**
734
+ * @param {string} nostr_hex_sk
735
+ * @param {any} request
736
+ * @returns {Promise<any>}
737
+ */
738
+ export function recover_watcher(nostr_hex_sk, request) {
739
+ const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
740
+ const len0 = WASM_VECTOR_LEN;
741
+ const ret = wasm.recover_watcher(ptr0, len0, request);
742
+ return ret;
743
+ }
744
+
745
+ /**
746
+ * @param {string} nostr_hex_sk
747
+ * @returns {Promise<any>}
748
+ */
749
+ export function destroy_watcher(nostr_hex_sk) {
750
+ const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
751
+ const len0 = WASM_VECTOR_LEN;
752
+ const ret = wasm.destroy_watcher(ptr0, len0);
753
+ return ret;
754
+ }
755
+
756
+ /**
757
+ * @param {string} nostr_hex_sk
758
+ * @returns {Promise<any>}
759
+ */
760
+ export function destroy_recover_watcher(nostr_hex_sk) {
761
+ const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
762
+ const len0 = WASM_VECTOR_LEN;
763
+ const ret = wasm.destroy_recover_watcher(ptr0, len0);
764
+ return ret;
765
+ }
766
+
767
+ /**
768
+ * @param {string} nostr_hex_sk
953
769
  * @returns {Promise<any>}
954
770
  */
955
- export function get_balance(token) {
956
- const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
771
+ export function check_watcher(nostr_hex_sk) {
772
+ const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
957
773
  const len0 = WASM_VECTOR_LEN;
958
- const ret = wasm.get_balance(ptr0, len0);
774
+ const ret = wasm.check_watcher(ptr0, len0);
959
775
  return ret;
960
776
  }
961
777
 
962
778
  /**
963
- * @param {string} token
779
+ * @param {string} nostr_hex_sk
780
+ * @param {string} request
964
781
  * @returns {Promise<any>}
965
782
  */
966
- export function get_txs(token) {
967
- const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
783
+ export function watcher_next_address(nostr_hex_sk, request) {
784
+ const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
968
785
  const len0 = WASM_VECTOR_LEN;
969
- const ret = wasm.get_txs(ptr0, len0);
786
+ const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
787
+ const len1 = WASM_VECTOR_LEN;
788
+ const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
970
789
  return ret;
971
790
  }
972
791
 
973
792
  /**
974
- * @param {string} payment_request
975
- * @param {string} token
793
+ * @param {string} nostr_hex_sk
794
+ * @param {string} request
976
795
  * @returns {Promise<any>}
977
796
  */
978
- export function pay_invoice(payment_request, token) {
979
- const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
797
+ export function watcher_next_utxo(nostr_hex_sk, request) {
798
+ const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
980
799
  const len0 = WASM_VECTOR_LEN;
981
- const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
800
+ const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
982
801
  const len1 = WASM_VECTOR_LEN;
983
- const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
802
+ const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
984
803
  return ret;
985
804
  }
986
805
 
987
806
  /**
988
- * @param {string} payment_hash
807
+ * @param {string} nostr_hex_sk
808
+ * @param {string} request
989
809
  * @returns {Promise<any>}
990
810
  */
991
- export function check_payment(payment_hash) {
992
- const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
811
+ export function watcher_unspent_utxos(nostr_hex_sk, request) {
812
+ const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
993
813
  const len0 = WASM_VECTOR_LEN;
994
- const ret = wasm.check_payment(ptr0, len0);
814
+ const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
815
+ const len1 = WASM_VECTOR_LEN;
816
+ const ret = wasm.watcher_unspent_utxos(ptr0, len0, ptr1, len1);
995
817
  return ret;
996
818
  }
997
819
 
998
820
  /**
999
- * @param {string} token
1000
- * @param {string | null} [ln_address]
1001
- * @returns {Promise<any>}
821
+ * @param {string} decimal
822
+ * @param {number} precision
823
+ * @returns {string}
1002
824
  */
1003
- export function swap_btc_ln(token, ln_address) {
1004
- const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1005
- const len0 = WASM_VECTOR_LEN;
1006
- var ptr1 = isLikeNone(ln_address) ? 0 : passStringToWasm0(ln_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1007
- var len1 = WASM_VECTOR_LEN;
1008
- const ret = wasm.swap_btc_ln(ptr0, len0, ptr1, len1);
1009
- return ret;
825
+ export function convert_contract_amount_raw(decimal, precision) {
826
+ let deferred2_0;
827
+ let deferred2_1;
828
+ try {
829
+ const ptr0 = passStringToWasm0(decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
830
+ const len0 = WASM_VECTOR_LEN;
831
+ const ret = wasm.convert_contract_amount_raw(ptr0, len0, precision);
832
+ deferred2_0 = ret[0];
833
+ deferred2_1 = ret[1];
834
+ return getStringFromWasm0(ret[0], ret[1]);
835
+ } finally {
836
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
837
+ }
1010
838
  }
1011
839
 
1012
840
  /**
1013
- * @param {string} address
1014
841
  * @param {bigint} amount
1015
- * @param {string} token
1016
- * @returns {Promise<any>}
842
+ * @param {number} precision
843
+ * @returns {string}
1017
844
  */
1018
- export function swap_ln_btc(address, amount, token) {
1019
- const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
845
+ export function convert_contract_amount_string(amount, precision) {
846
+ let deferred1_0;
847
+ let deferred1_1;
848
+ try {
849
+ const ret = wasm.convert_contract_amount_string(amount, precision);
850
+ deferred1_0 = ret[0];
851
+ deferred1_1 = ret[1];
852
+ return getStringFromWasm0(ret[0], ret[1]);
853
+ } finally {
854
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
855
+ }
856
+ }
857
+
858
+ /**
859
+ * @param {string} amount
860
+ * @returns {any}
861
+ */
862
+ export function parse_contract_amount(amount) {
863
+ const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1020
864
  const len0 = WASM_VECTOR_LEN;
1021
- const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1022
- const len1 = WASM_VECTOR_LEN;
1023
- const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
865
+ const ret = wasm.parse_contract_amount(ptr0, len0);
866
+ return ret;
867
+ }
868
+
869
+ /**
870
+ * @param {string} amount
871
+ * @param {number} precision
872
+ * @returns {string}
873
+ */
874
+ export function parse_contract_amount_precision(amount, precision) {
875
+ let deferred2_0;
876
+ let deferred2_1;
877
+ try {
878
+ const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
879
+ const len0 = WASM_VECTOR_LEN;
880
+ const ret = wasm.parse_contract_amount_precision(ptr0, len0, precision);
881
+ deferred2_0 = ret[0];
882
+ deferred2_1 = ret[1];
883
+ return getStringFromWasm0(ret[0], ret[1]);
884
+ } finally {
885
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
886
+ }
887
+ }
888
+
889
+ /**
890
+ * @returns {any}
891
+ */
892
+ export function version() {
893
+ const ret = wasm.version();
1024
894
  return ret;
1025
895
  }
1026
896
 
@@ -1493,6 +1363,136 @@ export function restore_rgb_data(nostr_hex_sk) {
1493
1363
  return ret;
1494
1364
  }
1495
1365
 
1366
+ function passArray8ToWasm0(arg, malloc) {
1367
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1368
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1369
+ WASM_VECTOR_LEN = arg.length;
1370
+ return ptr;
1371
+ }
1372
+ /**
1373
+ * @param {string} secret_key
1374
+ * @param {string} name
1375
+ * @param {Uint8Array} data
1376
+ * @param {boolean} force
1377
+ * @param {Uint8Array | null} [metadata]
1378
+ * @returns {Promise<any>}
1379
+ */
1380
+ export function store(secret_key, name, data, force, metadata) {
1381
+ const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1382
+ const len0 = WASM_VECTOR_LEN;
1383
+ const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1384
+ const len1 = WASM_VECTOR_LEN;
1385
+ const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1386
+ const len2 = WASM_VECTOR_LEN;
1387
+ var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
1388
+ var len3 = WASM_VECTOR_LEN;
1389
+ const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
1390
+ return ret;
1391
+ }
1392
+
1393
+ /**
1394
+ * @param {string} secret_key
1395
+ * @param {string} name
1396
+ * @returns {Promise<any>}
1397
+ */
1398
+ export function retrieve(secret_key, name) {
1399
+ const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1400
+ const len0 = WASM_VECTOR_LEN;
1401
+ const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1402
+ const len1 = WASM_VECTOR_LEN;
1403
+ const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
1404
+ return ret;
1405
+ }
1406
+
1407
+ /**
1408
+ * @param {string} secret_key
1409
+ * @param {string} name
1410
+ * @returns {Promise<any>}
1411
+ */
1412
+ export function retrieve_metadata(secret_key, name) {
1413
+ const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1414
+ const len0 = WASM_VECTOR_LEN;
1415
+ const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1416
+ const len1 = WASM_VECTOR_LEN;
1417
+ const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
1418
+ return ret;
1419
+ }
1420
+
1421
+ /**
1422
+ * @param {Uint8Array} bytes
1423
+ * @returns {string}
1424
+ */
1425
+ export function encode_hex(bytes) {
1426
+ let deferred2_0;
1427
+ let deferred2_1;
1428
+ try {
1429
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1430
+ const len0 = WASM_VECTOR_LEN;
1431
+ const ret = wasm.encode_hex(ptr0, len0);
1432
+ deferred2_0 = ret[0];
1433
+ deferred2_1 = ret[1];
1434
+ return getStringFromWasm0(ret[0], ret[1]);
1435
+ } finally {
1436
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1437
+ }
1438
+ }
1439
+
1440
+ /**
1441
+ * @param {Uint8Array} bytes
1442
+ * @returns {string}
1443
+ */
1444
+ export function encode_base64(bytes) {
1445
+ let deferred2_0;
1446
+ let deferred2_1;
1447
+ try {
1448
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1449
+ const len0 = WASM_VECTOR_LEN;
1450
+ const ret = wasm.encode_base64(ptr0, len0);
1451
+ deferred2_0 = ret[0];
1452
+ deferred2_1 = ret[1];
1453
+ return getStringFromWasm0(ret[0], ret[1]);
1454
+ } finally {
1455
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1456
+ }
1457
+ }
1458
+
1459
+ function takeFromExternrefTable0(idx) {
1460
+ const value = wasm.__wbindgen_export_4.get(idx);
1461
+ wasm.__externref_table_dealloc(idx);
1462
+ return value;
1463
+ }
1464
+ /**
1465
+ * @param {string} string
1466
+ * @returns {Uint8Array}
1467
+ */
1468
+ export function decode_hex(string) {
1469
+ const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1470
+ const len0 = WASM_VECTOR_LEN;
1471
+ const ret = wasm.decode_hex(ptr0, len0);
1472
+ if (ret[3]) {
1473
+ throw takeFromExternrefTable0(ret[2]);
1474
+ }
1475
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1476
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1477
+ return v2;
1478
+ }
1479
+
1480
+ /**
1481
+ * @param {string} string
1482
+ * @returns {Uint8Array}
1483
+ */
1484
+ export function decode_base64(string) {
1485
+ const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1486
+ const len0 = WASM_VECTOR_LEN;
1487
+ const ret = wasm.decode_base64(ptr0, len0);
1488
+ if (ret[3]) {
1489
+ throw takeFromExternrefTable0(ret[2]);
1490
+ }
1491
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1492
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1493
+ return v2;
1494
+ }
1495
+
1496
1496
  /**
1497
1497
  * @param {string} pubkey
1498
1498
  * @param {string} token
@@ -1522,15 +1522,15 @@ export function update_nostr_pubkey(pubkey, token) {
1522
1522
  }
1523
1523
 
1524
1524
  function __wbg_adapter_54(arg0, arg1, arg2) {
1525
- wasm.closure1936_externref_shim(arg0, arg1, arg2);
1525
+ wasm.closure752_externref_shim(arg0, arg1, arg2);
1526
1526
  }
1527
1527
 
1528
1528
  function __wbg_adapter_57(arg0, arg1, arg2) {
1529
- wasm.closure2726_externref_shim(arg0, arg1, arg2);
1529
+ wasm.closure2732_externref_shim(arg0, arg1, arg2);
1530
1530
  }
1531
1531
 
1532
1532
  function __wbg_adapter_60(arg0, arg1, arg2) {
1533
- wasm.closure2757_externref_shim(arg0, arg1, arg2);
1533
+ wasm.closure2763_externref_shim(arg0, arg1, arg2);
1534
1534
  }
1535
1535
 
1536
1536
  function __wbg_adapter_63(arg0, arg1) {
@@ -1538,11 +1538,11 @@ function __wbg_adapter_63(arg0, arg1) {
1538
1538
  }
1539
1539
 
1540
1540
  function __wbg_adapter_66(arg0, arg1, arg2) {
1541
- wasm.closure3937_externref_shim(arg0, arg1, arg2);
1541
+ wasm.closure3938_externref_shim(arg0, arg1, arg2);
1542
1542
  }
1543
1543
 
1544
1544
  function __wbg_adapter_430(arg0, arg1, arg2, arg3) {
1545
- wasm.closure4229_externref_shim(arg0, arg1, arg2, arg3);
1545
+ wasm.closure4230_externref_shim(arg0, arg1, arg2, arg3);
1546
1546
  }
1547
1547
 
1548
1548
  const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
@@ -2309,24 +2309,24 @@ function __wbg_get_imports() {
2309
2309
  const ret = false;
2310
2310
  return ret;
2311
2311
  };
2312
- imports.wbg.__wbindgen_closure_wrapper11844 = function(arg0, arg1, arg2) {
2313
- const ret = makeMutClosure(arg0, arg1, 2727, __wbg_adapter_57);
2312
+ imports.wbg.__wbindgen_closure_wrapper12229 = function(arg0, arg1, arg2) {
2313
+ const ret = makeMutClosure(arg0, arg1, 2733, __wbg_adapter_57);
2314
2314
  return ret;
2315
2315
  };
2316
- imports.wbg.__wbindgen_closure_wrapper11926 = function(arg0, arg1, arg2) {
2317
- const ret = makeMutClosure(arg0, arg1, 2758, __wbg_adapter_60);
2316
+ imports.wbg.__wbindgen_closure_wrapper12311 = function(arg0, arg1, arg2) {
2317
+ const ret = makeMutClosure(arg0, arg1, 2764, __wbg_adapter_60);
2318
2318
  return ret;
2319
2319
  };
2320
- imports.wbg.__wbindgen_closure_wrapper12106 = function(arg0, arg1, arg2) {
2321
- const ret = makeMutClosure(arg0, arg1, 2849, __wbg_adapter_63);
2320
+ imports.wbg.__wbindgen_closure_wrapper12491 = function(arg0, arg1, arg2) {
2321
+ const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_63);
2322
2322
  return ret;
2323
2323
  };
2324
- imports.wbg.__wbindgen_closure_wrapper16496 = function(arg0, arg1, arg2) {
2325
- const ret = makeMutClosure(arg0, arg1, 3938, __wbg_adapter_66);
2324
+ imports.wbg.__wbindgen_closure_wrapper16875 = function(arg0, arg1, arg2) {
2325
+ const ret = makeMutClosure(arg0, arg1, 3939, __wbg_adapter_66);
2326
2326
  return ret;
2327
2327
  };
2328
- imports.wbg.__wbindgen_closure_wrapper8046 = function(arg0, arg1, arg2) {
2329
- const ret = makeMutClosure(arg0, arg1, 1937, __wbg_adapter_54);
2328
+ imports.wbg.__wbindgen_closure_wrapper2557 = function(arg0, arg1, arg2) {
2329
+ const ret = makeMutClosure(arg0, arg1, 753, __wbg_adapter_54);
2330
2330
  return ret;
2331
2331
  };
2332
2332
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -1,24 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
5
- export const convert_contract_amount_string: (a: bigint, b: number) => [number, number];
6
- export const parse_contract_amount: (a: number, b: number) => any;
7
- export const parse_contract_amount_precision: (a: number, b: number, c: number) => [number, number];
8
- export const version: () => any;
9
- export const fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
10
- export const transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
11
- export const get_btc_wallet: (a: number, b: number) => any;
12
- export const backup_btc_data: (a: number, b: number) => any;
13
- export const recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
14
- export const restore_btc_data: (a: number, b: number) => any;
15
- export const store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
16
- export const retrieve: (a: number, b: number, c: number, d: number) => any;
17
- export const retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
18
- export const encode_hex: (a: number, b: number) => [number, number];
19
- export const encode_base64: (a: number, b: number) => [number, number];
20
- export const decode_hex: (a: number, b: number) => [number, number, number, number];
21
- export const decode_base64: (a: number, b: number) => [number, number, number, number];
22
4
  export const get_network: () => any;
23
5
  export const switch_network: (a: number, b: number) => any;
24
6
  export const get_env: (a: number, b: number) => any;
@@ -41,14 +23,12 @@ export const drain_wallet: (a: number, b: number, c: number, d: number, e: numbe
41
23
  export const bump_fee: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
42
24
  export const psbt_sign_and_publish_file: (a: any) => any;
43
25
  export const psbt_publish_file: (a: any) => any;
44
- export const create_watcher: (a: number, b: number, c: any) => any;
45
- export const recover_watcher: (a: number, b: number, c: any) => any;
46
- export const destroy_watcher: (a: number, b: number) => any;
47
- export const destroy_recover_watcher: (a: number, b: number) => any;
48
- export const check_watcher: (a: number, b: number) => any;
49
- export const watcher_next_address: (a: number, b: number, c: number, d: number) => any;
50
- export const watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
51
- export const watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
26
+ export const fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
27
+ export const transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
28
+ export const get_btc_wallet: (a: number, b: number) => any;
29
+ export const backup_btc_data: (a: number, b: number) => any;
30
+ export const recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
31
+ export const restore_btc_data: (a: number, b: number) => any;
52
32
  export const create_wallet: (a: number, b: number, c: number, d: number) => any;
53
33
  export const auth: (a: number, b: number, c: number, d: number) => any;
54
34
  export const ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => any;
@@ -58,6 +38,19 @@ export const pay_invoice: (a: number, b: number, c: number, d: number) => any;
58
38
  export const check_payment: (a: number, b: number) => any;
59
39
  export const swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
60
40
  export const swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
41
+ export const create_watcher: (a: number, b: number, c: any) => any;
42
+ export const recover_watcher: (a: number, b: number, c: any) => any;
43
+ export const destroy_watcher: (a: number, b: number) => any;
44
+ export const destroy_recover_watcher: (a: number, b: number) => any;
45
+ export const check_watcher: (a: number, b: number) => any;
46
+ export const watcher_next_address: (a: number, b: number, c: number, d: number) => any;
47
+ export const watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
48
+ export const watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
49
+ export const convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
50
+ export const convert_contract_amount_string: (a: bigint, b: number) => [number, number];
51
+ export const parse_contract_amount: (a: number, b: number) => any;
52
+ export const parse_contract_amount_precision: (a: number, b: number, c: number) => [number, number];
53
+ export const version: () => any;
61
54
  export const get_rgb_version: () => [number, number];
62
55
  export const get_rgb_wallet: (a: number, b: number) => any;
63
56
  export const get_btc_wallet_data: (a: number, b: number) => any;
@@ -96,6 +89,13 @@ export const create_airdrop_claim: (a: number, b: number, c: any) => any;
96
89
  export const close_airdrop: (a: number, b: number, c: any) => any;
97
90
  export const backup_rgb_data: (a: number, b: number) => any;
98
91
  export const restore_rgb_data: (a: number, b: number) => any;
92
+ export const store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
93
+ export const retrieve: (a: number, b: number, c: number, d: number) => any;
94
+ export const retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
95
+ export const encode_hex: (a: number, b: number) => [number, number];
96
+ export const encode_base64: (a: number, b: number) => [number, number];
97
+ export const decode_hex: (a: number, b: number) => [number, number, number, number];
98
+ export const decode_base64: (a: number, b: number) => [number, number, number, number];
99
99
  export const new_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
100
100
  export const update_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
101
101
  export const rustsecp256k1_v0_9_2_context_create: (a: number) => number;
@@ -123,10 +123,10 @@ export const __externref_drop_slice: (a: number, b: number) => void;
123
123
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
124
124
  export const __wbindgen_export_7: WebAssembly.Table;
125
125
  export const __externref_table_dealloc: (a: number) => void;
126
- export const closure1936_externref_shim: (a: number, b: number, c: any) => void;
127
- export const closure2726_externref_shim: (a: number, b: number, c: any) => void;
128
- export const closure2757_externref_shim: (a: number, b: number, c: any) => void;
126
+ export const closure752_externref_shim: (a: number, b: number, c: any) => void;
127
+ export const closure2732_externref_shim: (a: number, b: number, c: any) => void;
128
+ export const closure2763_externref_shim: (a: number, b: number, c: any) => void;
129
129
  export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ceba1bc0c075797: (a: number, b: number) => void;
130
- export const closure3937_externref_shim: (a: number, b: number, c: any) => void;
131
- export const closure4229_externref_shim: (a: number, b: number, c: any, d: any) => void;
130
+ export const closure3938_externref_shim: (a: number, b: number, c: any) => void;
131
+ export const closure4230_externref_shim: (a: number, b: number, c: any, d: any) => void;
132
132
  export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "Stanley Arua <stanarua@aol.com>"
10
10
  ],
11
11
  "description": "Core functionality for the BitMask wallet",
12
- "version": "1.0.7-beta.14",
12
+ "version": "1.0.7-beta.16",
13
13
  "license": "MIT/Apache-2.0",
14
14
  "repository": {
15
15
  "type": "git",