@lendasat/lendaswap-sdk 0.1.7 → 0.1.65
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/dist/api.d.ts +138 -160
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +174 -113
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/price-calculations.d.ts +135 -0
- package/dist/price-calculations.d.ts.map +1 -0
- package/dist/price-calculations.js +171 -0
- package/dist/price-calculations.js.map +1 -0
- package/dist/price-calculations.test.d.ts +2 -0
- package/dist/price-calculations.test.d.ts.map +1 -0
- package/dist/price-calculations.test.js +173 -0
- package/dist/price-calculations.test.js.map +1 -0
- package/dist/price-feed.d.ts +3 -0
- package/dist/price-feed.d.ts.map +1 -1
- package/dist/price-feed.js.map +1 -1
- package/dist/storage/dexieSwapStorage.d.ts +12 -10
- package/dist/storage/dexieSwapStorage.d.ts.map +1 -1
- package/dist/storage/dexieSwapStorage.js +63 -2
- package/dist/storage/dexieSwapStorage.js.map +1 -1
- package/dist/storage/dexieVtxoSwapStorage.d.ts +105 -0
- package/dist/storage/dexieVtxoSwapStorage.d.ts.map +1 -0
- package/dist/storage/dexieVtxoSwapStorage.js +149 -0
- package/dist/storage/dexieVtxoSwapStorage.js.map +1 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -1
- package/dist/usd-price.d.ts.map +1 -1
- package/dist/usd-price.js +1 -0
- package/dist/usd-price.js.map +1 -1
- package/package.json +1 -1
- package/wasm/lendaswap_wasm_sdk.d.ts +361 -43
- package/wasm/lendaswap_wasm_sdk_bg.js +2499 -483
- package/wasm/lendaswap_wasm_sdk_bg.wasm +0 -0
- package/wasm/lendaswap_wasm_sdk_bg.wasm.d.ts +259 -65
|
@@ -186,6 +186,17 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
186
186
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
190
|
+
ptr = ptr >>> 0;
|
|
191
|
+
const mem = getDataViewMemory0();
|
|
192
|
+
const result = [];
|
|
193
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
194
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
195
|
+
}
|
|
196
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
197
|
+
return result;
|
|
198
|
+
}
|
|
199
|
+
|
|
189
200
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
190
201
|
? { register: () => {}, unregister: () => {} }
|
|
191
202
|
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
@@ -217,16 +228,22 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
217
228
|
CLOSURE_DTORS.register(real, state, state);
|
|
218
229
|
return real;
|
|
219
230
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Returns a human-readable string representation of the swap status.
|
|
233
|
+
* @param {SwapStatus} status
|
|
234
|
+
* @returns {string}
|
|
235
|
+
*/
|
|
236
|
+
export function swapStatusToString(status) {
|
|
237
|
+
let deferred1_0;
|
|
238
|
+
let deferred1_1;
|
|
239
|
+
try {
|
|
240
|
+
const ret = wasm.swapStatusToString(status);
|
|
241
|
+
deferred1_0 = ret[0];
|
|
242
|
+
deferred1_1 = ret[1];
|
|
243
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
244
|
+
} finally {
|
|
245
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
227
246
|
}
|
|
228
|
-
wasm.__externref_drop_slice(ptr, len);
|
|
229
|
-
return result;
|
|
230
247
|
}
|
|
231
248
|
|
|
232
249
|
function _assertClass(instance, klass) {
|
|
@@ -309,13 +326,54 @@ function wasm_bindgen__convert__closures_____invoke__h68e6792a5299b78b(arg0, arg
|
|
|
309
326
|
|
|
310
327
|
/**
|
|
311
328
|
* Chain type for token information.
|
|
312
|
-
* @enum {0 | 1 | 2 | 3}
|
|
329
|
+
* @enum {0 | 1 | 2 | 3 | 4}
|
|
313
330
|
*/
|
|
314
331
|
export const Chain = Object.freeze({
|
|
315
332
|
Arkade: 0, "0": "Arkade",
|
|
316
333
|
Lightning: 1, "1": "Lightning",
|
|
317
|
-
|
|
318
|
-
|
|
334
|
+
Bitcoin: 2, "2": "Bitcoin",
|
|
335
|
+
Polygon: 3, "3": "Polygon",
|
|
336
|
+
Ethereum: 4, "4": "Ethereum",
|
|
337
|
+
});
|
|
338
|
+
/**
|
|
339
|
+
* Bitcoin network type.
|
|
340
|
+
* @enum {0 | 1 | 2 | 3}
|
|
341
|
+
*/
|
|
342
|
+
export const Network = Object.freeze({
|
|
343
|
+
Bitcoin: 0, "0": "Bitcoin",
|
|
344
|
+
Testnet: 1, "1": "Testnet",
|
|
345
|
+
Regtest: 2, "2": "Regtest",
|
|
346
|
+
Mutinynet: 3, "3": "Mutinynet",
|
|
347
|
+
});
|
|
348
|
+
/**
|
|
349
|
+
* Swap status for BTC/EVM swaps.
|
|
350
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14}
|
|
351
|
+
*/
|
|
352
|
+
export const SwapStatus = Object.freeze({
|
|
353
|
+
Pending: 0, "0": "Pending",
|
|
354
|
+
ClientFundingSeen: 1, "1": "ClientFundingSeen",
|
|
355
|
+
ClientFunded: 2, "2": "ClientFunded",
|
|
356
|
+
ClientRefunded: 3, "3": "ClientRefunded",
|
|
357
|
+
ServerFunded: 4, "4": "ServerFunded",
|
|
358
|
+
ClientRedeeming: 5, "5": "ClientRedeeming",
|
|
359
|
+
ClientRedeemed: 6, "6": "ClientRedeemed",
|
|
360
|
+
ServerRedeemed: 7, "7": "ServerRedeemed",
|
|
361
|
+
ClientFundedServerRefunded: 8, "8": "ClientFundedServerRefunded",
|
|
362
|
+
ClientRefundedServerFunded: 9, "9": "ClientRefundedServerFunded",
|
|
363
|
+
ClientRefundedServerRefunded: 10, "10": "ClientRefundedServerRefunded",
|
|
364
|
+
Expired: 11, "11": "Expired",
|
|
365
|
+
ClientInvalidFunded: 12, "12": "ClientInvalidFunded",
|
|
366
|
+
ClientFundedTooLate: 13, "13": "ClientFundedTooLate",
|
|
367
|
+
ClientRedeemedAndClientRefunded: 14, "14": "ClientRedeemedAndClientRefunded",
|
|
368
|
+
});
|
|
369
|
+
/**
|
|
370
|
+
* Swap type discriminator.
|
|
371
|
+
* @enum {0 | 1 | 2}
|
|
372
|
+
*/
|
|
373
|
+
export const SwapType = Object.freeze({
|
|
374
|
+
BtcToEvm: 0, "0": "BtcToEvm",
|
|
375
|
+
EvmToBtc: 1, "1": "EvmToBtc",
|
|
376
|
+
BtcToArkade: 2, "2": "BtcToArkade",
|
|
319
377
|
});
|
|
320
378
|
|
|
321
379
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -386,538 +444,2335 @@ export class AssetPair {
|
|
|
386
444
|
}
|
|
387
445
|
if (Symbol.dispose) AssetPair.prototype[Symbol.dispose] = AssetPair.prototype.free;
|
|
388
446
|
|
|
389
|
-
const
|
|
447
|
+
const BtcToArkadeSwapResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
390
448
|
? { register: () => {}, unregister: () => {} }
|
|
391
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
449
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_btctoarkadeswapresponse_free(ptr >>> 0, 1));
|
|
392
450
|
/**
|
|
393
|
-
*
|
|
451
|
+
* Fields from SwapCommonFields are flattened.
|
|
394
452
|
*/
|
|
395
|
-
export class
|
|
453
|
+
export class BtcToArkadeSwapResponse {
|
|
454
|
+
|
|
455
|
+
static __wrap(ptr) {
|
|
456
|
+
ptr = ptr >>> 0;
|
|
457
|
+
const obj = Object.create(BtcToArkadeSwapResponse.prototype);
|
|
458
|
+
obj.__wbg_ptr = ptr;
|
|
459
|
+
BtcToArkadeSwapResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
460
|
+
return obj;
|
|
461
|
+
}
|
|
396
462
|
|
|
397
463
|
__destroy_into_raw() {
|
|
398
464
|
const ptr = this.__wbg_ptr;
|
|
399
465
|
this.__wbg_ptr = 0;
|
|
400
|
-
|
|
466
|
+
BtcToArkadeSwapResponseFinalization.unregister(this);
|
|
401
467
|
return ptr;
|
|
402
468
|
}
|
|
403
469
|
|
|
404
470
|
free() {
|
|
405
471
|
const ptr = this.__destroy_into_raw();
|
|
406
|
-
wasm.
|
|
472
|
+
wasm.__wbg_btctoarkadeswapresponse_free(ptr, 0);
|
|
407
473
|
}
|
|
408
474
|
/**
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
* # Arguments
|
|
412
|
-
* * `base_url` - The Lendaswap API URL
|
|
413
|
-
* * `wallet_storage` - Storage provider for wallet data (mnemonic, key index)
|
|
414
|
-
* * `swap_storage` - Storage provider for swap data
|
|
415
|
-
* * `network` - The Bitcoin network ("bitcoin" or "testnet")
|
|
416
|
-
* * `arkade_url` - The Arkade server URL
|
|
417
|
-
* @param {string} base_url
|
|
418
|
-
* @param {JsWalletStorageProvider} wallet_storage
|
|
419
|
-
* @param {JsSwapStorageProvider} swap_storage
|
|
420
|
-
* @param {string} network
|
|
421
|
-
* @param {string} arkade_url
|
|
475
|
+
* @returns {string}
|
|
422
476
|
*/
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const len4 = WASM_VECTOR_LEN;
|
|
434
|
-
const ret = wasm.client_new(ptr0, len0, ptr1, ptr2, ptr3, len3, ptr4, len4);
|
|
435
|
-
if (ret[2]) {
|
|
436
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
477
|
+
get id() {
|
|
478
|
+
let deferred1_0;
|
|
479
|
+
let deferred1_1;
|
|
480
|
+
try {
|
|
481
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_id(this.__wbg_ptr);
|
|
482
|
+
deferred1_0 = ret[0];
|
|
483
|
+
deferred1_1 = ret[1];
|
|
484
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
485
|
+
} finally {
|
|
486
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
437
487
|
}
|
|
438
|
-
this.__wbg_ptr = ret[0] >>> 0;
|
|
439
|
-
ClientFinalization.register(this, this.__wbg_ptr, this);
|
|
440
|
-
return this;
|
|
441
488
|
}
|
|
442
489
|
/**
|
|
443
|
-
* @param {string
|
|
444
|
-
* @returns {Promise<void>}
|
|
490
|
+
* @param {string} arg0
|
|
445
491
|
*/
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
return ret;
|
|
492
|
+
set id(arg0) {
|
|
493
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
494
|
+
const len0 = WASM_VECTOR_LEN;
|
|
495
|
+
wasm.__wbg_set_btctoarkadeswapresponse_id(this.__wbg_ptr, ptr0, len0);
|
|
451
496
|
}
|
|
452
497
|
/**
|
|
453
|
-
*
|
|
454
|
-
* @param {string} target_address
|
|
455
|
-
* @param {number} target_amount
|
|
456
|
-
* @param {string} target_token
|
|
457
|
-
* @param {string} target_chain
|
|
458
|
-
* @param {string | null} [referral_code]
|
|
459
|
-
* @returns {Promise<any>}
|
|
498
|
+
* @returns {SwapStatus}
|
|
460
499
|
*/
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
const len0 = WASM_VECTOR_LEN;
|
|
464
|
-
const ptr1 = passStringToWasm0(target_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
465
|
-
const len1 = WASM_VECTOR_LEN;
|
|
466
|
-
const ptr2 = passStringToWasm0(target_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
467
|
-
const len2 = WASM_VECTOR_LEN;
|
|
468
|
-
var ptr3 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
469
|
-
var len3 = WASM_VECTOR_LEN;
|
|
470
|
-
const ret = wasm.client_createArkadeToEvmSwap(this.__wbg_ptr, ptr0, len0, target_amount, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
500
|
+
get status() {
|
|
501
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_status(this.__wbg_ptr);
|
|
471
502
|
return ret;
|
|
472
503
|
}
|
|
473
504
|
/**
|
|
474
|
-
*
|
|
475
|
-
* @param {string} target_address
|
|
476
|
-
* @param {string} user_address
|
|
477
|
-
* @param {number} source_amount
|
|
478
|
-
* @param {string} source_token
|
|
479
|
-
* @param {string} source_chain
|
|
480
|
-
* @param {string | null} [referral_code]
|
|
481
|
-
* @returns {Promise<any>}
|
|
505
|
+
* @param {SwapStatus} arg0
|
|
482
506
|
*/
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
const len0 = WASM_VECTOR_LEN;
|
|
486
|
-
const ptr1 = passStringToWasm0(user_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
487
|
-
const len1 = WASM_VECTOR_LEN;
|
|
488
|
-
const ptr2 = passStringToWasm0(source_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
489
|
-
const len2 = WASM_VECTOR_LEN;
|
|
490
|
-
const ptr3 = passStringToWasm0(source_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
491
|
-
const len3 = WASM_VECTOR_LEN;
|
|
492
|
-
var ptr4 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
493
|
-
var len4 = WASM_VECTOR_LEN;
|
|
494
|
-
const ret = wasm.client_createEvmToArkadeSwap(this.__wbg_ptr, ptr0, len0, ptr1, len1, source_amount, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
495
|
-
return ret;
|
|
507
|
+
set status(arg0) {
|
|
508
|
+
wasm.__wbg_set_btctoarkadeswapresponse_status(this.__wbg_ptr, arg0);
|
|
496
509
|
}
|
|
497
510
|
/**
|
|
498
|
-
*
|
|
499
|
-
* @param {string} bolt11_invoice
|
|
500
|
-
* @param {string} user_address
|
|
501
|
-
* @param {string} source_token
|
|
502
|
-
* @param {string} source_chain
|
|
503
|
-
* @param {string | null} [referral_code]
|
|
504
|
-
* @returns {Promise<any>}
|
|
511
|
+
* @returns {string}
|
|
505
512
|
*/
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
const ret = wasm.client_createEvmToLightningSwap(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
518
|
-
return ret;
|
|
513
|
+
get btc_htlc_address() {
|
|
514
|
+
let deferred1_0;
|
|
515
|
+
let deferred1_1;
|
|
516
|
+
try {
|
|
517
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_htlc_address(this.__wbg_ptr);
|
|
518
|
+
deferred1_0 = ret[0];
|
|
519
|
+
deferred1_1 = ret[1];
|
|
520
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
521
|
+
} finally {
|
|
522
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
523
|
+
}
|
|
519
524
|
}
|
|
520
525
|
/**
|
|
521
|
-
* @
|
|
526
|
+
* @param {string} arg0
|
|
522
527
|
*/
|
|
523
|
-
|
|
524
|
-
const
|
|
525
|
-
|
|
528
|
+
set btc_htlc_address(arg0) {
|
|
529
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
530
|
+
const len0 = WASM_VECTOR_LEN;
|
|
531
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_htlc_address(this.__wbg_ptr, ptr0, len0);
|
|
526
532
|
}
|
|
527
533
|
/**
|
|
528
|
-
* @returns {
|
|
534
|
+
* @returns {bigint}
|
|
529
535
|
*/
|
|
530
|
-
|
|
531
|
-
const ret = wasm.
|
|
536
|
+
get asset_amount() {
|
|
537
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr);
|
|
532
538
|
return ret;
|
|
533
539
|
}
|
|
534
540
|
/**
|
|
535
|
-
*
|
|
536
|
-
* @param {string} from
|
|
537
|
-
* @param {string} to
|
|
538
|
-
* @param {bigint} base_amount
|
|
539
|
-
* @returns {Promise<QuoteResponse>}
|
|
541
|
+
* @param {bigint} arg0
|
|
540
542
|
*/
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
const len0 = WASM_VECTOR_LEN;
|
|
544
|
-
const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
545
|
-
const len1 = WASM_VECTOR_LEN;
|
|
546
|
-
const ret = wasm.client_getQuote(this.__wbg_ptr, ptr0, len0, ptr1, len1, base_amount);
|
|
547
|
-
return ret;
|
|
543
|
+
set asset_amount(arg0) {
|
|
544
|
+
wasm.__wbg_set_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr, arg0);
|
|
548
545
|
}
|
|
549
546
|
/**
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
* This function returns `[ExtendedSwapResponse]`. It's too complex for Wasm to handle.
|
|
553
|
-
* @param {string} id
|
|
554
|
-
* @returns {Promise<any>}
|
|
547
|
+
* @returns {bigint}
|
|
555
548
|
*/
|
|
556
|
-
|
|
557
|
-
const
|
|
558
|
-
const len0 = WASM_VECTOR_LEN;
|
|
559
|
-
const ret = wasm.client_getSwap(this.__wbg_ptr, ptr0, len0);
|
|
549
|
+
get sats_receive() {
|
|
550
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_sats_receive(this.__wbg_ptr);
|
|
560
551
|
return ret;
|
|
561
552
|
}
|
|
562
553
|
/**
|
|
563
|
-
*
|
|
564
|
-
*
|
|
565
|
-
* This function returns `[ExtendedSwapResponse[]]`. It's too complex for Wasm to handle.
|
|
566
|
-
* @returns {Promise<any>}
|
|
554
|
+
* @param {bigint} arg0
|
|
567
555
|
*/
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
return ret;
|
|
556
|
+
set sats_receive(arg0) {
|
|
557
|
+
wasm.__wbg_set_btctoarkadeswapresponse_sats_receive(this.__wbg_ptr, arg0);
|
|
571
558
|
}
|
|
572
559
|
/**
|
|
573
|
-
* @
|
|
574
|
-
* @param {string | null} [secret]
|
|
575
|
-
* @returns {Promise<void>}
|
|
560
|
+
* @returns {bigint}
|
|
576
561
|
*/
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
const len0 = WASM_VECTOR_LEN;
|
|
580
|
-
var ptr1 = isLikeNone(secret) ? 0 : passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
581
|
-
var len1 = WASM_VECTOR_LEN;
|
|
582
|
-
const ret = wasm.client_claimGelato(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
562
|
+
get fee_sats() {
|
|
563
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr);
|
|
583
564
|
return ret;
|
|
584
565
|
}
|
|
585
566
|
/**
|
|
586
|
-
* @param {
|
|
587
|
-
* @returns {Promise<any>}
|
|
567
|
+
* @param {bigint} arg0
|
|
588
568
|
*/
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
const len0 = WASM_VECTOR_LEN;
|
|
592
|
-
const ret = wasm.client_amountsForSwap(this.__wbg_ptr, ptr0, len0);
|
|
593
|
-
return ret;
|
|
569
|
+
set fee_sats(arg0) {
|
|
570
|
+
wasm.__wbg_set_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr, arg0);
|
|
594
571
|
}
|
|
595
572
|
/**
|
|
596
|
-
* @
|
|
597
|
-
* @returns {Promise<void>}
|
|
573
|
+
* @returns {string}
|
|
598
574
|
*/
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
575
|
+
get hash_lock() {
|
|
576
|
+
let deferred1_0;
|
|
577
|
+
let deferred1_1;
|
|
578
|
+
try {
|
|
579
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_hash_lock(this.__wbg_ptr);
|
|
580
|
+
deferred1_0 = ret[0];
|
|
581
|
+
deferred1_1 = ret[1];
|
|
582
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
583
|
+
} finally {
|
|
584
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
585
|
+
}
|
|
604
586
|
}
|
|
605
587
|
/**
|
|
606
|
-
* @param {string}
|
|
607
|
-
* @param {string} refund_address
|
|
608
|
-
* @returns {Promise<string>}
|
|
588
|
+
* @param {string} arg0
|
|
609
589
|
*/
|
|
610
|
-
|
|
611
|
-
const ptr0 = passStringToWasm0(
|
|
590
|
+
set hash_lock(arg0) {
|
|
591
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
612
592
|
const len0 = WASM_VECTOR_LEN;
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
593
|
+
wasm.__wbg_set_btctoarkadeswapresponse_hash_lock(this.__wbg_ptr, ptr0, len0);
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* @returns {bigint}
|
|
597
|
+
*/
|
|
598
|
+
get btc_refund_locktime() {
|
|
599
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr);
|
|
600
|
+
return ret;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* @param {bigint} arg0
|
|
604
|
+
*/
|
|
605
|
+
set btc_refund_locktime(arg0) {
|
|
606
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr, arg0);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* @returns {string}
|
|
610
|
+
*/
|
|
611
|
+
get arkade_vhtlc_address() {
|
|
612
|
+
let deferred1_0;
|
|
613
|
+
let deferred1_1;
|
|
614
|
+
try {
|
|
615
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_arkade_vhtlc_address(this.__wbg_ptr);
|
|
616
|
+
deferred1_0 = ret[0];
|
|
617
|
+
deferred1_1 = ret[1];
|
|
618
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
619
|
+
} finally {
|
|
620
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* @param {string} arg0
|
|
625
|
+
*/
|
|
626
|
+
set arkade_vhtlc_address(arg0) {
|
|
627
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
628
|
+
const len0 = WASM_VECTOR_LEN;
|
|
629
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_vhtlc_address(this.__wbg_ptr, ptr0, len0);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* @returns {string}
|
|
633
|
+
*/
|
|
634
|
+
get target_arkade_address() {
|
|
635
|
+
let deferred1_0;
|
|
636
|
+
let deferred1_1;
|
|
637
|
+
try {
|
|
638
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_target_arkade_address(this.__wbg_ptr);
|
|
639
|
+
deferred1_0 = ret[0];
|
|
640
|
+
deferred1_1 = ret[1];
|
|
641
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
642
|
+
} finally {
|
|
643
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* @param {string} arg0
|
|
648
|
+
*/
|
|
649
|
+
set target_arkade_address(arg0) {
|
|
650
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
651
|
+
const len0 = WASM_VECTOR_LEN;
|
|
652
|
+
wasm.__wbg_set_btctoarkadeswapresponse_target_arkade_address(this.__wbg_ptr, ptr0, len0);
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* @returns {string | undefined}
|
|
656
|
+
*/
|
|
657
|
+
get btc_fund_txid() {
|
|
658
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_fund_txid(this.__wbg_ptr);
|
|
659
|
+
let v1;
|
|
660
|
+
if (ret[0] !== 0) {
|
|
661
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
662
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
663
|
+
}
|
|
664
|
+
return v1;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* @param {string | null} [arg0]
|
|
668
|
+
*/
|
|
669
|
+
set btc_fund_txid(arg0) {
|
|
670
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
671
|
+
var len0 = WASM_VECTOR_LEN;
|
|
672
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_fund_txid(this.__wbg_ptr, ptr0, len0);
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* @returns {string | undefined}
|
|
676
|
+
*/
|
|
677
|
+
get btc_claim_txid() {
|
|
678
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_claim_txid(this.__wbg_ptr);
|
|
679
|
+
let v1;
|
|
680
|
+
if (ret[0] !== 0) {
|
|
681
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
682
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
683
|
+
}
|
|
684
|
+
return v1;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* @param {string | null} [arg0]
|
|
688
|
+
*/
|
|
689
|
+
set btc_claim_txid(arg0) {
|
|
690
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
691
|
+
var len0 = WASM_VECTOR_LEN;
|
|
692
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_claim_txid(this.__wbg_ptr, ptr0, len0);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* @returns {string | undefined}
|
|
696
|
+
*/
|
|
697
|
+
get arkade_fund_txid() {
|
|
698
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_arkade_fund_txid(this.__wbg_ptr);
|
|
699
|
+
let v1;
|
|
700
|
+
if (ret[0] !== 0) {
|
|
701
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
702
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
703
|
+
}
|
|
704
|
+
return v1;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* @param {string | null} [arg0]
|
|
708
|
+
*/
|
|
709
|
+
set arkade_fund_txid(arg0) {
|
|
710
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
711
|
+
var len0 = WASM_VECTOR_LEN;
|
|
712
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_fund_txid(this.__wbg_ptr, ptr0, len0);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* @returns {string | undefined}
|
|
716
|
+
*/
|
|
717
|
+
get arkade_claim_txid() {
|
|
718
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_arkade_claim_txid(this.__wbg_ptr);
|
|
719
|
+
let v1;
|
|
720
|
+
if (ret[0] !== 0) {
|
|
721
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
722
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
723
|
+
}
|
|
724
|
+
return v1;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* @param {string | null} [arg0]
|
|
728
|
+
*/
|
|
729
|
+
set arkade_claim_txid(arg0) {
|
|
730
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
731
|
+
var len0 = WASM_VECTOR_LEN;
|
|
732
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_claim_txid(this.__wbg_ptr, ptr0, len0);
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* @returns {string}
|
|
736
|
+
*/
|
|
737
|
+
get network() {
|
|
738
|
+
let deferred1_0;
|
|
739
|
+
let deferred1_1;
|
|
740
|
+
try {
|
|
741
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_network(this.__wbg_ptr);
|
|
742
|
+
deferred1_0 = ret[0];
|
|
743
|
+
deferred1_1 = ret[1];
|
|
744
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
745
|
+
} finally {
|
|
746
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* @param {string} arg0
|
|
751
|
+
*/
|
|
752
|
+
set network(arg0) {
|
|
753
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
754
|
+
const len0 = WASM_VECTOR_LEN;
|
|
755
|
+
wasm.__wbg_set_btctoarkadeswapresponse_network(this.__wbg_ptr, ptr0, len0);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* @returns {string}
|
|
759
|
+
*/
|
|
760
|
+
get created_at() {
|
|
761
|
+
let deferred1_0;
|
|
762
|
+
let deferred1_1;
|
|
763
|
+
try {
|
|
764
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_created_at(this.__wbg_ptr);
|
|
765
|
+
deferred1_0 = ret[0];
|
|
766
|
+
deferred1_1 = ret[1];
|
|
767
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
768
|
+
} finally {
|
|
769
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* @param {string} arg0
|
|
774
|
+
*/
|
|
775
|
+
set created_at(arg0) {
|
|
776
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
777
|
+
const len0 = WASM_VECTOR_LEN;
|
|
778
|
+
wasm.__wbg_set_btctoarkadeswapresponse_created_at(this.__wbg_ptr, ptr0, len0);
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* @returns {string}
|
|
782
|
+
*/
|
|
783
|
+
get server_vhtlc_pk() {
|
|
784
|
+
let deferred1_0;
|
|
785
|
+
let deferred1_1;
|
|
786
|
+
try {
|
|
787
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_server_vhtlc_pk(this.__wbg_ptr);
|
|
788
|
+
deferred1_0 = ret[0];
|
|
789
|
+
deferred1_1 = ret[1];
|
|
790
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
791
|
+
} finally {
|
|
792
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* @param {string} arg0
|
|
797
|
+
*/
|
|
798
|
+
set server_vhtlc_pk(arg0) {
|
|
799
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
800
|
+
const len0 = WASM_VECTOR_LEN;
|
|
801
|
+
wasm.__wbg_set_btctoarkadeswapresponse_server_vhtlc_pk(this.__wbg_ptr, ptr0, len0);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* @returns {string}
|
|
805
|
+
*/
|
|
806
|
+
get arkade_server_pk() {
|
|
807
|
+
let deferred1_0;
|
|
808
|
+
let deferred1_1;
|
|
809
|
+
try {
|
|
810
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_arkade_server_pk(this.__wbg_ptr);
|
|
811
|
+
deferred1_0 = ret[0];
|
|
812
|
+
deferred1_1 = ret[1];
|
|
813
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
814
|
+
} finally {
|
|
815
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* @param {string} arg0
|
|
820
|
+
*/
|
|
821
|
+
set arkade_server_pk(arg0) {
|
|
822
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
823
|
+
const len0 = WASM_VECTOR_LEN;
|
|
824
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_server_pk(this.__wbg_ptr, ptr0, len0);
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* @returns {bigint}
|
|
828
|
+
*/
|
|
829
|
+
get vhtlc_refund_locktime() {
|
|
830
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr);
|
|
831
|
+
return ret;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* @param {bigint} arg0
|
|
835
|
+
*/
|
|
836
|
+
set vhtlc_refund_locktime(arg0) {
|
|
837
|
+
wasm.__wbg_set_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr, arg0);
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* @returns {bigint}
|
|
841
|
+
*/
|
|
842
|
+
get unilateral_claim_delay() {
|
|
843
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_unilateral_claim_delay(this.__wbg_ptr);
|
|
844
|
+
return ret;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* @param {bigint} arg0
|
|
848
|
+
*/
|
|
849
|
+
set unilateral_claim_delay(arg0) {
|
|
850
|
+
wasm.__wbg_set_btctoarkadeswapresponse_unilateral_claim_delay(this.__wbg_ptr, arg0);
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* @returns {bigint}
|
|
854
|
+
*/
|
|
855
|
+
get unilateral_refund_delay() {
|
|
856
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_unilateral_refund_delay(this.__wbg_ptr);
|
|
857
|
+
return ret;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* @param {bigint} arg0
|
|
861
|
+
*/
|
|
862
|
+
set unilateral_refund_delay(arg0) {
|
|
863
|
+
wasm.__wbg_set_btctoarkadeswapresponse_unilateral_refund_delay(this.__wbg_ptr, arg0);
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* @returns {bigint}
|
|
867
|
+
*/
|
|
868
|
+
get unilateral_refund_without_receiver_delay() {
|
|
869
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_unilateral_refund_without_receiver_delay(this.__wbg_ptr);
|
|
870
|
+
return ret;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* @param {bigint} arg0
|
|
874
|
+
*/
|
|
875
|
+
set unilateral_refund_without_receiver_delay(arg0) {
|
|
876
|
+
wasm.__wbg_set_btctoarkadeswapresponse_unilateral_refund_without_receiver_delay(this.__wbg_ptr, arg0);
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* @returns {TokenId}
|
|
880
|
+
*/
|
|
881
|
+
get source_token() {
|
|
882
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_source_token(this.__wbg_ptr);
|
|
883
|
+
return TokenId.__wrap(ret);
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* @param {TokenId} arg0
|
|
887
|
+
*/
|
|
888
|
+
set source_token(arg0) {
|
|
889
|
+
_assertClass(arg0, TokenId);
|
|
890
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
891
|
+
wasm.__wbg_set_btctoarkadeswapresponse_source_token(this.__wbg_ptr, ptr0);
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* @returns {TokenId}
|
|
895
|
+
*/
|
|
896
|
+
get target_token() {
|
|
897
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_target_token(this.__wbg_ptr);
|
|
898
|
+
return TokenId.__wrap(ret);
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* @param {TokenId} arg0
|
|
902
|
+
*/
|
|
903
|
+
set target_token(arg0) {
|
|
904
|
+
_assertClass(arg0, TokenId);
|
|
905
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
906
|
+
wasm.__wbg_set_btctoarkadeswapresponse_target_token(this.__wbg_ptr, ptr0);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
if (Symbol.dispose) BtcToArkadeSwapResponse.prototype[Symbol.dispose] = BtcToArkadeSwapResponse.prototype.free;
|
|
910
|
+
|
|
911
|
+
const BtcToEvmSwapResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
912
|
+
? { register: () => {}, unregister: () => {} }
|
|
913
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_btctoevmswapresponse_free(ptr >>> 0, 1));
|
|
914
|
+
/**
|
|
915
|
+
* BTC to EVM swap response.
|
|
916
|
+
* Fields from SwapCommonFields are flattened.
|
|
917
|
+
*/
|
|
918
|
+
export class BtcToEvmSwapResponse {
|
|
919
|
+
|
|
920
|
+
static __wrap(ptr) {
|
|
921
|
+
ptr = ptr >>> 0;
|
|
922
|
+
const obj = Object.create(BtcToEvmSwapResponse.prototype);
|
|
923
|
+
obj.__wbg_ptr = ptr;
|
|
924
|
+
BtcToEvmSwapResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
925
|
+
return obj;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
__destroy_into_raw() {
|
|
929
|
+
const ptr = this.__wbg_ptr;
|
|
930
|
+
this.__wbg_ptr = 0;
|
|
931
|
+
BtcToEvmSwapResponseFinalization.unregister(this);
|
|
932
|
+
return ptr;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
free() {
|
|
936
|
+
const ptr = this.__destroy_into_raw();
|
|
937
|
+
wasm.__wbg_btctoevmswapresponse_free(ptr, 0);
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* @returns {string}
|
|
941
|
+
*/
|
|
942
|
+
get id() {
|
|
943
|
+
let deferred1_0;
|
|
944
|
+
let deferred1_1;
|
|
945
|
+
try {
|
|
946
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_id(this.__wbg_ptr);
|
|
947
|
+
deferred1_0 = ret[0];
|
|
948
|
+
deferred1_1 = ret[1];
|
|
949
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
950
|
+
} finally {
|
|
951
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* @param {string} arg0
|
|
956
|
+
*/
|
|
957
|
+
set id(arg0) {
|
|
958
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
959
|
+
const len0 = WASM_VECTOR_LEN;
|
|
960
|
+
wasm.__wbg_set_btctoevmswapresponse_id(this.__wbg_ptr, ptr0, len0);
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* @returns {SwapStatus}
|
|
964
|
+
*/
|
|
965
|
+
get status() {
|
|
966
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_status(this.__wbg_ptr);
|
|
967
|
+
return ret;
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* @param {SwapStatus} arg0
|
|
971
|
+
*/
|
|
972
|
+
set status(arg0) {
|
|
973
|
+
wasm.__wbg_set_btctoarkadeswapresponse_status(this.__wbg_ptr, arg0);
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* @returns {string}
|
|
977
|
+
*/
|
|
978
|
+
get hash_lock() {
|
|
979
|
+
let deferred1_0;
|
|
980
|
+
let deferred1_1;
|
|
981
|
+
try {
|
|
982
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_hash_lock(this.__wbg_ptr);
|
|
983
|
+
deferred1_0 = ret[0];
|
|
984
|
+
deferred1_1 = ret[1];
|
|
985
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
986
|
+
} finally {
|
|
987
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* @param {string} arg0
|
|
992
|
+
*/
|
|
993
|
+
set hash_lock(arg0) {
|
|
994
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
995
|
+
const len0 = WASM_VECTOR_LEN;
|
|
996
|
+
wasm.__wbg_set_btctoarkadeswapresponse_id(this.__wbg_ptr, ptr0, len0);
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* @returns {bigint}
|
|
1000
|
+
*/
|
|
1001
|
+
get fee_sats() {
|
|
1002
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr);
|
|
1003
|
+
return ret;
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* @param {bigint} arg0
|
|
1007
|
+
*/
|
|
1008
|
+
set fee_sats(arg0) {
|
|
1009
|
+
wasm.__wbg_set_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr, arg0);
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* @returns {number}
|
|
1013
|
+
*/
|
|
1014
|
+
get asset_amount() {
|
|
1015
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_asset_amount(this.__wbg_ptr);
|
|
1016
|
+
return ret;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* @param {number} arg0
|
|
1020
|
+
*/
|
|
1021
|
+
set asset_amount(arg0) {
|
|
1022
|
+
wasm.__wbg_set_btctoevmswapresponse_asset_amount(this.__wbg_ptr, arg0);
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* @returns {string}
|
|
1026
|
+
*/
|
|
1027
|
+
get sender_pk() {
|
|
1028
|
+
let deferred1_0;
|
|
1029
|
+
let deferred1_1;
|
|
1030
|
+
try {
|
|
1031
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_sender_pk(this.__wbg_ptr);
|
|
1032
|
+
deferred1_0 = ret[0];
|
|
1033
|
+
deferred1_1 = ret[1];
|
|
1034
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1035
|
+
} finally {
|
|
1036
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* @param {string} arg0
|
|
1041
|
+
*/
|
|
1042
|
+
set sender_pk(arg0) {
|
|
1043
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1044
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1045
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_htlc_address(this.__wbg_ptr, ptr0, len0);
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* @returns {string}
|
|
1049
|
+
*/
|
|
1050
|
+
get receiver_pk() {
|
|
1051
|
+
let deferred1_0;
|
|
1052
|
+
let deferred1_1;
|
|
1053
|
+
try {
|
|
1054
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_receiver_pk(this.__wbg_ptr);
|
|
1055
|
+
deferred1_0 = ret[0];
|
|
1056
|
+
deferred1_1 = ret[1];
|
|
1057
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1058
|
+
} finally {
|
|
1059
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* @param {string} arg0
|
|
1064
|
+
*/
|
|
1065
|
+
set receiver_pk(arg0) {
|
|
1066
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1067
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1068
|
+
wasm.__wbg_set_btctoarkadeswapresponse_hash_lock(this.__wbg_ptr, ptr0, len0);
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* @returns {string}
|
|
1072
|
+
*/
|
|
1073
|
+
get server_pk() {
|
|
1074
|
+
let deferred1_0;
|
|
1075
|
+
let deferred1_1;
|
|
1076
|
+
try {
|
|
1077
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_server_pk(this.__wbg_ptr);
|
|
1078
|
+
deferred1_0 = ret[0];
|
|
1079
|
+
deferred1_1 = ret[1];
|
|
1080
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1081
|
+
} finally {
|
|
1082
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* @param {string} arg0
|
|
1087
|
+
*/
|
|
1088
|
+
set server_pk(arg0) {
|
|
1089
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1090
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1091
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_vhtlc_address(this.__wbg_ptr, ptr0, len0);
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* @returns {number}
|
|
1095
|
+
*/
|
|
1096
|
+
get refund_locktime() {
|
|
1097
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_refund_locktime(this.__wbg_ptr);
|
|
1098
|
+
return ret >>> 0;
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* @param {number} arg0
|
|
1102
|
+
*/
|
|
1103
|
+
set refund_locktime(arg0) {
|
|
1104
|
+
wasm.__wbg_set_btctoevmswapresponse_refund_locktime(this.__wbg_ptr, arg0);
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* @returns {bigint}
|
|
1108
|
+
*/
|
|
1109
|
+
get unilateral_claim_delay() {
|
|
1110
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr);
|
|
1111
|
+
return ret;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* @param {bigint} arg0
|
|
1115
|
+
*/
|
|
1116
|
+
set unilateral_claim_delay(arg0) {
|
|
1117
|
+
wasm.__wbg_set_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr, arg0);
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* @returns {bigint}
|
|
1121
|
+
*/
|
|
1122
|
+
get unilateral_refund_delay() {
|
|
1123
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr);
|
|
1124
|
+
return ret;
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* @param {bigint} arg0
|
|
1128
|
+
*/
|
|
1129
|
+
set unilateral_refund_delay(arg0) {
|
|
1130
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr, arg0);
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* @returns {bigint}
|
|
1134
|
+
*/
|
|
1135
|
+
get unilateral_refund_without_receiver_delay() {
|
|
1136
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr);
|
|
1137
|
+
return ret;
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* @param {bigint} arg0
|
|
1141
|
+
*/
|
|
1142
|
+
set unilateral_refund_without_receiver_delay(arg0) {
|
|
1143
|
+
wasm.__wbg_set_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr, arg0);
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* @returns {Network}
|
|
1147
|
+
*/
|
|
1148
|
+
get network() {
|
|
1149
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_network(this.__wbg_ptr);
|
|
1150
|
+
return ret;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* @param {Network} arg0
|
|
1154
|
+
*/
|
|
1155
|
+
set network(arg0) {
|
|
1156
|
+
wasm.__wbg_set_btctoevmswapresponse_network(this.__wbg_ptr, arg0);
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* @returns {string}
|
|
1160
|
+
*/
|
|
1161
|
+
get created_at() {
|
|
1162
|
+
let deferred1_0;
|
|
1163
|
+
let deferred1_1;
|
|
1164
|
+
try {
|
|
1165
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_created_at(this.__wbg_ptr);
|
|
1166
|
+
deferred1_0 = ret[0];
|
|
1167
|
+
deferred1_1 = ret[1];
|
|
1168
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1169
|
+
} finally {
|
|
1170
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* @param {string} arg0
|
|
1175
|
+
*/
|
|
1176
|
+
set created_at(arg0) {
|
|
1177
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1178
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1179
|
+
wasm.__wbg_set_btctoarkadeswapresponse_target_arkade_address(this.__wbg_ptr, ptr0, len0);
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* @returns {string}
|
|
1183
|
+
*/
|
|
1184
|
+
get htlc_address_evm() {
|
|
1185
|
+
let deferred1_0;
|
|
1186
|
+
let deferred1_1;
|
|
1187
|
+
try {
|
|
1188
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_htlc_address_evm(this.__wbg_ptr);
|
|
1189
|
+
deferred1_0 = ret[0];
|
|
1190
|
+
deferred1_1 = ret[1];
|
|
1191
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1192
|
+
} finally {
|
|
1193
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* @param {string} arg0
|
|
1198
|
+
*/
|
|
1199
|
+
set htlc_address_evm(arg0) {
|
|
1200
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1201
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1202
|
+
wasm.__wbg_set_btctoarkadeswapresponse_network(this.__wbg_ptr, ptr0, len0);
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* @returns {string}
|
|
1206
|
+
*/
|
|
1207
|
+
get htlc_address_arkade() {
|
|
1208
|
+
let deferred1_0;
|
|
1209
|
+
let deferred1_1;
|
|
1210
|
+
try {
|
|
1211
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_htlc_address_arkade(this.__wbg_ptr);
|
|
1212
|
+
deferred1_0 = ret[0];
|
|
1213
|
+
deferred1_1 = ret[1];
|
|
1214
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1215
|
+
} finally {
|
|
1216
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* @param {string} arg0
|
|
1221
|
+
*/
|
|
1222
|
+
set htlc_address_arkade(arg0) {
|
|
1223
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1224
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1225
|
+
wasm.__wbg_set_btctoarkadeswapresponse_created_at(this.__wbg_ptr, ptr0, len0);
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* @returns {string}
|
|
1229
|
+
*/
|
|
1230
|
+
get user_address_evm() {
|
|
1231
|
+
let deferred1_0;
|
|
1232
|
+
let deferred1_1;
|
|
1233
|
+
try {
|
|
1234
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_user_address_evm(this.__wbg_ptr);
|
|
1235
|
+
deferred1_0 = ret[0];
|
|
1236
|
+
deferred1_1 = ret[1];
|
|
1237
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1238
|
+
} finally {
|
|
1239
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* @param {string} arg0
|
|
1244
|
+
*/
|
|
1245
|
+
set user_address_evm(arg0) {
|
|
1246
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1247
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1248
|
+
wasm.__wbg_set_btctoarkadeswapresponse_server_vhtlc_pk(this.__wbg_ptr, ptr0, len0);
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* @returns {string}
|
|
1252
|
+
*/
|
|
1253
|
+
get ln_invoice() {
|
|
1254
|
+
let deferred1_0;
|
|
1255
|
+
let deferred1_1;
|
|
1256
|
+
try {
|
|
1257
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_ln_invoice(this.__wbg_ptr);
|
|
1258
|
+
deferred1_0 = ret[0];
|
|
1259
|
+
deferred1_1 = ret[1];
|
|
1260
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1261
|
+
} finally {
|
|
1262
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* @param {string} arg0
|
|
1267
|
+
*/
|
|
1268
|
+
set ln_invoice(arg0) {
|
|
1269
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1270
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1271
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_server_pk(this.__wbg_ptr, ptr0, len0);
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* @returns {bigint}
|
|
1275
|
+
*/
|
|
1276
|
+
get sats_receive() {
|
|
1277
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_unilateral_claim_delay(this.__wbg_ptr);
|
|
1278
|
+
return ret;
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* @param {bigint} arg0
|
|
1282
|
+
*/
|
|
1283
|
+
set sats_receive(arg0) {
|
|
1284
|
+
wasm.__wbg_set_btctoarkadeswapresponse_unilateral_claim_delay(this.__wbg_ptr, arg0);
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* @returns {TokenId}
|
|
1288
|
+
*/
|
|
1289
|
+
get source_token() {
|
|
1290
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_source_token(this.__wbg_ptr);
|
|
1291
|
+
return TokenId.__wrap(ret);
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* @param {TokenId} arg0
|
|
1295
|
+
*/
|
|
1296
|
+
set source_token(arg0) {
|
|
1297
|
+
_assertClass(arg0, TokenId);
|
|
1298
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1299
|
+
wasm.__wbg_set_btctoevmswapresponse_source_token(this.__wbg_ptr, ptr0);
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* @returns {TokenId}
|
|
1303
|
+
*/
|
|
1304
|
+
get target_token() {
|
|
1305
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_source_token(this.__wbg_ptr);
|
|
1306
|
+
return TokenId.__wrap(ret);
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* @param {TokenId} arg0
|
|
1310
|
+
*/
|
|
1311
|
+
set target_token(arg0) {
|
|
1312
|
+
_assertClass(arg0, TokenId);
|
|
1313
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1314
|
+
wasm.__wbg_set_btctoarkadeswapresponse_source_token(this.__wbg_ptr, ptr0);
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* @returns {string | undefined}
|
|
1318
|
+
*/
|
|
1319
|
+
get bitcoin_htlc_claim_txid() {
|
|
1320
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_bitcoin_htlc_claim_txid(this.__wbg_ptr);
|
|
1321
|
+
let v1;
|
|
1322
|
+
if (ret[0] !== 0) {
|
|
1323
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1324
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1325
|
+
}
|
|
1326
|
+
return v1;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* @param {string | null} [arg0]
|
|
1330
|
+
*/
|
|
1331
|
+
set bitcoin_htlc_claim_txid(arg0) {
|
|
1332
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1333
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1334
|
+
wasm.__wbg_set_btctoevmswapresponse_bitcoin_htlc_claim_txid(this.__wbg_ptr, ptr0, len0);
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* @returns {string | undefined}
|
|
1338
|
+
*/
|
|
1339
|
+
get bitcoin_htlc_fund_txid() {
|
|
1340
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_bitcoin_htlc_fund_txid(this.__wbg_ptr);
|
|
1341
|
+
let v1;
|
|
1342
|
+
if (ret[0] !== 0) {
|
|
1343
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1344
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1345
|
+
}
|
|
1346
|
+
return v1;
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* @param {string | null} [arg0]
|
|
1350
|
+
*/
|
|
1351
|
+
set bitcoin_htlc_fund_txid(arg0) {
|
|
1352
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1353
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1354
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_fund_txid(this.__wbg_ptr, ptr0, len0);
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* @returns {string | undefined}
|
|
1358
|
+
*/
|
|
1359
|
+
get evm_htlc_claim_txid() {
|
|
1360
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_evm_htlc_claim_txid(this.__wbg_ptr);
|
|
1361
|
+
let v1;
|
|
1362
|
+
if (ret[0] !== 0) {
|
|
1363
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1364
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1365
|
+
}
|
|
1366
|
+
return v1;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* @param {string | null} [arg0]
|
|
1370
|
+
*/
|
|
1371
|
+
set evm_htlc_claim_txid(arg0) {
|
|
1372
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1373
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1374
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_claim_txid(this.__wbg_ptr, ptr0, len0);
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* @returns {string | undefined}
|
|
1378
|
+
*/
|
|
1379
|
+
get evm_htlc_fund_txid() {
|
|
1380
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_evm_htlc_fund_txid(this.__wbg_ptr);
|
|
1381
|
+
let v1;
|
|
1382
|
+
if (ret[0] !== 0) {
|
|
1383
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1384
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1385
|
+
}
|
|
1386
|
+
return v1;
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* @param {string | null} [arg0]
|
|
1390
|
+
*/
|
|
1391
|
+
set evm_htlc_fund_txid(arg0) {
|
|
1392
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1393
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1394
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_fund_txid(this.__wbg_ptr, ptr0, len0);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
if (Symbol.dispose) BtcToEvmSwapResponse.prototype[Symbol.dispose] = BtcToEvmSwapResponse.prototype.free;
|
|
1398
|
+
|
|
1399
|
+
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1400
|
+
? { register: () => {}, unregister: () => {} }
|
|
1401
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
1402
|
+
/**
|
|
1403
|
+
* Lendaswap client.
|
|
1404
|
+
*/
|
|
1405
|
+
export class Client {
|
|
1406
|
+
|
|
1407
|
+
__destroy_into_raw() {
|
|
1408
|
+
const ptr = this.__wbg_ptr;
|
|
1409
|
+
this.__wbg_ptr = 0;
|
|
1410
|
+
ClientFinalization.unregister(this);
|
|
1411
|
+
return ptr;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
free() {
|
|
1415
|
+
const ptr = this.__destroy_into_raw();
|
|
1416
|
+
wasm.__wbg_client_free(ptr, 0);
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Create a new client with separate wallet, swap, and VTXO swap storage.
|
|
1420
|
+
*
|
|
1421
|
+
* # Arguments
|
|
1422
|
+
* * `base_url` - The Lendaswap API URL
|
|
1423
|
+
* * `wallet_storage` - Storage provider for wallet data (mnemonic, key index)
|
|
1424
|
+
* * `swap_storage` - Storage provider for swap data
|
|
1425
|
+
* * `vtxo_swap_storage` - Storage provider for VTXO swap data
|
|
1426
|
+
* * `network` - The Bitcoin network ("bitcoin" or "testnet")
|
|
1427
|
+
* * `arkade_url` - The Arkade server URL
|
|
1428
|
+
* * `esplora_url` - The Esplora API URL for on-chain Bitcoin operations
|
|
1429
|
+
* @param {string} base_url
|
|
1430
|
+
* @param {JsWalletStorageProvider} wallet_storage
|
|
1431
|
+
* @param {JsSwapStorageProvider} swap_storage
|
|
1432
|
+
* @param {JsVtxoSwapStorageProvider} vtxo_swap_storage
|
|
1433
|
+
* @param {string} network
|
|
1434
|
+
* @param {string} arkade_url
|
|
1435
|
+
* @param {string} esplora_url
|
|
1436
|
+
*/
|
|
1437
|
+
constructor(base_url, wallet_storage, swap_storage, vtxo_swap_storage, network, arkade_url, esplora_url) {
|
|
1438
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1439
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1440
|
+
_assertClass(wallet_storage, JsWalletStorageProvider);
|
|
1441
|
+
var ptr1 = wallet_storage.__destroy_into_raw();
|
|
1442
|
+
_assertClass(swap_storage, JsSwapStorageProvider);
|
|
1443
|
+
var ptr2 = swap_storage.__destroy_into_raw();
|
|
1444
|
+
_assertClass(vtxo_swap_storage, JsVtxoSwapStorageProvider);
|
|
1445
|
+
var ptr3 = vtxo_swap_storage.__destroy_into_raw();
|
|
1446
|
+
const ptr4 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1447
|
+
const len4 = WASM_VECTOR_LEN;
|
|
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);
|
|
1453
|
+
if (ret[2]) {
|
|
1454
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1455
|
+
}
|
|
1456
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
1457
|
+
ClientFinalization.register(this, this.__wbg_ptr, this);
|
|
1458
|
+
return this;
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* @param {string | null} [mnemonic]
|
|
1462
|
+
* @returns {Promise<void>}
|
|
1463
|
+
*/
|
|
1464
|
+
init(mnemonic) {
|
|
1465
|
+
var ptr0 = isLikeNone(mnemonic) ? 0 : passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1466
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1467
|
+
const ret = wasm.client_init(this.__wbg_ptr, ptr0, len0);
|
|
1468
|
+
return ret;
|
|
1469
|
+
}
|
|
1470
|
+
/**
|
|
1471
|
+
* Create an Arkade to EVM swap.
|
|
1472
|
+
* @param {string} target_address
|
|
1473
|
+
* @param {number} target_amount
|
|
1474
|
+
* @param {string} target_token
|
|
1475
|
+
* @param {string} target_chain
|
|
1476
|
+
* @param {string | null} [referral_code]
|
|
1477
|
+
* @returns {Promise<BtcToEvmSwapResponse>}
|
|
1478
|
+
*/
|
|
1479
|
+
createArkadeToEvmSwap(target_address, target_amount, target_token, target_chain, referral_code) {
|
|
1480
|
+
const ptr0 = passStringToWasm0(target_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1481
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1482
|
+
const ptr1 = passStringToWasm0(target_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1483
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1484
|
+
const ptr2 = passStringToWasm0(target_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1485
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1486
|
+
var ptr3 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1487
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1488
|
+
const ret = wasm.client_createArkadeToEvmSwap(this.__wbg_ptr, ptr0, len0, target_amount, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1489
|
+
return ret;
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Create an EVM to Arkade swap.
|
|
1493
|
+
* @param {string} target_address
|
|
1494
|
+
* @param {string} user_address
|
|
1495
|
+
* @param {number} source_amount
|
|
1496
|
+
* @param {string} source_token
|
|
1497
|
+
* @param {string} source_chain
|
|
1498
|
+
* @param {string | null} [referral_code]
|
|
1499
|
+
* @returns {Promise<EvmToBtcSwapResponse>}
|
|
1500
|
+
*/
|
|
1501
|
+
createEvmToArkadeSwap(target_address, user_address, source_amount, source_token, source_chain, referral_code) {
|
|
1502
|
+
const ptr0 = passStringToWasm0(target_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1503
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1504
|
+
const ptr1 = passStringToWasm0(user_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1505
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1506
|
+
const ptr2 = passStringToWasm0(source_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1507
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1508
|
+
const ptr3 = passStringToWasm0(source_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1509
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1510
|
+
var ptr4 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1511
|
+
var len4 = WASM_VECTOR_LEN;
|
|
1512
|
+
const ret = wasm.client_createEvmToArkadeSwap(this.__wbg_ptr, ptr0, len0, ptr1, len1, source_amount, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
1513
|
+
return ret;
|
|
1514
|
+
}
|
|
1515
|
+
/**
|
|
1516
|
+
* Create an EVM to Lightning swap.
|
|
1517
|
+
* @param {string} bolt11_invoice
|
|
1518
|
+
* @param {string} user_address
|
|
1519
|
+
* @param {string} source_token
|
|
1520
|
+
* @param {string} source_chain
|
|
1521
|
+
* @param {string | null} [referral_code]
|
|
1522
|
+
* @returns {Promise<EvmToBtcSwapResponse>}
|
|
1523
|
+
*/
|
|
1524
|
+
createEvmToLightningSwap(bolt11_invoice, user_address, source_token, source_chain, referral_code) {
|
|
1525
|
+
const ptr0 = passStringToWasm0(bolt11_invoice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1526
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1527
|
+
const ptr1 = passStringToWasm0(user_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1528
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1529
|
+
const ptr2 = passStringToWasm0(source_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1530
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1531
|
+
const ptr3 = passStringToWasm0(source_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1532
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1533
|
+
var ptr4 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1534
|
+
var len4 = WASM_VECTOR_LEN;
|
|
1535
|
+
const ret = wasm.client_createEvmToLightningSwap(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
1536
|
+
return ret;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* @returns {Promise<AssetPair[]>}
|
|
1540
|
+
*/
|
|
1541
|
+
getAssetPairs() {
|
|
1542
|
+
const ret = wasm.client_getAssetPairs(this.__wbg_ptr);
|
|
1543
|
+
return ret;
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* @returns {Promise<TokenInfo[]>}
|
|
1547
|
+
*/
|
|
1548
|
+
getTokens() {
|
|
1549
|
+
const ret = wasm.client_getTokens(this.__wbg_ptr);
|
|
1550
|
+
return ret;
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Get a quote.
|
|
1554
|
+
* @param {string} from
|
|
1555
|
+
* @param {string} to
|
|
1556
|
+
* @param {bigint} base_amount
|
|
1557
|
+
* @returns {Promise<QuoteResponse>}
|
|
1558
|
+
*/
|
|
1559
|
+
getQuote(from, to, base_amount) {
|
|
1560
|
+
const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1561
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1562
|
+
const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1563
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1564
|
+
const ret = wasm.client_getQuote(this.__wbg_ptr, ptr0, len0, ptr1, len1, base_amount);
|
|
1565
|
+
return ret;
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Get swap by ID.
|
|
1569
|
+
* @param {string} id
|
|
1570
|
+
* @returns {Promise<ExtendedSwapStorageData>}
|
|
1571
|
+
*/
|
|
1572
|
+
getSwap(id) {
|
|
1573
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1574
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1575
|
+
const ret = wasm.client_getSwap(this.__wbg_ptr, ptr0, len0);
|
|
1576
|
+
return ret;
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Get all swaps.
|
|
1580
|
+
* @returns {Promise<ExtendedSwapStorageData[]>}
|
|
1581
|
+
*/
|
|
1582
|
+
listAll() {
|
|
1583
|
+
const ret = wasm.client_listAll(this.__wbg_ptr);
|
|
1584
|
+
return ret;
|
|
1585
|
+
}
|
|
1586
|
+
/**
|
|
1587
|
+
* @param {string} swap_id
|
|
1588
|
+
* @param {string | null} [secret]
|
|
1589
|
+
* @returns {Promise<void>}
|
|
1590
|
+
*/
|
|
1591
|
+
claimGelato(swap_id, secret) {
|
|
1592
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1593
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1594
|
+
var ptr1 = isLikeNone(secret) ? 0 : passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1595
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1596
|
+
const ret = wasm.client_claimGelato(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1597
|
+
return ret;
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* @param {string} swap_id
|
|
1601
|
+
* @returns {Promise<any>}
|
|
1602
|
+
*/
|
|
1603
|
+
amountsForSwap(swap_id) {
|
|
1604
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1605
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1606
|
+
const ret = wasm.client_amountsForSwap(this.__wbg_ptr, ptr0, len0);
|
|
1607
|
+
return ret;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* @param {string} swap_id
|
|
1611
|
+
* @returns {Promise<void>}
|
|
1612
|
+
*/
|
|
1613
|
+
claimVhtlc(swap_id) {
|
|
1614
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1615
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1616
|
+
const ret = wasm.client_claimVhtlc(this.__wbg_ptr, ptr0, len0);
|
|
1617
|
+
return ret;
|
|
1618
|
+
}
|
|
1619
|
+
/**
|
|
1620
|
+
* @param {string} swap_id
|
|
1621
|
+
* @param {string} refund_address
|
|
1622
|
+
* @returns {Promise<string>}
|
|
1623
|
+
*/
|
|
1624
|
+
refundVhtlc(swap_id, refund_address) {
|
|
1625
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1626
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1627
|
+
const ptr1 = passStringToWasm0(refund_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1628
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1629
|
+
const ret = wasm.client_refundVhtlc(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1630
|
+
return ret;
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Create an on-chain Bitcoin to Arkade swap.
|
|
1634
|
+
* @param {string} target_arkade_address
|
|
1635
|
+
* @param {bigint} sats_receive
|
|
1636
|
+
* @param {string | null} [referral_code]
|
|
1637
|
+
* @returns {Promise<BtcToArkadeSwapResponse>}
|
|
1638
|
+
*/
|
|
1639
|
+
createBitcoinToArkadeSwap(target_arkade_address, sats_receive, referral_code) {
|
|
1640
|
+
const ptr0 = passStringToWasm0(target_arkade_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1641
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1642
|
+
var ptr1 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1643
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1644
|
+
const ret = wasm.client_createBitcoinToArkadeSwap(this.__wbg_ptr, ptr0, len0, sats_receive, ptr1, len1);
|
|
1645
|
+
return ret;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Claim the Arkade VHTLC for a BTC-to-Arkade swap.
|
|
1649
|
+
* @param {string} swap_id
|
|
1650
|
+
* @returns {Promise<string>}
|
|
1651
|
+
*/
|
|
1652
|
+
claimBtcToArkadeVhtlc(swap_id) {
|
|
1653
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1654
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1655
|
+
const ret = wasm.client_claimBtcToArkadeVhtlc(this.__wbg_ptr, ptr0, len0);
|
|
1656
|
+
return ret;
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Refund from the on-chain Bitcoin HTLC after timeout.
|
|
1660
|
+
* @param {string} swap_id
|
|
1661
|
+
* @param {string} refund_address
|
|
1662
|
+
* @returns {Promise<string>}
|
|
1663
|
+
*/
|
|
1664
|
+
refundOnchainHtlc(swap_id, refund_address) {
|
|
1665
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1666
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1667
|
+
const ptr1 = passStringToWasm0(refund_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1668
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1669
|
+
const ret = wasm.client_refundOnchainHtlc(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1670
|
+
return ret;
|
|
617
1671
|
}
|
|
618
1672
|
/**
|
|
619
1673
|
* Get API version.
|
|
620
1674
|
* @returns {Promise<Version>}
|
|
621
1675
|
*/
|
|
622
|
-
getVersion() {
|
|
623
|
-
const ret = wasm.client_getVersion(this.__wbg_ptr);
|
|
1676
|
+
getVersion() {
|
|
1677
|
+
const ret = wasm.client_getVersion(this.__wbg_ptr);
|
|
1678
|
+
return ret;
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Recover swaps using xpub.
|
|
1682
|
+
* @returns {Promise<ExtendedSwapStorageData[]>}
|
|
1683
|
+
*/
|
|
1684
|
+
recoverSwaps() {
|
|
1685
|
+
const ret = wasm.client_recoverSwaps(this.__wbg_ptr);
|
|
1686
|
+
return ret;
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Get mnemonic
|
|
1690
|
+
* @returns {Promise<string>}
|
|
1691
|
+
*/
|
|
1692
|
+
getMnemonic() {
|
|
1693
|
+
const ret = wasm.client_getMnemonic(this.__wbg_ptr);
|
|
1694
|
+
return ret;
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Get userIdXpub
|
|
1698
|
+
* @returns {Promise<string>}
|
|
1699
|
+
*/
|
|
1700
|
+
getUserIdXpub() {
|
|
1701
|
+
const ret = wasm.client_getUserIdXpub(this.__wbg_ptr);
|
|
1702
|
+
return ret;
|
|
1703
|
+
}
|
|
1704
|
+
/**
|
|
1705
|
+
* Deletes all stored swaps
|
|
1706
|
+
* @returns {Promise<void>}
|
|
1707
|
+
*/
|
|
1708
|
+
clearSwapStorage() {
|
|
1709
|
+
const ret = wasm.client_clearSwapStorage(this.__wbg_ptr);
|
|
1710
|
+
return ret;
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Delete specific swap
|
|
1714
|
+
* @param {string} id
|
|
1715
|
+
* @returns {Promise<void>}
|
|
1716
|
+
*/
|
|
1717
|
+
deleteSwap(id) {
|
|
1718
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1719
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1720
|
+
const ret = wasm.client_deleteSwap(this.__wbg_ptr, ptr0, len0);
|
|
1721
|
+
return ret;
|
|
1722
|
+
}
|
|
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
|
+
/**
|
|
1744
|
+
* Estimate the fee for a VTXO swap.
|
|
1745
|
+
*
|
|
1746
|
+
* # Arguments
|
|
1747
|
+
* * `vtxos` - List of VTXO outpoints to refresh ("txid:vout" format)
|
|
1748
|
+
* @param {string[]} vtxos
|
|
1749
|
+
* @returns {Promise<EstimateVtxoSwapResponse>}
|
|
1750
|
+
*/
|
|
1751
|
+
estimateVtxoSwap(vtxos) {
|
|
1752
|
+
const ptr0 = passArrayJsValueToWasm0(vtxos, wasm.__wbindgen_malloc);
|
|
1753
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1754
|
+
const ret = wasm.client_estimateVtxoSwap(this.__wbg_ptr, ptr0, len0);
|
|
1755
|
+
return ret;
|
|
1756
|
+
}
|
|
1757
|
+
/**
|
|
1758
|
+
* Create a VTXO swap for refreshing VTXOs.
|
|
1759
|
+
*
|
|
1760
|
+
* Returns the swap response and swap params.
|
|
1761
|
+
*
|
|
1762
|
+
* # Arguments
|
|
1763
|
+
* * `vtxos` - List of VTXO outpoints to refresh ("txid:vout" format)
|
|
1764
|
+
* @param {string[]} vtxos
|
|
1765
|
+
* @returns {Promise<CreateVtxoSwapResult>}
|
|
1766
|
+
*/
|
|
1767
|
+
createVtxoSwap(vtxos) {
|
|
1768
|
+
const ptr0 = passArrayJsValueToWasm0(vtxos, wasm.__wbindgen_malloc);
|
|
1769
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1770
|
+
const ret = wasm.client_createVtxoSwap(this.__wbg_ptr, ptr0, len0);
|
|
1771
|
+
return ret;
|
|
1772
|
+
}
|
|
1773
|
+
/**
|
|
1774
|
+
* Get VTXO swap details by ID.
|
|
1775
|
+
* @param {string} id
|
|
1776
|
+
* @returns {Promise<ExtendedVtxoSwapStorageData>}
|
|
1777
|
+
*/
|
|
1778
|
+
getVtxoSwap(id) {
|
|
1779
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1780
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1781
|
+
const ret = wasm.client_getVtxoSwap(this.__wbg_ptr, ptr0, len0);
|
|
1782
|
+
return ret;
|
|
1783
|
+
}
|
|
1784
|
+
/**
|
|
1785
|
+
* Claim the server's VHTLC in a VTXO swap.
|
|
1786
|
+
*
|
|
1787
|
+
* # Arguments
|
|
1788
|
+
* * `swap` - The VTXO swap response
|
|
1789
|
+
* * `swap_params` - The client's swap parameters
|
|
1790
|
+
* * `claim_address` - The Arkade address to receive the claimed funds
|
|
1791
|
+
* @param {VtxoSwapResponse} swap
|
|
1792
|
+
* @param {SwapParams} swap_params
|
|
1793
|
+
* @param {string} claim_address
|
|
1794
|
+
* @returns {Promise<string>}
|
|
1795
|
+
*/
|
|
1796
|
+
claimVtxoSwap(swap, swap_params, claim_address) {
|
|
1797
|
+
_assertClass(swap, VtxoSwapResponse);
|
|
1798
|
+
_assertClass(swap_params, SwapParams);
|
|
1799
|
+
const ptr0 = passStringToWasm0(claim_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1800
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1801
|
+
const ret = wasm.client_claimVtxoSwap(this.__wbg_ptr, swap.__wbg_ptr, swap_params.__wbg_ptr, ptr0, len0);
|
|
1802
|
+
return ret;
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* Refund the client's VHTLC in a VTXO swap.
|
|
1806
|
+
*
|
|
1807
|
+
* # Arguments
|
|
1808
|
+
* * `swap_id` - The swap ID
|
|
1809
|
+
* * `refund_address` - The Arkade address to receive the refunded funds
|
|
1810
|
+
* @param {string} swap_id
|
|
1811
|
+
* @param {string} refund_address
|
|
1812
|
+
* @returns {Promise<string>}
|
|
1813
|
+
*/
|
|
1814
|
+
refundVtxoSwap(swap_id, refund_address) {
|
|
1815
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1816
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1817
|
+
const ptr1 = passStringToWasm0(refund_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1818
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1819
|
+
const ret = wasm.client_refundVtxoSwap(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1820
|
+
return ret;
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* List all VTXO swaps from local storage.
|
|
1824
|
+
*
|
|
1825
|
+
* Returns all stored VTXO swaps without fetching from the API.
|
|
1826
|
+
* @returns {Promise<ExtendedVtxoSwapStorageData[]>}
|
|
1827
|
+
*/
|
|
1828
|
+
listAllVtxoSwaps() {
|
|
1829
|
+
const ret = wasm.client_listAllVtxoSwaps(this.__wbg_ptr);
|
|
1830
|
+
return ret;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
|
|
1834
|
+
|
|
1835
|
+
const CreateVtxoSwapResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1836
|
+
? { register: () => {}, unregister: () => {} }
|
|
1837
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_createvtxoswapresult_free(ptr >>> 0, 1));
|
|
1838
|
+
/**
|
|
1839
|
+
* Result from creating a VTXO swap.
|
|
1840
|
+
*/
|
|
1841
|
+
export class CreateVtxoSwapResult {
|
|
1842
|
+
|
|
1843
|
+
static __wrap(ptr) {
|
|
1844
|
+
ptr = ptr >>> 0;
|
|
1845
|
+
const obj = Object.create(CreateVtxoSwapResult.prototype);
|
|
1846
|
+
obj.__wbg_ptr = ptr;
|
|
1847
|
+
CreateVtxoSwapResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1848
|
+
return obj;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
__destroy_into_raw() {
|
|
1852
|
+
const ptr = this.__wbg_ptr;
|
|
1853
|
+
this.__wbg_ptr = 0;
|
|
1854
|
+
CreateVtxoSwapResultFinalization.unregister(this);
|
|
1855
|
+
return ptr;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
free() {
|
|
1859
|
+
const ptr = this.__destroy_into_raw();
|
|
1860
|
+
wasm.__wbg_createvtxoswapresult_free(ptr, 0);
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* The swap response
|
|
1864
|
+
* @returns {VtxoSwapResponse}
|
|
1865
|
+
*/
|
|
1866
|
+
get response() {
|
|
1867
|
+
const ret = wasm.__wbg_get_createvtxoswapresult_response(this.__wbg_ptr);
|
|
1868
|
+
return VtxoSwapResponse.__wrap(ret);
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* The swap response
|
|
1872
|
+
* @param {VtxoSwapResponse} arg0
|
|
1873
|
+
*/
|
|
1874
|
+
set response(arg0) {
|
|
1875
|
+
_assertClass(arg0, VtxoSwapResponse);
|
|
1876
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1877
|
+
wasm.__wbg_set_createvtxoswapresult_response(this.__wbg_ptr, ptr0);
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* The swap parameters (needed for claim/refund)
|
|
1881
|
+
* @returns {SwapParams}
|
|
1882
|
+
*/
|
|
1883
|
+
get swap_params() {
|
|
1884
|
+
const ret = wasm.__wbg_get_createvtxoswapresult_swap_params(this.__wbg_ptr);
|
|
1885
|
+
return SwapParams.__wrap(ret);
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* The swap parameters (needed for claim/refund)
|
|
1889
|
+
* @param {SwapParams} arg0
|
|
1890
|
+
*/
|
|
1891
|
+
set swap_params(arg0) {
|
|
1892
|
+
_assertClass(arg0, SwapParams);
|
|
1893
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
1894
|
+
wasm.__wbg_set_createvtxoswapresult_swap_params(this.__wbg_ptr, ptr0);
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
if (Symbol.dispose) CreateVtxoSwapResult.prototype[Symbol.dispose] = CreateVtxoSwapResult.prototype.free;
|
|
1898
|
+
|
|
1899
|
+
const EstimateVtxoSwapResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1900
|
+
? { register: () => {}, unregister: () => {} }
|
|
1901
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_estimatevtxoswapresponse_free(ptr >>> 0, 1));
|
|
1902
|
+
/**
|
|
1903
|
+
* Estimate response for a VTXO swap.
|
|
1904
|
+
*/
|
|
1905
|
+
export class EstimateVtxoSwapResponse {
|
|
1906
|
+
|
|
1907
|
+
static __wrap(ptr) {
|
|
1908
|
+
ptr = ptr >>> 0;
|
|
1909
|
+
const obj = Object.create(EstimateVtxoSwapResponse.prototype);
|
|
1910
|
+
obj.__wbg_ptr = ptr;
|
|
1911
|
+
EstimateVtxoSwapResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1912
|
+
return obj;
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
__destroy_into_raw() {
|
|
1916
|
+
const ptr = this.__wbg_ptr;
|
|
1917
|
+
this.__wbg_ptr = 0;
|
|
1918
|
+
EstimateVtxoSwapResponseFinalization.unregister(this);
|
|
1919
|
+
return ptr;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
free() {
|
|
1923
|
+
const ptr = this.__destroy_into_raw();
|
|
1924
|
+
wasm.__wbg_estimatevtxoswapresponse_free(ptr, 0);
|
|
1925
|
+
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Total fee in satoshis
|
|
1928
|
+
* @returns {bigint}
|
|
1929
|
+
*/
|
|
1930
|
+
get fee_sats() {
|
|
1931
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr);
|
|
1932
|
+
return ret;
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* Total fee in satoshis
|
|
1936
|
+
* @param {bigint} arg0
|
|
1937
|
+
*/
|
|
1938
|
+
set fee_sats(arg0) {
|
|
1939
|
+
wasm.__wbg_set_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr, arg0);
|
|
1940
|
+
}
|
|
1941
|
+
/**
|
|
1942
|
+
* Total input amount in satoshis
|
|
1943
|
+
* @returns {bigint}
|
|
1944
|
+
*/
|
|
1945
|
+
get total_input_sats() {
|
|
1946
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_sats_receive(this.__wbg_ptr);
|
|
1947
|
+
return ret;
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* Total input amount in satoshis
|
|
1951
|
+
* @param {bigint} arg0
|
|
1952
|
+
*/
|
|
1953
|
+
set total_input_sats(arg0) {
|
|
1954
|
+
wasm.__wbg_set_btctoarkadeswapresponse_sats_receive(this.__wbg_ptr, arg0);
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Amount user will receive (total_input_sats - fee_sats)
|
|
1958
|
+
* @returns {bigint}
|
|
1959
|
+
*/
|
|
1960
|
+
get output_sats() {
|
|
1961
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr);
|
|
1962
|
+
return ret;
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* Amount user will receive (total_input_sats - fee_sats)
|
|
1966
|
+
* @param {bigint} arg0
|
|
1967
|
+
*/
|
|
1968
|
+
set output_sats(arg0) {
|
|
1969
|
+
wasm.__wbg_set_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr, arg0);
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* Number of VTXOs being refreshed
|
|
1973
|
+
* @returns {number}
|
|
1974
|
+
*/
|
|
1975
|
+
get vtxo_count() {
|
|
1976
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_vtxo_count(this.__wbg_ptr);
|
|
1977
|
+
return ret >>> 0;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Number of VTXOs being refreshed
|
|
1981
|
+
* @param {number} arg0
|
|
1982
|
+
*/
|
|
1983
|
+
set vtxo_count(arg0) {
|
|
1984
|
+
wasm.__wbg_set_estimatevtxoswapresponse_vtxo_count(this.__wbg_ptr, arg0);
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* Expected expiry timestamp (Unix) of the resulting VTXOs
|
|
1988
|
+
* @returns {bigint}
|
|
1989
|
+
*/
|
|
1990
|
+
get expected_vtxo_expiry() {
|
|
1991
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr);
|
|
1992
|
+
return ret;
|
|
1993
|
+
}
|
|
1994
|
+
/**
|
|
1995
|
+
* Expected expiry timestamp (Unix) of the resulting VTXOs
|
|
1996
|
+
* @param {bigint} arg0
|
|
1997
|
+
*/
|
|
1998
|
+
set expected_vtxo_expiry(arg0) {
|
|
1999
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr, arg0);
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
if (Symbol.dispose) EstimateVtxoSwapResponse.prototype[Symbol.dispose] = EstimateVtxoSwapResponse.prototype.free;
|
|
2003
|
+
|
|
2004
|
+
const EvmToBtcSwapResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2005
|
+
? { register: () => {}, unregister: () => {} }
|
|
2006
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_evmtobtcswapresponse_free(ptr >>> 0, 1));
|
|
2007
|
+
/**
|
|
2008
|
+
* EVM to BTC swap response.
|
|
2009
|
+
* Fields from SwapCommonFields are flattened.
|
|
2010
|
+
*/
|
|
2011
|
+
export class EvmToBtcSwapResponse {
|
|
2012
|
+
|
|
2013
|
+
static __wrap(ptr) {
|
|
2014
|
+
ptr = ptr >>> 0;
|
|
2015
|
+
const obj = Object.create(EvmToBtcSwapResponse.prototype);
|
|
2016
|
+
obj.__wbg_ptr = ptr;
|
|
2017
|
+
EvmToBtcSwapResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2018
|
+
return obj;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
__destroy_into_raw() {
|
|
2022
|
+
const ptr = this.__wbg_ptr;
|
|
2023
|
+
this.__wbg_ptr = 0;
|
|
2024
|
+
EvmToBtcSwapResponseFinalization.unregister(this);
|
|
2025
|
+
return ptr;
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
free() {
|
|
2029
|
+
const ptr = this.__destroy_into_raw();
|
|
2030
|
+
wasm.__wbg_evmtobtcswapresponse_free(ptr, 0);
|
|
2031
|
+
}
|
|
2032
|
+
/**
|
|
2033
|
+
* @returns {string}
|
|
2034
|
+
*/
|
|
2035
|
+
get id() {
|
|
2036
|
+
let deferred1_0;
|
|
2037
|
+
let deferred1_1;
|
|
2038
|
+
try {
|
|
2039
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_id(this.__wbg_ptr);
|
|
2040
|
+
deferred1_0 = ret[0];
|
|
2041
|
+
deferred1_1 = ret[1];
|
|
2042
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2043
|
+
} finally {
|
|
2044
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* @param {string} arg0
|
|
2049
|
+
*/
|
|
2050
|
+
set id(arg0) {
|
|
2051
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2052
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2053
|
+
wasm.__wbg_set_btctoarkadeswapresponse_network(this.__wbg_ptr, ptr0, len0);
|
|
2054
|
+
}
|
|
2055
|
+
/**
|
|
2056
|
+
* @returns {SwapStatus}
|
|
2057
|
+
*/
|
|
2058
|
+
get status() {
|
|
2059
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_status(this.__wbg_ptr);
|
|
2060
|
+
return ret;
|
|
2061
|
+
}
|
|
2062
|
+
/**
|
|
2063
|
+
* @param {SwapStatus} arg0
|
|
2064
|
+
*/
|
|
2065
|
+
set status(arg0) {
|
|
2066
|
+
wasm.__wbg_set_evmtobtcswapresponse_status(this.__wbg_ptr, arg0);
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* @returns {string}
|
|
2070
|
+
*/
|
|
2071
|
+
get hash_lock() {
|
|
2072
|
+
let deferred1_0;
|
|
2073
|
+
let deferred1_1;
|
|
2074
|
+
try {
|
|
2075
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_hash_lock(this.__wbg_ptr);
|
|
2076
|
+
deferred1_0 = ret[0];
|
|
2077
|
+
deferred1_1 = ret[1];
|
|
2078
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2079
|
+
} finally {
|
|
2080
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* @param {string} arg0
|
|
2085
|
+
*/
|
|
2086
|
+
set hash_lock(arg0) {
|
|
2087
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2088
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2089
|
+
wasm.__wbg_set_btctoarkadeswapresponse_created_at(this.__wbg_ptr, ptr0, len0);
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* @returns {bigint}
|
|
2093
|
+
*/
|
|
2094
|
+
get fee_sats() {
|
|
2095
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr);
|
|
2096
|
+
return ret;
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* @param {bigint} arg0
|
|
2100
|
+
*/
|
|
2101
|
+
set fee_sats(arg0) {
|
|
2102
|
+
wasm.__wbg_set_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr, arg0);
|
|
2103
|
+
}
|
|
2104
|
+
/**
|
|
2105
|
+
* @returns {number}
|
|
2106
|
+
*/
|
|
2107
|
+
get asset_amount() {
|
|
2108
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_asset_amount(this.__wbg_ptr);
|
|
2109
|
+
return ret;
|
|
2110
|
+
}
|
|
2111
|
+
/**
|
|
2112
|
+
* @param {number} arg0
|
|
2113
|
+
*/
|
|
2114
|
+
set asset_amount(arg0) {
|
|
2115
|
+
wasm.__wbg_set_btctoevmswapresponse_asset_amount(this.__wbg_ptr, arg0);
|
|
2116
|
+
}
|
|
2117
|
+
/**
|
|
2118
|
+
* @returns {string}
|
|
2119
|
+
*/
|
|
2120
|
+
get sender_pk() {
|
|
2121
|
+
let deferred1_0;
|
|
2122
|
+
let deferred1_1;
|
|
2123
|
+
try {
|
|
2124
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_sender_pk(this.__wbg_ptr);
|
|
2125
|
+
deferred1_0 = ret[0];
|
|
2126
|
+
deferred1_1 = ret[1];
|
|
2127
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2128
|
+
} finally {
|
|
2129
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
/**
|
|
2133
|
+
* @param {string} arg0
|
|
2134
|
+
*/
|
|
2135
|
+
set sender_pk(arg0) {
|
|
2136
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2137
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2138
|
+
wasm.__wbg_set_btctoarkadeswapresponse_server_vhtlc_pk(this.__wbg_ptr, ptr0, len0);
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* @returns {string}
|
|
2142
|
+
*/
|
|
2143
|
+
get receiver_pk() {
|
|
2144
|
+
let deferred1_0;
|
|
2145
|
+
let deferred1_1;
|
|
2146
|
+
try {
|
|
2147
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_receiver_pk(this.__wbg_ptr);
|
|
2148
|
+
deferred1_0 = ret[0];
|
|
2149
|
+
deferred1_1 = ret[1];
|
|
2150
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2151
|
+
} finally {
|
|
2152
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
/**
|
|
2156
|
+
* @param {string} arg0
|
|
2157
|
+
*/
|
|
2158
|
+
set receiver_pk(arg0) {
|
|
2159
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2160
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2161
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_server_pk(this.__wbg_ptr, ptr0, len0);
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* @returns {string}
|
|
2165
|
+
*/
|
|
2166
|
+
get server_pk() {
|
|
2167
|
+
let deferred1_0;
|
|
2168
|
+
let deferred1_1;
|
|
2169
|
+
try {
|
|
2170
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_server_pk(this.__wbg_ptr);
|
|
2171
|
+
deferred1_0 = ret[0];
|
|
2172
|
+
deferred1_1 = ret[1];
|
|
2173
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2174
|
+
} finally {
|
|
2175
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* @param {string} arg0
|
|
2180
|
+
*/
|
|
2181
|
+
set server_pk(arg0) {
|
|
2182
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2183
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2184
|
+
wasm.__wbg_set_evmtobtcswapresponse_server_pk(this.__wbg_ptr, ptr0, len0);
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* @returns {number}
|
|
2188
|
+
*/
|
|
2189
|
+
get refund_locktime() {
|
|
2190
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_refund_locktime(this.__wbg_ptr);
|
|
2191
|
+
return ret >>> 0;
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* @param {number} arg0
|
|
2195
|
+
*/
|
|
2196
|
+
set refund_locktime(arg0) {
|
|
2197
|
+
wasm.__wbg_set_btctoevmswapresponse_refund_locktime(this.__wbg_ptr, arg0);
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* @returns {bigint}
|
|
2201
|
+
*/
|
|
2202
|
+
get unilateral_claim_delay() {
|
|
2203
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr);
|
|
2204
|
+
return ret;
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* @param {bigint} arg0
|
|
2208
|
+
*/
|
|
2209
|
+
set unilateral_claim_delay(arg0) {
|
|
2210
|
+
wasm.__wbg_set_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr, arg0);
|
|
2211
|
+
}
|
|
2212
|
+
/**
|
|
2213
|
+
* @returns {bigint}
|
|
2214
|
+
*/
|
|
2215
|
+
get unilateral_refund_delay() {
|
|
2216
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr);
|
|
624
2217
|
return ret;
|
|
625
2218
|
}
|
|
626
2219
|
/**
|
|
627
|
-
*
|
|
628
|
-
* @returns {Promise<any>}
|
|
2220
|
+
* @param {bigint} arg0
|
|
629
2221
|
*/
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
return ret;
|
|
2222
|
+
set unilateral_refund_delay(arg0) {
|
|
2223
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr, arg0);
|
|
633
2224
|
}
|
|
634
2225
|
/**
|
|
635
|
-
*
|
|
636
|
-
* @returns {Promise<string>}
|
|
2226
|
+
* @returns {bigint}
|
|
637
2227
|
*/
|
|
638
|
-
|
|
639
|
-
const ret = wasm.
|
|
2228
|
+
get unilateral_refund_without_receiver_delay() {
|
|
2229
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr);
|
|
640
2230
|
return ret;
|
|
641
2231
|
}
|
|
642
2232
|
/**
|
|
643
|
-
*
|
|
644
|
-
* @returns {Promise<string>}
|
|
2233
|
+
* @param {bigint} arg0
|
|
645
2234
|
*/
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
return ret;
|
|
2235
|
+
set unilateral_refund_without_receiver_delay(arg0) {
|
|
2236
|
+
wasm.__wbg_set_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr, arg0);
|
|
649
2237
|
}
|
|
650
2238
|
/**
|
|
651
|
-
*
|
|
652
|
-
* @returns {Promise<void>}
|
|
2239
|
+
* @returns {Network}
|
|
653
2240
|
*/
|
|
654
|
-
|
|
655
|
-
const ret = wasm.
|
|
2241
|
+
get network() {
|
|
2242
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_network(this.__wbg_ptr);
|
|
656
2243
|
return ret;
|
|
657
2244
|
}
|
|
658
2245
|
/**
|
|
659
|
-
*
|
|
660
|
-
* @param {string} id
|
|
661
|
-
* @returns {Promise<void>}
|
|
2246
|
+
* @param {Network} arg0
|
|
662
2247
|
*/
|
|
663
|
-
|
|
664
|
-
|
|
2248
|
+
set network(arg0) {
|
|
2249
|
+
wasm.__wbg_set_evmtobtcswapresponse_network(this.__wbg_ptr, arg0);
|
|
2250
|
+
}
|
|
2251
|
+
/**
|
|
2252
|
+
* @returns {string}
|
|
2253
|
+
*/
|
|
2254
|
+
get created_at() {
|
|
2255
|
+
let deferred1_0;
|
|
2256
|
+
let deferred1_1;
|
|
2257
|
+
try {
|
|
2258
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_created_at(this.__wbg_ptr);
|
|
2259
|
+
deferred1_0 = ret[0];
|
|
2260
|
+
deferred1_1 = ret[1];
|
|
2261
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2262
|
+
} finally {
|
|
2263
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* @param {string} arg0
|
|
2268
|
+
*/
|
|
2269
|
+
set created_at(arg0) {
|
|
2270
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
665
2271
|
const len0 = WASM_VECTOR_LEN;
|
|
666
|
-
|
|
667
|
-
return ret;
|
|
2272
|
+
wasm.__wbg_set_evmtobtcswapresponse_created_at(this.__wbg_ptr, ptr0, len0);
|
|
668
2273
|
}
|
|
669
2274
|
/**
|
|
670
|
-
*
|
|
671
|
-
*
|
|
672
|
-
* # Arguments
|
|
673
|
-
* * `vtxos` - List of VTXO outpoints to refresh ("txid:vout" format)
|
|
674
|
-
* @param {string[]} vtxos
|
|
675
|
-
* @returns {Promise<EstimateVtxoSwapResponse>}
|
|
2275
|
+
* @returns {string}
|
|
676
2276
|
*/
|
|
677
|
-
|
|
678
|
-
|
|
2277
|
+
get htlc_address_evm() {
|
|
2278
|
+
let deferred1_0;
|
|
2279
|
+
let deferred1_1;
|
|
2280
|
+
try {
|
|
2281
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_htlc_address_evm(this.__wbg_ptr);
|
|
2282
|
+
deferred1_0 = ret[0];
|
|
2283
|
+
deferred1_1 = ret[1];
|
|
2284
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2285
|
+
} finally {
|
|
2286
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
/**
|
|
2290
|
+
* @param {string} arg0
|
|
2291
|
+
*/
|
|
2292
|
+
set htlc_address_evm(arg0) {
|
|
2293
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
679
2294
|
const len0 = WASM_VECTOR_LEN;
|
|
680
|
-
|
|
681
|
-
return ret;
|
|
2295
|
+
wasm.__wbg_set_evmtobtcswapresponse_htlc_address_evm(this.__wbg_ptr, ptr0, len0);
|
|
682
2296
|
}
|
|
683
2297
|
/**
|
|
684
|
-
*
|
|
685
|
-
*
|
|
686
|
-
* Returns the swap response and swap params.
|
|
687
|
-
*
|
|
688
|
-
* # Arguments
|
|
689
|
-
* * `vtxos` - List of VTXO outpoints to refresh ("txid:vout" format)
|
|
690
|
-
* @param {string[]} vtxos
|
|
691
|
-
* @returns {Promise<CreateVtxoSwapResult>}
|
|
2298
|
+
* @returns {string}
|
|
692
2299
|
*/
|
|
693
|
-
|
|
694
|
-
|
|
2300
|
+
get htlc_address_arkade() {
|
|
2301
|
+
let deferred1_0;
|
|
2302
|
+
let deferred1_1;
|
|
2303
|
+
try {
|
|
2304
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_htlc_address_arkade(this.__wbg_ptr);
|
|
2305
|
+
deferred1_0 = ret[0];
|
|
2306
|
+
deferred1_1 = ret[1];
|
|
2307
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2308
|
+
} finally {
|
|
2309
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* @param {string} arg0
|
|
2314
|
+
*/
|
|
2315
|
+
set htlc_address_arkade(arg0) {
|
|
2316
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
695
2317
|
const len0 = WASM_VECTOR_LEN;
|
|
696
|
-
|
|
697
|
-
return ret;
|
|
2318
|
+
wasm.__wbg_set_evmtobtcswapresponse_htlc_address_arkade(this.__wbg_ptr, ptr0, len0);
|
|
698
2319
|
}
|
|
699
2320
|
/**
|
|
700
|
-
*
|
|
701
|
-
* @param {string} id
|
|
702
|
-
* @returns {Promise<VtxoSwapResponse>}
|
|
2321
|
+
* @returns {string}
|
|
703
2322
|
*/
|
|
704
|
-
|
|
705
|
-
|
|
2323
|
+
get user_address_evm() {
|
|
2324
|
+
let deferred1_0;
|
|
2325
|
+
let deferred1_1;
|
|
2326
|
+
try {
|
|
2327
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_user_address_evm(this.__wbg_ptr);
|
|
2328
|
+
deferred1_0 = ret[0];
|
|
2329
|
+
deferred1_1 = ret[1];
|
|
2330
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2331
|
+
} finally {
|
|
2332
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* @param {string} arg0
|
|
2337
|
+
*/
|
|
2338
|
+
set user_address_evm(arg0) {
|
|
2339
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
706
2340
|
const len0 = WASM_VECTOR_LEN;
|
|
707
|
-
|
|
708
|
-
return ret;
|
|
2341
|
+
wasm.__wbg_set_evmtobtcswapresponse_user_address_evm(this.__wbg_ptr, ptr0, len0);
|
|
709
2342
|
}
|
|
710
2343
|
/**
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
* # Arguments
|
|
714
|
-
* * `swap` - The VTXO swap response
|
|
715
|
-
* * `swap_params` - The client's swap parameters
|
|
716
|
-
* * `claim_address` - The Arkade address to receive the claimed funds
|
|
717
|
-
* @param {VtxoSwapResponse} swap
|
|
718
|
-
* @param {SwapParams} swap_params
|
|
719
|
-
* @param {string} claim_address
|
|
720
|
-
* @returns {Promise<string>}
|
|
2344
|
+
* @returns {string | undefined}
|
|
721
2345
|
*/
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
2346
|
+
get user_address_arkade() {
|
|
2347
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_user_address_arkade(this.__wbg_ptr);
|
|
2348
|
+
let v1;
|
|
2349
|
+
if (ret[0] !== 0) {
|
|
2350
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2351
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2352
|
+
}
|
|
2353
|
+
return v1;
|
|
2354
|
+
}
|
|
2355
|
+
/**
|
|
2356
|
+
* @param {string | null} [arg0]
|
|
2357
|
+
*/
|
|
2358
|
+
set user_address_arkade(arg0) {
|
|
2359
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2360
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2361
|
+
wasm.__wbg_set_btctoevmswapresponse_bitcoin_htlc_claim_txid(this.__wbg_ptr, ptr0, len0);
|
|
2362
|
+
}
|
|
2363
|
+
/**
|
|
2364
|
+
* @returns {string}
|
|
2365
|
+
*/
|
|
2366
|
+
get ln_invoice() {
|
|
2367
|
+
let deferred1_0;
|
|
2368
|
+
let deferred1_1;
|
|
2369
|
+
try {
|
|
2370
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_ln_invoice(this.__wbg_ptr);
|
|
2371
|
+
deferred1_0 = ret[0];
|
|
2372
|
+
deferred1_1 = ret[1];
|
|
2373
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2374
|
+
} finally {
|
|
2375
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
/**
|
|
2379
|
+
* @param {string} arg0
|
|
2380
|
+
*/
|
|
2381
|
+
set ln_invoice(arg0) {
|
|
2382
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
726
2383
|
const len0 = WASM_VECTOR_LEN;
|
|
727
|
-
|
|
2384
|
+
wasm.__wbg_set_evmtobtcswapresponse_ln_invoice(this.__wbg_ptr, ptr0, len0);
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* @returns {TokenId}
|
|
2388
|
+
*/
|
|
2389
|
+
get source_token() {
|
|
2390
|
+
const ret = wasm.__wbg_get_btctoevmswapresponse_source_token(this.__wbg_ptr);
|
|
2391
|
+
return TokenId.__wrap(ret);
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* @param {TokenId} arg0
|
|
2395
|
+
*/
|
|
2396
|
+
set source_token(arg0) {
|
|
2397
|
+
_assertClass(arg0, TokenId);
|
|
2398
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2399
|
+
wasm.__wbg_set_btctoevmswapresponse_source_token(this.__wbg_ptr, ptr0);
|
|
2400
|
+
}
|
|
2401
|
+
/**
|
|
2402
|
+
* @returns {TokenId}
|
|
2403
|
+
*/
|
|
2404
|
+
get target_token() {
|
|
2405
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_source_token(this.__wbg_ptr);
|
|
2406
|
+
return TokenId.__wrap(ret);
|
|
2407
|
+
}
|
|
2408
|
+
/**
|
|
2409
|
+
* @param {TokenId} arg0
|
|
2410
|
+
*/
|
|
2411
|
+
set target_token(arg0) {
|
|
2412
|
+
_assertClass(arg0, TokenId);
|
|
2413
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2414
|
+
wasm.__wbg_set_btctoarkadeswapresponse_source_token(this.__wbg_ptr, ptr0);
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* @returns {bigint}
|
|
2418
|
+
*/
|
|
2419
|
+
get sats_receive() {
|
|
2420
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_unilateral_claim_delay(this.__wbg_ptr);
|
|
728
2421
|
return ret;
|
|
729
2422
|
}
|
|
730
2423
|
/**
|
|
731
|
-
*
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
* @
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
2424
|
+
* @param {bigint} arg0
|
|
2425
|
+
*/
|
|
2426
|
+
set sats_receive(arg0) {
|
|
2427
|
+
wasm.__wbg_set_btctoarkadeswapresponse_unilateral_claim_delay(this.__wbg_ptr, arg0);
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* @returns {string | undefined}
|
|
2431
|
+
*/
|
|
2432
|
+
get bitcoin_htlc_fund_txid() {
|
|
2433
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_bitcoin_htlc_fund_txid(this.__wbg_ptr);
|
|
2434
|
+
let v1;
|
|
2435
|
+
if (ret[0] !== 0) {
|
|
2436
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2437
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2438
|
+
}
|
|
2439
|
+
return v1;
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* @param {string | null} [arg0]
|
|
2443
|
+
*/
|
|
2444
|
+
set bitcoin_htlc_fund_txid(arg0) {
|
|
2445
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2446
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2447
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_fund_txid(this.__wbg_ptr, ptr0, len0);
|
|
2448
|
+
}
|
|
2449
|
+
/**
|
|
2450
|
+
* @returns {string | undefined}
|
|
2451
|
+
*/
|
|
2452
|
+
get bitcoin_htlc_claim_txid() {
|
|
2453
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_bitcoin_htlc_claim_txid(this.__wbg_ptr);
|
|
2454
|
+
let v1;
|
|
2455
|
+
if (ret[0] !== 0) {
|
|
2456
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2457
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2458
|
+
}
|
|
2459
|
+
return v1;
|
|
2460
|
+
}
|
|
2461
|
+
/**
|
|
2462
|
+
* @param {string | null} [arg0]
|
|
2463
|
+
*/
|
|
2464
|
+
set bitcoin_htlc_claim_txid(arg0) {
|
|
2465
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2466
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2467
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_claim_txid(this.__wbg_ptr, ptr0, len0);
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
* @returns {string | undefined}
|
|
2471
|
+
*/
|
|
2472
|
+
get evm_htlc_claim_txid() {
|
|
2473
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_evm_htlc_claim_txid(this.__wbg_ptr);
|
|
2474
|
+
let v1;
|
|
2475
|
+
if (ret[0] !== 0) {
|
|
2476
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2477
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2478
|
+
}
|
|
2479
|
+
return v1;
|
|
2480
|
+
}
|
|
2481
|
+
/**
|
|
2482
|
+
* @param {string | null} [arg0]
|
|
2483
|
+
*/
|
|
2484
|
+
set evm_htlc_claim_txid(arg0) {
|
|
2485
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2486
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2487
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_fund_txid(this.__wbg_ptr, ptr0, len0);
|
|
2488
|
+
}
|
|
2489
|
+
/**
|
|
2490
|
+
* @returns {string | undefined}
|
|
2491
|
+
*/
|
|
2492
|
+
get evm_htlc_fund_txid() {
|
|
2493
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_evm_htlc_fund_txid(this.__wbg_ptr);
|
|
2494
|
+
let v1;
|
|
2495
|
+
if (ret[0] !== 0) {
|
|
2496
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2497
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2498
|
+
}
|
|
2499
|
+
return v1;
|
|
2500
|
+
}
|
|
2501
|
+
/**
|
|
2502
|
+
* @param {string | null} [arg0]
|
|
2503
|
+
*/
|
|
2504
|
+
set evm_htlc_fund_txid(arg0) {
|
|
2505
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2506
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2507
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_claim_txid(this.__wbg_ptr, ptr0, len0);
|
|
2508
|
+
}
|
|
2509
|
+
/**
|
|
2510
|
+
* @returns {string | undefined}
|
|
2511
|
+
*/
|
|
2512
|
+
get create_swap_tx() {
|
|
2513
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_create_swap_tx(this.__wbg_ptr);
|
|
2514
|
+
let v1;
|
|
2515
|
+
if (ret[0] !== 0) {
|
|
2516
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2517
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2518
|
+
}
|
|
2519
|
+
return v1;
|
|
2520
|
+
}
|
|
2521
|
+
/**
|
|
2522
|
+
* @param {string | null} [arg0]
|
|
2523
|
+
*/
|
|
2524
|
+
set create_swap_tx(arg0) {
|
|
2525
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2526
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2527
|
+
wasm.__wbg_set_evmtobtcswapresponse_create_swap_tx(this.__wbg_ptr, ptr0, len0);
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* @returns {string | undefined}
|
|
2531
|
+
*/
|
|
2532
|
+
get approve_tx() {
|
|
2533
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_approve_tx(this.__wbg_ptr);
|
|
2534
|
+
let v1;
|
|
2535
|
+
if (ret[0] !== 0) {
|
|
2536
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2537
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2538
|
+
}
|
|
2539
|
+
return v1;
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* @param {string | null} [arg0]
|
|
2543
|
+
*/
|
|
2544
|
+
set approve_tx(arg0) {
|
|
2545
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2546
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2547
|
+
wasm.__wbg_set_evmtobtcswapresponse_approve_tx(this.__wbg_ptr, ptr0, len0);
|
|
2548
|
+
}
|
|
2549
|
+
/**
|
|
2550
|
+
* @returns {string | undefined}
|
|
2551
|
+
*/
|
|
2552
|
+
get gelato_forwarder_address() {
|
|
2553
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_gelato_forwarder_address(this.__wbg_ptr);
|
|
2554
|
+
let v1;
|
|
2555
|
+
if (ret[0] !== 0) {
|
|
2556
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2557
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2558
|
+
}
|
|
2559
|
+
return v1;
|
|
2560
|
+
}
|
|
2561
|
+
/**
|
|
2562
|
+
* @param {string | null} [arg0]
|
|
2563
|
+
*/
|
|
2564
|
+
set gelato_forwarder_address(arg0) {
|
|
2565
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2566
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2567
|
+
wasm.__wbg_set_evmtobtcswapresponse_gelato_forwarder_address(this.__wbg_ptr, ptr0, len0);
|
|
2568
|
+
}
|
|
2569
|
+
/**
|
|
2570
|
+
* @returns {string | undefined}
|
|
2571
|
+
*/
|
|
2572
|
+
get gelato_user_nonce() {
|
|
2573
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_gelato_user_nonce(this.__wbg_ptr);
|
|
2574
|
+
let v1;
|
|
2575
|
+
if (ret[0] !== 0) {
|
|
2576
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2577
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2578
|
+
}
|
|
2579
|
+
return v1;
|
|
2580
|
+
}
|
|
2581
|
+
/**
|
|
2582
|
+
* @param {string | null} [arg0]
|
|
2583
|
+
*/
|
|
2584
|
+
set gelato_user_nonce(arg0) {
|
|
2585
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2586
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2587
|
+
wasm.__wbg_set_evmtobtcswapresponse_gelato_user_nonce(this.__wbg_ptr, ptr0, len0);
|
|
2588
|
+
}
|
|
2589
|
+
/**
|
|
2590
|
+
* @returns {string | undefined}
|
|
2591
|
+
*/
|
|
2592
|
+
get gelato_user_deadline() {
|
|
2593
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_gelato_user_deadline(this.__wbg_ptr);
|
|
2594
|
+
let v1;
|
|
2595
|
+
if (ret[0] !== 0) {
|
|
2596
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
2597
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2598
|
+
}
|
|
2599
|
+
return v1;
|
|
2600
|
+
}
|
|
2601
|
+
/**
|
|
2602
|
+
* @param {string | null} [arg0]
|
|
2603
|
+
*/
|
|
2604
|
+
set gelato_user_deadline(arg0) {
|
|
2605
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2606
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2607
|
+
wasm.__wbg_set_evmtobtcswapresponse_gelato_user_deadline(this.__wbg_ptr, ptr0, len0);
|
|
2608
|
+
}
|
|
2609
|
+
/**
|
|
2610
|
+
* @returns {string}
|
|
741
2611
|
*/
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
2612
|
+
get source_token_address() {
|
|
2613
|
+
let deferred1_0;
|
|
2614
|
+
let deferred1_1;
|
|
2615
|
+
try {
|
|
2616
|
+
const ret = wasm.__wbg_get_evmtobtcswapresponse_source_token_address(this.__wbg_ptr);
|
|
2617
|
+
deferred1_0 = ret[0];
|
|
2618
|
+
deferred1_1 = ret[1];
|
|
2619
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2620
|
+
} finally {
|
|
2621
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* @param {string} arg0
|
|
2626
|
+
*/
|
|
2627
|
+
set source_token_address(arg0) {
|
|
2628
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
746
2629
|
const len0 = WASM_VECTOR_LEN;
|
|
747
|
-
|
|
748
|
-
return ret;
|
|
2630
|
+
wasm.__wbg_set_evmtobtcswapresponse_source_token_address(this.__wbg_ptr, ptr0, len0);
|
|
749
2631
|
}
|
|
750
2632
|
}
|
|
751
|
-
if (Symbol.dispose)
|
|
2633
|
+
if (Symbol.dispose) EvmToBtcSwapResponse.prototype[Symbol.dispose] = EvmToBtcSwapResponse.prototype.free;
|
|
752
2634
|
|
|
753
|
-
const
|
|
2635
|
+
const ExtendedSwapStorageDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
754
2636
|
? { register: () => {}, unregister: () => {} }
|
|
755
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
2637
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_extendedswapstoragedata_free(ptr >>> 0, 1));
|
|
756
2638
|
/**
|
|
757
|
-
*
|
|
2639
|
+
* Extended swap storage data that combines the API response with client-side swap parameters.
|
|
2640
|
+
* This is the data structure stored for each swap.
|
|
2641
|
+
*
|
|
2642
|
+
* Note: The `response` field contains a `GetSwapResponse` enum which cannot be directly
|
|
2643
|
+
* exposed via wasm-bindgen. It is serialized to a plain JS object via serde.
|
|
758
2644
|
*/
|
|
759
|
-
export class
|
|
2645
|
+
export class ExtendedSwapStorageData {
|
|
760
2646
|
|
|
761
2647
|
static __wrap(ptr) {
|
|
762
2648
|
ptr = ptr >>> 0;
|
|
763
|
-
const obj = Object.create(
|
|
2649
|
+
const obj = Object.create(ExtendedSwapStorageData.prototype);
|
|
764
2650
|
obj.__wbg_ptr = ptr;
|
|
765
|
-
|
|
2651
|
+
ExtendedSwapStorageDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
766
2652
|
return obj;
|
|
767
2653
|
}
|
|
768
2654
|
|
|
769
2655
|
__destroy_into_raw() {
|
|
770
2656
|
const ptr = this.__wbg_ptr;
|
|
771
2657
|
this.__wbg_ptr = 0;
|
|
772
|
-
|
|
2658
|
+
ExtendedSwapStorageDataFinalization.unregister(this);
|
|
773
2659
|
return ptr;
|
|
774
2660
|
}
|
|
775
2661
|
|
|
776
2662
|
free() {
|
|
777
2663
|
const ptr = this.__destroy_into_raw();
|
|
778
|
-
wasm.
|
|
2664
|
+
wasm.__wbg_extendedswapstoragedata_free(ptr, 0);
|
|
779
2665
|
}
|
|
780
2666
|
/**
|
|
781
|
-
*
|
|
782
|
-
* @returns {
|
|
2667
|
+
* Get the swap type.
|
|
2668
|
+
* @returns {SwapType}
|
|
783
2669
|
*/
|
|
784
|
-
get
|
|
785
|
-
const ret = wasm.
|
|
786
|
-
return
|
|
2670
|
+
get swapType() {
|
|
2671
|
+
const ret = wasm.extendedswapstoragedata_swapType(this.__wbg_ptr);
|
|
2672
|
+
return ret;
|
|
787
2673
|
}
|
|
788
2674
|
/**
|
|
789
|
-
*
|
|
790
|
-
*
|
|
2675
|
+
* Get the BTC to EVM swap response, if this is a BTC to EVM swap.
|
|
2676
|
+
* Returns undefined if this is an EVM to BTC swap.
|
|
2677
|
+
* @returns {BtcToEvmSwapResponse | undefined}
|
|
791
2678
|
*/
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
wasm.__wbg_set_createvtxoswapresult_response(this.__wbg_ptr, ptr0);
|
|
2679
|
+
get btcToEvmResponse() {
|
|
2680
|
+
const ret = wasm.extendedswapstoragedata_btcToEvmResponse(this.__wbg_ptr);
|
|
2681
|
+
return ret === 0 ? undefined : BtcToEvmSwapResponse.__wrap(ret);
|
|
796
2682
|
}
|
|
797
2683
|
/**
|
|
798
|
-
*
|
|
799
|
-
*
|
|
2684
|
+
* Get the EVM to BTC swap response, if this is an EVM to BTC swap.
|
|
2685
|
+
* Returns undefined if this is a BTC to EVM swap.
|
|
2686
|
+
* @returns {EvmToBtcSwapResponse | undefined}
|
|
800
2687
|
*/
|
|
801
|
-
get
|
|
802
|
-
const ret = wasm.
|
|
803
|
-
return
|
|
2688
|
+
get evmToBtcResponse() {
|
|
2689
|
+
const ret = wasm.extendedswapstoragedata_evmToBtcResponse(this.__wbg_ptr);
|
|
2690
|
+
return ret === 0 ? undefined : EvmToBtcSwapResponse.__wrap(ret);
|
|
804
2691
|
}
|
|
805
2692
|
/**
|
|
806
|
-
*
|
|
807
|
-
*
|
|
2693
|
+
* Get the Onchain to Arkade swap response, if this is an Onchian to Arkade swap.
|
|
2694
|
+
* Returns undefined if not.
|
|
2695
|
+
* @returns {BtcToArkadeSwapResponse | undefined}
|
|
808
2696
|
*/
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
2697
|
+
get btcToArkadeResponse() {
|
|
2698
|
+
const ret = wasm.extendedswapstoragedata_btcToArkadeResponse(this.__wbg_ptr);
|
|
2699
|
+
return ret === 0 ? undefined : BtcToArkadeSwapResponse.__wrap(ret);
|
|
2700
|
+
}
|
|
2701
|
+
/**
|
|
2702
|
+
* Get the swap parameters.
|
|
2703
|
+
* @returns {SwapParams}
|
|
2704
|
+
*/
|
|
2705
|
+
get swapParams() {
|
|
2706
|
+
const ret = wasm.extendedswapstoragedata_swapParams(this.__wbg_ptr);
|
|
2707
|
+
return SwapParams.__wrap(ret);
|
|
813
2708
|
}
|
|
814
2709
|
}
|
|
815
|
-
if (Symbol.dispose)
|
|
2710
|
+
if (Symbol.dispose) ExtendedSwapStorageData.prototype[Symbol.dispose] = ExtendedSwapStorageData.prototype.free;
|
|
816
2711
|
|
|
817
|
-
const
|
|
2712
|
+
const ExtendedVtxoSwapStorageDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
818
2713
|
? { register: () => {}, unregister: () => {} }
|
|
819
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
2714
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_extendedvtxoswapstoragedata_free(ptr >>> 0, 1));
|
|
820
2715
|
/**
|
|
821
|
-
*
|
|
2716
|
+
* Extended VTXO swap data that combines the API response with client-side swap parameters.
|
|
2717
|
+
* This is the data structure stored for each VTXO swap.
|
|
822
2718
|
*/
|
|
823
|
-
export class
|
|
2719
|
+
export class ExtendedVtxoSwapStorageData {
|
|
824
2720
|
|
|
825
2721
|
static __wrap(ptr) {
|
|
826
2722
|
ptr = ptr >>> 0;
|
|
827
|
-
const obj = Object.create(
|
|
2723
|
+
const obj = Object.create(ExtendedVtxoSwapStorageData.prototype);
|
|
828
2724
|
obj.__wbg_ptr = ptr;
|
|
829
|
-
|
|
2725
|
+
ExtendedVtxoSwapStorageDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
830
2726
|
return obj;
|
|
831
2727
|
}
|
|
832
2728
|
|
|
833
2729
|
__destroy_into_raw() {
|
|
834
2730
|
const ptr = this.__wbg_ptr;
|
|
835
2731
|
this.__wbg_ptr = 0;
|
|
836
|
-
|
|
2732
|
+
ExtendedVtxoSwapStorageDataFinalization.unregister(this);
|
|
837
2733
|
return ptr;
|
|
838
2734
|
}
|
|
839
2735
|
|
|
840
2736
|
free() {
|
|
841
2737
|
const ptr = this.__destroy_into_raw();
|
|
842
|
-
wasm.
|
|
843
|
-
}
|
|
844
|
-
/**
|
|
845
|
-
* Total fee in satoshis
|
|
846
|
-
* @returns {bigint}
|
|
847
|
-
*/
|
|
848
|
-
get feeSats() {
|
|
849
|
-
const ret = wasm.__wbg_get_estimatevtxoswapresponse_feeSats(this.__wbg_ptr);
|
|
850
|
-
return ret;
|
|
851
|
-
}
|
|
852
|
-
/**
|
|
853
|
-
* Total fee in satoshis
|
|
854
|
-
* @param {bigint} arg0
|
|
855
|
-
*/
|
|
856
|
-
set feeSats(arg0) {
|
|
857
|
-
wasm.__wbg_set_estimatevtxoswapresponse_feeSats(this.__wbg_ptr, arg0);
|
|
858
|
-
}
|
|
859
|
-
/**
|
|
860
|
-
* Total input amount in satoshis
|
|
861
|
-
* @returns {bigint}
|
|
862
|
-
*/
|
|
863
|
-
get totalInputSats() {
|
|
864
|
-
const ret = wasm.__wbg_get_estimatevtxoswapresponse_totalInputSats(this.__wbg_ptr);
|
|
865
|
-
return ret;
|
|
866
|
-
}
|
|
867
|
-
/**
|
|
868
|
-
* Total input amount in satoshis
|
|
869
|
-
* @param {bigint} arg0
|
|
870
|
-
*/
|
|
871
|
-
set totalInputSats(arg0) {
|
|
872
|
-
wasm.__wbg_set_estimatevtxoswapresponse_totalInputSats(this.__wbg_ptr, arg0);
|
|
873
|
-
}
|
|
874
|
-
/**
|
|
875
|
-
* Amount user will receive (total_input_sats - fee_sats)
|
|
876
|
-
* @returns {bigint}
|
|
877
|
-
*/
|
|
878
|
-
get outputSats() {
|
|
879
|
-
const ret = wasm.__wbg_get_estimatevtxoswapresponse_outputSats(this.__wbg_ptr);
|
|
880
|
-
return ret;
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* Amount user will receive (total_input_sats - fee_sats)
|
|
884
|
-
* @param {bigint} arg0
|
|
885
|
-
*/
|
|
886
|
-
set outputSats(arg0) {
|
|
887
|
-
wasm.__wbg_set_estimatevtxoswapresponse_outputSats(this.__wbg_ptr, arg0);
|
|
2738
|
+
wasm.__wbg_extendedvtxoswapstoragedata_free(ptr, 0);
|
|
888
2739
|
}
|
|
889
2740
|
/**
|
|
890
|
-
*
|
|
891
|
-
* @returns {
|
|
2741
|
+
* The VTXO swap response from the API
|
|
2742
|
+
* @returns {VtxoSwapResponse}
|
|
892
2743
|
*/
|
|
893
|
-
get
|
|
894
|
-
const ret = wasm.
|
|
895
|
-
return ret
|
|
2744
|
+
get response() {
|
|
2745
|
+
const ret = wasm.__wbg_get_createvtxoswapresult_response(this.__wbg_ptr);
|
|
2746
|
+
return VtxoSwapResponse.__wrap(ret);
|
|
896
2747
|
}
|
|
897
2748
|
/**
|
|
898
|
-
*
|
|
899
|
-
* @param {
|
|
2749
|
+
* The VTXO swap response from the API
|
|
2750
|
+
* @param {VtxoSwapResponse} arg0
|
|
900
2751
|
*/
|
|
901
|
-
set
|
|
902
|
-
|
|
2752
|
+
set response(arg0) {
|
|
2753
|
+
_assertClass(arg0, VtxoSwapResponse);
|
|
2754
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2755
|
+
wasm.__wbg_set_createvtxoswapresult_response(this.__wbg_ptr, ptr0);
|
|
903
2756
|
}
|
|
904
2757
|
/**
|
|
905
|
-
*
|
|
906
|
-
* @returns {
|
|
2758
|
+
* The client-side swap parameters (keys, preimage, etc.)
|
|
2759
|
+
* @returns {SwapParams}
|
|
907
2760
|
*/
|
|
908
|
-
get
|
|
909
|
-
const ret = wasm.
|
|
910
|
-
return ret;
|
|
2761
|
+
get swap_params() {
|
|
2762
|
+
const ret = wasm.__wbg_get_createvtxoswapresult_swap_params(this.__wbg_ptr);
|
|
2763
|
+
return SwapParams.__wrap(ret);
|
|
911
2764
|
}
|
|
912
2765
|
/**
|
|
913
|
-
*
|
|
914
|
-
* @param {
|
|
2766
|
+
* The client-side swap parameters (keys, preimage, etc.)
|
|
2767
|
+
* @param {SwapParams} arg0
|
|
915
2768
|
*/
|
|
916
|
-
set
|
|
917
|
-
|
|
2769
|
+
set swap_params(arg0) {
|
|
2770
|
+
_assertClass(arg0, SwapParams);
|
|
2771
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2772
|
+
wasm.__wbg_set_createvtxoswapresult_swap_params(this.__wbg_ptr, ptr0);
|
|
918
2773
|
}
|
|
919
2774
|
}
|
|
920
|
-
if (Symbol.dispose)
|
|
2775
|
+
if (Symbol.dispose) ExtendedVtxoSwapStorageData.prototype[Symbol.dispose] = ExtendedVtxoSwapStorageData.prototype.free;
|
|
921
2776
|
|
|
922
2777
|
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
923
2778
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1110,6 +2965,69 @@ export class JsSwapStorageProvider {
|
|
|
1110
2965
|
}
|
|
1111
2966
|
if (Symbol.dispose) JsSwapStorageProvider.prototype[Symbol.dispose] = JsSwapStorageProvider.prototype.free;
|
|
1112
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
|
+
|
|
1113
3031
|
const JsWalletStorageProviderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1114
3032
|
? { register: () => {}, unregister: () => {} }
|
|
1115
3033
|
: new FinalizationRegistry(ptr => wasm.__wbg_jswalletstorageprovider_free(ptr >>> 0, 1));
|
|
@@ -1219,27 +3137,27 @@ export class QuoteResponse {
|
|
|
1219
3137
|
* @returns {bigint}
|
|
1220
3138
|
*/
|
|
1221
3139
|
get networkFee() {
|
|
1222
|
-
const ret = wasm.
|
|
3140
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr);
|
|
1223
3141
|
return BigInt.asUintN(64, ret);
|
|
1224
3142
|
}
|
|
1225
3143
|
/**
|
|
1226
3144
|
* @param {bigint} arg0
|
|
1227
3145
|
*/
|
|
1228
3146
|
set networkFee(arg0) {
|
|
1229
|
-
wasm.
|
|
3147
|
+
wasm.__wbg_set_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr, arg0);
|
|
1230
3148
|
}
|
|
1231
3149
|
/**
|
|
1232
3150
|
* @returns {bigint}
|
|
1233
3151
|
*/
|
|
1234
3152
|
get protocolFee() {
|
|
1235
|
-
const ret = wasm.
|
|
3153
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_sats_receive(this.__wbg_ptr);
|
|
1236
3154
|
return BigInt.asUintN(64, ret);
|
|
1237
3155
|
}
|
|
1238
3156
|
/**
|
|
1239
3157
|
* @param {bigint} arg0
|
|
1240
3158
|
*/
|
|
1241
3159
|
set protocolFee(arg0) {
|
|
1242
|
-
wasm.
|
|
3160
|
+
wasm.__wbg_set_btctoarkadeswapresponse_sats_receive(this.__wbg_ptr, arg0);
|
|
1243
3161
|
}
|
|
1244
3162
|
/**
|
|
1245
3163
|
* @returns {number}
|
|
@@ -1258,27 +3176,27 @@ export class QuoteResponse {
|
|
|
1258
3176
|
* @returns {bigint}
|
|
1259
3177
|
*/
|
|
1260
3178
|
get minAmount() {
|
|
1261
|
-
const ret = wasm.
|
|
3179
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr);
|
|
1262
3180
|
return BigInt.asUintN(64, ret);
|
|
1263
3181
|
}
|
|
1264
3182
|
/**
|
|
1265
3183
|
* @param {bigint} arg0
|
|
1266
3184
|
*/
|
|
1267
3185
|
set minAmount(arg0) {
|
|
1268
|
-
wasm.
|
|
3186
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr, arg0);
|
|
1269
3187
|
}
|
|
1270
3188
|
/**
|
|
1271
3189
|
* @returns {bigint}
|
|
1272
3190
|
*/
|
|
1273
3191
|
get maxAmount() {
|
|
1274
|
-
const ret = wasm.
|
|
3192
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr);
|
|
1275
3193
|
return BigInt.asUintN(64, ret);
|
|
1276
3194
|
}
|
|
1277
3195
|
/**
|
|
1278
3196
|
* @param {bigint} arg0
|
|
1279
3197
|
*/
|
|
1280
3198
|
set maxAmount(arg0) {
|
|
1281
|
-
wasm.
|
|
3199
|
+
wasm.__wbg_set_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr, arg0);
|
|
1282
3200
|
}
|
|
1283
3201
|
}
|
|
1284
3202
|
if (Symbol.dispose) QuoteResponse.prototype[Symbol.dispose] = QuoteResponse.prototype.free;
|
|
@@ -1480,6 +3398,30 @@ export class TokenId {
|
|
|
1480
3398
|
const ptr = this.__destroy_into_raw();
|
|
1481
3399
|
wasm.__wbg_tokenid_free(ptr, 0);
|
|
1482
3400
|
}
|
|
3401
|
+
/**
|
|
3402
|
+
* Static constructor for BTC Lightning token
|
|
3403
|
+
* @returns {TokenId}
|
|
3404
|
+
*/
|
|
3405
|
+
static btcLightning() {
|
|
3406
|
+
const ret = wasm.tokenid_btcLightning();
|
|
3407
|
+
return TokenId.__wrap(ret);
|
|
3408
|
+
}
|
|
3409
|
+
/**
|
|
3410
|
+
* Static constructor for BTC onchain token
|
|
3411
|
+
* @returns {TokenId}
|
|
3412
|
+
*/
|
|
3413
|
+
static btcOnchain() {
|
|
3414
|
+
const ret = wasm.tokenid_btcOnchain();
|
|
3415
|
+
return TokenId.__wrap(ret);
|
|
3416
|
+
}
|
|
3417
|
+
/**
|
|
3418
|
+
* Static constructor for BTC Arkade token
|
|
3419
|
+
* @returns {TokenId}
|
|
3420
|
+
*/
|
|
3421
|
+
static btcArkade() {
|
|
3422
|
+
const ret = wasm.tokenid_btcArkade();
|
|
3423
|
+
return TokenId.__wrap(ret);
|
|
3424
|
+
}
|
|
1483
3425
|
/**
|
|
1484
3426
|
* @returns {string}
|
|
1485
3427
|
*/
|
|
@@ -1508,6 +3450,56 @@ export class TokenId {
|
|
|
1508
3450
|
}
|
|
1509
3451
|
return TokenId.__wrap(ret[0]);
|
|
1510
3452
|
}
|
|
3453
|
+
/**
|
|
3454
|
+
* Returns true if this token equals another token
|
|
3455
|
+
* @param {TokenId} other
|
|
3456
|
+
* @returns {boolean}
|
|
3457
|
+
*/
|
|
3458
|
+
equals(other) {
|
|
3459
|
+
_assertClass(other, TokenId);
|
|
3460
|
+
const ret = wasm.tokenid_equals(this.__wbg_ptr, other.__wbg_ptr);
|
|
3461
|
+
return ret !== 0;
|
|
3462
|
+
}
|
|
3463
|
+
/**
|
|
3464
|
+
* Returns true if the token is Arkade
|
|
3465
|
+
* @returns {boolean}
|
|
3466
|
+
*/
|
|
3467
|
+
isArkade() {
|
|
3468
|
+
const ret = wasm.tokenid_isArkade(this.__wbg_ptr);
|
|
3469
|
+
return ret !== 0;
|
|
3470
|
+
}
|
|
3471
|
+
/**
|
|
3472
|
+
* Returns true if the token is Lightning
|
|
3473
|
+
* @returns {boolean}
|
|
3474
|
+
*/
|
|
3475
|
+
isLightning() {
|
|
3476
|
+
const ret = wasm.tokenid_isLightning(this.__wbg_ptr);
|
|
3477
|
+
return ret !== 0;
|
|
3478
|
+
}
|
|
3479
|
+
/**
|
|
3480
|
+
* Returns true if the token is onchain btc
|
|
3481
|
+
* @returns {boolean}
|
|
3482
|
+
*/
|
|
3483
|
+
isBtcOnchain() {
|
|
3484
|
+
const ret = wasm.tokenid_isBtcOnchain(this.__wbg_ptr);
|
|
3485
|
+
return ret !== 0;
|
|
3486
|
+
}
|
|
3487
|
+
/**
|
|
3488
|
+
* Returns true if the token is either Arkade or Lightning
|
|
3489
|
+
* @returns {boolean}
|
|
3490
|
+
*/
|
|
3491
|
+
isBtc() {
|
|
3492
|
+
const ret = wasm.tokenid_isBtc(this.__wbg_ptr);
|
|
3493
|
+
return ret !== 0;
|
|
3494
|
+
}
|
|
3495
|
+
/**
|
|
3496
|
+
* Returns true if the token is not BTC on Arkade and not BTC on Lightning
|
|
3497
|
+
* @returns {boolean}
|
|
3498
|
+
*/
|
|
3499
|
+
isEvmToken() {
|
|
3500
|
+
const ret = wasm.tokenid_isEvmToken(this.__wbg_ptr);
|
|
3501
|
+
return ret !== 0;
|
|
3502
|
+
}
|
|
1511
3503
|
}
|
|
1512
3504
|
if (Symbol.dispose) TokenId.prototype[Symbol.dispose] = TokenId.prototype.free;
|
|
1513
3505
|
|
|
@@ -1539,27 +3531,19 @@ export class TokenInfo {
|
|
|
1539
3531
|
wasm.__wbg_tokeninfo_free(ptr, 0);
|
|
1540
3532
|
}
|
|
1541
3533
|
/**
|
|
1542
|
-
* @returns {
|
|
3534
|
+
* @returns {TokenId}
|
|
1543
3535
|
*/
|
|
1544
|
-
get
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
try {
|
|
1548
|
-
const ret = wasm.__wbg_get_tokeninfo_tokenId(this.__wbg_ptr);
|
|
1549
|
-
deferred1_0 = ret[0];
|
|
1550
|
-
deferred1_1 = ret[1];
|
|
1551
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1552
|
-
} finally {
|
|
1553
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1554
|
-
}
|
|
3536
|
+
get token_id() {
|
|
3537
|
+
const ret = wasm.__wbg_get_tokeninfo_token_id(this.__wbg_ptr);
|
|
3538
|
+
return TokenId.__wrap(ret);
|
|
1555
3539
|
}
|
|
1556
3540
|
/**
|
|
1557
|
-
* @param {
|
|
3541
|
+
* @param {TokenId} arg0
|
|
1558
3542
|
*/
|
|
1559
|
-
set
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
wasm.
|
|
3543
|
+
set token_id(arg0) {
|
|
3544
|
+
_assertClass(arg0, TokenId);
|
|
3545
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
3546
|
+
wasm.__wbg_set_tokeninfo_token_id(this.__wbg_ptr, ptr0);
|
|
1563
3547
|
}
|
|
1564
3548
|
/**
|
|
1565
3549
|
* @returns {string}
|
|
@@ -1860,11 +3844,11 @@ export class VtxoSwapResponse {
|
|
|
1860
3844
|
* Creation timestamp (RFC3339)
|
|
1861
3845
|
* @returns {string}
|
|
1862
3846
|
*/
|
|
1863
|
-
get
|
|
3847
|
+
get created_at() {
|
|
1864
3848
|
let deferred1_0;
|
|
1865
3849
|
let deferred1_1;
|
|
1866
3850
|
try {
|
|
1867
|
-
const ret = wasm.
|
|
3851
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_created_at(this.__wbg_ptr);
|
|
1868
3852
|
deferred1_0 = ret[0];
|
|
1869
3853
|
deferred1_1 = ret[1];
|
|
1870
3854
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1876,20 +3860,20 @@ export class VtxoSwapResponse {
|
|
|
1876
3860
|
* Creation timestamp (RFC3339)
|
|
1877
3861
|
* @param {string} arg0
|
|
1878
3862
|
*/
|
|
1879
|
-
set
|
|
3863
|
+
set created_at(arg0) {
|
|
1880
3864
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1881
3865
|
const len0 = WASM_VECTOR_LEN;
|
|
1882
|
-
wasm.
|
|
3866
|
+
wasm.__wbg_set_vtxoswapresponse_created_at(this.__wbg_ptr, ptr0, len0);
|
|
1883
3867
|
}
|
|
1884
3868
|
/**
|
|
1885
3869
|
* Client's VHTLC address
|
|
1886
3870
|
* @returns {string}
|
|
1887
3871
|
*/
|
|
1888
|
-
get
|
|
3872
|
+
get client_vhtlc_address() {
|
|
1889
3873
|
let deferred1_0;
|
|
1890
3874
|
let deferred1_1;
|
|
1891
3875
|
try {
|
|
1892
|
-
const ret = wasm.
|
|
3876
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_client_vhtlc_address(this.__wbg_ptr);
|
|
1893
3877
|
deferred1_0 = ret[0];
|
|
1894
3878
|
deferred1_1 = ret[1];
|
|
1895
3879
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1901,35 +3885,35 @@ export class VtxoSwapResponse {
|
|
|
1901
3885
|
* Client's VHTLC address
|
|
1902
3886
|
* @param {string} arg0
|
|
1903
3887
|
*/
|
|
1904
|
-
set
|
|
3888
|
+
set client_vhtlc_address(arg0) {
|
|
1905
3889
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1906
3890
|
const len0 = WASM_VECTOR_LEN;
|
|
1907
|
-
wasm.
|
|
3891
|
+
wasm.__wbg_set_btctoevmswapresponse_id(this.__wbg_ptr, ptr0, len0);
|
|
1908
3892
|
}
|
|
1909
3893
|
/**
|
|
1910
3894
|
* Amount client should fund in satoshis
|
|
1911
3895
|
* @returns {bigint}
|
|
1912
3896
|
*/
|
|
1913
|
-
get
|
|
1914
|
-
const ret = wasm.
|
|
3897
|
+
get client_fund_amount_sats() {
|
|
3898
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr);
|
|
1915
3899
|
return ret;
|
|
1916
3900
|
}
|
|
1917
3901
|
/**
|
|
1918
3902
|
* Amount client should fund in satoshis
|
|
1919
3903
|
* @param {bigint} arg0
|
|
1920
3904
|
*/
|
|
1921
|
-
set
|
|
1922
|
-
wasm.
|
|
3905
|
+
set client_fund_amount_sats(arg0) {
|
|
3906
|
+
wasm.__wbg_set_btctoarkadeswapresponse_asset_amount(this.__wbg_ptr, arg0);
|
|
1923
3907
|
}
|
|
1924
3908
|
/**
|
|
1925
3909
|
* Client's public key
|
|
1926
3910
|
* @returns {string}
|
|
1927
3911
|
*/
|
|
1928
|
-
get
|
|
3912
|
+
get client_pk() {
|
|
1929
3913
|
let deferred1_0;
|
|
1930
3914
|
let deferred1_1;
|
|
1931
3915
|
try {
|
|
1932
|
-
const ret = wasm.
|
|
3916
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_client_pk(this.__wbg_ptr);
|
|
1933
3917
|
deferred1_0 = ret[0];
|
|
1934
3918
|
deferred1_1 = ret[1];
|
|
1935
3919
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -1941,80 +3925,80 @@ export class VtxoSwapResponse {
|
|
|
1941
3925
|
* Client's public key
|
|
1942
3926
|
* @param {string} arg0
|
|
1943
3927
|
*/
|
|
1944
|
-
set
|
|
3928
|
+
set client_pk(arg0) {
|
|
1945
3929
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1946
3930
|
const len0 = WASM_VECTOR_LEN;
|
|
1947
|
-
wasm.
|
|
3931
|
+
wasm.__wbg_set_btctoarkadeswapresponse_id(this.__wbg_ptr, ptr0, len0);
|
|
1948
3932
|
}
|
|
1949
3933
|
/**
|
|
1950
3934
|
* Client VHTLC locktime (Unix timestamp)
|
|
1951
3935
|
* @returns {bigint}
|
|
1952
3936
|
*/
|
|
1953
|
-
get
|
|
1954
|
-
const ret = wasm.
|
|
3937
|
+
get client_locktime() {
|
|
3938
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_sats_receive(this.__wbg_ptr);
|
|
1955
3939
|
return BigInt.asUintN(64, ret);
|
|
1956
3940
|
}
|
|
1957
3941
|
/**
|
|
1958
3942
|
* Client VHTLC locktime (Unix timestamp)
|
|
1959
3943
|
* @param {bigint} arg0
|
|
1960
3944
|
*/
|
|
1961
|
-
set
|
|
1962
|
-
wasm.
|
|
3945
|
+
set client_locktime(arg0) {
|
|
3946
|
+
wasm.__wbg_set_btctoarkadeswapresponse_sats_receive(this.__wbg_ptr, arg0);
|
|
1963
3947
|
}
|
|
1964
3948
|
/**
|
|
1965
3949
|
* Client claim delay in seconds
|
|
1966
3950
|
* @returns {bigint}
|
|
1967
3951
|
*/
|
|
1968
|
-
get
|
|
1969
|
-
const ret = wasm.
|
|
3952
|
+
get client_unilateral_claim_delay() {
|
|
3953
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr);
|
|
1970
3954
|
return ret;
|
|
1971
3955
|
}
|
|
1972
3956
|
/**
|
|
1973
3957
|
* Client claim delay in seconds
|
|
1974
3958
|
* @param {bigint} arg0
|
|
1975
3959
|
*/
|
|
1976
|
-
set
|
|
1977
|
-
wasm.
|
|
3960
|
+
set client_unilateral_claim_delay(arg0) {
|
|
3961
|
+
wasm.__wbg_set_btctoarkadeswapresponse_fee_sats(this.__wbg_ptr, arg0);
|
|
1978
3962
|
}
|
|
1979
3963
|
/**
|
|
1980
3964
|
* Client refund delay in seconds
|
|
1981
3965
|
* @returns {bigint}
|
|
1982
3966
|
*/
|
|
1983
|
-
get
|
|
1984
|
-
const ret = wasm.
|
|
3967
|
+
get client_unilateral_refund_delay() {
|
|
3968
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr);
|
|
1985
3969
|
return ret;
|
|
1986
3970
|
}
|
|
1987
3971
|
/**
|
|
1988
3972
|
* Client refund delay in seconds
|
|
1989
3973
|
* @param {bigint} arg0
|
|
1990
3974
|
*/
|
|
1991
|
-
set
|
|
1992
|
-
wasm.
|
|
3975
|
+
set client_unilateral_refund_delay(arg0) {
|
|
3976
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_refund_locktime(this.__wbg_ptr, arg0);
|
|
1993
3977
|
}
|
|
1994
3978
|
/**
|
|
1995
3979
|
* Client refund without receiver delay in seconds
|
|
1996
3980
|
* @returns {bigint}
|
|
1997
3981
|
*/
|
|
1998
|
-
get
|
|
1999
|
-
const ret = wasm.
|
|
3982
|
+
get client_unilateral_refund_without_receiver_delay() {
|
|
3983
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr);
|
|
2000
3984
|
return ret;
|
|
2001
3985
|
}
|
|
2002
3986
|
/**
|
|
2003
3987
|
* Client refund without receiver delay in seconds
|
|
2004
3988
|
* @param {bigint} arg0
|
|
2005
3989
|
*/
|
|
2006
|
-
set
|
|
2007
|
-
wasm.
|
|
3990
|
+
set client_unilateral_refund_without_receiver_delay(arg0) {
|
|
3991
|
+
wasm.__wbg_set_btctoarkadeswapresponse_vhtlc_refund_locktime(this.__wbg_ptr, arg0);
|
|
2008
3992
|
}
|
|
2009
3993
|
/**
|
|
2010
3994
|
* Server's VHTLC address
|
|
2011
3995
|
* @returns {string}
|
|
2012
3996
|
*/
|
|
2013
|
-
get
|
|
3997
|
+
get server_vhtlc_address() {
|
|
2014
3998
|
let deferred1_0;
|
|
2015
3999
|
let deferred1_1;
|
|
2016
4000
|
try {
|
|
2017
|
-
const ret = wasm.
|
|
4001
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_server_vhtlc_address(this.__wbg_ptr);
|
|
2018
4002
|
deferred1_0 = ret[0];
|
|
2019
4003
|
deferred1_1 = ret[1];
|
|
2020
4004
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -2026,35 +4010,35 @@ export class VtxoSwapResponse {
|
|
|
2026
4010
|
* Server's VHTLC address
|
|
2027
4011
|
* @param {string} arg0
|
|
2028
4012
|
*/
|
|
2029
|
-
set
|
|
4013
|
+
set server_vhtlc_address(arg0) {
|
|
2030
4014
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2031
4015
|
const len0 = WASM_VECTOR_LEN;
|
|
2032
|
-
wasm.
|
|
4016
|
+
wasm.__wbg_set_btctoarkadeswapresponse_btc_htlc_address(this.__wbg_ptr, ptr0, len0);
|
|
2033
4017
|
}
|
|
2034
4018
|
/**
|
|
2035
4019
|
* Amount server will fund in satoshis
|
|
2036
4020
|
* @returns {bigint}
|
|
2037
4021
|
*/
|
|
2038
|
-
get
|
|
2039
|
-
const ret = wasm.
|
|
4022
|
+
get server_fund_amount_sats() {
|
|
4023
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_unilateral_claim_delay(this.__wbg_ptr);
|
|
2040
4024
|
return ret;
|
|
2041
4025
|
}
|
|
2042
4026
|
/**
|
|
2043
4027
|
* Amount server will fund in satoshis
|
|
2044
4028
|
* @param {bigint} arg0
|
|
2045
4029
|
*/
|
|
2046
|
-
set
|
|
2047
|
-
wasm.
|
|
4030
|
+
set server_fund_amount_sats(arg0) {
|
|
4031
|
+
wasm.__wbg_set_btctoarkadeswapresponse_unilateral_claim_delay(this.__wbg_ptr, arg0);
|
|
2048
4032
|
}
|
|
2049
4033
|
/**
|
|
2050
4034
|
* Server's public key
|
|
2051
4035
|
* @returns {string}
|
|
2052
4036
|
*/
|
|
2053
|
-
get
|
|
4037
|
+
get server_pk() {
|
|
2054
4038
|
let deferred1_0;
|
|
2055
4039
|
let deferred1_1;
|
|
2056
4040
|
try {
|
|
2057
|
-
const ret = wasm.
|
|
4041
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_server_pk(this.__wbg_ptr);
|
|
2058
4042
|
deferred1_0 = ret[0];
|
|
2059
4043
|
deferred1_1 = ret[1];
|
|
2060
4044
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -2066,80 +4050,80 @@ export class VtxoSwapResponse {
|
|
|
2066
4050
|
* Server's public key
|
|
2067
4051
|
* @param {string} arg0
|
|
2068
4052
|
*/
|
|
2069
|
-
set
|
|
4053
|
+
set server_pk(arg0) {
|
|
2070
4054
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2071
4055
|
const len0 = WASM_VECTOR_LEN;
|
|
2072
|
-
wasm.
|
|
4056
|
+
wasm.__wbg_set_btctoarkadeswapresponse_hash_lock(this.__wbg_ptr, ptr0, len0);
|
|
2073
4057
|
}
|
|
2074
4058
|
/**
|
|
2075
4059
|
* Server VHTLC locktime (Unix timestamp)
|
|
2076
4060
|
* @returns {bigint}
|
|
2077
4061
|
*/
|
|
2078
|
-
get
|
|
2079
|
-
const ret = wasm.
|
|
4062
|
+
get server_locktime() {
|
|
4063
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_unilateral_refund_delay(this.__wbg_ptr);
|
|
2080
4064
|
return BigInt.asUintN(64, ret);
|
|
2081
4065
|
}
|
|
2082
4066
|
/**
|
|
2083
4067
|
* Server VHTLC locktime (Unix timestamp)
|
|
2084
4068
|
* @param {bigint} arg0
|
|
2085
4069
|
*/
|
|
2086
|
-
set
|
|
2087
|
-
wasm.
|
|
4070
|
+
set server_locktime(arg0) {
|
|
4071
|
+
wasm.__wbg_set_btctoarkadeswapresponse_unilateral_refund_delay(this.__wbg_ptr, arg0);
|
|
2088
4072
|
}
|
|
2089
4073
|
/**
|
|
2090
4074
|
* Server claim delay in seconds
|
|
2091
4075
|
* @returns {bigint}
|
|
2092
4076
|
*/
|
|
2093
|
-
get
|
|
2094
|
-
const ret = wasm.
|
|
4077
|
+
get server_unilateral_claim_delay() {
|
|
4078
|
+
const ret = wasm.__wbg_get_btctoarkadeswapresponse_unilateral_refund_without_receiver_delay(this.__wbg_ptr);
|
|
2095
4079
|
return ret;
|
|
2096
4080
|
}
|
|
2097
4081
|
/**
|
|
2098
4082
|
* Server claim delay in seconds
|
|
2099
4083
|
* @param {bigint} arg0
|
|
2100
4084
|
*/
|
|
2101
|
-
set
|
|
2102
|
-
wasm.
|
|
4085
|
+
set server_unilateral_claim_delay(arg0) {
|
|
4086
|
+
wasm.__wbg_set_btctoarkadeswapresponse_unilateral_refund_without_receiver_delay(this.__wbg_ptr, arg0);
|
|
2103
4087
|
}
|
|
2104
4088
|
/**
|
|
2105
4089
|
* Server refund delay in seconds
|
|
2106
4090
|
* @returns {bigint}
|
|
2107
4091
|
*/
|
|
2108
|
-
get
|
|
2109
|
-
const ret = wasm.
|
|
4092
|
+
get server_unilateral_refund_delay() {
|
|
4093
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_server_unilateral_refund_delay(this.__wbg_ptr);
|
|
2110
4094
|
return ret;
|
|
2111
4095
|
}
|
|
2112
4096
|
/**
|
|
2113
4097
|
* Server refund delay in seconds
|
|
2114
4098
|
* @param {bigint} arg0
|
|
2115
4099
|
*/
|
|
2116
|
-
set
|
|
2117
|
-
wasm.
|
|
4100
|
+
set server_unilateral_refund_delay(arg0) {
|
|
4101
|
+
wasm.__wbg_set_vtxoswapresponse_server_unilateral_refund_delay(this.__wbg_ptr, arg0);
|
|
2118
4102
|
}
|
|
2119
4103
|
/**
|
|
2120
4104
|
* Server refund without receiver delay in seconds
|
|
2121
4105
|
* @returns {bigint}
|
|
2122
4106
|
*/
|
|
2123
|
-
get
|
|
2124
|
-
const ret = wasm.
|
|
4107
|
+
get server_unilateral_refund_without_receiver_delay() {
|
|
4108
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_server_unilateral_refund_without_receiver_delay(this.__wbg_ptr);
|
|
2125
4109
|
return ret;
|
|
2126
4110
|
}
|
|
2127
4111
|
/**
|
|
2128
4112
|
* Server refund without receiver delay in seconds
|
|
2129
4113
|
* @param {bigint} arg0
|
|
2130
4114
|
*/
|
|
2131
|
-
set
|
|
2132
|
-
wasm.
|
|
4115
|
+
set server_unilateral_refund_without_receiver_delay(arg0) {
|
|
4116
|
+
wasm.__wbg_set_vtxoswapresponse_server_unilateral_refund_without_receiver_delay(this.__wbg_ptr, arg0);
|
|
2133
4117
|
}
|
|
2134
4118
|
/**
|
|
2135
4119
|
* Arkade server's public key
|
|
2136
4120
|
* @returns {string}
|
|
2137
4121
|
*/
|
|
2138
|
-
get
|
|
4122
|
+
get arkade_server_pk() {
|
|
2139
4123
|
let deferred1_0;
|
|
2140
4124
|
let deferred1_1;
|
|
2141
4125
|
try {
|
|
2142
|
-
const ret = wasm.
|
|
4126
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_arkade_server_pk(this.__wbg_ptr);
|
|
2143
4127
|
deferred1_0 = ret[0];
|
|
2144
4128
|
deferred1_1 = ret[1];
|
|
2145
4129
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -2151,20 +4135,20 @@ export class VtxoSwapResponse {
|
|
|
2151
4135
|
* Arkade server's public key
|
|
2152
4136
|
* @param {string} arg0
|
|
2153
4137
|
*/
|
|
2154
|
-
set
|
|
4138
|
+
set arkade_server_pk(arg0) {
|
|
2155
4139
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2156
4140
|
const len0 = WASM_VECTOR_LEN;
|
|
2157
|
-
wasm.
|
|
4141
|
+
wasm.__wbg_set_btctoarkadeswapresponse_arkade_vhtlc_address(this.__wbg_ptr, ptr0, len0);
|
|
2158
4142
|
}
|
|
2159
4143
|
/**
|
|
2160
4144
|
* The preimage hash (SHA256)
|
|
2161
4145
|
* @returns {string}
|
|
2162
4146
|
*/
|
|
2163
|
-
get
|
|
4147
|
+
get preimage_hash() {
|
|
2164
4148
|
let deferred1_0;
|
|
2165
4149
|
let deferred1_1;
|
|
2166
4150
|
try {
|
|
2167
|
-
const ret = wasm.
|
|
4151
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_preimage_hash(this.__wbg_ptr);
|
|
2168
4152
|
deferred1_0 = ret[0];
|
|
2169
4153
|
deferred1_1 = ret[1];
|
|
2170
4154
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -2176,25 +4160,25 @@ export class VtxoSwapResponse {
|
|
|
2176
4160
|
* The preimage hash (SHA256)
|
|
2177
4161
|
* @param {string} arg0
|
|
2178
4162
|
*/
|
|
2179
|
-
set
|
|
4163
|
+
set preimage_hash(arg0) {
|
|
2180
4164
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2181
4165
|
const len0 = WASM_VECTOR_LEN;
|
|
2182
|
-
wasm.
|
|
4166
|
+
wasm.__wbg_set_btctoarkadeswapresponse_target_arkade_address(this.__wbg_ptr, ptr0, len0);
|
|
2183
4167
|
}
|
|
2184
4168
|
/**
|
|
2185
4169
|
* Fee in satoshis
|
|
2186
4170
|
* @returns {bigint}
|
|
2187
4171
|
*/
|
|
2188
|
-
get
|
|
2189
|
-
const ret = wasm.
|
|
4172
|
+
get fee_sats() {
|
|
4173
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_fee_sats(this.__wbg_ptr);
|
|
2190
4174
|
return ret;
|
|
2191
4175
|
}
|
|
2192
4176
|
/**
|
|
2193
4177
|
* Fee in satoshis
|
|
2194
4178
|
* @param {bigint} arg0
|
|
2195
4179
|
*/
|
|
2196
|
-
set
|
|
2197
|
-
wasm.
|
|
4180
|
+
set fee_sats(arg0) {
|
|
4181
|
+
wasm.__wbg_set_vtxoswapresponse_fee_sats(this.__wbg_ptr, arg0);
|
|
2198
4182
|
}
|
|
2199
4183
|
/**
|
|
2200
4184
|
* Bitcoin network
|
|
@@ -2219,7 +4203,7 @@ export class VtxoSwapResponse {
|
|
|
2219
4203
|
set network(arg0) {
|
|
2220
4204
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2221
4205
|
const len0 = WASM_VECTOR_LEN;
|
|
2222
|
-
wasm.
|
|
4206
|
+
wasm.__wbg_set_btctoarkadeswapresponse_network(this.__wbg_ptr, ptr0, len0);
|
|
2223
4207
|
}
|
|
2224
4208
|
}
|
|
2225
4209
|
if (Symbol.dispose) VtxoSwapResponse.prototype[Symbol.dispose] = VtxoSwapResponse.prototype.free;
|
|
@@ -2367,6 +4351,16 @@ export function __wbg_assetpair_new(arg0) {
|
|
|
2367
4351
|
return ret;
|
|
2368
4352
|
};
|
|
2369
4353
|
|
|
4354
|
+
export function __wbg_btctoarkadeswapresponse_new(arg0) {
|
|
4355
|
+
const ret = BtcToArkadeSwapResponse.__wrap(arg0);
|
|
4356
|
+
return ret;
|
|
4357
|
+
};
|
|
4358
|
+
|
|
4359
|
+
export function __wbg_btctoevmswapresponse_new(arg0) {
|
|
4360
|
+
const ret = BtcToEvmSwapResponse.__wrap(arg0);
|
|
4361
|
+
return ret;
|
|
4362
|
+
};
|
|
4363
|
+
|
|
2370
4364
|
export function __wbg_buffer_ccc4520b36d3ccf4(arg0) {
|
|
2371
4365
|
const ret = arg0.buffer;
|
|
2372
4366
|
return ret;
|
|
@@ -2464,6 +4458,21 @@ export function __wbg_estimatevtxoswapresponse_new(arg0) {
|
|
|
2464
4458
|
return ret;
|
|
2465
4459
|
};
|
|
2466
4460
|
|
|
4461
|
+
export function __wbg_evmtobtcswapresponse_new(arg0) {
|
|
4462
|
+
const ret = EvmToBtcSwapResponse.__wrap(arg0);
|
|
4463
|
+
return ret;
|
|
4464
|
+
};
|
|
4465
|
+
|
|
4466
|
+
export function __wbg_extendedswapstoragedata_new(arg0) {
|
|
4467
|
+
const ret = ExtendedSwapStorageData.__wrap(arg0);
|
|
4468
|
+
return ret;
|
|
4469
|
+
};
|
|
4470
|
+
|
|
4471
|
+
export function __wbg_extendedvtxoswapstoragedata_new(arg0) {
|
|
4472
|
+
const ret = ExtendedVtxoSwapStorageData.__wrap(arg0);
|
|
4473
|
+
return ret;
|
|
4474
|
+
};
|
|
4475
|
+
|
|
2467
4476
|
export function __wbg_fetch_74a3e84ebd2c9a0e(arg0) {
|
|
2468
4477
|
const ret = fetch(arg0);
|
|
2469
4478
|
return ret;
|
|
@@ -2811,10 +4820,6 @@ export function __wbg_set_body_3c365989753d61f4(arg0, arg1) {
|
|
|
2811
4820
|
arg0.body = arg1;
|
|
2812
4821
|
};
|
|
2813
4822
|
|
|
2814
|
-
export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
|
|
2815
|
-
arg0[arg1 >>> 0] = arg2;
|
|
2816
|
-
};
|
|
2817
|
-
|
|
2818
4823
|
export function __wbg_set_cache_2f9deb19b92b81e3(arg0, arg1) {
|
|
2819
4824
|
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
2820
4825
|
};
|
|
@@ -2939,18 +4944,15 @@ export function __wbg_view_f6c15ac9fed63bbd(arg0) {
|
|
|
2939
4944
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2940
4945
|
};
|
|
2941
4946
|
|
|
2942
|
-
export function __wbg_vtxoswapresponse_new(arg0) {
|
|
2943
|
-
const ret = VtxoSwapResponse.__wrap(arg0);
|
|
2944
|
-
return ret;
|
|
2945
|
-
};
|
|
2946
|
-
|
|
2947
4947
|
export function __wbg_warn_8f5b5437666d0885(arg0, arg1, arg2, arg3) {
|
|
2948
4948
|
console.warn(arg0, arg1, arg2, arg3);
|
|
2949
4949
|
};
|
|
2950
4950
|
|
|
2951
|
-
export function
|
|
2952
|
-
|
|
2953
|
-
|
|
4951
|
+
export function __wbindgen_cast_06995a06d497c5c3(arg0, arg1) {
|
|
4952
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
4953
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
4954
|
+
// Cast intrinsic for `Vector(NamedExternref("ExtendedSwapStorageData")) -> Externref`.
|
|
4955
|
+
const ret = v0;
|
|
2954
4956
|
return ret;
|
|
2955
4957
|
};
|
|
2956
4958
|
|
|
@@ -2960,14 +4962,20 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
|
2960
4962
|
return ret;
|
|
2961
4963
|
};
|
|
2962
4964
|
|
|
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
|
+
|
|
2963
4971
|
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
2964
4972
|
// Cast intrinsic for `U64 -> Externref`.
|
|
2965
4973
|
const ret = BigInt.asUintN(64, arg0);
|
|
2966
4974
|
return ret;
|
|
2967
4975
|
};
|
|
2968
4976
|
|
|
2969
|
-
export function
|
|
2970
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
4977
|
+
export function __wbindgen_cast_4c7cfc910d5ce480(arg0, arg1) {
|
|
4978
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 676, function: Function { arguments: [Externref], shim_idx: 677, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2971
4979
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h5b1ee57da9b2ce1f, wasm_bindgen__convert__closures_____invoke__hf86cb6f5b134f7f7);
|
|
2972
4980
|
return ret;
|
|
2973
4981
|
};
|
|
@@ -3000,6 +5008,14 @@ export function __wbindgen_cast_d1236da12498f6f5(arg0, arg1) {
|
|
|
3000
5008
|
return ret;
|
|
3001
5009
|
};
|
|
3002
5010
|
|
|
5011
|
+
export function __wbindgen_cast_d6914f410e29f6a8(arg0, arg1) {
|
|
5012
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
5013
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
5014
|
+
// Cast intrinsic for `Vector(NamedExternref("ExtendedVtxoSwapStorageData")) -> Externref`.
|
|
5015
|
+
const ret = v0;
|
|
5016
|
+
return ret;
|
|
5017
|
+
};
|
|
5018
|
+
|
|
3003
5019
|
export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
3004
5020
|
// Cast intrinsic for `F64 -> Externref`.
|
|
3005
5021
|
const ret = arg0;
|