@lendasat/lendaswap-sdk 0.1.65 → 0.1.68
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/README.md +200 -126
- package/dist/api.d.ts +139 -103
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +236 -137
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -27
- package/dist/index.js.map +1 -1
- package/package.json +14 -15
- package/wasm/lendaswap_wasm_sdk.d.ts +133 -123
- package/wasm/lendaswap_wasm_sdk_bg.js +548 -248
- package/wasm/lendaswap_wasm_sdk_bg.wasm +0 -0
- package/wasm/lendaswap_wasm_sdk_bg.wasm.d.ts +45 -35
- package/dist/price-calculations.test.d.ts +0 -2
- package/dist/price-calculations.test.d.ts.map +0 -1
- package/dist/price-calculations.test.js +0 -173
- package/dist/price-calculations.test.js.map +0 -1
- package/dist/storage/dexieSwapStorage.d.ts +0 -113
- package/dist/storage/dexieSwapStorage.d.ts.map +0 -1
- package/dist/storage/dexieSwapStorage.js +0 -200
- package/dist/storage/dexieSwapStorage.js.map +0 -1
- package/dist/storage/dexieVtxoSwapStorage.d.ts +0 -105
- package/dist/storage/dexieVtxoSwapStorage.d.ts.map +0 -1
- package/dist/storage/dexieVtxoSwapStorage.js +0 -149
- package/dist/storage/dexieVtxoSwapStorage.js.map +0 -1
- package/dist/storage/dexieWalletStorage.d.ts +0 -99
- package/dist/storage/dexieWalletStorage.d.ts.map +0 -1
- package/dist/storage/dexieWalletStorage.js +0 -139
- package/dist/storage/dexieWalletStorage.js.map +0 -1
- package/dist/storage/index.d.ts +0 -19
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -22
- package/dist/storage/index.js.map +0 -1
|
@@ -267,6 +267,28 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
267
267
|
WASM_VECTOR_LEN = array.length;
|
|
268
268
|
return ptr;
|
|
269
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Open the IndexedDB database with migrations.
|
|
272
|
+
*
|
|
273
|
+
* This function opens (or creates) the lendaswap IndexedDB database
|
|
274
|
+
* and runs any necessary migrations. It also migrates wallet data from
|
|
275
|
+
* the old Dexie-based `lendaswap-wallet` database if present.
|
|
276
|
+
*
|
|
277
|
+
* # Arguments
|
|
278
|
+
* * `db_name` - Optional database name (default: "lendaswap-v2")
|
|
279
|
+
*
|
|
280
|
+
* # Returns
|
|
281
|
+
* An `IdbStorageHandle` that can be used to create storage implementations.
|
|
282
|
+
* @param {string | null} [db_name]
|
|
283
|
+
* @returns {Promise<IdbStorageHandle>}
|
|
284
|
+
*/
|
|
285
|
+
export function openIdbDatabase(db_name) {
|
|
286
|
+
var ptr0 = isLikeNone(db_name) ? 0 : passStringToWasm0(db_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
287
|
+
var len0 = WASM_VECTOR_LEN;
|
|
288
|
+
const ret = wasm.openIdbDatabase(ptr0, len0);
|
|
289
|
+
return ret;
|
|
290
|
+
}
|
|
291
|
+
|
|
270
292
|
/**
|
|
271
293
|
* Initialize the WASM module.
|
|
272
294
|
*
|
|
@@ -312,16 +334,24 @@ export function getLogLevel() {
|
|
|
312
334
|
}
|
|
313
335
|
}
|
|
314
336
|
|
|
315
|
-
function
|
|
316
|
-
wasm.
|
|
337
|
+
function wasm_bindgen__convert__closures_____invoke__hc679149b55f75c33(arg0, arg1) {
|
|
338
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hc679149b55f75c33(arg0, arg1);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function wasm_bindgen__convert__closures_____invoke__h336ff17a2ee3a667(arg0, arg1, arg2) {
|
|
342
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h336ff17a2ee3a667(arg0, arg1, arg2);
|
|
317
343
|
}
|
|
318
344
|
|
|
319
|
-
function
|
|
320
|
-
wasm.
|
|
345
|
+
function wasm_bindgen__convert__closures_____invoke__h28f0f152c9423ebc(arg0, arg1, arg2) {
|
|
346
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h28f0f152c9423ebc(arg0, arg1, arg2);
|
|
321
347
|
}
|
|
322
348
|
|
|
323
|
-
function
|
|
324
|
-
wasm.
|
|
349
|
+
function wasm_bindgen__convert__closures_____invoke__h3ae63c3559e47aa7(arg0, arg1, arg2) {
|
|
350
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h3ae63c3559e47aa7(arg0, arg1, arg2);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function wasm_bindgen__convert__closures_____invoke__h95b85cd8e04171dd(arg0, arg1, arg2, arg3) {
|
|
354
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h95b85cd8e04171dd(arg0, arg1, arg2, arg3);
|
|
325
355
|
}
|
|
326
356
|
|
|
327
357
|
/**
|
|
@@ -376,6 +406,8 @@ export const SwapType = Object.freeze({
|
|
|
376
406
|
BtcToArkade: 2, "2": "BtcToArkade",
|
|
377
407
|
});
|
|
378
408
|
|
|
409
|
+
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
410
|
+
|
|
379
411
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
380
412
|
|
|
381
413
|
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
@@ -1400,10 +1432,51 @@ const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1400
1432
|
? { register: () => {}, unregister: () => {} }
|
|
1401
1433
|
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
1402
1434
|
/**
|
|
1403
|
-
* Lendaswap client.
|
|
1435
|
+
* Lendaswap client using IndexedDB storage.
|
|
1436
|
+
*
|
|
1437
|
+
* This client uses native Rust IndexedDB storage via the `idb` crate.
|
|
1438
|
+
*
|
|
1439
|
+
* # Example
|
|
1440
|
+
*
|
|
1441
|
+
* ```javascript
|
|
1442
|
+
* import init, { openIdbDatabase, Client, ClientBuilder } from '@lendasat/lendaswap-sdk';
|
|
1443
|
+
*
|
|
1444
|
+
* await init();
|
|
1445
|
+
*
|
|
1446
|
+
* // Open the IndexedDB database
|
|
1447
|
+
* const storage = await openIdbDatabase();
|
|
1448
|
+
*
|
|
1449
|
+
* // Create the client using the builder (recommended)
|
|
1450
|
+
* const client = new ClientBuilder()
|
|
1451
|
+
* .url('https://api.lendaswap.com')
|
|
1452
|
+
* .storage(storage)
|
|
1453
|
+
* .network('bitcoin')
|
|
1454
|
+
* .arkadeUrl('https://arkade.computer')
|
|
1455
|
+
* .esploraUrl('https://mempool.space/api')
|
|
1456
|
+
* .build();
|
|
1457
|
+
*
|
|
1458
|
+
* // Or use the constructor directly
|
|
1459
|
+
* const client2 = new Client(
|
|
1460
|
+
* 'https://api.lendaswap.com',
|
|
1461
|
+
* storage,
|
|
1462
|
+
* 'bitcoin',
|
|
1463
|
+
* 'https://arkade.computer',
|
|
1464
|
+
* 'https://mempool.space/api'
|
|
1465
|
+
* );
|
|
1466
|
+
*
|
|
1467
|
+
* await client.init();
|
|
1468
|
+
* ```
|
|
1404
1469
|
*/
|
|
1405
1470
|
export class Client {
|
|
1406
1471
|
|
|
1472
|
+
static __wrap(ptr) {
|
|
1473
|
+
ptr = ptr >>> 0;
|
|
1474
|
+
const obj = Object.create(Client.prototype);
|
|
1475
|
+
obj.__wbg_ptr = ptr;
|
|
1476
|
+
ClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1477
|
+
return obj;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1407
1480
|
__destroy_into_raw() {
|
|
1408
1481
|
const ptr = this.__wbg_ptr;
|
|
1409
1482
|
this.__wbg_ptr = 0;
|
|
@@ -1416,40 +1489,39 @@ export class Client {
|
|
|
1416
1489
|
wasm.__wbg_client_free(ptr, 0);
|
|
1417
1490
|
}
|
|
1418
1491
|
/**
|
|
1419
|
-
* Create a new
|
|
1492
|
+
* Create a new [`ClientBuilder`] for constructing a client.
|
|
1493
|
+
* @returns {ClientBuilder}
|
|
1494
|
+
*/
|
|
1495
|
+
static builder() {
|
|
1496
|
+
const ret = wasm.client_builder();
|
|
1497
|
+
return ClientBuilder.__wrap(ret);
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Create a new client with IndexedDB storage.
|
|
1420
1501
|
*
|
|
1421
1502
|
* # Arguments
|
|
1422
1503
|
* * `base_url` - The Lendaswap API URL
|
|
1423
|
-
* * `
|
|
1424
|
-
* * `swap_storage` - Storage provider for swap data
|
|
1425
|
-
* * `vtxo_swap_storage` - Storage provider for VTXO swap data
|
|
1504
|
+
* * `storage` - Storage handle from `openIdbDatabase()`
|
|
1426
1505
|
* * `network` - The Bitcoin network ("bitcoin" or "testnet")
|
|
1427
1506
|
* * `arkade_url` - The Arkade server URL
|
|
1428
1507
|
* * `esplora_url` - The Esplora API URL for on-chain Bitcoin operations
|
|
1429
1508
|
* @param {string} base_url
|
|
1430
|
-
* @param {
|
|
1431
|
-
* @param {JsSwapStorageProvider} swap_storage
|
|
1432
|
-
* @param {JsVtxoSwapStorageProvider} vtxo_swap_storage
|
|
1509
|
+
* @param {IdbStorageHandle} storage
|
|
1433
1510
|
* @param {string} network
|
|
1434
1511
|
* @param {string} arkade_url
|
|
1435
1512
|
* @param {string} esplora_url
|
|
1436
1513
|
*/
|
|
1437
|
-
constructor(base_url,
|
|
1514
|
+
constructor(base_url, storage, network, arkade_url, esplora_url) {
|
|
1438
1515
|
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1439
1516
|
const len0 = WASM_VECTOR_LEN;
|
|
1440
|
-
_assertClass(
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
const
|
|
1447
|
-
const
|
|
1448
|
-
const ptr5 = passStringToWasm0(arkade_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1449
|
-
const len5 = WASM_VECTOR_LEN;
|
|
1450
|
-
const ptr6 = passStringToWasm0(esplora_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1451
|
-
const len6 = WASM_VECTOR_LEN;
|
|
1452
|
-
const ret = wasm.client_new(ptr0, len0, ptr1, ptr2, ptr3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
1517
|
+
_assertClass(storage, IdbStorageHandle);
|
|
1518
|
+
const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1519
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1520
|
+
const ptr2 = passStringToWasm0(arkade_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1521
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1522
|
+
const ptr3 = passStringToWasm0(esplora_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1523
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1524
|
+
const ret = wasm.client_new(ptr0, len0, storage.__wbg_ptr, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1453
1525
|
if (ret[2]) {
|
|
1454
1526
|
throw takeFromExternrefTable0(ret[1]);
|
|
1455
1527
|
}
|
|
@@ -1470,13 +1542,14 @@ export class Client {
|
|
|
1470
1542
|
/**
|
|
1471
1543
|
* Create an Arkade to EVM swap.
|
|
1472
1544
|
* @param {string} target_address
|
|
1473
|
-
* @param {
|
|
1545
|
+
* @param {bigint | null | undefined} source_amount
|
|
1546
|
+
* @param {number | null | undefined} target_amount
|
|
1474
1547
|
* @param {string} target_token
|
|
1475
1548
|
* @param {string} target_chain
|
|
1476
1549
|
* @param {string | null} [referral_code]
|
|
1477
1550
|
* @returns {Promise<BtcToEvmSwapResponse>}
|
|
1478
1551
|
*/
|
|
1479
|
-
createArkadeToEvmSwap(target_address, target_amount, target_token, target_chain, referral_code) {
|
|
1552
|
+
createArkadeToEvmSwap(target_address, source_amount, target_amount, target_token, target_chain, referral_code) {
|
|
1480
1553
|
const ptr0 = passStringToWasm0(target_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1481
1554
|
const len0 = WASM_VECTOR_LEN;
|
|
1482
1555
|
const ptr1 = passStringToWasm0(target_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -1485,7 +1558,29 @@ export class Client {
|
|
|
1485
1558
|
const len2 = WASM_VECTOR_LEN;
|
|
1486
1559
|
var ptr3 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1487
1560
|
var len3 = WASM_VECTOR_LEN;
|
|
1488
|
-
const ret = wasm.client_createArkadeToEvmSwap(this.__wbg_ptr, ptr0, len0, target_amount, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1561
|
+
const ret = wasm.client_createArkadeToEvmSwap(this.__wbg_ptr, ptr0, len0, !isLikeNone(source_amount), isLikeNone(source_amount) ? BigInt(0) : source_amount, !isLikeNone(target_amount), isLikeNone(target_amount) ? 0 : target_amount, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1562
|
+
return ret;
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Create a Lightning to EVM swap.
|
|
1566
|
+
* @param {string} target_address
|
|
1567
|
+
* @param {bigint | null | undefined} source_amount
|
|
1568
|
+
* @param {number | null | undefined} target_amount
|
|
1569
|
+
* @param {string} target_token
|
|
1570
|
+
* @param {string} target_chain
|
|
1571
|
+
* @param {string | null} [referral_code]
|
|
1572
|
+
* @returns {Promise<BtcToEvmSwapResponse>}
|
|
1573
|
+
*/
|
|
1574
|
+
createLightningToEvmSwap(target_address, source_amount, target_amount, target_token, target_chain, referral_code) {
|
|
1575
|
+
const ptr0 = passStringToWasm0(target_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1576
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1577
|
+
const ptr1 = passStringToWasm0(target_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1578
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1579
|
+
const ptr2 = passStringToWasm0(target_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1580
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1581
|
+
var ptr3 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1582
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1583
|
+
const ret = wasm.client_createLightningToEvmSwap(this.__wbg_ptr, ptr0, len0, !isLikeNone(source_amount), isLikeNone(source_amount) ? BigInt(0) : source_amount, !isLikeNone(target_amount), isLikeNone(target_amount) ? 0 : target_amount, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1489
1584
|
return ret;
|
|
1490
1585
|
}
|
|
1491
1586
|
/**
|
|
@@ -1720,26 +1815,6 @@ export class Client {
|
|
|
1720
1815
|
const ret = wasm.client_deleteSwap(this.__wbg_ptr, ptr0, len0);
|
|
1721
1816
|
return ret;
|
|
1722
1817
|
}
|
|
1723
|
-
/**
|
|
1724
|
-
* Get the list of swap IDs that failed to deserialize during the last listAll() call.
|
|
1725
|
-
* These are "corrupted" entries that couldn't be loaded.
|
|
1726
|
-
* @returns {string[]}
|
|
1727
|
-
*/
|
|
1728
|
-
getCorruptedSwapIds() {
|
|
1729
|
-
const ret = wasm.client_getCorruptedSwapIds(this.__wbg_ptr);
|
|
1730
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1731
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1732
|
-
return v1;
|
|
1733
|
-
}
|
|
1734
|
-
/**
|
|
1735
|
-
* Delete all corrupted swap entries from storage.
|
|
1736
|
-
* Returns the number of entries deleted.
|
|
1737
|
-
* @returns {Promise<number>}
|
|
1738
|
-
*/
|
|
1739
|
-
deleteCorruptedSwaps() {
|
|
1740
|
-
const ret = wasm.client_deleteCorruptedSwaps(this.__wbg_ptr);
|
|
1741
|
-
return ret;
|
|
1742
|
-
}
|
|
1743
1818
|
/**
|
|
1744
1819
|
* Estimate the fee for a VTXO swap.
|
|
1745
1820
|
*
|
|
@@ -1832,6 +1907,138 @@ export class Client {
|
|
|
1832
1907
|
}
|
|
1833
1908
|
if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
|
|
1834
1909
|
|
|
1910
|
+
const ClientBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1911
|
+
? { register: () => {}, unregister: () => {} }
|
|
1912
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_clientbuilder_free(ptr >>> 0, 1));
|
|
1913
|
+
/**
|
|
1914
|
+
* Builder for constructing a [`Client`] with a fluent API.
|
|
1915
|
+
*
|
|
1916
|
+
* # Example
|
|
1917
|
+
*
|
|
1918
|
+
* ```javascript
|
|
1919
|
+
* import init, { openIdbDatabase, ClientBuilder } from '@lendasat/lendaswap-sdk';
|
|
1920
|
+
*
|
|
1921
|
+
* await init();
|
|
1922
|
+
*
|
|
1923
|
+
* const storage = await openIdbDatabase();
|
|
1924
|
+
*
|
|
1925
|
+
* const client = await ClientBuilder.new()
|
|
1926
|
+
* .url('https://api.lendaswap.com')
|
|
1927
|
+
* .storage(storage)
|
|
1928
|
+
* .network('bitcoin')
|
|
1929
|
+
* .arkadeUrl('https://arkade.computer')
|
|
1930
|
+
* .esploraUrl('https://mempool.space/api')
|
|
1931
|
+
* .build();
|
|
1932
|
+
*
|
|
1933
|
+
* await client.init();
|
|
1934
|
+
* ```
|
|
1935
|
+
*/
|
|
1936
|
+
export class ClientBuilder {
|
|
1937
|
+
|
|
1938
|
+
static __wrap(ptr) {
|
|
1939
|
+
ptr = ptr >>> 0;
|
|
1940
|
+
const obj = Object.create(ClientBuilder.prototype);
|
|
1941
|
+
obj.__wbg_ptr = ptr;
|
|
1942
|
+
ClientBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1943
|
+
return obj;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
__destroy_into_raw() {
|
|
1947
|
+
const ptr = this.__wbg_ptr;
|
|
1948
|
+
this.__wbg_ptr = 0;
|
|
1949
|
+
ClientBuilderFinalization.unregister(this);
|
|
1950
|
+
return ptr;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
free() {
|
|
1954
|
+
const ptr = this.__destroy_into_raw();
|
|
1955
|
+
wasm.__wbg_clientbuilder_free(ptr, 0);
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* Create a new client builder with all fields unset.
|
|
1959
|
+
*/
|
|
1960
|
+
constructor() {
|
|
1961
|
+
const ret = wasm.client_builder();
|
|
1962
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1963
|
+
ClientBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
1964
|
+
return this;
|
|
1965
|
+
}
|
|
1966
|
+
/**
|
|
1967
|
+
* Set the Lendaswap API URL.
|
|
1968
|
+
* @param {string} url
|
|
1969
|
+
* @returns {ClientBuilder}
|
|
1970
|
+
*/
|
|
1971
|
+
url(url) {
|
|
1972
|
+
const ptr = this.__destroy_into_raw();
|
|
1973
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1974
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1975
|
+
const ret = wasm.clientbuilder_url(ptr, ptr0, len0);
|
|
1976
|
+
return ClientBuilder.__wrap(ret);
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* Set the storage handle from `openIdbDatabase()`.
|
|
1980
|
+
* @param {IdbStorageHandle} storage
|
|
1981
|
+
* @returns {ClientBuilder}
|
|
1982
|
+
*/
|
|
1983
|
+
storage(storage) {
|
|
1984
|
+
const ptr = this.__destroy_into_raw();
|
|
1985
|
+
_assertClass(storage, IdbStorageHandle);
|
|
1986
|
+
const ret = wasm.clientbuilder_storage(ptr, storage.__wbg_ptr);
|
|
1987
|
+
return ClientBuilder.__wrap(ret);
|
|
1988
|
+
}
|
|
1989
|
+
/**
|
|
1990
|
+
* Set the Bitcoin network ("bitcoin", "testnet", "regtest", or "mutinynet").
|
|
1991
|
+
* @param {string} network
|
|
1992
|
+
* @returns {ClientBuilder}
|
|
1993
|
+
*/
|
|
1994
|
+
network(network) {
|
|
1995
|
+
const ptr = this.__destroy_into_raw();
|
|
1996
|
+
const ptr0 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1997
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1998
|
+
const ret = wasm.clientbuilder_network(ptr, ptr0, len0);
|
|
1999
|
+
return ClientBuilder.__wrap(ret);
|
|
2000
|
+
}
|
|
2001
|
+
/**
|
|
2002
|
+
* Set the Arkade server URL.
|
|
2003
|
+
* @param {string} url
|
|
2004
|
+
* @returns {ClientBuilder}
|
|
2005
|
+
*/
|
|
2006
|
+
arkadeUrl(url) {
|
|
2007
|
+
const ptr = this.__destroy_into_raw();
|
|
2008
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2009
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2010
|
+
const ret = wasm.clientbuilder_arkadeUrl(ptr, ptr0, len0);
|
|
2011
|
+
return ClientBuilder.__wrap(ret);
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* Set the Esplora API URL for on-chain Bitcoin operations.
|
|
2015
|
+
* @param {string} url
|
|
2016
|
+
* @returns {ClientBuilder}
|
|
2017
|
+
*/
|
|
2018
|
+
esploraUrl(url) {
|
|
2019
|
+
const ptr = this.__destroy_into_raw();
|
|
2020
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2021
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2022
|
+
const ret = wasm.clientbuilder_esploraUrl(ptr, ptr0, len0);
|
|
2023
|
+
return ClientBuilder.__wrap(ret);
|
|
2024
|
+
}
|
|
2025
|
+
/**
|
|
2026
|
+
* Build the client, consuming the builder.
|
|
2027
|
+
*
|
|
2028
|
+
* Returns an error if any required field is missing.
|
|
2029
|
+
* @returns {Client}
|
|
2030
|
+
*/
|
|
2031
|
+
build() {
|
|
2032
|
+
const ptr = this.__destroy_into_raw();
|
|
2033
|
+
const ret = wasm.clientbuilder_build(ptr);
|
|
2034
|
+
if (ret[2]) {
|
|
2035
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2036
|
+
}
|
|
2037
|
+
return Client.__wrap(ret[0]);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
if (Symbol.dispose) ClientBuilder.prototype[Symbol.dispose] = ClientBuilder.prototype.free;
|
|
2041
|
+
|
|
1835
2042
|
const CreateVtxoSwapResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1836
2043
|
? { register: () => {}, unregister: () => {} }
|
|
1837
2044
|
: new FinalizationRegistry(ptr => wasm.__wbg_createvtxoswapresult_free(ptr >>> 0, 1));
|
|
@@ -2774,6 +2981,58 @@ export class ExtendedVtxoSwapStorageData {
|
|
|
2774
2981
|
}
|
|
2775
2982
|
if (Symbol.dispose) ExtendedVtxoSwapStorageData.prototype[Symbol.dispose] = ExtendedVtxoSwapStorageData.prototype.free;
|
|
2776
2983
|
|
|
2984
|
+
const IdbStorageHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2985
|
+
? { register: () => {}, unregister: () => {} }
|
|
2986
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_idbstoragehandle_free(ptr >>> 0, 1));
|
|
2987
|
+
/**
|
|
2988
|
+
* Shared database handle for all storage implementations.
|
|
2989
|
+
*/
|
|
2990
|
+
export class IdbStorageHandle {
|
|
2991
|
+
|
|
2992
|
+
static __wrap(ptr) {
|
|
2993
|
+
ptr = ptr >>> 0;
|
|
2994
|
+
const obj = Object.create(IdbStorageHandle.prototype);
|
|
2995
|
+
obj.__wbg_ptr = ptr;
|
|
2996
|
+
IdbStorageHandleFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2997
|
+
return obj;
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
__destroy_into_raw() {
|
|
3001
|
+
const ptr = this.__wbg_ptr;
|
|
3002
|
+
this.__wbg_ptr = 0;
|
|
3003
|
+
IdbStorageHandleFinalization.unregister(this);
|
|
3004
|
+
return ptr;
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
free() {
|
|
3008
|
+
const ptr = this.__destroy_into_raw();
|
|
3009
|
+
wasm.__wbg_idbstoragehandle_free(ptr, 0);
|
|
3010
|
+
}
|
|
3011
|
+
/**
|
|
3012
|
+
* Get the database name.
|
|
3013
|
+
* @returns {string}
|
|
3014
|
+
*/
|
|
3015
|
+
get name() {
|
|
3016
|
+
let deferred1_0;
|
|
3017
|
+
let deferred1_1;
|
|
3018
|
+
try {
|
|
3019
|
+
const ret = wasm.idbstoragehandle_name(this.__wbg_ptr);
|
|
3020
|
+
deferred1_0 = ret[0];
|
|
3021
|
+
deferred1_1 = ret[1];
|
|
3022
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3023
|
+
} finally {
|
|
3024
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
/**
|
|
3028
|
+
* Close the database connection.
|
|
3029
|
+
*/
|
|
3030
|
+
close() {
|
|
3031
|
+
wasm.idbstoragehandle_close(this.__wbg_ptr);
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
if (Symbol.dispose) IdbStorageHandle.prototype[Symbol.dispose] = IdbStorageHandle.prototype.free;
|
|
3035
|
+
|
|
2777
3036
|
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2778
3037
|
? { register: () => {}, unregister: () => {} }
|
|
2779
3038
|
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
|
|
@@ -2903,186 +3162,6 @@ export class IntoUnderlyingSource {
|
|
|
2903
3162
|
}
|
|
2904
3163
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
2905
3164
|
|
|
2906
|
-
const JsSwapStorageProviderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2907
|
-
? { register: () => {}, unregister: () => {} }
|
|
2908
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_jsswapstorageprovider_free(ptr >>> 0, 1));
|
|
2909
|
-
/**
|
|
2910
|
-
* JavaScript swap storage provider passed from TypeScript.
|
|
2911
|
-
*
|
|
2912
|
-
* This struct wraps JavaScript callback functions that implement
|
|
2913
|
-
* typed swap storage operations. Each function should return a Promise.
|
|
2914
|
-
*
|
|
2915
|
-
* # Example (TypeScript with Dexie)
|
|
2916
|
-
*
|
|
2917
|
-
* ```typescript
|
|
2918
|
-
* import Dexie from 'dexie';
|
|
2919
|
-
*
|
|
2920
|
-
* const db = new Dexie('lendaswap');
|
|
2921
|
-
* db.version(1).stores({ swaps: 'id' });
|
|
2922
|
-
*
|
|
2923
|
-
* const swapStorage = new JsSwapStorageProvider(
|
|
2924
|
-
* async (swapId) => await db.swaps.get(swapId) ?? null,
|
|
2925
|
-
* async (swapId, data) => { await db.swaps.put({ id: swapId, ...data }); },
|
|
2926
|
-
* async (swapId) => { await db.swaps.delete(swapId); },
|
|
2927
|
-
* async () => await db.swaps.toCollection().primaryKeys()
|
|
2928
|
-
* );
|
|
2929
|
-
* ```
|
|
2930
|
-
*/
|
|
2931
|
-
export class JsSwapStorageProvider {
|
|
2932
|
-
|
|
2933
|
-
__destroy_into_raw() {
|
|
2934
|
-
const ptr = this.__wbg_ptr;
|
|
2935
|
-
this.__wbg_ptr = 0;
|
|
2936
|
-
JsSwapStorageProviderFinalization.unregister(this);
|
|
2937
|
-
return ptr;
|
|
2938
|
-
}
|
|
2939
|
-
|
|
2940
|
-
free() {
|
|
2941
|
-
const ptr = this.__destroy_into_raw();
|
|
2942
|
-
wasm.__wbg_jsswapstorageprovider_free(ptr, 0);
|
|
2943
|
-
}
|
|
2944
|
-
/**
|
|
2945
|
-
* Create a new JsSwapStorageProvider from JavaScript callbacks.
|
|
2946
|
-
*
|
|
2947
|
-
* # Arguments
|
|
2948
|
-
* * `get_fn` - Function: `(swapId: string) => Promise<ExtendedSwapStorageData | null>`
|
|
2949
|
-
* * `store_fn` - Function: `(swapId: string, data: ExtendedSwapStorageData) => Promise<void>`
|
|
2950
|
-
* * `delete_fn` - Function: `(swapId: string) => Promise<void>`
|
|
2951
|
-
* * `list_fn` - Function: `() => Promise<string[]>`
|
|
2952
|
-
* * `get_all_fn` - Function: `() => Promise<ExtendedSwapStorageData[]>`
|
|
2953
|
-
* @param {Function} get_fn
|
|
2954
|
-
* @param {Function} store_fn
|
|
2955
|
-
* @param {Function} delete_fn
|
|
2956
|
-
* @param {Function} list_fn
|
|
2957
|
-
* @param {Function} get_all_fn
|
|
2958
|
-
*/
|
|
2959
|
-
constructor(get_fn, store_fn, delete_fn, list_fn, get_all_fn) {
|
|
2960
|
-
const ret = wasm.jsswapstorageprovider_new(get_fn, store_fn, delete_fn, list_fn, get_all_fn);
|
|
2961
|
-
this.__wbg_ptr = ret >>> 0;
|
|
2962
|
-
JsSwapStorageProviderFinalization.register(this, this.__wbg_ptr, this);
|
|
2963
|
-
return this;
|
|
2964
|
-
}
|
|
2965
|
-
}
|
|
2966
|
-
if (Symbol.dispose) JsSwapStorageProvider.prototype[Symbol.dispose] = JsSwapStorageProvider.prototype.free;
|
|
2967
|
-
|
|
2968
|
-
const JsVtxoSwapStorageProviderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2969
|
-
? { register: () => {}, unregister: () => {} }
|
|
2970
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_jsvtxoswapstorageprovider_free(ptr >>> 0, 1));
|
|
2971
|
-
/**
|
|
2972
|
-
* JavaScript VTXO swap storage provider passed from TypeScript.
|
|
2973
|
-
*
|
|
2974
|
-
* This struct wraps JavaScript callback functions that implement
|
|
2975
|
-
* typed VTXO swap storage operations. Each function should return a Promise.
|
|
2976
|
-
*
|
|
2977
|
-
* # Example (TypeScript with Dexie)
|
|
2978
|
-
*
|
|
2979
|
-
* ```typescript
|
|
2980
|
-
* import Dexie from 'dexie';
|
|
2981
|
-
*
|
|
2982
|
-
* const db = new Dexie('lendaswap');
|
|
2983
|
-
* db.version(1).stores({ vtxoSwaps: 'id' });
|
|
2984
|
-
*
|
|
2985
|
-
* const vtxoSwapStorage = new JsVtxoSwapStorageProvider(
|
|
2986
|
-
* async (swapId) => await db.vtxoSwaps.get(swapId) ?? null,
|
|
2987
|
-
* async (swapId, data) => { await db.vtxoSwaps.put({ id: swapId, ...data }); },
|
|
2988
|
-
* async (swapId) => { await db.vtxoSwaps.delete(swapId); },
|
|
2989
|
-
* async () => await db.vtxoSwaps.toCollection().primaryKeys(),
|
|
2990
|
-
* async () => await db.vtxoSwaps.toArray()
|
|
2991
|
-
* );
|
|
2992
|
-
* ```
|
|
2993
|
-
*/
|
|
2994
|
-
export class JsVtxoSwapStorageProvider {
|
|
2995
|
-
|
|
2996
|
-
__destroy_into_raw() {
|
|
2997
|
-
const ptr = this.__wbg_ptr;
|
|
2998
|
-
this.__wbg_ptr = 0;
|
|
2999
|
-
JsVtxoSwapStorageProviderFinalization.unregister(this);
|
|
3000
|
-
return ptr;
|
|
3001
|
-
}
|
|
3002
|
-
|
|
3003
|
-
free() {
|
|
3004
|
-
const ptr = this.__destroy_into_raw();
|
|
3005
|
-
wasm.__wbg_jsvtxoswapstorageprovider_free(ptr, 0);
|
|
3006
|
-
}
|
|
3007
|
-
/**
|
|
3008
|
-
* Create a new JsVtxoSwapStorageProvider from JavaScript callbacks.
|
|
3009
|
-
*
|
|
3010
|
-
* # Arguments
|
|
3011
|
-
* * `get_fn` - Function: `(swapId: string) => Promise<ExtendedVtxoSwapStorageData | null>`
|
|
3012
|
-
* * `store_fn` - Function: `(swapId: string, data: ExtendedVtxoSwapStorageData) => Promise<void>`
|
|
3013
|
-
* * `delete_fn` - Function: `(swapId: string) => Promise<void>`
|
|
3014
|
-
* * `list_fn` - Function: `() => Promise<string[]>`
|
|
3015
|
-
* * `get_all_fn` - Function: `() => Promise<ExtendedVtxoSwapStorageData[]>`
|
|
3016
|
-
* @param {Function} get_fn
|
|
3017
|
-
* @param {Function} store_fn
|
|
3018
|
-
* @param {Function} delete_fn
|
|
3019
|
-
* @param {Function} list_fn
|
|
3020
|
-
* @param {Function} get_all_fn
|
|
3021
|
-
*/
|
|
3022
|
-
constructor(get_fn, store_fn, delete_fn, list_fn, get_all_fn) {
|
|
3023
|
-
const ret = wasm.jsvtxoswapstorageprovider_new(get_fn, store_fn, delete_fn, list_fn, get_all_fn);
|
|
3024
|
-
this.__wbg_ptr = ret >>> 0;
|
|
3025
|
-
JsVtxoSwapStorageProviderFinalization.register(this, this.__wbg_ptr, this);
|
|
3026
|
-
return this;
|
|
3027
|
-
}
|
|
3028
|
-
}
|
|
3029
|
-
if (Symbol.dispose) JsVtxoSwapStorageProvider.prototype[Symbol.dispose] = JsVtxoSwapStorageProvider.prototype.free;
|
|
3030
|
-
|
|
3031
|
-
const JsWalletStorageProviderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3032
|
-
? { register: () => {}, unregister: () => {} }
|
|
3033
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_jswalletstorageprovider_free(ptr >>> 0, 1));
|
|
3034
|
-
/**
|
|
3035
|
-
* JavaScript wallet storage provider passed from TypeScript.
|
|
3036
|
-
*
|
|
3037
|
-
* This struct wraps JavaScript callback functions that implement
|
|
3038
|
-
* the typed wallet storage operations. Each function should return a Promise.
|
|
3039
|
-
*
|
|
3040
|
-
* # Example (TypeScript)
|
|
3041
|
-
*
|
|
3042
|
-
* ```typescript
|
|
3043
|
-
* const provider = new JsWalletStorageProvider(
|
|
3044
|
-
* async () => localStorage.getItem('mnemonic'), // get_mnemonic
|
|
3045
|
-
* async (mnemonic) => localStorage.setItem('mnemonic', mnemonic), // set_mnemonic
|
|
3046
|
-
* async () => parseInt(localStorage.getItem('key_index') ?? '0'), // get_key_index
|
|
3047
|
-
* async (index) => localStorage.setItem('key_index', index.toString()), // set_key_index
|
|
3048
|
-
* );
|
|
3049
|
-
* ```
|
|
3050
|
-
*/
|
|
3051
|
-
export class JsWalletStorageProvider {
|
|
3052
|
-
|
|
3053
|
-
__destroy_into_raw() {
|
|
3054
|
-
const ptr = this.__wbg_ptr;
|
|
3055
|
-
this.__wbg_ptr = 0;
|
|
3056
|
-
JsWalletStorageProviderFinalization.unregister(this);
|
|
3057
|
-
return ptr;
|
|
3058
|
-
}
|
|
3059
|
-
|
|
3060
|
-
free() {
|
|
3061
|
-
const ptr = this.__destroy_into_raw();
|
|
3062
|
-
wasm.__wbg_jswalletstorageprovider_free(ptr, 0);
|
|
3063
|
-
}
|
|
3064
|
-
/**
|
|
3065
|
-
* Create a new JsWalletStorageProvider from JavaScript callbacks.
|
|
3066
|
-
*
|
|
3067
|
-
* # Arguments
|
|
3068
|
-
* * `get_mnemonic_fn` - Function: `() => Promise<string | null>`
|
|
3069
|
-
* * `set_mnemonic_fn` - Function: `(mnemonic: string) => Promise<void>`
|
|
3070
|
-
* * `get_key_index_fn` - Function: `() => Promise<number>`
|
|
3071
|
-
* * `set_key_index_fn` - Function: `(index: number) => Promise<void>`
|
|
3072
|
-
* @param {Function} get_mnemonic_fn
|
|
3073
|
-
* @param {Function} set_mnemonic_fn
|
|
3074
|
-
* @param {Function} get_key_index_fn
|
|
3075
|
-
* @param {Function} set_key_index_fn
|
|
3076
|
-
*/
|
|
3077
|
-
constructor(get_mnemonic_fn, set_mnemonic_fn, get_key_index_fn, set_key_index_fn) {
|
|
3078
|
-
const ret = wasm.jswalletstorageprovider_new(get_mnemonic_fn, set_mnemonic_fn, get_key_index_fn, set_key_index_fn);
|
|
3079
|
-
this.__wbg_ptr = ret >>> 0;
|
|
3080
|
-
JsWalletStorageProviderFinalization.register(this, this.__wbg_ptr, this);
|
|
3081
|
-
return this;
|
|
3082
|
-
}
|
|
3083
|
-
}
|
|
3084
|
-
if (Symbol.dispose) JsWalletStorageProvider.prototype[Symbol.dispose] = JsWalletStorageProvider.prototype.free;
|
|
3085
|
-
|
|
3086
3165
|
const QuoteResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3087
3166
|
? { register: () => {}, unregister: () => {} }
|
|
3088
3167
|
: new FinalizationRegistry(ptr => wasm.__wbg_quoteresponse_free(ptr >>> 0, 1));
|
|
@@ -4386,11 +4465,6 @@ export function __wbg_call_525440f72fbfc0ea() { return handleError(function (arg
|
|
|
4386
4465
|
return ret;
|
|
4387
4466
|
}, arguments) };
|
|
4388
4467
|
|
|
4389
|
-
export function __wbg_call_e45d2cf9fc925fcf() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4390
|
-
const ret = arg0.call(arg1, arg2, arg3);
|
|
4391
|
-
return ret;
|
|
4392
|
-
}, arguments) };
|
|
4393
|
-
|
|
4394
4468
|
export function __wbg_call_e762c39fa8ea36bf() { return handleError(function (arg0, arg1) {
|
|
4395
4469
|
const ret = arg0.call(arg1);
|
|
4396
4470
|
return ret;
|
|
@@ -4409,6 +4483,19 @@ export function __wbg_close_6956df845478561a() { return handleError(function (ar
|
|
|
4409
4483
|
arg0.close();
|
|
4410
4484
|
}, arguments) };
|
|
4411
4485
|
|
|
4486
|
+
export function __wbg_close_74386af11ef5ae35(arg0) {
|
|
4487
|
+
arg0.close();
|
|
4488
|
+
};
|
|
4489
|
+
|
|
4490
|
+
export function __wbg_commit_818d38a9872b3721() { return handleError(function (arg0) {
|
|
4491
|
+
arg0.commit();
|
|
4492
|
+
}, arguments) };
|
|
4493
|
+
|
|
4494
|
+
export function __wbg_createObjectStore_283a43a822bf49ca() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4495
|
+
const ret = arg0.createObjectStore(getStringFromWasm0(arg1, arg2), arg3);
|
|
4496
|
+
return ret;
|
|
4497
|
+
}, arguments) };
|
|
4498
|
+
|
|
4412
4499
|
export function __wbg_createvtxoswapresult_new(arg0) {
|
|
4413
4500
|
const ret = CreateVtxoSwapResult.__wrap(arg0);
|
|
4414
4501
|
return ret;
|
|
@@ -4423,6 +4510,16 @@ export function __wbg_debug_e55e1461940eb14d(arg0, arg1, arg2, arg3) {
|
|
|
4423
4510
|
console.debug(arg0, arg1, arg2, arg3);
|
|
4424
4511
|
};
|
|
4425
4512
|
|
|
4513
|
+
export function __wbg_deleteProperty_42a98e7a6d307b6e() { return handleError(function (arg0, arg1) {
|
|
4514
|
+
const ret = Reflect.deleteProperty(arg0, arg1);
|
|
4515
|
+
return ret;
|
|
4516
|
+
}, arguments) };
|
|
4517
|
+
|
|
4518
|
+
export function __wbg_delete_f808c4661e8e34c0() { return handleError(function (arg0, arg1) {
|
|
4519
|
+
const ret = arg0.delete(arg1);
|
|
4520
|
+
return ret;
|
|
4521
|
+
}, arguments) };
|
|
4522
|
+
|
|
4426
4523
|
export function __wbg_done_2042aa2670fb1db1(arg0) {
|
|
4427
4524
|
const ret = arg0.done;
|
|
4428
4525
|
return ret;
|
|
@@ -4437,6 +4534,11 @@ export function __wbg_entries_e171b586f8f6bdbf(arg0) {
|
|
|
4437
4534
|
return ret;
|
|
4438
4535
|
};
|
|
4439
4536
|
|
|
4537
|
+
export function __wbg_error_3e929987fcd3e155() { return handleError(function (arg0) {
|
|
4538
|
+
const ret = arg0.error;
|
|
4539
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4540
|
+
}, arguments) };
|
|
4541
|
+
|
|
4440
4542
|
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
4441
4543
|
let deferred0_0;
|
|
4442
4544
|
let deferred0_1;
|
|
@@ -4449,6 +4551,11 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
4449
4551
|
}
|
|
4450
4552
|
};
|
|
4451
4553
|
|
|
4554
|
+
export function __wbg_error_87b9cee2628b207f(arg0) {
|
|
4555
|
+
const ret = arg0.error;
|
|
4556
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4557
|
+
};
|
|
4558
|
+
|
|
4452
4559
|
export function __wbg_error_d8b22cf4e59a6791(arg0, arg1, arg2, arg3) {
|
|
4453
4560
|
console.error(arg0, arg1, arg2, arg3);
|
|
4454
4561
|
};
|
|
@@ -4483,6 +4590,36 @@ export function __wbg_fetch_f8ba0e29a9d6de0d(arg0, arg1) {
|
|
|
4483
4590
|
return ret;
|
|
4484
4591
|
};
|
|
4485
4592
|
|
|
4593
|
+
export function __wbg_getAllKeys_33842a9ff138a7b2() { return handleError(function (arg0) {
|
|
4594
|
+
const ret = arg0.getAllKeys();
|
|
4595
|
+
return ret;
|
|
4596
|
+
}, arguments) };
|
|
4597
|
+
|
|
4598
|
+
export function __wbg_getAllKeys_7bec8850dae0e72f() { return handleError(function (arg0, arg1, arg2) {
|
|
4599
|
+
const ret = arg0.getAllKeys(arg1, arg2 >>> 0);
|
|
4600
|
+
return ret;
|
|
4601
|
+
}, arguments) };
|
|
4602
|
+
|
|
4603
|
+
export function __wbg_getAllKeys_982f32ccbec04575() { return handleError(function (arg0, arg1) {
|
|
4604
|
+
const ret = arg0.getAllKeys(arg1);
|
|
4605
|
+
return ret;
|
|
4606
|
+
}, arguments) };
|
|
4607
|
+
|
|
4608
|
+
export function __wbg_getAll_1a464082bb763d3e() { return handleError(function (arg0, arg1, arg2) {
|
|
4609
|
+
const ret = arg0.getAll(arg1, arg2 >>> 0);
|
|
4610
|
+
return ret;
|
|
4611
|
+
}, arguments) };
|
|
4612
|
+
|
|
4613
|
+
export function __wbg_getAll_38347e0eb50cf7a2() { return handleError(function (arg0, arg1) {
|
|
4614
|
+
const ret = arg0.getAll(arg1);
|
|
4615
|
+
return ret;
|
|
4616
|
+
}, arguments) };
|
|
4617
|
+
|
|
4618
|
+
export function __wbg_getAll_9121ade297db31db() { return handleError(function (arg0) {
|
|
4619
|
+
const ret = arg0.getAll();
|
|
4620
|
+
return ret;
|
|
4621
|
+
}, arguments) };
|
|
4622
|
+
|
|
4486
4623
|
export function __wbg_getItem_89f57d6acc51a876() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4487
4624
|
const ret = arg1.getItem(getStringFromWasm0(arg2, arg3));
|
|
4488
4625
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -4505,6 +4642,11 @@ export function __wbg_get_efcb449f58ec27c2() { return handleError(function (arg0
|
|
|
4505
4642
|
return ret;
|
|
4506
4643
|
}, arguments) };
|
|
4507
4644
|
|
|
4645
|
+
export function __wbg_get_fb1fa70beb44a754() { return handleError(function (arg0, arg1) {
|
|
4646
|
+
const ret = arg0.get(arg1);
|
|
4647
|
+
return ret;
|
|
4648
|
+
}, arguments) };
|
|
4649
|
+
|
|
4508
4650
|
export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
|
|
4509
4651
|
const ret = arg0[arg1];
|
|
4510
4652
|
return ret;
|
|
@@ -4520,6 +4662,11 @@ export function __wbg_headers_b87d7eaba61c3278(arg0) {
|
|
|
4520
4662
|
return ret;
|
|
4521
4663
|
};
|
|
4522
4664
|
|
|
4665
|
+
export function __wbg_idbstoragehandle_new(arg0) {
|
|
4666
|
+
const ret = IdbStorageHandle.__wrap(arg0);
|
|
4667
|
+
return ret;
|
|
4668
|
+
};
|
|
4669
|
+
|
|
4523
4670
|
export function __wbg_info_68cd5b51ef7e5137(arg0, arg1, arg2, arg3) {
|
|
4524
4671
|
console.info(arg0, arg1, arg2, arg3);
|
|
4525
4672
|
};
|
|
@@ -4535,6 +4682,61 @@ export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
|
|
|
4535
4682
|
return ret;
|
|
4536
4683
|
};
|
|
4537
4684
|
|
|
4685
|
+
export function __wbg_instanceof_IdbDatabase_fcf75ffeeec3ec8c(arg0) {
|
|
4686
|
+
let result;
|
|
4687
|
+
try {
|
|
4688
|
+
result = arg0 instanceof IDBDatabase;
|
|
4689
|
+
} catch (_) {
|
|
4690
|
+
result = false;
|
|
4691
|
+
}
|
|
4692
|
+
const ret = result;
|
|
4693
|
+
return ret;
|
|
4694
|
+
};
|
|
4695
|
+
|
|
4696
|
+
export function __wbg_instanceof_IdbFactory_b39cfd3ab00cea49(arg0) {
|
|
4697
|
+
let result;
|
|
4698
|
+
try {
|
|
4699
|
+
result = arg0 instanceof IDBFactory;
|
|
4700
|
+
} catch (_) {
|
|
4701
|
+
result = false;
|
|
4702
|
+
}
|
|
4703
|
+
const ret = result;
|
|
4704
|
+
return ret;
|
|
4705
|
+
};
|
|
4706
|
+
|
|
4707
|
+
export function __wbg_instanceof_IdbOpenDbRequest_08e4929084e51476(arg0) {
|
|
4708
|
+
let result;
|
|
4709
|
+
try {
|
|
4710
|
+
result = arg0 instanceof IDBOpenDBRequest;
|
|
4711
|
+
} catch (_) {
|
|
4712
|
+
result = false;
|
|
4713
|
+
}
|
|
4714
|
+
const ret = result;
|
|
4715
|
+
return ret;
|
|
4716
|
+
};
|
|
4717
|
+
|
|
4718
|
+
export function __wbg_instanceof_IdbRequest_26754883a3cc8f81(arg0) {
|
|
4719
|
+
let result;
|
|
4720
|
+
try {
|
|
4721
|
+
result = arg0 instanceof IDBRequest;
|
|
4722
|
+
} catch (_) {
|
|
4723
|
+
result = false;
|
|
4724
|
+
}
|
|
4725
|
+
const ret = result;
|
|
4726
|
+
return ret;
|
|
4727
|
+
};
|
|
4728
|
+
|
|
4729
|
+
export function __wbg_instanceof_IdbTransaction_ab2777580e1cb04c(arg0) {
|
|
4730
|
+
let result;
|
|
4731
|
+
try {
|
|
4732
|
+
result = arg0 instanceof IDBTransaction;
|
|
4733
|
+
} catch (_) {
|
|
4734
|
+
result = false;
|
|
4735
|
+
}
|
|
4736
|
+
const ret = result;
|
|
4737
|
+
return ret;
|
|
4738
|
+
};
|
|
4739
|
+
|
|
4538
4740
|
export function __wbg_instanceof_Map_8579b5e2ab5437c7(arg0) {
|
|
4539
4741
|
let result;
|
|
4540
4742
|
try {
|
|
@@ -4546,10 +4748,10 @@ export function __wbg_instanceof_Map_8579b5e2ab5437c7(arg0) {
|
|
|
4546
4748
|
return ret;
|
|
4547
4749
|
};
|
|
4548
4750
|
|
|
4549
|
-
export function
|
|
4751
|
+
export function __wbg_instanceof_Object_10bb762262230c68(arg0) {
|
|
4550
4752
|
let result;
|
|
4551
4753
|
try {
|
|
4552
|
-
result = arg0 instanceof
|
|
4754
|
+
result = arg0 instanceof Object;
|
|
4553
4755
|
} catch (_) {
|
|
4554
4756
|
result = false;
|
|
4555
4757
|
}
|
|
@@ -4629,6 +4831,14 @@ export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
|
|
|
4629
4831
|
return ret;
|
|
4630
4832
|
};
|
|
4631
4833
|
|
|
4834
|
+
export function __wbg_name_012808ba1253a92d(arg0, arg1) {
|
|
4835
|
+
const ret = arg1.name;
|
|
4836
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4837
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4838
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4839
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4840
|
+
};
|
|
4841
|
+
|
|
4632
4842
|
export function __wbg_new_1acc0b6eea89d040() {
|
|
4633
4843
|
const ret = new Object();
|
|
4634
4844
|
return ret;
|
|
@@ -4646,7 +4856,7 @@ export function __wbg_new_3c3d849046688a66(arg0, arg1) {
|
|
|
4646
4856
|
const a = state0.a;
|
|
4647
4857
|
state0.a = 0;
|
|
4648
4858
|
try {
|
|
4649
|
-
return
|
|
4859
|
+
return wasm_bindgen__convert__closures_____invoke__h95b85cd8e04171dd(a, state0.b, arg0, arg1);
|
|
4650
4860
|
} finally {
|
|
4651
4861
|
state0.a = a;
|
|
4652
4862
|
}
|
|
@@ -4743,6 +4953,26 @@ export function __wbg_now_f5ba683d8ce2c571(arg0) {
|
|
|
4743
4953
|
return ret;
|
|
4744
4954
|
};
|
|
4745
4955
|
|
|
4956
|
+
export function __wbg_objectStore_2aab1d8b165c62a6() { return handleError(function (arg0, arg1, arg2) {
|
|
4957
|
+
const ret = arg0.objectStore(getStringFromWasm0(arg1, arg2));
|
|
4958
|
+
return ret;
|
|
4959
|
+
}, arguments) };
|
|
4960
|
+
|
|
4961
|
+
export function __wbg_oldVersion_54e2e7cdf22e05ff(arg0) {
|
|
4962
|
+
const ret = arg0.oldVersion;
|
|
4963
|
+
return ret;
|
|
4964
|
+
};
|
|
4965
|
+
|
|
4966
|
+
export function __wbg_open_9d8c51d122a5a6ea() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4967
|
+
const ret = arg0.open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
4968
|
+
return ret;
|
|
4969
|
+
}, arguments) };
|
|
4970
|
+
|
|
4971
|
+
export function __wbg_open_a36354e60d7255fb() { return handleError(function (arg0, arg1, arg2) {
|
|
4972
|
+
const ret = arg0.open(getStringFromWasm0(arg1, arg2));
|
|
4973
|
+
return ret;
|
|
4974
|
+
}, arguments) };
|
|
4975
|
+
|
|
4746
4976
|
export function __wbg_performance_e8315b5ae987e93f(arg0) {
|
|
4747
4977
|
const ret = arg0.performance;
|
|
4748
4978
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -4762,6 +4992,16 @@ export function __wbg_push_df81a39d04db858c(arg0, arg1) {
|
|
|
4762
4992
|
return ret;
|
|
4763
4993
|
};
|
|
4764
4994
|
|
|
4995
|
+
export function __wbg_put_88678dd575c85637() { return handleError(function (arg0, arg1, arg2) {
|
|
4996
|
+
const ret = arg0.put(arg1, arg2);
|
|
4997
|
+
return ret;
|
|
4998
|
+
}, arguments) };
|
|
4999
|
+
|
|
5000
|
+
export function __wbg_put_fe0fdaf42663469b() { return handleError(function (arg0, arg1) {
|
|
5001
|
+
const ret = arg0.put(arg1);
|
|
5002
|
+
return ret;
|
|
5003
|
+
}, arguments) };
|
|
5004
|
+
|
|
4765
5005
|
export function __wbg_queueMicrotask_34d692c25c47d05b(arg0) {
|
|
4766
5006
|
const ret = arg0.queueMicrotask;
|
|
4767
5007
|
return ret;
|
|
@@ -4794,6 +5034,11 @@ export function __wbg_respond_0f4dbf5386f5c73e() { return handleError(function (
|
|
|
4794
5034
|
arg0.respond(arg1 >>> 0);
|
|
4795
5035
|
}, arguments) };
|
|
4796
5036
|
|
|
5037
|
+
export function __wbg_result_25e75004b82b9830() { return handleError(function (arg0) {
|
|
5038
|
+
const ret = arg0.result;
|
|
5039
|
+
return ret;
|
|
5040
|
+
}, arguments) };
|
|
5041
|
+
|
|
4797
5042
|
export function __wbg_setItem_64dfb54d7b20d84c() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
4798
5043
|
arg0.setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
4799
5044
|
}, arguments) };
|
|
@@ -4820,6 +5065,11 @@ export function __wbg_set_body_3c365989753d61f4(arg0, arg1) {
|
|
|
4820
5065
|
arg0.body = arg1;
|
|
4821
5066
|
};
|
|
4822
5067
|
|
|
5068
|
+
export function __wbg_set_c2abbebe8b9ebee1() { return handleError(function (arg0, arg1, arg2) {
|
|
5069
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
5070
|
+
return ret;
|
|
5071
|
+
}, arguments) };
|
|
5072
|
+
|
|
4823
5073
|
export function __wbg_set_cache_2f9deb19b92b81e3(arg0, arg1) {
|
|
4824
5074
|
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
4825
5075
|
};
|
|
@@ -4832,6 +5082,10 @@ export function __wbg_set_headers_6926da238cd32ee4(arg0, arg1) {
|
|
|
4832
5082
|
arg0.headers = arg1;
|
|
4833
5083
|
};
|
|
4834
5084
|
|
|
5085
|
+
export function __wbg_set_key_path_ff2217f4e8c2caba(arg0, arg1) {
|
|
5086
|
+
arg0.keyPath = arg1;
|
|
5087
|
+
};
|
|
5088
|
+
|
|
4835
5089
|
export function __wbg_set_method_c02d8cbbe204ac2d(arg0, arg1, arg2) {
|
|
4836
5090
|
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
4837
5091
|
};
|
|
@@ -4840,6 +5094,30 @@ export function __wbg_set_mode_52ef73cfa79639cb(arg0, arg1) {
|
|
|
4840
5094
|
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
4841
5095
|
};
|
|
4842
5096
|
|
|
5097
|
+
export function __wbg_set_onabort_6957ef4f3e5c91eb(arg0, arg1) {
|
|
5098
|
+
arg0.onabort = arg1;
|
|
5099
|
+
};
|
|
5100
|
+
|
|
5101
|
+
export function __wbg_set_oncomplete_71dbeb19a31158ae(arg0, arg1) {
|
|
5102
|
+
arg0.oncomplete = arg1;
|
|
5103
|
+
};
|
|
5104
|
+
|
|
5105
|
+
export function __wbg_set_onerror_2a8ad6135dc1ec74(arg0, arg1) {
|
|
5106
|
+
arg0.onerror = arg1;
|
|
5107
|
+
};
|
|
5108
|
+
|
|
5109
|
+
export function __wbg_set_onerror_dc82fea584ffccaa(arg0, arg1) {
|
|
5110
|
+
arg0.onerror = arg1;
|
|
5111
|
+
};
|
|
5112
|
+
|
|
5113
|
+
export function __wbg_set_onsuccess_f367d002b462109e(arg0, arg1) {
|
|
5114
|
+
arg0.onsuccess = arg1;
|
|
5115
|
+
};
|
|
5116
|
+
|
|
5117
|
+
export function __wbg_set_onupgradeneeded_0a519a73284a1418(arg0, arg1) {
|
|
5118
|
+
arg0.onupgradeneeded = arg1;
|
|
5119
|
+
};
|
|
5120
|
+
|
|
4843
5121
|
export function __wbg_set_signal_dda2cf7ccb6bee0f(arg0, arg1) {
|
|
4844
5122
|
arg0.signal = arg1;
|
|
4845
5123
|
};
|
|
@@ -4896,6 +5174,11 @@ export function __wbg_subarray_480600f3d6a9f26c(arg0, arg1, arg2) {
|
|
|
4896
5174
|
return ret;
|
|
4897
5175
|
};
|
|
4898
5176
|
|
|
5177
|
+
export function __wbg_target_1447f5d3a6fa6fe0(arg0) {
|
|
5178
|
+
const ret = arg0.target;
|
|
5179
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
5180
|
+
};
|
|
5181
|
+
|
|
4899
5182
|
export function __wbg_text_dc33c15c17bdfb52() { return handleError(function (arg0) {
|
|
4900
5183
|
const ret = arg0.text();
|
|
4901
5184
|
return ret;
|
|
@@ -4916,6 +5199,11 @@ export function __wbg_tokeninfo_new(arg0) {
|
|
|
4916
5199
|
return ret;
|
|
4917
5200
|
};
|
|
4918
5201
|
|
|
5202
|
+
export function __wbg_transaction_cd940bd89781f616() { return handleError(function (arg0, arg1, arg2) {
|
|
5203
|
+
const ret = arg0.transaction(arg1, __wbindgen_enum_IdbTransactionMode[arg2]);
|
|
5204
|
+
return ret;
|
|
5205
|
+
}, arguments) };
|
|
5206
|
+
|
|
4919
5207
|
export function __wbg_url_b36d2a5008eb056f(arg0, arg1) {
|
|
4920
5208
|
const ret = arg1.url;
|
|
4921
5209
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -4962,21 +5250,15 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
|
4962
5250
|
return ret;
|
|
4963
5251
|
};
|
|
4964
5252
|
|
|
4965
|
-
export function __wbindgen_cast_2a745ff4d81c99e5(arg0, arg1) {
|
|
4966
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 609, function: Function { arguments: [], shim_idx: 610, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4967
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h19250ab695821211, wasm_bindgen__convert__closures_____invoke__h49d21def8d7e8715);
|
|
4968
|
-
return ret;
|
|
4969
|
-
};
|
|
4970
|
-
|
|
4971
5253
|
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
4972
5254
|
// Cast intrinsic for `U64 -> Externref`.
|
|
4973
5255
|
const ret = BigInt.asUintN(64, arg0);
|
|
4974
5256
|
return ret;
|
|
4975
5257
|
};
|
|
4976
5258
|
|
|
4977
|
-
export function
|
|
4978
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 676, function: Function { arguments: [
|
|
4979
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
5259
|
+
export function __wbindgen_cast_4fd1580bc9ae0d88(arg0, arg1) {
|
|
5260
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 676, function: Function { arguments: [], shim_idx: 677, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
5261
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h84bbd0c3dfad89d9, wasm_bindgen__convert__closures_____invoke__hc679149b55f75c33);
|
|
4980
5262
|
return ret;
|
|
4981
5263
|
};
|
|
4982
5264
|
|
|
@@ -4988,12 +5270,30 @@ export function __wbindgen_cast_53d45148ea4f5d79(arg0, arg1) {
|
|
|
4988
5270
|
return ret;
|
|
4989
5271
|
};
|
|
4990
5272
|
|
|
5273
|
+
export function __wbindgen_cast_879de4805c71575c(arg0, arg1) {
|
|
5274
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 461, function: Function { arguments: [NamedExternref("Event")], shim_idx: 463, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
5275
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h3bcc7046e1647ab6, wasm_bindgen__convert__closures_____invoke__h3ae63c3559e47aa7);
|
|
5276
|
+
return ret;
|
|
5277
|
+
};
|
|
5278
|
+
|
|
4991
5279
|
export function __wbindgen_cast_9ae0607507abb057(arg0) {
|
|
4992
5280
|
// Cast intrinsic for `I64 -> Externref`.
|
|
4993
5281
|
const ret = arg0;
|
|
4994
5282
|
return ret;
|
|
4995
5283
|
};
|
|
4996
5284
|
|
|
5285
|
+
export function __wbindgen_cast_a693b7aee1d95a3b(arg0, arg1) {
|
|
5286
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 742, function: Function { arguments: [Externref], shim_idx: 743, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
5287
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hbf774c1eb42aa1c1, wasm_bindgen__convert__closures_____invoke__h28f0f152c9423ebc);
|
|
5288
|
+
return ret;
|
|
5289
|
+
};
|
|
5290
|
+
|
|
5291
|
+
export function __wbindgen_cast_ba16eb8bf73dab74(arg0, arg1) {
|
|
5292
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 286, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 184, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
5293
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hc0005a862eeb5409, wasm_bindgen__convert__closures_____invoke__h336ff17a2ee3a667);
|
|
5294
|
+
return ret;
|
|
5295
|
+
};
|
|
5296
|
+
|
|
4997
5297
|
export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
|
|
4998
5298
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
4999
5299
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|