bitmask-core 0.7.0-beta.1 → 0.7.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 +53 -46
- package/bitmask_core.js +117 -105
- package/bitmask_core_bg.wasm +0 -0
- package/package.json +1 -1
- package/rgb.js +3 -1
- package/rgb.ts +6 -0
package/bitmask_core.d.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* @returns {Promise<any>}
|
|
5
|
+
*/
|
|
6
|
+
export function get_network(): Promise<any>;
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} network_str
|
|
9
|
+
* @returns {Promise<any>}
|
|
10
|
+
*/
|
|
11
|
+
export function switch_network(network_str: string): Promise<any>;
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} key
|
|
14
|
+
* @returns {Promise<any>}
|
|
15
|
+
*/
|
|
16
|
+
export function get_env(key: string): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} key
|
|
19
|
+
* @param {string} value
|
|
20
|
+
* @returns {Promise<any>}
|
|
21
|
+
*/
|
|
22
|
+
export function set_env(key: string, value: string): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* @param {number} ms
|
|
25
|
+
* @returns {Promise<any>}
|
|
26
|
+
*/
|
|
27
|
+
export function sleep(ms: number): Promise<any>;
|
|
28
|
+
/**
|
|
4
29
|
* @param {string} password
|
|
5
30
|
* @returns {string}
|
|
6
31
|
*/
|
|
@@ -181,43 +206,6 @@ export function decode_hex(string: string): Uint8Array;
|
|
|
181
206
|
*/
|
|
182
207
|
export function decode_base64(string: string): Uint8Array;
|
|
183
208
|
/**
|
|
184
|
-
* @returns {Promise<any>}
|
|
185
|
-
*/
|
|
186
|
-
export function get_network(): Promise<any>;
|
|
187
|
-
/**
|
|
188
|
-
* @param {string} network_str
|
|
189
|
-
* @returns {Promise<any>}
|
|
190
|
-
*/
|
|
191
|
-
export function switch_network(network_str: string): Promise<any>;
|
|
192
|
-
/**
|
|
193
|
-
* @param {string} key
|
|
194
|
-
* @returns {Promise<any>}
|
|
195
|
-
*/
|
|
196
|
-
export function get_env(key: string): Promise<any>;
|
|
197
|
-
/**
|
|
198
|
-
* @param {string} key
|
|
199
|
-
* @param {string} value
|
|
200
|
-
* @returns {Promise<any>}
|
|
201
|
-
*/
|
|
202
|
-
export function set_env(key: string, value: string): Promise<any>;
|
|
203
|
-
/**
|
|
204
|
-
* @param {number} ms
|
|
205
|
-
* @returns {Promise<any>}
|
|
206
|
-
*/
|
|
207
|
-
export function sleep(ms: number): Promise<any>;
|
|
208
|
-
/**
|
|
209
|
-
* @param {string} pubkey
|
|
210
|
-
* @param {string} token
|
|
211
|
-
* @returns {Promise<any>}
|
|
212
|
-
*/
|
|
213
|
-
export function new_nostr_pubkey(pubkey: string, token: string): Promise<any>;
|
|
214
|
-
/**
|
|
215
|
-
* @param {string} pubkey
|
|
216
|
-
* @param {string} token
|
|
217
|
-
* @returns {Promise<any>}
|
|
218
|
-
*/
|
|
219
|
-
export function update_nostr_pubkey(pubkey: string, token: string): Promise<any>;
|
|
220
|
-
/**
|
|
221
209
|
* @param {string} nostr_hex_sk
|
|
222
210
|
* @param {any} request
|
|
223
211
|
* @returns {Promise<any>}
|
|
@@ -416,6 +404,12 @@ export function create_bid(nostr_hex_sk: string, request: any): Promise<any>;
|
|
|
416
404
|
export function create_swap(nostr_hex_sk: string, request: any): Promise<any>;
|
|
417
405
|
/**
|
|
418
406
|
* @param {string} nostr_hex_sk
|
|
407
|
+
* @param {any} request
|
|
408
|
+
* @returns {Promise<any>}
|
|
409
|
+
*/
|
|
410
|
+
export function direct_swap(nostr_hex_sk: string, request: any): Promise<any>;
|
|
411
|
+
/**
|
|
412
|
+
* @param {string} nostr_hex_sk
|
|
419
413
|
* @returns {Promise<any>}
|
|
420
414
|
*/
|
|
421
415
|
export function public_offers(nostr_hex_sk: string): Promise<any>;
|
|
@@ -454,11 +448,27 @@ export function import_media(request: any): Promise<any>;
|
|
|
454
448
|
* @returns {Promise<any>}
|
|
455
449
|
*/
|
|
456
450
|
export function get_media(media_id: string): Promise<any>;
|
|
451
|
+
/**
|
|
452
|
+
* @param {string} pubkey
|
|
453
|
+
* @param {string} token
|
|
454
|
+
* @returns {Promise<any>}
|
|
455
|
+
*/
|
|
456
|
+
export function new_nostr_pubkey(pubkey: string, token: string): Promise<any>;
|
|
457
|
+
/**
|
|
458
|
+
* @param {string} pubkey
|
|
459
|
+
* @param {string} token
|
|
460
|
+
* @returns {Promise<any>}
|
|
461
|
+
*/
|
|
462
|
+
export function update_nostr_pubkey(pubkey: string, token: string): Promise<any>;
|
|
457
463
|
|
|
458
464
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
459
465
|
|
|
460
466
|
export interface InitOutput {
|
|
461
467
|
readonly memory: WebAssembly.Memory;
|
|
468
|
+
readonly switch_network: (a: number, b: number) => number;
|
|
469
|
+
readonly get_env: (a: number, b: number) => number;
|
|
470
|
+
readonly set_env: (a: number, b: number, c: number, d: number) => number;
|
|
471
|
+
readonly sleep: (a: number) => number;
|
|
462
472
|
readonly hash_password: (a: number, b: number, c: number) => void;
|
|
463
473
|
readonly new_mnemonic: (a: number, b: number) => number;
|
|
464
474
|
readonly decrypt_wallet: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -487,14 +497,8 @@ export interface InitOutput {
|
|
|
487
497
|
readonly encode_base64: (a: number, b: number, c: number) => void;
|
|
488
498
|
readonly decode_hex: (a: number, b: number, c: number) => void;
|
|
489
499
|
readonly decode_base64: (a: number, b: number, c: number) => void;
|
|
490
|
-
readonly sync_wallets: () => number;
|
|
491
|
-
readonly switch_network: (a: number, b: number) => number;
|
|
492
|
-
readonly get_env: (a: number, b: number) => number;
|
|
493
|
-
readonly set_env: (a: number, b: number, c: number, d: number) => number;
|
|
494
|
-
readonly sleep: (a: number) => number;
|
|
495
500
|
readonly get_network: () => number;
|
|
496
|
-
readonly
|
|
497
|
-
readonly update_nostr_pubkey: (a: number, b: number, c: number, d: number) => number;
|
|
501
|
+
readonly sync_wallets: () => number;
|
|
498
502
|
readonly issue_contract: (a: number, b: number, c: number) => number;
|
|
499
503
|
readonly reissue_contract: (a: number, b: number, c: number) => number;
|
|
500
504
|
readonly rgb_create_invoice: (a: number, b: number, c: number) => number;
|
|
@@ -528,6 +532,7 @@ export interface InitOutput {
|
|
|
528
532
|
readonly create_offer: (a: number, b: number, c: number) => number;
|
|
529
533
|
readonly create_bid: (a: number, b: number, c: number) => number;
|
|
530
534
|
readonly create_swap: (a: number, b: number, c: number) => number;
|
|
535
|
+
readonly direct_swap: (a: number, b: number, c: number) => number;
|
|
531
536
|
readonly public_offers: (a: number, b: number) => number;
|
|
532
537
|
readonly my_orders: (a: number, b: number) => number;
|
|
533
538
|
readonly my_offers: (a: number, b: number) => number;
|
|
@@ -536,6 +541,8 @@ export interface InitOutput {
|
|
|
536
541
|
readonly get_media: (a: number, b: number) => number;
|
|
537
542
|
readonly import_consignments: (a: number) => number;
|
|
538
543
|
readonly import_media: (a: number) => number;
|
|
544
|
+
readonly new_nostr_pubkey: (a: number, b: number, c: number, d: number) => number;
|
|
545
|
+
readonly update_nostr_pubkey: (a: number, b: number, c: number, d: number) => number;
|
|
539
546
|
readonly rustsecp256k1zkp_v0_8_0_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
540
547
|
readonly rustsecp256k1zkp_v0_8_0_default_error_callback_fn: (a: number, b: number) => void;
|
|
541
548
|
readonly rustsecp256k1_v0_8_1_context_create: (a: number) => number;
|
|
@@ -549,11 +556,11 @@ export interface InitOutput {
|
|
|
549
556
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
550
557
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
551
558
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
552
|
-
readonly
|
|
559
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6d05c64ec984f162: (a: number, b: number, c: number) => void;
|
|
553
560
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
554
561
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
555
562
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
556
|
-
readonly
|
|
563
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h3e5581f88d899d55: (a: number, b: number, c: number, d: number) => void;
|
|
557
564
|
}
|
|
558
565
|
|
|
559
566
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
package/bitmask_core.js
CHANGED
|
@@ -223,7 +223,60 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
223
223
|
return real;
|
|
224
224
|
}
|
|
225
225
|
function __wbg_adapter_48(arg0, arg1, arg2) {
|
|
226
|
-
wasm.
|
|
226
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6d05c64ec984f162(arg0, arg1, addHeapObject(arg2));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @returns {Promise<any>}
|
|
231
|
+
*/
|
|
232
|
+
export function get_network() {
|
|
233
|
+
const ret = wasm.get_network();
|
|
234
|
+
return takeObject(ret);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @param {string} network_str
|
|
239
|
+
* @returns {Promise<any>}
|
|
240
|
+
*/
|
|
241
|
+
export function switch_network(network_str) {
|
|
242
|
+
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
243
|
+
const len0 = WASM_VECTOR_LEN;
|
|
244
|
+
const ret = wasm.switch_network(ptr0, len0);
|
|
245
|
+
return takeObject(ret);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @param {string} key
|
|
250
|
+
* @returns {Promise<any>}
|
|
251
|
+
*/
|
|
252
|
+
export function get_env(key) {
|
|
253
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
254
|
+
const len0 = WASM_VECTOR_LEN;
|
|
255
|
+
const ret = wasm.get_env(ptr0, len0);
|
|
256
|
+
return takeObject(ret);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @param {string} key
|
|
261
|
+
* @param {string} value
|
|
262
|
+
* @returns {Promise<any>}
|
|
263
|
+
*/
|
|
264
|
+
export function set_env(key, value) {
|
|
265
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
266
|
+
const len0 = WASM_VECTOR_LEN;
|
|
267
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
268
|
+
const len1 = WASM_VECTOR_LEN;
|
|
269
|
+
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
270
|
+
return takeObject(ret);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* @param {number} ms
|
|
275
|
+
* @returns {Promise<any>}
|
|
276
|
+
*/
|
|
277
|
+
export function sleep(ms) {
|
|
278
|
+
const ret = wasm.sleep(ms);
|
|
279
|
+
return takeObject(ret);
|
|
227
280
|
}
|
|
228
281
|
|
|
229
282
|
/**
|
|
@@ -710,87 +763,6 @@ export function decode_base64(string) {
|
|
|
710
763
|
}
|
|
711
764
|
}
|
|
712
765
|
|
|
713
|
-
/**
|
|
714
|
-
* @returns {Promise<any>}
|
|
715
|
-
*/
|
|
716
|
-
export function get_network() {
|
|
717
|
-
const ret = wasm.get_network();
|
|
718
|
-
return takeObject(ret);
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
/**
|
|
722
|
-
* @param {string} network_str
|
|
723
|
-
* @returns {Promise<any>}
|
|
724
|
-
*/
|
|
725
|
-
export function switch_network(network_str) {
|
|
726
|
-
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
727
|
-
const len0 = WASM_VECTOR_LEN;
|
|
728
|
-
const ret = wasm.switch_network(ptr0, len0);
|
|
729
|
-
return takeObject(ret);
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* @param {string} key
|
|
734
|
-
* @returns {Promise<any>}
|
|
735
|
-
*/
|
|
736
|
-
export function get_env(key) {
|
|
737
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
738
|
-
const len0 = WASM_VECTOR_LEN;
|
|
739
|
-
const ret = wasm.get_env(ptr0, len0);
|
|
740
|
-
return takeObject(ret);
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* @param {string} key
|
|
745
|
-
* @param {string} value
|
|
746
|
-
* @returns {Promise<any>}
|
|
747
|
-
*/
|
|
748
|
-
export function set_env(key, value) {
|
|
749
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
750
|
-
const len0 = WASM_VECTOR_LEN;
|
|
751
|
-
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
752
|
-
const len1 = WASM_VECTOR_LEN;
|
|
753
|
-
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
754
|
-
return takeObject(ret);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
/**
|
|
758
|
-
* @param {number} ms
|
|
759
|
-
* @returns {Promise<any>}
|
|
760
|
-
*/
|
|
761
|
-
export function sleep(ms) {
|
|
762
|
-
const ret = wasm.sleep(ms);
|
|
763
|
-
return takeObject(ret);
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* @param {string} pubkey
|
|
768
|
-
* @param {string} token
|
|
769
|
-
* @returns {Promise<any>}
|
|
770
|
-
*/
|
|
771
|
-
export function new_nostr_pubkey(pubkey, token) {
|
|
772
|
-
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
773
|
-
const len0 = WASM_VECTOR_LEN;
|
|
774
|
-
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
775
|
-
const len1 = WASM_VECTOR_LEN;
|
|
776
|
-
const ret = wasm.new_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
777
|
-
return takeObject(ret);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
/**
|
|
781
|
-
* @param {string} pubkey
|
|
782
|
-
* @param {string} token
|
|
783
|
-
* @returns {Promise<any>}
|
|
784
|
-
*/
|
|
785
|
-
export function update_nostr_pubkey(pubkey, token) {
|
|
786
|
-
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
787
|
-
const len0 = WASM_VECTOR_LEN;
|
|
788
|
-
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
789
|
-
const len1 = WASM_VECTOR_LEN;
|
|
790
|
-
const ret = wasm.update_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
791
|
-
return takeObject(ret);
|
|
792
|
-
}
|
|
793
|
-
|
|
794
766
|
/**
|
|
795
767
|
* @param {string} nostr_hex_sk
|
|
796
768
|
* @param {any} request
|
|
@@ -1216,6 +1188,18 @@ export function create_swap(nostr_hex_sk, request) {
|
|
|
1216
1188
|
return takeObject(ret);
|
|
1217
1189
|
}
|
|
1218
1190
|
|
|
1191
|
+
/**
|
|
1192
|
+
* @param {string} nostr_hex_sk
|
|
1193
|
+
* @param {any} request
|
|
1194
|
+
* @returns {Promise<any>}
|
|
1195
|
+
*/
|
|
1196
|
+
export function direct_swap(nostr_hex_sk, request) {
|
|
1197
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1198
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1199
|
+
const ret = wasm.direct_swap(ptr0, len0, addHeapObject(request));
|
|
1200
|
+
return takeObject(ret);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1219
1203
|
/**
|
|
1220
1204
|
* @param {string} nostr_hex_sk
|
|
1221
1205
|
* @returns {Promise<any>}
|
|
@@ -1300,6 +1284,34 @@ export function get_media(media_id) {
|
|
|
1300
1284
|
return takeObject(ret);
|
|
1301
1285
|
}
|
|
1302
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* @param {string} pubkey
|
|
1289
|
+
* @param {string} token
|
|
1290
|
+
* @returns {Promise<any>}
|
|
1291
|
+
*/
|
|
1292
|
+
export function new_nostr_pubkey(pubkey, token) {
|
|
1293
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1294
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1295
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1296
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1297
|
+
const ret = wasm.new_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
1298
|
+
return takeObject(ret);
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* @param {string} pubkey
|
|
1303
|
+
* @param {string} token
|
|
1304
|
+
* @returns {Promise<any>}
|
|
1305
|
+
*/
|
|
1306
|
+
export function update_nostr_pubkey(pubkey, token) {
|
|
1307
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1309
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1310
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1311
|
+
const ret = wasm.update_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
1312
|
+
return takeObject(ret);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1303
1315
|
let cachedUint32Memory0 = null;
|
|
1304
1316
|
|
|
1305
1317
|
function getUint32Memory0() {
|
|
@@ -1327,8 +1339,8 @@ function handleError(f, args) {
|
|
|
1327
1339
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
1328
1340
|
}
|
|
1329
1341
|
}
|
|
1330
|
-
function
|
|
1331
|
-
wasm.
|
|
1342
|
+
function __wbg_adapter_273(arg0, arg1, arg2, arg3) {
|
|
1343
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3e5581f88d899d55(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
1332
1344
|
}
|
|
1333
1345
|
|
|
1334
1346
|
async function __wbg_load(module, imports) {
|
|
@@ -1392,15 +1404,6 @@ function __wbg_get_imports() {
|
|
|
1392
1404
|
const ret = getObject(arg0) === undefined;
|
|
1393
1405
|
return ret;
|
|
1394
1406
|
};
|
|
1395
|
-
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
1396
|
-
const obj = takeObject(arg0).original;
|
|
1397
|
-
if (obj.cnt-- == 1) {
|
|
1398
|
-
obj.a = 0;
|
|
1399
|
-
return true;
|
|
1400
|
-
}
|
|
1401
|
-
const ret = false;
|
|
1402
|
-
return ret;
|
|
1403
|
-
};
|
|
1404
1407
|
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
1405
1408
|
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
1406
1409
|
return ret;
|
|
@@ -1417,12 +1420,6 @@ function __wbg_get_imports() {
|
|
|
1417
1420
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
1418
1421
|
return ret;
|
|
1419
1422
|
};
|
|
1420
|
-
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
1421
|
-
const obj = getObject(arg1);
|
|
1422
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1423
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
1424
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
1425
|
-
};
|
|
1426
1423
|
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
1427
1424
|
const val = getObject(arg0);
|
|
1428
1425
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -1432,19 +1429,34 @@ function __wbg_get_imports() {
|
|
|
1432
1429
|
const ret = getObject(arg0) in getObject(arg1);
|
|
1433
1430
|
return ret;
|
|
1434
1431
|
};
|
|
1435
|
-
imports.wbg.
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1432
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
1433
|
+
const obj = getObject(arg1);
|
|
1434
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1435
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
1436
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
1438
1437
|
};
|
|
1439
1438
|
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
1440
1439
|
const v = getObject(arg0);
|
|
1441
1440
|
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1442
1441
|
return ret;
|
|
1443
1442
|
};
|
|
1443
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
1444
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1445
|
+
return addHeapObject(ret);
|
|
1446
|
+
};
|
|
1444
1447
|
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
1445
1448
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1446
1449
|
return addHeapObject(ret);
|
|
1447
1450
|
};
|
|
1451
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
1452
|
+
const obj = takeObject(arg0).original;
|
|
1453
|
+
if (obj.cnt-- == 1) {
|
|
1454
|
+
obj.a = 0;
|
|
1455
|
+
return true;
|
|
1456
|
+
}
|
|
1457
|
+
const ret = false;
|
|
1458
|
+
return ret;
|
|
1459
|
+
};
|
|
1448
1460
|
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
1449
1461
|
const ret = new Error();
|
|
1450
1462
|
return addHeapObject(ret);
|
|
@@ -1820,7 +1832,7 @@ function __wbg_get_imports() {
|
|
|
1820
1832
|
const a = state0.a;
|
|
1821
1833
|
state0.a = 0;
|
|
1822
1834
|
try {
|
|
1823
|
-
return
|
|
1835
|
+
return __wbg_adapter_273(a, state0.b, arg0, arg1);
|
|
1824
1836
|
} finally {
|
|
1825
1837
|
state0.a = a;
|
|
1826
1838
|
}
|
|
@@ -1920,8 +1932,8 @@ function __wbg_get_imports() {
|
|
|
1920
1932
|
const ret = wasm.memory;
|
|
1921
1933
|
return addHeapObject(ret);
|
|
1922
1934
|
};
|
|
1923
|
-
imports.wbg.
|
|
1924
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1935
|
+
imports.wbg.__wbindgen_closure_wrapper14388 = function(arg0, arg1, arg2) {
|
|
1936
|
+
const ret = makeMutClosure(arg0, arg1, 3417, __wbg_adapter_48);
|
|
1925
1937
|
return addHeapObject(ret);
|
|
1926
1938
|
};
|
|
1927
1939
|
|
package/bitmask_core_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/rgb.js
CHANGED
|
@@ -34,7 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.getMedia = exports.importMedia = exports.getConsignment = exports.importConsignments = exports.myBids = exports.myOffers = exports.myOrders = exports.publicOffers = exports.createSwap = exports.createBid = exports.createOffer = exports.decodeInvoice = exports.verifyTransfers = exports.removeTransfer = exports.saveTransfer = exports.listTransfers = exports.watcherUtxo = exports.watcherAddress = exports.watcherUnspentUtxos = exports.watcherNextUtxo = exports.watcherNextAddress = exports.watcherDetails = exports.createWatcher = exports.listSchemas = exports.listInterfaces = exports.listContracts = exports.acceptTransfer = exports.importContract = exports.fullTransferAsset = exports.transferAsset = exports.psbtSignFile = exports.createPsbt = exports.createInvoice = exports.issueContract = void 0;
|
|
37
|
+
exports.getMedia = exports.importMedia = exports.getConsignment = exports.importConsignments = exports.myBids = exports.myOffers = exports.myOrders = exports.publicOffers = exports.directSwap = exports.createSwap = exports.createBid = exports.createOffer = exports.decodeInvoice = exports.verifyTransfers = exports.removeTransfer = exports.saveTransfer = exports.listTransfers = exports.watcherUtxo = exports.watcherAddress = exports.watcherUnspentUtxos = exports.watcherNextUtxo = exports.watcherNextAddress = exports.watcherDetails = exports.createWatcher = exports.listSchemas = exports.listInterfaces = exports.listContracts = exports.acceptTransfer = exports.importContract = exports.fullTransferAsset = exports.transferAsset = exports.psbtSignFile = exports.createPsbt = exports.createInvoice = exports.issueContract = void 0;
|
|
38
38
|
const BMC = __importStar(require("./bitmask_core"));
|
|
39
39
|
const issueContract = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.issue_contract(nostrHexSk, request)); });
|
|
40
40
|
exports.issueContract = issueContract;
|
|
@@ -88,6 +88,8 @@ const createBid = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, fun
|
|
|
88
88
|
exports.createBid = createBid;
|
|
89
89
|
const createSwap = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_swap(nostrHexSk, request)); });
|
|
90
90
|
exports.createSwap = createSwap;
|
|
91
|
+
const directSwap = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.direct_swap(nostrHexSk, request)); });
|
|
92
|
+
exports.directSwap = directSwap;
|
|
91
93
|
const publicOffers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.public_offers(nostrHexSk)); });
|
|
92
94
|
exports.publicOffers = publicOffers;
|
|
93
95
|
const myOrders = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.my_orders(nostrHexSk)); });
|
package/rgb.ts
CHANGED
|
@@ -157,6 +157,12 @@ export const createSwap = async (
|
|
|
157
157
|
): Promise<RgbSwapResponse> =>
|
|
158
158
|
JSON.parse(await BMC.create_swap(nostrHexSk, request));
|
|
159
159
|
|
|
160
|
+
export const directSwap = async (
|
|
161
|
+
nostrHexSk: string,
|
|
162
|
+
request: RgbBidRequest
|
|
163
|
+
): Promise<RgbSwapResponse> =>
|
|
164
|
+
JSON.parse(await BMC.direct_swap(nostrHexSk, request));
|
|
165
|
+
|
|
160
166
|
export const publicOffers = async (
|
|
161
167
|
nostrHexSk: string
|
|
162
168
|
): Promise<PublicRgbOffersResponse> =>
|