@lendasat/lendaswap-sdk 0.1.3 → 0.1.4
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.
|
@@ -0,0 +1,2959 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
let cachedUint8ArrayMemory0 = null;
|
|
4
|
+
|
|
5
|
+
function getUint8ArrayMemory0() {
|
|
6
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
7
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
8
|
+
}
|
|
9
|
+
return cachedUint8ArrayMemory0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
13
|
+
|
|
14
|
+
cachedTextDecoder.decode();
|
|
15
|
+
|
|
16
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
17
|
+
let numBytesDecoded = 0;
|
|
18
|
+
function decodeText(ptr, len) {
|
|
19
|
+
numBytesDecoded += len;
|
|
20
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
21
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
22
|
+
cachedTextDecoder.decode();
|
|
23
|
+
numBytesDecoded = len;
|
|
24
|
+
}
|
|
25
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getStringFromWasm0(ptr, len) {
|
|
29
|
+
ptr = ptr >>> 0;
|
|
30
|
+
return decodeText(ptr, len);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let WASM_VECTOR_LEN = 0;
|
|
34
|
+
|
|
35
|
+
const cachedTextEncoder = new TextEncoder();
|
|
36
|
+
|
|
37
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
38
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
39
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
40
|
+
view.set(buf);
|
|
41
|
+
return {
|
|
42
|
+
read: arg.length,
|
|
43
|
+
written: buf.length
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
49
|
+
|
|
50
|
+
if (realloc === undefined) {
|
|
51
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
52
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
53
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
54
|
+
WASM_VECTOR_LEN = buf.length;
|
|
55
|
+
return ptr;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
let len = arg.length;
|
|
59
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
60
|
+
|
|
61
|
+
const mem = getUint8ArrayMemory0();
|
|
62
|
+
|
|
63
|
+
let offset = 0;
|
|
64
|
+
|
|
65
|
+
for (; offset < len; offset++) {
|
|
66
|
+
const code = arg.charCodeAt(offset);
|
|
67
|
+
if (code > 0x7F) break;
|
|
68
|
+
mem[ptr + offset] = code;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (offset !== len) {
|
|
72
|
+
if (offset !== 0) {
|
|
73
|
+
arg = arg.slice(offset);
|
|
74
|
+
}
|
|
75
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
76
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
77
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
78
|
+
|
|
79
|
+
offset += ret.written;
|
|
80
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
WASM_VECTOR_LEN = offset;
|
|
84
|
+
return ptr;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
let cachedDataViewMemory0 = null;
|
|
88
|
+
|
|
89
|
+
function getDataViewMemory0() {
|
|
90
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
91
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
92
|
+
}
|
|
93
|
+
return cachedDataViewMemory0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function isLikeNone(x) {
|
|
97
|
+
return x === undefined || x === null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function debugString(val) {
|
|
101
|
+
// primitive types
|
|
102
|
+
const type = typeof val;
|
|
103
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
104
|
+
return `${val}`;
|
|
105
|
+
}
|
|
106
|
+
if (type == 'string') {
|
|
107
|
+
return `"${val}"`;
|
|
108
|
+
}
|
|
109
|
+
if (type == 'symbol') {
|
|
110
|
+
const description = val.description;
|
|
111
|
+
if (description == null) {
|
|
112
|
+
return 'Symbol';
|
|
113
|
+
} else {
|
|
114
|
+
return `Symbol(${description})`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (type == 'function') {
|
|
118
|
+
const name = val.name;
|
|
119
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
120
|
+
return `Function(${name})`;
|
|
121
|
+
} else {
|
|
122
|
+
return 'Function';
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// objects
|
|
126
|
+
if (Array.isArray(val)) {
|
|
127
|
+
const length = val.length;
|
|
128
|
+
let debug = '[';
|
|
129
|
+
if (length > 0) {
|
|
130
|
+
debug += debugString(val[0]);
|
|
131
|
+
}
|
|
132
|
+
for(let i = 1; i < length; i++) {
|
|
133
|
+
debug += ', ' + debugString(val[i]);
|
|
134
|
+
}
|
|
135
|
+
debug += ']';
|
|
136
|
+
return debug;
|
|
137
|
+
}
|
|
138
|
+
// Test for built-in
|
|
139
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
140
|
+
let className;
|
|
141
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
142
|
+
className = builtInMatches[1];
|
|
143
|
+
} else {
|
|
144
|
+
// Failed to match the standard '[object ClassName]'
|
|
145
|
+
return toString.call(val);
|
|
146
|
+
}
|
|
147
|
+
if (className == 'Object') {
|
|
148
|
+
// we're a user defined class or Object
|
|
149
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
150
|
+
// easier than looping through ownProperties of `val`.
|
|
151
|
+
try {
|
|
152
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
153
|
+
} catch (_) {
|
|
154
|
+
return 'Object';
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// errors
|
|
158
|
+
if (val instanceof Error) {
|
|
159
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
160
|
+
}
|
|
161
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
162
|
+
return className;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function addToExternrefTable0(obj) {
|
|
166
|
+
const idx = wasm.__externref_table_alloc();
|
|
167
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
168
|
+
return idx;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function handleError(f, args) {
|
|
172
|
+
try {
|
|
173
|
+
return f.apply(this, args);
|
|
174
|
+
} catch (e) {
|
|
175
|
+
const idx = addToExternrefTable0(e);
|
|
176
|
+
wasm.__wbindgen_exn_store(idx);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
181
|
+
ptr = ptr >>> 0;
|
|
182
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
186
|
+
? { register: () => {}, unregister: () => {} }
|
|
187
|
+
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
188
|
+
|
|
189
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
190
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
191
|
+
const real = (...args) => {
|
|
192
|
+
|
|
193
|
+
// First up with a closure we increment the internal reference
|
|
194
|
+
// count. This ensures that the Rust closure environment won't
|
|
195
|
+
// be deallocated while we're invoking it.
|
|
196
|
+
state.cnt++;
|
|
197
|
+
const a = state.a;
|
|
198
|
+
state.a = 0;
|
|
199
|
+
try {
|
|
200
|
+
return f(a, state.b, ...args);
|
|
201
|
+
} finally {
|
|
202
|
+
state.a = a;
|
|
203
|
+
real._wbg_cb_unref();
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
real._wbg_cb_unref = () => {
|
|
207
|
+
if (--state.cnt === 0) {
|
|
208
|
+
state.dtor(state.a, state.b);
|
|
209
|
+
state.a = 0;
|
|
210
|
+
CLOSURE_DTORS.unregister(state);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
214
|
+
return real;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
218
|
+
ptr = ptr >>> 0;
|
|
219
|
+
const mem = getDataViewMemory0();
|
|
220
|
+
const result = [];
|
|
221
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
222
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
223
|
+
}
|
|
224
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function _assertClass(instance, klass) {
|
|
229
|
+
if (!(instance instanceof klass)) {
|
|
230
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function takeFromExternrefTable0(idx) {
|
|
235
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
236
|
+
wasm.__externref_table_dealloc(idx);
|
|
237
|
+
return value;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
241
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
242
|
+
for (let i = 0; i < array.length; i++) {
|
|
243
|
+
const add = addToExternrefTable0(array[i]);
|
|
244
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
245
|
+
}
|
|
246
|
+
WASM_VECTOR_LEN = array.length;
|
|
247
|
+
return ptr;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Initialize the WASM module.
|
|
251
|
+
*
|
|
252
|
+
* This sets up logging and panic hooks for better debugging.
|
|
253
|
+
* Log level can be configured via localStorage key "lendaswap_log_level".
|
|
254
|
+
* Valid values: "trace", "debug", "info", "warn", "error" (case-insensitive).
|
|
255
|
+
* Default is "warn" if not set or invalid.
|
|
256
|
+
*/
|
|
257
|
+
export function initialize() {
|
|
258
|
+
wasm.initialize();
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Set the log level at runtime.
|
|
263
|
+
* This updates localStorage and reinitializes the logger.
|
|
264
|
+
*
|
|
265
|
+
* Valid values: "trace", "debug", "info", "warn", "error" (case-insensitive).
|
|
266
|
+
* @param {string} level
|
|
267
|
+
*/
|
|
268
|
+
export function setLogLevel(level) {
|
|
269
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
270
|
+
const len0 = WASM_VECTOR_LEN;
|
|
271
|
+
const ret = wasm.setLogLevel(ptr0, len0);
|
|
272
|
+
if (ret[1]) {
|
|
273
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Get the current log level.
|
|
279
|
+
* @returns {string}
|
|
280
|
+
*/
|
|
281
|
+
export function getLogLevel() {
|
|
282
|
+
let deferred1_0;
|
|
283
|
+
let deferred1_1;
|
|
284
|
+
try {
|
|
285
|
+
const ret = wasm.getLogLevel();
|
|
286
|
+
deferred1_0 = ret[0];
|
|
287
|
+
deferred1_1 = ret[1];
|
|
288
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
289
|
+
} finally {
|
|
290
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function wasm_bindgen__convert__closures_____invoke__h49d21def8d7e8715(arg0, arg1) {
|
|
295
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h49d21def8d7e8715(arg0, arg1);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function wasm_bindgen__convert__closures_____invoke__hf86cb6f5b134f7f7(arg0, arg1, arg2) {
|
|
299
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hf86cb6f5b134f7f7(arg0, arg1, arg2);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function wasm_bindgen__convert__closures_____invoke__h68e6792a5299b78b(arg0, arg1, arg2, arg3) {
|
|
303
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h68e6792a5299b78b(arg0, arg1, arg2, arg3);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Chain type for token information.
|
|
308
|
+
* @enum {0 | 1 | 2 | 3}
|
|
309
|
+
*/
|
|
310
|
+
export const Chain = Object.freeze({
|
|
311
|
+
Arkade: 0, "0": "Arkade",
|
|
312
|
+
Lightning: 1, "1": "Lightning",
|
|
313
|
+
Polygon: 2, "2": "Polygon",
|
|
314
|
+
Ethereum: 3, "3": "Ethereum",
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
318
|
+
|
|
319
|
+
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
320
|
+
|
|
321
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
322
|
+
|
|
323
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
324
|
+
|
|
325
|
+
const AssetPairFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
326
|
+
? { register: () => {}, unregister: () => {} }
|
|
327
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_assetpair_free(ptr >>> 0, 1));
|
|
328
|
+
/**
|
|
329
|
+
* Token information.
|
|
330
|
+
*/
|
|
331
|
+
export class AssetPair {
|
|
332
|
+
|
|
333
|
+
static __wrap(ptr) {
|
|
334
|
+
ptr = ptr >>> 0;
|
|
335
|
+
const obj = Object.create(AssetPair.prototype);
|
|
336
|
+
obj.__wbg_ptr = ptr;
|
|
337
|
+
AssetPairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
338
|
+
return obj;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
__destroy_into_raw() {
|
|
342
|
+
const ptr = this.__wbg_ptr;
|
|
343
|
+
this.__wbg_ptr = 0;
|
|
344
|
+
AssetPairFinalization.unregister(this);
|
|
345
|
+
return ptr;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
free() {
|
|
349
|
+
const ptr = this.__destroy_into_raw();
|
|
350
|
+
wasm.__wbg_assetpair_free(ptr, 0);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* @returns {TokenInfo}
|
|
354
|
+
*/
|
|
355
|
+
get source() {
|
|
356
|
+
const ret = wasm.__wbg_get_assetpair_source(this.__wbg_ptr);
|
|
357
|
+
return TokenInfo.__wrap(ret);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* @param {TokenInfo} arg0
|
|
361
|
+
*/
|
|
362
|
+
set source(arg0) {
|
|
363
|
+
_assertClass(arg0, TokenInfo);
|
|
364
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
365
|
+
wasm.__wbg_set_assetpair_source(this.__wbg_ptr, ptr0);
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* @returns {TokenInfo}
|
|
369
|
+
*/
|
|
370
|
+
get target() {
|
|
371
|
+
const ret = wasm.__wbg_get_assetpair_target(this.__wbg_ptr);
|
|
372
|
+
return TokenInfo.__wrap(ret);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* @param {TokenInfo} arg0
|
|
376
|
+
*/
|
|
377
|
+
set target(arg0) {
|
|
378
|
+
_assertClass(arg0, TokenInfo);
|
|
379
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
380
|
+
wasm.__wbg_set_assetpair_target(this.__wbg_ptr, ptr0);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (Symbol.dispose) AssetPair.prototype[Symbol.dispose] = AssetPair.prototype.free;
|
|
384
|
+
|
|
385
|
+
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
386
|
+
? { register: () => {}, unregister: () => {} }
|
|
387
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
388
|
+
/**
|
|
389
|
+
* Lendaswap client.
|
|
390
|
+
*/
|
|
391
|
+
export class Client {
|
|
392
|
+
|
|
393
|
+
__destroy_into_raw() {
|
|
394
|
+
const ptr = this.__wbg_ptr;
|
|
395
|
+
this.__wbg_ptr = 0;
|
|
396
|
+
ClientFinalization.unregister(this);
|
|
397
|
+
return ptr;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
free() {
|
|
401
|
+
const ptr = this.__destroy_into_raw();
|
|
402
|
+
wasm.__wbg_client_free(ptr, 0);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Create a new client with separate wallet and swap storage.
|
|
406
|
+
*
|
|
407
|
+
* # Arguments
|
|
408
|
+
* * `base_url` - The Lendaswap API URL
|
|
409
|
+
* * `wallet_storage` - Storage provider for wallet data (mnemonic, key index)
|
|
410
|
+
* * `swap_storage` - Storage provider for swap data
|
|
411
|
+
* * `network` - The Bitcoin network ("bitcoin" or "testnet")
|
|
412
|
+
* * `arkade_url` - The Arkade server URL
|
|
413
|
+
* @param {string} base_url
|
|
414
|
+
* @param {JsWalletStorageProvider} wallet_storage
|
|
415
|
+
* @param {JsSwapStorageProvider} swap_storage
|
|
416
|
+
* @param {string} network
|
|
417
|
+
* @param {string} arkade_url
|
|
418
|
+
*/
|
|
419
|
+
constructor(base_url, wallet_storage, swap_storage, network, arkade_url) {
|
|
420
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
421
|
+
const len0 = WASM_VECTOR_LEN;
|
|
422
|
+
_assertClass(wallet_storage, JsWalletStorageProvider);
|
|
423
|
+
var ptr1 = wallet_storage.__destroy_into_raw();
|
|
424
|
+
_assertClass(swap_storage, JsSwapStorageProvider);
|
|
425
|
+
var ptr2 = swap_storage.__destroy_into_raw();
|
|
426
|
+
const ptr3 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
427
|
+
const len3 = WASM_VECTOR_LEN;
|
|
428
|
+
const ptr4 = passStringToWasm0(arkade_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
429
|
+
const len4 = WASM_VECTOR_LEN;
|
|
430
|
+
const ret = wasm.client_new(ptr0, len0, ptr1, ptr2, ptr3, len3, ptr4, len4);
|
|
431
|
+
if (ret[2]) {
|
|
432
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
433
|
+
}
|
|
434
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
435
|
+
ClientFinalization.register(this, this.__wbg_ptr, this);
|
|
436
|
+
return this;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* @param {string | null} [mnemonic]
|
|
440
|
+
* @returns {Promise<void>}
|
|
441
|
+
*/
|
|
442
|
+
init(mnemonic) {
|
|
443
|
+
var ptr0 = isLikeNone(mnemonic) ? 0 : passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
444
|
+
var len0 = WASM_VECTOR_LEN;
|
|
445
|
+
const ret = wasm.client_init(this.__wbg_ptr, ptr0, len0);
|
|
446
|
+
return ret;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Create an Arkade to EVM swap.
|
|
450
|
+
* @param {string} target_address
|
|
451
|
+
* @param {number} target_amount
|
|
452
|
+
* @param {string} target_token
|
|
453
|
+
* @param {string} target_chain
|
|
454
|
+
* @param {string | null} [referral_code]
|
|
455
|
+
* @returns {Promise<any>}
|
|
456
|
+
*/
|
|
457
|
+
createArkadeToEvmSwap(target_address, target_amount, target_token, target_chain, referral_code) {
|
|
458
|
+
const ptr0 = passStringToWasm0(target_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
459
|
+
const len0 = WASM_VECTOR_LEN;
|
|
460
|
+
const ptr1 = passStringToWasm0(target_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
461
|
+
const len1 = WASM_VECTOR_LEN;
|
|
462
|
+
const ptr2 = passStringToWasm0(target_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
463
|
+
const len2 = WASM_VECTOR_LEN;
|
|
464
|
+
var ptr3 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
465
|
+
var len3 = WASM_VECTOR_LEN;
|
|
466
|
+
const ret = wasm.client_createArkadeToEvmSwap(this.__wbg_ptr, ptr0, len0, target_amount, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
467
|
+
return ret;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Create an EVM to Arkade swap.
|
|
471
|
+
* @param {string} target_address
|
|
472
|
+
* @param {string} user_address
|
|
473
|
+
* @param {number} source_amount
|
|
474
|
+
* @param {string} source_token
|
|
475
|
+
* @param {string} source_chain
|
|
476
|
+
* @param {string | null} [referral_code]
|
|
477
|
+
* @returns {Promise<any>}
|
|
478
|
+
*/
|
|
479
|
+
createEvmToArkadeSwap(target_address, user_address, source_amount, source_token, source_chain, referral_code) {
|
|
480
|
+
const ptr0 = passStringToWasm0(target_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
481
|
+
const len0 = WASM_VECTOR_LEN;
|
|
482
|
+
const ptr1 = passStringToWasm0(user_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
483
|
+
const len1 = WASM_VECTOR_LEN;
|
|
484
|
+
const ptr2 = passStringToWasm0(source_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
485
|
+
const len2 = WASM_VECTOR_LEN;
|
|
486
|
+
const ptr3 = passStringToWasm0(source_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
487
|
+
const len3 = WASM_VECTOR_LEN;
|
|
488
|
+
var ptr4 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
489
|
+
var len4 = WASM_VECTOR_LEN;
|
|
490
|
+
const ret = wasm.client_createEvmToArkadeSwap(this.__wbg_ptr, ptr0, len0, ptr1, len1, source_amount, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
491
|
+
return ret;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Create an EVM to Lightning swap.
|
|
495
|
+
* @param {string} bolt11_invoice
|
|
496
|
+
* @param {string} user_address
|
|
497
|
+
* @param {string} source_token
|
|
498
|
+
* @param {string} source_chain
|
|
499
|
+
* @param {string | null} [referral_code]
|
|
500
|
+
* @returns {Promise<any>}
|
|
501
|
+
*/
|
|
502
|
+
createEvmToLightningSwap(bolt11_invoice, user_address, source_token, source_chain, referral_code) {
|
|
503
|
+
const ptr0 = passStringToWasm0(bolt11_invoice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
504
|
+
const len0 = WASM_VECTOR_LEN;
|
|
505
|
+
const ptr1 = passStringToWasm0(user_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
506
|
+
const len1 = WASM_VECTOR_LEN;
|
|
507
|
+
const ptr2 = passStringToWasm0(source_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
508
|
+
const len2 = WASM_VECTOR_LEN;
|
|
509
|
+
const ptr3 = passStringToWasm0(source_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
510
|
+
const len3 = WASM_VECTOR_LEN;
|
|
511
|
+
var ptr4 = isLikeNone(referral_code) ? 0 : passStringToWasm0(referral_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
512
|
+
var len4 = WASM_VECTOR_LEN;
|
|
513
|
+
const ret = wasm.client_createEvmToLightningSwap(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
514
|
+
return ret;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* @returns {Promise<AssetPair[]>}
|
|
518
|
+
*/
|
|
519
|
+
getAssetPairs() {
|
|
520
|
+
const ret = wasm.client_getAssetPairs(this.__wbg_ptr);
|
|
521
|
+
return ret;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @returns {Promise<TokenInfo[]>}
|
|
525
|
+
*/
|
|
526
|
+
getTokens() {
|
|
527
|
+
const ret = wasm.client_getTokens(this.__wbg_ptr);
|
|
528
|
+
return ret;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Get a quote.
|
|
532
|
+
* @param {string} from
|
|
533
|
+
* @param {string} to
|
|
534
|
+
* @param {bigint} base_amount
|
|
535
|
+
* @returns {Promise<QuoteResponse>}
|
|
536
|
+
*/
|
|
537
|
+
getQuote(from, to, base_amount) {
|
|
538
|
+
const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
539
|
+
const len0 = WASM_VECTOR_LEN;
|
|
540
|
+
const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
541
|
+
const len1 = WASM_VECTOR_LEN;
|
|
542
|
+
const ret = wasm.client_getQuote(this.__wbg_ptr, ptr0, len0, ptr1, len1, base_amount);
|
|
543
|
+
return ret;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Get swap by ID.
|
|
547
|
+
*
|
|
548
|
+
* This function returns `[ExtendedSwapResponse]`. It's too complex for Wasm to handle.
|
|
549
|
+
* @param {string} id
|
|
550
|
+
* @returns {Promise<any>}
|
|
551
|
+
*/
|
|
552
|
+
getSwap(id) {
|
|
553
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
554
|
+
const len0 = WASM_VECTOR_LEN;
|
|
555
|
+
const ret = wasm.client_getSwap(this.__wbg_ptr, ptr0, len0);
|
|
556
|
+
return ret;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Get all swaps.
|
|
560
|
+
*
|
|
561
|
+
* This function returns `[ExtendedSwapResponse[]]`. It's too complex for Wasm to handle.
|
|
562
|
+
* @returns {Promise<any>}
|
|
563
|
+
*/
|
|
564
|
+
listAll() {
|
|
565
|
+
const ret = wasm.client_listAll(this.__wbg_ptr);
|
|
566
|
+
return ret;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* @param {string} swap_id
|
|
570
|
+
* @param {string | null} [secret]
|
|
571
|
+
* @returns {Promise<void>}
|
|
572
|
+
*/
|
|
573
|
+
claimGelato(swap_id, secret) {
|
|
574
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
575
|
+
const len0 = WASM_VECTOR_LEN;
|
|
576
|
+
var ptr1 = isLikeNone(secret) ? 0 : passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
577
|
+
var len1 = WASM_VECTOR_LEN;
|
|
578
|
+
const ret = wasm.client_claimGelato(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
579
|
+
return ret;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* @param {string} swap_id
|
|
583
|
+
* @returns {Promise<any>}
|
|
584
|
+
*/
|
|
585
|
+
amountsForSwap(swap_id) {
|
|
586
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
587
|
+
const len0 = WASM_VECTOR_LEN;
|
|
588
|
+
const ret = wasm.client_amountsForSwap(this.__wbg_ptr, ptr0, len0);
|
|
589
|
+
return ret;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* @param {string} swap_id
|
|
593
|
+
* @returns {Promise<void>}
|
|
594
|
+
*/
|
|
595
|
+
claimVhtlc(swap_id) {
|
|
596
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
597
|
+
const len0 = WASM_VECTOR_LEN;
|
|
598
|
+
const ret = wasm.client_claimVhtlc(this.__wbg_ptr, ptr0, len0);
|
|
599
|
+
return ret;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* @param {string} swap_id
|
|
603
|
+
* @param {string} refund_address
|
|
604
|
+
* @returns {Promise<string>}
|
|
605
|
+
*/
|
|
606
|
+
refundVhtlc(swap_id, refund_address) {
|
|
607
|
+
const ptr0 = passStringToWasm0(swap_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
608
|
+
const len0 = WASM_VECTOR_LEN;
|
|
609
|
+
const ptr1 = passStringToWasm0(refund_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
610
|
+
const len1 = WASM_VECTOR_LEN;
|
|
611
|
+
const ret = wasm.client_refundVhtlc(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
612
|
+
return ret;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Get API version.
|
|
616
|
+
* @returns {Promise<Version>}
|
|
617
|
+
*/
|
|
618
|
+
getVersion() {
|
|
619
|
+
const ret = wasm.client_getVersion(this.__wbg_ptr);
|
|
620
|
+
return ret;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Recover swaps using xpub.
|
|
624
|
+
* @returns {Promise<any>}
|
|
625
|
+
*/
|
|
626
|
+
recoverSwaps() {
|
|
627
|
+
const ret = wasm.client_recoverSwaps(this.__wbg_ptr);
|
|
628
|
+
return ret;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Get mnemonic
|
|
632
|
+
* @returns {Promise<string>}
|
|
633
|
+
*/
|
|
634
|
+
getMnemonic() {
|
|
635
|
+
const ret = wasm.client_getMnemonic(this.__wbg_ptr);
|
|
636
|
+
return ret;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Get userIdXpub
|
|
640
|
+
* @returns {Promise<string>}
|
|
641
|
+
*/
|
|
642
|
+
getUserIdXpub() {
|
|
643
|
+
const ret = wasm.client_getUserIdXpub(this.__wbg_ptr);
|
|
644
|
+
return ret;
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Deletes all stored swaps
|
|
648
|
+
* @returns {Promise<void>}
|
|
649
|
+
*/
|
|
650
|
+
clearSwapStorage() {
|
|
651
|
+
const ret = wasm.client_clearSwapStorage(this.__wbg_ptr);
|
|
652
|
+
return ret;
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Delete specific swap
|
|
656
|
+
* @param {string} id
|
|
657
|
+
* @returns {Promise<void>}
|
|
658
|
+
*/
|
|
659
|
+
deleteSwap(id) {
|
|
660
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
661
|
+
const len0 = WASM_VECTOR_LEN;
|
|
662
|
+
const ret = wasm.client_deleteSwap(this.__wbg_ptr, ptr0, len0);
|
|
663
|
+
return ret;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Estimate the fee for a VTXO swap.
|
|
667
|
+
*
|
|
668
|
+
* # Arguments
|
|
669
|
+
* * `vtxos` - List of VTXO outpoints to refresh ("txid:vout" format)
|
|
670
|
+
* @param {string[]} vtxos
|
|
671
|
+
* @returns {Promise<EstimateVtxoSwapResponse>}
|
|
672
|
+
*/
|
|
673
|
+
estimateVtxoSwap(vtxos) {
|
|
674
|
+
const ptr0 = passArrayJsValueToWasm0(vtxos, wasm.__wbindgen_malloc);
|
|
675
|
+
const len0 = WASM_VECTOR_LEN;
|
|
676
|
+
const ret = wasm.client_estimateVtxoSwap(this.__wbg_ptr, ptr0, len0);
|
|
677
|
+
return ret;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Create a VTXO swap for refreshing VTXOs.
|
|
681
|
+
*
|
|
682
|
+
* Returns the swap response and swap params.
|
|
683
|
+
*
|
|
684
|
+
* # Arguments
|
|
685
|
+
* * `vtxos` - List of VTXO outpoints to refresh ("txid:vout" format)
|
|
686
|
+
* @param {string[]} vtxos
|
|
687
|
+
* @returns {Promise<CreateVtxoSwapResult>}
|
|
688
|
+
*/
|
|
689
|
+
createVtxoSwap(vtxos) {
|
|
690
|
+
const ptr0 = passArrayJsValueToWasm0(vtxos, wasm.__wbindgen_malloc);
|
|
691
|
+
const len0 = WASM_VECTOR_LEN;
|
|
692
|
+
const ret = wasm.client_createVtxoSwap(this.__wbg_ptr, ptr0, len0);
|
|
693
|
+
return ret;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Get VTXO swap details by ID.
|
|
697
|
+
* @param {string} id
|
|
698
|
+
* @returns {Promise<VtxoSwapResponse>}
|
|
699
|
+
*/
|
|
700
|
+
getVtxoSwap(id) {
|
|
701
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
702
|
+
const len0 = WASM_VECTOR_LEN;
|
|
703
|
+
const ret = wasm.client_getVtxoSwap(this.__wbg_ptr, ptr0, len0);
|
|
704
|
+
return ret;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Claim the server's VHTLC in a VTXO swap.
|
|
708
|
+
*
|
|
709
|
+
* # Arguments
|
|
710
|
+
* * `swap` - The VTXO swap response
|
|
711
|
+
* * `swap_params` - The client's swap parameters
|
|
712
|
+
* * `claim_address` - The Arkade address to receive the claimed funds
|
|
713
|
+
* @param {VtxoSwapResponse} swap
|
|
714
|
+
* @param {SwapParams} swap_params
|
|
715
|
+
* @param {string} claim_address
|
|
716
|
+
* @returns {Promise<string>}
|
|
717
|
+
*/
|
|
718
|
+
claimVtxoSwap(swap, swap_params, claim_address) {
|
|
719
|
+
_assertClass(swap, VtxoSwapResponse);
|
|
720
|
+
_assertClass(swap_params, SwapParams);
|
|
721
|
+
const ptr0 = passStringToWasm0(claim_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
722
|
+
const len0 = WASM_VECTOR_LEN;
|
|
723
|
+
const ret = wasm.client_claimVtxoSwap(this.__wbg_ptr, swap.__wbg_ptr, swap_params.__wbg_ptr, ptr0, len0);
|
|
724
|
+
return ret;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Refund the client's VHTLC in a VTXO swap.
|
|
728
|
+
*
|
|
729
|
+
* # Arguments
|
|
730
|
+
* * `swap` - The VTXO swap response
|
|
731
|
+
* * `swap_params` - The client's swap parameters
|
|
732
|
+
* * `refund_address` - The Arkade address to receive the refunded funds
|
|
733
|
+
* @param {VtxoSwapResponse} swap
|
|
734
|
+
* @param {SwapParams} swap_params
|
|
735
|
+
* @param {string} refund_address
|
|
736
|
+
* @returns {Promise<string>}
|
|
737
|
+
*/
|
|
738
|
+
refundVtxoSwap(swap, swap_params, refund_address) {
|
|
739
|
+
_assertClass(swap, VtxoSwapResponse);
|
|
740
|
+
_assertClass(swap_params, SwapParams);
|
|
741
|
+
const ptr0 = passStringToWasm0(refund_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
742
|
+
const len0 = WASM_VECTOR_LEN;
|
|
743
|
+
const ret = wasm.client_refundVtxoSwap(this.__wbg_ptr, swap.__wbg_ptr, swap_params.__wbg_ptr, ptr0, len0);
|
|
744
|
+
return ret;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
|
|
748
|
+
|
|
749
|
+
const CreateVtxoSwapResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
750
|
+
? { register: () => {}, unregister: () => {} }
|
|
751
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_createvtxoswapresult_free(ptr >>> 0, 1));
|
|
752
|
+
/**
|
|
753
|
+
* Result from creating a VTXO swap.
|
|
754
|
+
*/
|
|
755
|
+
export class CreateVtxoSwapResult {
|
|
756
|
+
|
|
757
|
+
static __wrap(ptr) {
|
|
758
|
+
ptr = ptr >>> 0;
|
|
759
|
+
const obj = Object.create(CreateVtxoSwapResult.prototype);
|
|
760
|
+
obj.__wbg_ptr = ptr;
|
|
761
|
+
CreateVtxoSwapResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
762
|
+
return obj;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
__destroy_into_raw() {
|
|
766
|
+
const ptr = this.__wbg_ptr;
|
|
767
|
+
this.__wbg_ptr = 0;
|
|
768
|
+
CreateVtxoSwapResultFinalization.unregister(this);
|
|
769
|
+
return ptr;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
free() {
|
|
773
|
+
const ptr = this.__destroy_into_raw();
|
|
774
|
+
wasm.__wbg_createvtxoswapresult_free(ptr, 0);
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* The swap response
|
|
778
|
+
* @returns {VtxoSwapResponse}
|
|
779
|
+
*/
|
|
780
|
+
get response() {
|
|
781
|
+
const ret = wasm.__wbg_get_createvtxoswapresult_response(this.__wbg_ptr);
|
|
782
|
+
return VtxoSwapResponse.__wrap(ret);
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* The swap response
|
|
786
|
+
* @param {VtxoSwapResponse} arg0
|
|
787
|
+
*/
|
|
788
|
+
set response(arg0) {
|
|
789
|
+
_assertClass(arg0, VtxoSwapResponse);
|
|
790
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
791
|
+
wasm.__wbg_set_createvtxoswapresult_response(this.__wbg_ptr, ptr0);
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* The swap parameters (needed for claim/refund)
|
|
795
|
+
* @returns {SwapParams}
|
|
796
|
+
*/
|
|
797
|
+
get swapParams() {
|
|
798
|
+
const ret = wasm.__wbg_get_createvtxoswapresult_swapParams(this.__wbg_ptr);
|
|
799
|
+
return SwapParams.__wrap(ret);
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* The swap parameters (needed for claim/refund)
|
|
803
|
+
* @param {SwapParams} arg0
|
|
804
|
+
*/
|
|
805
|
+
set swapParams(arg0) {
|
|
806
|
+
_assertClass(arg0, SwapParams);
|
|
807
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
808
|
+
wasm.__wbg_set_createvtxoswapresult_swapParams(this.__wbg_ptr, ptr0);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
if (Symbol.dispose) CreateVtxoSwapResult.prototype[Symbol.dispose] = CreateVtxoSwapResult.prototype.free;
|
|
812
|
+
|
|
813
|
+
const EstimateVtxoSwapResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
814
|
+
? { register: () => {}, unregister: () => {} }
|
|
815
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_estimatevtxoswapresponse_free(ptr >>> 0, 1));
|
|
816
|
+
/**
|
|
817
|
+
* Estimate response for a VTXO swap.
|
|
818
|
+
*/
|
|
819
|
+
export class EstimateVtxoSwapResponse {
|
|
820
|
+
|
|
821
|
+
static __wrap(ptr) {
|
|
822
|
+
ptr = ptr >>> 0;
|
|
823
|
+
const obj = Object.create(EstimateVtxoSwapResponse.prototype);
|
|
824
|
+
obj.__wbg_ptr = ptr;
|
|
825
|
+
EstimateVtxoSwapResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
826
|
+
return obj;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
__destroy_into_raw() {
|
|
830
|
+
const ptr = this.__wbg_ptr;
|
|
831
|
+
this.__wbg_ptr = 0;
|
|
832
|
+
EstimateVtxoSwapResponseFinalization.unregister(this);
|
|
833
|
+
return ptr;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
free() {
|
|
837
|
+
const ptr = this.__destroy_into_raw();
|
|
838
|
+
wasm.__wbg_estimatevtxoswapresponse_free(ptr, 0);
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Total fee in satoshis
|
|
842
|
+
* @returns {bigint}
|
|
843
|
+
*/
|
|
844
|
+
get feeSats() {
|
|
845
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_feeSats(this.__wbg_ptr);
|
|
846
|
+
return ret;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Total fee in satoshis
|
|
850
|
+
* @param {bigint} arg0
|
|
851
|
+
*/
|
|
852
|
+
set feeSats(arg0) {
|
|
853
|
+
wasm.__wbg_set_estimatevtxoswapresponse_feeSats(this.__wbg_ptr, arg0);
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Total input amount in satoshis
|
|
857
|
+
* @returns {bigint}
|
|
858
|
+
*/
|
|
859
|
+
get totalInputSats() {
|
|
860
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_totalInputSats(this.__wbg_ptr);
|
|
861
|
+
return ret;
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Total input amount in satoshis
|
|
865
|
+
* @param {bigint} arg0
|
|
866
|
+
*/
|
|
867
|
+
set totalInputSats(arg0) {
|
|
868
|
+
wasm.__wbg_set_estimatevtxoswapresponse_totalInputSats(this.__wbg_ptr, arg0);
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Amount user will receive (total_input_sats - fee_sats)
|
|
872
|
+
* @returns {bigint}
|
|
873
|
+
*/
|
|
874
|
+
get outputSats() {
|
|
875
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_outputSats(this.__wbg_ptr);
|
|
876
|
+
return ret;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Amount user will receive (total_input_sats - fee_sats)
|
|
880
|
+
* @param {bigint} arg0
|
|
881
|
+
*/
|
|
882
|
+
set outputSats(arg0) {
|
|
883
|
+
wasm.__wbg_set_estimatevtxoswapresponse_outputSats(this.__wbg_ptr, arg0);
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Number of VTXOs being refreshed
|
|
887
|
+
* @returns {number}
|
|
888
|
+
*/
|
|
889
|
+
get vtxoCount() {
|
|
890
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_vtxoCount(this.__wbg_ptr);
|
|
891
|
+
return ret >>> 0;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Number of VTXOs being refreshed
|
|
895
|
+
* @param {number} arg0
|
|
896
|
+
*/
|
|
897
|
+
set vtxoCount(arg0) {
|
|
898
|
+
wasm.__wbg_set_estimatevtxoswapresponse_vtxoCount(this.__wbg_ptr, arg0);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
if (Symbol.dispose) EstimateVtxoSwapResponse.prototype[Symbol.dispose] = EstimateVtxoSwapResponse.prototype.free;
|
|
902
|
+
|
|
903
|
+
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
904
|
+
? { register: () => {}, unregister: () => {} }
|
|
905
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
|
|
906
|
+
|
|
907
|
+
export class IntoUnderlyingByteSource {
|
|
908
|
+
|
|
909
|
+
__destroy_into_raw() {
|
|
910
|
+
const ptr = this.__wbg_ptr;
|
|
911
|
+
this.__wbg_ptr = 0;
|
|
912
|
+
IntoUnderlyingByteSourceFinalization.unregister(this);
|
|
913
|
+
return ptr;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
free() {
|
|
917
|
+
const ptr = this.__destroy_into_raw();
|
|
918
|
+
wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* @returns {ReadableStreamType}
|
|
922
|
+
*/
|
|
923
|
+
get type() {
|
|
924
|
+
const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
|
|
925
|
+
return __wbindgen_enum_ReadableStreamType[ret];
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* @returns {number}
|
|
929
|
+
*/
|
|
930
|
+
get autoAllocateChunkSize() {
|
|
931
|
+
const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
|
|
932
|
+
return ret >>> 0;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* @param {ReadableByteStreamController} controller
|
|
936
|
+
*/
|
|
937
|
+
start(controller) {
|
|
938
|
+
wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* @param {ReadableByteStreamController} controller
|
|
942
|
+
* @returns {Promise<any>}
|
|
943
|
+
*/
|
|
944
|
+
pull(controller) {
|
|
945
|
+
const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
|
|
946
|
+
return ret;
|
|
947
|
+
}
|
|
948
|
+
cancel() {
|
|
949
|
+
const ptr = this.__destroy_into_raw();
|
|
950
|
+
wasm.intounderlyingbytesource_cancel(ptr);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
954
|
+
|
|
955
|
+
const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
956
|
+
? { register: () => {}, unregister: () => {} }
|
|
957
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
|
|
958
|
+
|
|
959
|
+
export class IntoUnderlyingSink {
|
|
960
|
+
|
|
961
|
+
__destroy_into_raw() {
|
|
962
|
+
const ptr = this.__wbg_ptr;
|
|
963
|
+
this.__wbg_ptr = 0;
|
|
964
|
+
IntoUnderlyingSinkFinalization.unregister(this);
|
|
965
|
+
return ptr;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
free() {
|
|
969
|
+
const ptr = this.__destroy_into_raw();
|
|
970
|
+
wasm.__wbg_intounderlyingsink_free(ptr, 0);
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* @param {any} chunk
|
|
974
|
+
* @returns {Promise<any>}
|
|
975
|
+
*/
|
|
976
|
+
write(chunk) {
|
|
977
|
+
const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
|
|
978
|
+
return ret;
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* @returns {Promise<any>}
|
|
982
|
+
*/
|
|
983
|
+
close() {
|
|
984
|
+
const ptr = this.__destroy_into_raw();
|
|
985
|
+
const ret = wasm.intounderlyingsink_close(ptr);
|
|
986
|
+
return ret;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* @param {any} reason
|
|
990
|
+
* @returns {Promise<any>}
|
|
991
|
+
*/
|
|
992
|
+
abort(reason) {
|
|
993
|
+
const ptr = this.__destroy_into_raw();
|
|
994
|
+
const ret = wasm.intounderlyingsink_abort(ptr, reason);
|
|
995
|
+
return ret;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
999
|
+
|
|
1000
|
+
const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1001
|
+
? { register: () => {}, unregister: () => {} }
|
|
1002
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
|
|
1003
|
+
|
|
1004
|
+
export class IntoUnderlyingSource {
|
|
1005
|
+
|
|
1006
|
+
__destroy_into_raw() {
|
|
1007
|
+
const ptr = this.__wbg_ptr;
|
|
1008
|
+
this.__wbg_ptr = 0;
|
|
1009
|
+
IntoUnderlyingSourceFinalization.unregister(this);
|
|
1010
|
+
return ptr;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
free() {
|
|
1014
|
+
const ptr = this.__destroy_into_raw();
|
|
1015
|
+
wasm.__wbg_intounderlyingsource_free(ptr, 0);
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* @param {ReadableStreamDefaultController} controller
|
|
1019
|
+
* @returns {Promise<any>}
|
|
1020
|
+
*/
|
|
1021
|
+
pull(controller) {
|
|
1022
|
+
const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
|
|
1023
|
+
return ret;
|
|
1024
|
+
}
|
|
1025
|
+
cancel() {
|
|
1026
|
+
const ptr = this.__destroy_into_raw();
|
|
1027
|
+
wasm.intounderlyingsource_cancel(ptr);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1031
|
+
|
|
1032
|
+
const JsSwapStorageProviderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1033
|
+
? { register: () => {}, unregister: () => {} }
|
|
1034
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_jsswapstorageprovider_free(ptr >>> 0, 1));
|
|
1035
|
+
/**
|
|
1036
|
+
* JavaScript swap storage provider passed from TypeScript.
|
|
1037
|
+
*
|
|
1038
|
+
* This struct wraps JavaScript callback functions that implement
|
|
1039
|
+
* typed swap storage operations. Each function should return a Promise.
|
|
1040
|
+
*
|
|
1041
|
+
* # Example (TypeScript with Dexie)
|
|
1042
|
+
*
|
|
1043
|
+
* ```typescript
|
|
1044
|
+
* import Dexie from 'dexie';
|
|
1045
|
+
*
|
|
1046
|
+
* const db = new Dexie('lendaswap');
|
|
1047
|
+
* db.version(1).stores({ swaps: 'id' });
|
|
1048
|
+
*
|
|
1049
|
+
* const swapStorage = new JsSwapStorageProvider(
|
|
1050
|
+
* async (swapId) => await db.swaps.get(swapId) ?? null,
|
|
1051
|
+
* async (swapId, data) => { await db.swaps.put({ id: swapId, ...data }); },
|
|
1052
|
+
* async (swapId) => { await db.swaps.delete(swapId); },
|
|
1053
|
+
* async () => await db.swaps.toCollection().primaryKeys()
|
|
1054
|
+
* );
|
|
1055
|
+
* ```
|
|
1056
|
+
*/
|
|
1057
|
+
export class JsSwapStorageProvider {
|
|
1058
|
+
|
|
1059
|
+
__destroy_into_raw() {
|
|
1060
|
+
const ptr = this.__wbg_ptr;
|
|
1061
|
+
this.__wbg_ptr = 0;
|
|
1062
|
+
JsSwapStorageProviderFinalization.unregister(this);
|
|
1063
|
+
return ptr;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
free() {
|
|
1067
|
+
const ptr = this.__destroy_into_raw();
|
|
1068
|
+
wasm.__wbg_jsswapstorageprovider_free(ptr, 0);
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Create a new JsSwapStorageProvider from JavaScript callbacks.
|
|
1072
|
+
*
|
|
1073
|
+
* # Arguments
|
|
1074
|
+
* * `get_fn` - Function: `(swapId: string) => Promise<ExtendedSwapStorageData | null>`
|
|
1075
|
+
* * `store_fn` - Function: `(swapId: string, data: ExtendedSwapStorageData) => Promise<void>`
|
|
1076
|
+
* * `delete_fn` - Function: `(swapId: string) => Promise<void>`
|
|
1077
|
+
* * `list_fn` - Function: `() => Promise<string[]>`
|
|
1078
|
+
* * `get_all_fn` - Function: `() => Promise<ExtendedSwapStorageData[]>`
|
|
1079
|
+
* @param {Function} get_fn
|
|
1080
|
+
* @param {Function} store_fn
|
|
1081
|
+
* @param {Function} delete_fn
|
|
1082
|
+
* @param {Function} list_fn
|
|
1083
|
+
* @param {Function} get_all_fn
|
|
1084
|
+
*/
|
|
1085
|
+
constructor(get_fn, store_fn, delete_fn, list_fn, get_all_fn) {
|
|
1086
|
+
const ret = wasm.jsswapstorageprovider_new(get_fn, store_fn, delete_fn, list_fn, get_all_fn);
|
|
1087
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1088
|
+
JsSwapStorageProviderFinalization.register(this, this.__wbg_ptr, this);
|
|
1089
|
+
return this;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
if (Symbol.dispose) JsSwapStorageProvider.prototype[Symbol.dispose] = JsSwapStorageProvider.prototype.free;
|
|
1093
|
+
|
|
1094
|
+
const JsWalletStorageProviderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1095
|
+
? { register: () => {}, unregister: () => {} }
|
|
1096
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_jswalletstorageprovider_free(ptr >>> 0, 1));
|
|
1097
|
+
/**
|
|
1098
|
+
* JavaScript wallet storage provider passed from TypeScript.
|
|
1099
|
+
*
|
|
1100
|
+
* This struct wraps JavaScript callback functions that implement
|
|
1101
|
+
* the typed wallet storage operations. Each function should return a Promise.
|
|
1102
|
+
*
|
|
1103
|
+
* # Example (TypeScript)
|
|
1104
|
+
*
|
|
1105
|
+
* ```typescript
|
|
1106
|
+
* const provider = new JsWalletStorageProvider(
|
|
1107
|
+
* async () => localStorage.getItem('mnemonic'), // get_mnemonic
|
|
1108
|
+
* async (mnemonic) => localStorage.setItem('mnemonic', mnemonic), // set_mnemonic
|
|
1109
|
+
* async () => parseInt(localStorage.getItem('key_index') ?? '0'), // get_key_index
|
|
1110
|
+
* async (index) => localStorage.setItem('key_index', index.toString()), // set_key_index
|
|
1111
|
+
* );
|
|
1112
|
+
* ```
|
|
1113
|
+
*/
|
|
1114
|
+
export class JsWalletStorageProvider {
|
|
1115
|
+
|
|
1116
|
+
__destroy_into_raw() {
|
|
1117
|
+
const ptr = this.__wbg_ptr;
|
|
1118
|
+
this.__wbg_ptr = 0;
|
|
1119
|
+
JsWalletStorageProviderFinalization.unregister(this);
|
|
1120
|
+
return ptr;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
free() {
|
|
1124
|
+
const ptr = this.__destroy_into_raw();
|
|
1125
|
+
wasm.__wbg_jswalletstorageprovider_free(ptr, 0);
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Create a new JsWalletStorageProvider from JavaScript callbacks.
|
|
1129
|
+
*
|
|
1130
|
+
* # Arguments
|
|
1131
|
+
* * `get_mnemonic_fn` - Function: `() => Promise<string | null>`
|
|
1132
|
+
* * `set_mnemonic_fn` - Function: `(mnemonic: string) => Promise<void>`
|
|
1133
|
+
* * `get_key_index_fn` - Function: `() => Promise<number>`
|
|
1134
|
+
* * `set_key_index_fn` - Function: `(index: number) => Promise<void>`
|
|
1135
|
+
* @param {Function} get_mnemonic_fn
|
|
1136
|
+
* @param {Function} set_mnemonic_fn
|
|
1137
|
+
* @param {Function} get_key_index_fn
|
|
1138
|
+
* @param {Function} set_key_index_fn
|
|
1139
|
+
*/
|
|
1140
|
+
constructor(get_mnemonic_fn, set_mnemonic_fn, get_key_index_fn, set_key_index_fn) {
|
|
1141
|
+
const ret = wasm.jswalletstorageprovider_new(get_mnemonic_fn, set_mnemonic_fn, get_key_index_fn, set_key_index_fn);
|
|
1142
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1143
|
+
JsWalletStorageProviderFinalization.register(this, this.__wbg_ptr, this);
|
|
1144
|
+
return this;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
if (Symbol.dispose) JsWalletStorageProvider.prototype[Symbol.dispose] = JsWalletStorageProvider.prototype.free;
|
|
1148
|
+
|
|
1149
|
+
const QuoteResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1150
|
+
? { register: () => {}, unregister: () => {} }
|
|
1151
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_quoteresponse_free(ptr >>> 0, 1));
|
|
1152
|
+
/**
|
|
1153
|
+
* Quote response from the API.
|
|
1154
|
+
*/
|
|
1155
|
+
export class QuoteResponse {
|
|
1156
|
+
|
|
1157
|
+
static __wrap(ptr) {
|
|
1158
|
+
ptr = ptr >>> 0;
|
|
1159
|
+
const obj = Object.create(QuoteResponse.prototype);
|
|
1160
|
+
obj.__wbg_ptr = ptr;
|
|
1161
|
+
QuoteResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1162
|
+
return obj;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
__destroy_into_raw() {
|
|
1166
|
+
const ptr = this.__wbg_ptr;
|
|
1167
|
+
this.__wbg_ptr = 0;
|
|
1168
|
+
QuoteResponseFinalization.unregister(this);
|
|
1169
|
+
return ptr;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
free() {
|
|
1173
|
+
const ptr = this.__destroy_into_raw();
|
|
1174
|
+
wasm.__wbg_quoteresponse_free(ptr, 0);
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* @returns {string}
|
|
1178
|
+
*/
|
|
1179
|
+
get exchangeRate() {
|
|
1180
|
+
let deferred1_0;
|
|
1181
|
+
let deferred1_1;
|
|
1182
|
+
try {
|
|
1183
|
+
const ret = wasm.__wbg_get_quoteresponse_exchangeRate(this.__wbg_ptr);
|
|
1184
|
+
deferred1_0 = ret[0];
|
|
1185
|
+
deferred1_1 = ret[1];
|
|
1186
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1187
|
+
} finally {
|
|
1188
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* @param {string} arg0
|
|
1193
|
+
*/
|
|
1194
|
+
set exchangeRate(arg0) {
|
|
1195
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1196
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1197
|
+
wasm.__wbg_set_quoteresponse_exchangeRate(this.__wbg_ptr, ptr0, len0);
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* @returns {bigint}
|
|
1201
|
+
*/
|
|
1202
|
+
get networkFee() {
|
|
1203
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_feeSats(this.__wbg_ptr);
|
|
1204
|
+
return BigInt.asUintN(64, ret);
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* @param {bigint} arg0
|
|
1208
|
+
*/
|
|
1209
|
+
set networkFee(arg0) {
|
|
1210
|
+
wasm.__wbg_set_estimatevtxoswapresponse_feeSats(this.__wbg_ptr, arg0);
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* @returns {bigint}
|
|
1214
|
+
*/
|
|
1215
|
+
get protocolFee() {
|
|
1216
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_totalInputSats(this.__wbg_ptr);
|
|
1217
|
+
return BigInt.asUintN(64, ret);
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* @param {bigint} arg0
|
|
1221
|
+
*/
|
|
1222
|
+
set protocolFee(arg0) {
|
|
1223
|
+
wasm.__wbg_set_estimatevtxoswapresponse_totalInputSats(this.__wbg_ptr, arg0);
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* @returns {number}
|
|
1227
|
+
*/
|
|
1228
|
+
get protocolFeeRate() {
|
|
1229
|
+
const ret = wasm.__wbg_get_quoteresponse_protocolFeeRate(this.__wbg_ptr);
|
|
1230
|
+
return ret;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* @param {number} arg0
|
|
1234
|
+
*/
|
|
1235
|
+
set protocolFeeRate(arg0) {
|
|
1236
|
+
wasm.__wbg_set_quoteresponse_protocolFeeRate(this.__wbg_ptr, arg0);
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* @returns {bigint}
|
|
1240
|
+
*/
|
|
1241
|
+
get minAmount() {
|
|
1242
|
+
const ret = wasm.__wbg_get_quoteresponse_minAmount(this.__wbg_ptr);
|
|
1243
|
+
return BigInt.asUintN(64, ret);
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* @param {bigint} arg0
|
|
1247
|
+
*/
|
|
1248
|
+
set minAmount(arg0) {
|
|
1249
|
+
wasm.__wbg_set_quoteresponse_minAmount(this.__wbg_ptr, arg0);
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* @returns {bigint}
|
|
1253
|
+
*/
|
|
1254
|
+
get maxAmount() {
|
|
1255
|
+
const ret = wasm.__wbg_get_quoteresponse_maxAmount(this.__wbg_ptr);
|
|
1256
|
+
return BigInt.asUintN(64, ret);
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* @param {bigint} arg0
|
|
1260
|
+
*/
|
|
1261
|
+
set maxAmount(arg0) {
|
|
1262
|
+
wasm.__wbg_set_quoteresponse_maxAmount(this.__wbg_ptr, arg0);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
if (Symbol.dispose) QuoteResponse.prototype[Symbol.dispose] = QuoteResponse.prototype.free;
|
|
1266
|
+
|
|
1267
|
+
const SwapParamsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1268
|
+
? { register: () => {}, unregister: () => {} }
|
|
1269
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_swapparams_free(ptr >>> 0, 1));
|
|
1270
|
+
/**
|
|
1271
|
+
* Parameters derived for a swap operation.
|
|
1272
|
+
*/
|
|
1273
|
+
export class SwapParams {
|
|
1274
|
+
|
|
1275
|
+
static __wrap(ptr) {
|
|
1276
|
+
ptr = ptr >>> 0;
|
|
1277
|
+
const obj = Object.create(SwapParams.prototype);
|
|
1278
|
+
obj.__wbg_ptr = ptr;
|
|
1279
|
+
SwapParamsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1280
|
+
return obj;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
__destroy_into_raw() {
|
|
1284
|
+
const ptr = this.__wbg_ptr;
|
|
1285
|
+
this.__wbg_ptr = 0;
|
|
1286
|
+
SwapParamsFinalization.unregister(this);
|
|
1287
|
+
return ptr;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
free() {
|
|
1291
|
+
const ptr = this.__destroy_into_raw();
|
|
1292
|
+
wasm.__wbg_swapparams_free(ptr, 0);
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Secret key (hex-encoded).
|
|
1296
|
+
* @returns {string}
|
|
1297
|
+
*/
|
|
1298
|
+
get own_sk() {
|
|
1299
|
+
let deferred1_0;
|
|
1300
|
+
let deferred1_1;
|
|
1301
|
+
try {
|
|
1302
|
+
const ret = wasm.__wbg_get_swapparams_own_sk(this.__wbg_ptr);
|
|
1303
|
+
deferred1_0 = ret[0];
|
|
1304
|
+
deferred1_1 = ret[1];
|
|
1305
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1306
|
+
} finally {
|
|
1307
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Secret key (hex-encoded).
|
|
1312
|
+
* @param {string} arg0
|
|
1313
|
+
*/
|
|
1314
|
+
set own_sk(arg0) {
|
|
1315
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1316
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1317
|
+
wasm.__wbg_set_swapparams_own_sk(this.__wbg_ptr, ptr0, len0);
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* Public key (hex-encoded).
|
|
1321
|
+
* @returns {string}
|
|
1322
|
+
*/
|
|
1323
|
+
get own_pk() {
|
|
1324
|
+
let deferred1_0;
|
|
1325
|
+
let deferred1_1;
|
|
1326
|
+
try {
|
|
1327
|
+
const ret = wasm.__wbg_get_swapparams_own_pk(this.__wbg_ptr);
|
|
1328
|
+
deferred1_0 = ret[0];
|
|
1329
|
+
deferred1_1 = ret[1];
|
|
1330
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1331
|
+
} finally {
|
|
1332
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
/**
|
|
1336
|
+
* Public key (hex-encoded).
|
|
1337
|
+
* @param {string} arg0
|
|
1338
|
+
*/
|
|
1339
|
+
set own_pk(arg0) {
|
|
1340
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1341
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1342
|
+
wasm.__wbg_set_swapparams_own_pk(this.__wbg_ptr, ptr0, len0);
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* Preimage for HTLC (hex-encoded).
|
|
1346
|
+
* @returns {string}
|
|
1347
|
+
*/
|
|
1348
|
+
get preimage() {
|
|
1349
|
+
let deferred1_0;
|
|
1350
|
+
let deferred1_1;
|
|
1351
|
+
try {
|
|
1352
|
+
const ret = wasm.__wbg_get_swapparams_preimage(this.__wbg_ptr);
|
|
1353
|
+
deferred1_0 = ret[0];
|
|
1354
|
+
deferred1_1 = ret[1];
|
|
1355
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1356
|
+
} finally {
|
|
1357
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Preimage for HTLC (hex-encoded).
|
|
1362
|
+
* @param {string} arg0
|
|
1363
|
+
*/
|
|
1364
|
+
set preimage(arg0) {
|
|
1365
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1367
|
+
wasm.__wbg_set_swapparams_preimage(this.__wbg_ptr, ptr0, len0);
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Hash of the preimage (hex-encoded).
|
|
1371
|
+
* @returns {string}
|
|
1372
|
+
*/
|
|
1373
|
+
get preimage_hash() {
|
|
1374
|
+
let deferred1_0;
|
|
1375
|
+
let deferred1_1;
|
|
1376
|
+
try {
|
|
1377
|
+
const ret = wasm.__wbg_get_swapparams_preimage_hash(this.__wbg_ptr);
|
|
1378
|
+
deferred1_0 = ret[0];
|
|
1379
|
+
deferred1_1 = ret[1];
|
|
1380
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1381
|
+
} finally {
|
|
1382
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* Hash of the preimage (hex-encoded).
|
|
1387
|
+
* @param {string} arg0
|
|
1388
|
+
*/
|
|
1389
|
+
set preimage_hash(arg0) {
|
|
1390
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1391
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1392
|
+
wasm.__wbg_set_swapparams_preimage_hash(this.__wbg_ptr, ptr0, len0);
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* User ID derived from HD wallet (hex-encoded).
|
|
1396
|
+
* @returns {string}
|
|
1397
|
+
*/
|
|
1398
|
+
get user_id() {
|
|
1399
|
+
let deferred1_0;
|
|
1400
|
+
let deferred1_1;
|
|
1401
|
+
try {
|
|
1402
|
+
const ret = wasm.__wbg_get_swapparams_user_id(this.__wbg_ptr);
|
|
1403
|
+
deferred1_0 = ret[0];
|
|
1404
|
+
deferred1_1 = ret[1];
|
|
1405
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1406
|
+
} finally {
|
|
1407
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* User ID derived from HD wallet (hex-encoded).
|
|
1412
|
+
* @param {string} arg0
|
|
1413
|
+
*/
|
|
1414
|
+
set user_id(arg0) {
|
|
1415
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1416
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1417
|
+
wasm.__wbg_set_swapparams_user_id(this.__wbg_ptr, ptr0, len0);
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Key derivation index used.
|
|
1421
|
+
* @returns {number}
|
|
1422
|
+
*/
|
|
1423
|
+
get key_index() {
|
|
1424
|
+
const ret = wasm.__wbg_get_swapparams_key_index(this.__wbg_ptr);
|
|
1425
|
+
return ret >>> 0;
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Key derivation index used.
|
|
1429
|
+
* @param {number} arg0
|
|
1430
|
+
*/
|
|
1431
|
+
set key_index(arg0) {
|
|
1432
|
+
wasm.__wbg_set_swapparams_key_index(this.__wbg_ptr, arg0);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
if (Symbol.dispose) SwapParams.prototype[Symbol.dispose] = SwapParams.prototype.free;
|
|
1436
|
+
|
|
1437
|
+
const TokenIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1438
|
+
? { register: () => {}, unregister: () => {} }
|
|
1439
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_tokenid_free(ptr >>> 0, 1));
|
|
1440
|
+
/**
|
|
1441
|
+
* Token identifier.
|
|
1442
|
+
*/
|
|
1443
|
+
export class TokenId {
|
|
1444
|
+
|
|
1445
|
+
static __wrap(ptr) {
|
|
1446
|
+
ptr = ptr >>> 0;
|
|
1447
|
+
const obj = Object.create(TokenId.prototype);
|
|
1448
|
+
obj.__wbg_ptr = ptr;
|
|
1449
|
+
TokenIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1450
|
+
return obj;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
__destroy_into_raw() {
|
|
1454
|
+
const ptr = this.__wbg_ptr;
|
|
1455
|
+
this.__wbg_ptr = 0;
|
|
1456
|
+
TokenIdFinalization.unregister(this);
|
|
1457
|
+
return ptr;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
free() {
|
|
1461
|
+
const ptr = this.__destroy_into_raw();
|
|
1462
|
+
wasm.__wbg_tokenid_free(ptr, 0);
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
* @returns {string}
|
|
1466
|
+
*/
|
|
1467
|
+
toString() {
|
|
1468
|
+
let deferred1_0;
|
|
1469
|
+
let deferred1_1;
|
|
1470
|
+
try {
|
|
1471
|
+
const ret = wasm.tokenid_toString(this.__wbg_ptr);
|
|
1472
|
+
deferred1_0 = ret[0];
|
|
1473
|
+
deferred1_1 = ret[1];
|
|
1474
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1475
|
+
} finally {
|
|
1476
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* @param {string} s
|
|
1481
|
+
* @returns {TokenId}
|
|
1482
|
+
*/
|
|
1483
|
+
static fromString(s) {
|
|
1484
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1485
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1486
|
+
const ret = wasm.tokenid_fromString(ptr0, len0);
|
|
1487
|
+
if (ret[2]) {
|
|
1488
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1489
|
+
}
|
|
1490
|
+
return TokenId.__wrap(ret[0]);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
if (Symbol.dispose) TokenId.prototype[Symbol.dispose] = TokenId.prototype.free;
|
|
1494
|
+
|
|
1495
|
+
const TokenInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1496
|
+
? { register: () => {}, unregister: () => {} }
|
|
1497
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_tokeninfo_free(ptr >>> 0, 1));
|
|
1498
|
+
/**
|
|
1499
|
+
* Token information.
|
|
1500
|
+
*/
|
|
1501
|
+
export class TokenInfo {
|
|
1502
|
+
|
|
1503
|
+
static __wrap(ptr) {
|
|
1504
|
+
ptr = ptr >>> 0;
|
|
1505
|
+
const obj = Object.create(TokenInfo.prototype);
|
|
1506
|
+
obj.__wbg_ptr = ptr;
|
|
1507
|
+
TokenInfoFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1508
|
+
return obj;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
__destroy_into_raw() {
|
|
1512
|
+
const ptr = this.__wbg_ptr;
|
|
1513
|
+
this.__wbg_ptr = 0;
|
|
1514
|
+
TokenInfoFinalization.unregister(this);
|
|
1515
|
+
return ptr;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
free() {
|
|
1519
|
+
const ptr = this.__destroy_into_raw();
|
|
1520
|
+
wasm.__wbg_tokeninfo_free(ptr, 0);
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* @returns {string}
|
|
1524
|
+
*/
|
|
1525
|
+
get tokenId() {
|
|
1526
|
+
let deferred1_0;
|
|
1527
|
+
let deferred1_1;
|
|
1528
|
+
try {
|
|
1529
|
+
const ret = wasm.__wbg_get_tokeninfo_tokenId(this.__wbg_ptr);
|
|
1530
|
+
deferred1_0 = ret[0];
|
|
1531
|
+
deferred1_1 = ret[1];
|
|
1532
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1533
|
+
} finally {
|
|
1534
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* @param {string} arg0
|
|
1539
|
+
*/
|
|
1540
|
+
set tokenId(arg0) {
|
|
1541
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1542
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1543
|
+
wasm.__wbg_set_tokeninfo_tokenId(this.__wbg_ptr, ptr0, len0);
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* @returns {string}
|
|
1547
|
+
*/
|
|
1548
|
+
get symbol() {
|
|
1549
|
+
let deferred1_0;
|
|
1550
|
+
let deferred1_1;
|
|
1551
|
+
try {
|
|
1552
|
+
const ret = wasm.__wbg_get_tokeninfo_symbol(this.__wbg_ptr);
|
|
1553
|
+
deferred1_0 = ret[0];
|
|
1554
|
+
deferred1_1 = ret[1];
|
|
1555
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1556
|
+
} finally {
|
|
1557
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* @param {string} arg0
|
|
1562
|
+
*/
|
|
1563
|
+
set symbol(arg0) {
|
|
1564
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1565
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1566
|
+
wasm.__wbg_set_tokeninfo_symbol(this.__wbg_ptr, ptr0, len0);
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* @returns {Chain}
|
|
1570
|
+
*/
|
|
1571
|
+
get chain() {
|
|
1572
|
+
const ret = wasm.__wbg_get_tokeninfo_chain(this.__wbg_ptr);
|
|
1573
|
+
return ret;
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* @param {Chain} arg0
|
|
1577
|
+
*/
|
|
1578
|
+
set chain(arg0) {
|
|
1579
|
+
wasm.__wbg_set_tokeninfo_chain(this.__wbg_ptr, arg0);
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* @returns {string}
|
|
1583
|
+
*/
|
|
1584
|
+
get name() {
|
|
1585
|
+
let deferred1_0;
|
|
1586
|
+
let deferred1_1;
|
|
1587
|
+
try {
|
|
1588
|
+
const ret = wasm.__wbg_get_tokeninfo_name(this.__wbg_ptr);
|
|
1589
|
+
deferred1_0 = ret[0];
|
|
1590
|
+
deferred1_1 = ret[1];
|
|
1591
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1592
|
+
} finally {
|
|
1593
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* @param {string} arg0
|
|
1598
|
+
*/
|
|
1599
|
+
set name(arg0) {
|
|
1600
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1601
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1602
|
+
wasm.__wbg_set_tokeninfo_name(this.__wbg_ptr, ptr0, len0);
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* @returns {number}
|
|
1606
|
+
*/
|
|
1607
|
+
get decimals() {
|
|
1608
|
+
const ret = wasm.__wbg_get_tokeninfo_decimals(this.__wbg_ptr);
|
|
1609
|
+
return ret;
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* @param {number} arg0
|
|
1613
|
+
*/
|
|
1614
|
+
set decimals(arg0) {
|
|
1615
|
+
wasm.__wbg_set_tokeninfo_decimals(this.__wbg_ptr, arg0);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
if (Symbol.dispose) TokenInfo.prototype[Symbol.dispose] = TokenInfo.prototype.free;
|
|
1619
|
+
|
|
1620
|
+
const VersionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1621
|
+
? { register: () => {}, unregister: () => {} }
|
|
1622
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_version_free(ptr >>> 0, 1));
|
|
1623
|
+
/**
|
|
1624
|
+
* Version information.
|
|
1625
|
+
*/
|
|
1626
|
+
export class Version {
|
|
1627
|
+
|
|
1628
|
+
static __wrap(ptr) {
|
|
1629
|
+
ptr = ptr >>> 0;
|
|
1630
|
+
const obj = Object.create(Version.prototype);
|
|
1631
|
+
obj.__wbg_ptr = ptr;
|
|
1632
|
+
VersionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1633
|
+
return obj;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
__destroy_into_raw() {
|
|
1637
|
+
const ptr = this.__wbg_ptr;
|
|
1638
|
+
this.__wbg_ptr = 0;
|
|
1639
|
+
VersionFinalization.unregister(this);
|
|
1640
|
+
return ptr;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
free() {
|
|
1644
|
+
const ptr = this.__destroy_into_raw();
|
|
1645
|
+
wasm.__wbg_version_free(ptr, 0);
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* @returns {string}
|
|
1649
|
+
*/
|
|
1650
|
+
get tag() {
|
|
1651
|
+
let deferred1_0;
|
|
1652
|
+
let deferred1_1;
|
|
1653
|
+
try {
|
|
1654
|
+
const ret = wasm.__wbg_get_version_tag(this.__wbg_ptr);
|
|
1655
|
+
deferred1_0 = ret[0];
|
|
1656
|
+
deferred1_1 = ret[1];
|
|
1657
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1658
|
+
} finally {
|
|
1659
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* @param {string} arg0
|
|
1664
|
+
*/
|
|
1665
|
+
set tag(arg0) {
|
|
1666
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1667
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1668
|
+
wasm.__wbg_set_version_tag(this.__wbg_ptr, ptr0, len0);
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* @returns {string}
|
|
1672
|
+
*/
|
|
1673
|
+
get commitHash() {
|
|
1674
|
+
let deferred1_0;
|
|
1675
|
+
let deferred1_1;
|
|
1676
|
+
try {
|
|
1677
|
+
const ret = wasm.__wbg_get_version_commitHash(this.__wbg_ptr);
|
|
1678
|
+
deferred1_0 = ret[0];
|
|
1679
|
+
deferred1_1 = ret[1];
|
|
1680
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1681
|
+
} finally {
|
|
1682
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
/**
|
|
1686
|
+
* @param {string} arg0
|
|
1687
|
+
*/
|
|
1688
|
+
set commitHash(arg0) {
|
|
1689
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1690
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1691
|
+
wasm.__wbg_set_version_commitHash(this.__wbg_ptr, ptr0, len0);
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
if (Symbol.dispose) Version.prototype[Symbol.dispose] = Version.prototype.free;
|
|
1695
|
+
|
|
1696
|
+
const VhtlcAmountsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1697
|
+
? { register: () => {}, unregister: () => {} }
|
|
1698
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_vhtlcamounts_free(ptr >>> 0, 1));
|
|
1699
|
+
/**
|
|
1700
|
+
* VHTLC amounts returned from Arkade.
|
|
1701
|
+
*/
|
|
1702
|
+
export class VhtlcAmounts {
|
|
1703
|
+
|
|
1704
|
+
__destroy_into_raw() {
|
|
1705
|
+
const ptr = this.__wbg_ptr;
|
|
1706
|
+
this.__wbg_ptr = 0;
|
|
1707
|
+
VhtlcAmountsFinalization.unregister(this);
|
|
1708
|
+
return ptr;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
free() {
|
|
1712
|
+
const ptr = this.__destroy_into_raw();
|
|
1713
|
+
wasm.__wbg_vhtlcamounts_free(ptr, 0);
|
|
1714
|
+
}
|
|
1715
|
+
/**
|
|
1716
|
+
* Amount that can be spent (in satoshis).
|
|
1717
|
+
* @returns {bigint}
|
|
1718
|
+
*/
|
|
1719
|
+
get spendable() {
|
|
1720
|
+
const ret = wasm.__wbg_get_vhtlcamounts_spendable(this.__wbg_ptr);
|
|
1721
|
+
return BigInt.asUintN(64, ret);
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* Amount that can be spent (in satoshis).
|
|
1725
|
+
* @param {bigint} arg0
|
|
1726
|
+
*/
|
|
1727
|
+
set spendable(arg0) {
|
|
1728
|
+
wasm.__wbg_set_vhtlcamounts_spendable(this.__wbg_ptr, arg0);
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Amount already spent (in satoshis).
|
|
1732
|
+
* @returns {bigint}
|
|
1733
|
+
*/
|
|
1734
|
+
get spent() {
|
|
1735
|
+
const ret = wasm.__wbg_get_vhtlcamounts_spent(this.__wbg_ptr);
|
|
1736
|
+
return BigInt.asUintN(64, ret);
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Amount already spent (in satoshis).
|
|
1740
|
+
* @param {bigint} arg0
|
|
1741
|
+
*/
|
|
1742
|
+
set spent(arg0) {
|
|
1743
|
+
wasm.__wbg_set_vhtlcamounts_spent(this.__wbg_ptr, arg0);
|
|
1744
|
+
}
|
|
1745
|
+
/**
|
|
1746
|
+
* Amount that can be recovered via refund (in satoshis).
|
|
1747
|
+
* @returns {bigint}
|
|
1748
|
+
*/
|
|
1749
|
+
get recoverable() {
|
|
1750
|
+
const ret = wasm.__wbg_get_vhtlcamounts_recoverable(this.__wbg_ptr);
|
|
1751
|
+
return BigInt.asUintN(64, ret);
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* Amount that can be recovered via refund (in satoshis).
|
|
1755
|
+
* @param {bigint} arg0
|
|
1756
|
+
*/
|
|
1757
|
+
set recoverable(arg0) {
|
|
1758
|
+
wasm.__wbg_set_vhtlcamounts_recoverable(this.__wbg_ptr, arg0);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
if (Symbol.dispose) VhtlcAmounts.prototype[Symbol.dispose] = VhtlcAmounts.prototype.free;
|
|
1762
|
+
|
|
1763
|
+
const VtxoSwapResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1764
|
+
? { register: () => {}, unregister: () => {} }
|
|
1765
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_vtxoswapresponse_free(ptr >>> 0, 1));
|
|
1766
|
+
/**
|
|
1767
|
+
* Response from creating/getting a VTXO swap.
|
|
1768
|
+
*/
|
|
1769
|
+
export class VtxoSwapResponse {
|
|
1770
|
+
|
|
1771
|
+
static __wrap(ptr) {
|
|
1772
|
+
ptr = ptr >>> 0;
|
|
1773
|
+
const obj = Object.create(VtxoSwapResponse.prototype);
|
|
1774
|
+
obj.__wbg_ptr = ptr;
|
|
1775
|
+
VtxoSwapResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1776
|
+
return obj;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
__destroy_into_raw() {
|
|
1780
|
+
const ptr = this.__wbg_ptr;
|
|
1781
|
+
this.__wbg_ptr = 0;
|
|
1782
|
+
VtxoSwapResponseFinalization.unregister(this);
|
|
1783
|
+
return ptr;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
free() {
|
|
1787
|
+
const ptr = this.__destroy_into_raw();
|
|
1788
|
+
wasm.__wbg_vtxoswapresponse_free(ptr, 0);
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Swap ID
|
|
1792
|
+
* @returns {string}
|
|
1793
|
+
*/
|
|
1794
|
+
get id() {
|
|
1795
|
+
let deferred1_0;
|
|
1796
|
+
let deferred1_1;
|
|
1797
|
+
try {
|
|
1798
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_id(this.__wbg_ptr);
|
|
1799
|
+
deferred1_0 = ret[0];
|
|
1800
|
+
deferred1_1 = ret[1];
|
|
1801
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1802
|
+
} finally {
|
|
1803
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* Swap ID
|
|
1808
|
+
* @param {string} arg0
|
|
1809
|
+
*/
|
|
1810
|
+
set id(arg0) {
|
|
1811
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1812
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1813
|
+
wasm.__wbg_set_vtxoswapresponse_id(this.__wbg_ptr, ptr0, len0);
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Swap status
|
|
1817
|
+
* @returns {string}
|
|
1818
|
+
*/
|
|
1819
|
+
get status() {
|
|
1820
|
+
let deferred1_0;
|
|
1821
|
+
let deferred1_1;
|
|
1822
|
+
try {
|
|
1823
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_status(this.__wbg_ptr);
|
|
1824
|
+
deferred1_0 = ret[0];
|
|
1825
|
+
deferred1_1 = ret[1];
|
|
1826
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1827
|
+
} finally {
|
|
1828
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Swap status
|
|
1833
|
+
* @param {string} arg0
|
|
1834
|
+
*/
|
|
1835
|
+
set status(arg0) {
|
|
1836
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1837
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1838
|
+
wasm.__wbg_set_vtxoswapresponse_status(this.__wbg_ptr, ptr0, len0);
|
|
1839
|
+
}
|
|
1840
|
+
/**
|
|
1841
|
+
* Creation timestamp (RFC3339)
|
|
1842
|
+
* @returns {string}
|
|
1843
|
+
*/
|
|
1844
|
+
get createdAt() {
|
|
1845
|
+
let deferred1_0;
|
|
1846
|
+
let deferred1_1;
|
|
1847
|
+
try {
|
|
1848
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_createdAt(this.__wbg_ptr);
|
|
1849
|
+
deferred1_0 = ret[0];
|
|
1850
|
+
deferred1_1 = ret[1];
|
|
1851
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1852
|
+
} finally {
|
|
1853
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* Creation timestamp (RFC3339)
|
|
1858
|
+
* @param {string} arg0
|
|
1859
|
+
*/
|
|
1860
|
+
set createdAt(arg0) {
|
|
1861
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1862
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1863
|
+
wasm.__wbg_set_vtxoswapresponse_createdAt(this.__wbg_ptr, ptr0, len0);
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Client's VHTLC address
|
|
1867
|
+
* @returns {string}
|
|
1868
|
+
*/
|
|
1869
|
+
get clientVhtlcAddress() {
|
|
1870
|
+
let deferred1_0;
|
|
1871
|
+
let deferred1_1;
|
|
1872
|
+
try {
|
|
1873
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_clientVhtlcAddress(this.__wbg_ptr);
|
|
1874
|
+
deferred1_0 = ret[0];
|
|
1875
|
+
deferred1_1 = ret[1];
|
|
1876
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1877
|
+
} finally {
|
|
1878
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Client's VHTLC address
|
|
1883
|
+
* @param {string} arg0
|
|
1884
|
+
*/
|
|
1885
|
+
set clientVhtlcAddress(arg0) {
|
|
1886
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1887
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1888
|
+
wasm.__wbg_set_vtxoswapresponse_clientVhtlcAddress(this.__wbg_ptr, ptr0, len0);
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Amount client should fund in satoshis
|
|
1892
|
+
* @returns {bigint}
|
|
1893
|
+
*/
|
|
1894
|
+
get clientFundAmountSats() {
|
|
1895
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_feeSats(this.__wbg_ptr);
|
|
1896
|
+
return ret;
|
|
1897
|
+
}
|
|
1898
|
+
/**
|
|
1899
|
+
* Amount client should fund in satoshis
|
|
1900
|
+
* @param {bigint} arg0
|
|
1901
|
+
*/
|
|
1902
|
+
set clientFundAmountSats(arg0) {
|
|
1903
|
+
wasm.__wbg_set_estimatevtxoswapresponse_feeSats(this.__wbg_ptr, arg0);
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* Client's public key
|
|
1907
|
+
* @returns {string}
|
|
1908
|
+
*/
|
|
1909
|
+
get clientPk() {
|
|
1910
|
+
let deferred1_0;
|
|
1911
|
+
let deferred1_1;
|
|
1912
|
+
try {
|
|
1913
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_clientPk(this.__wbg_ptr);
|
|
1914
|
+
deferred1_0 = ret[0];
|
|
1915
|
+
deferred1_1 = ret[1];
|
|
1916
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1917
|
+
} finally {
|
|
1918
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* Client's public key
|
|
1923
|
+
* @param {string} arg0
|
|
1924
|
+
*/
|
|
1925
|
+
set clientPk(arg0) {
|
|
1926
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1927
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1928
|
+
wasm.__wbg_set_vtxoswapresponse_clientPk(this.__wbg_ptr, ptr0, len0);
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Client VHTLC locktime (Unix timestamp)
|
|
1932
|
+
* @returns {bigint}
|
|
1933
|
+
*/
|
|
1934
|
+
get clientLocktime() {
|
|
1935
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_totalInputSats(this.__wbg_ptr);
|
|
1936
|
+
return BigInt.asUintN(64, ret);
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* Client VHTLC locktime (Unix timestamp)
|
|
1940
|
+
* @param {bigint} arg0
|
|
1941
|
+
*/
|
|
1942
|
+
set clientLocktime(arg0) {
|
|
1943
|
+
wasm.__wbg_set_estimatevtxoswapresponse_totalInputSats(this.__wbg_ptr, arg0);
|
|
1944
|
+
}
|
|
1945
|
+
/**
|
|
1946
|
+
* Client claim delay in seconds
|
|
1947
|
+
* @returns {bigint}
|
|
1948
|
+
*/
|
|
1949
|
+
get clientUnilateralClaimDelay() {
|
|
1950
|
+
const ret = wasm.__wbg_get_estimatevtxoswapresponse_outputSats(this.__wbg_ptr);
|
|
1951
|
+
return ret;
|
|
1952
|
+
}
|
|
1953
|
+
/**
|
|
1954
|
+
* Client claim delay in seconds
|
|
1955
|
+
* @param {bigint} arg0
|
|
1956
|
+
*/
|
|
1957
|
+
set clientUnilateralClaimDelay(arg0) {
|
|
1958
|
+
wasm.__wbg_set_estimatevtxoswapresponse_outputSats(this.__wbg_ptr, arg0);
|
|
1959
|
+
}
|
|
1960
|
+
/**
|
|
1961
|
+
* Client refund delay in seconds
|
|
1962
|
+
* @returns {bigint}
|
|
1963
|
+
*/
|
|
1964
|
+
get clientUnilateralRefundDelay() {
|
|
1965
|
+
const ret = wasm.__wbg_get_quoteresponse_minAmount(this.__wbg_ptr);
|
|
1966
|
+
return ret;
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Client refund delay in seconds
|
|
1970
|
+
* @param {bigint} arg0
|
|
1971
|
+
*/
|
|
1972
|
+
set clientUnilateralRefundDelay(arg0) {
|
|
1973
|
+
wasm.__wbg_set_quoteresponse_minAmount(this.__wbg_ptr, arg0);
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Client refund without receiver delay in seconds
|
|
1977
|
+
* @returns {bigint}
|
|
1978
|
+
*/
|
|
1979
|
+
get clientUnilateralRefundWithoutReceiverDelay() {
|
|
1980
|
+
const ret = wasm.__wbg_get_quoteresponse_maxAmount(this.__wbg_ptr);
|
|
1981
|
+
return ret;
|
|
1982
|
+
}
|
|
1983
|
+
/**
|
|
1984
|
+
* Client refund without receiver delay in seconds
|
|
1985
|
+
* @param {bigint} arg0
|
|
1986
|
+
*/
|
|
1987
|
+
set clientUnilateralRefundWithoutReceiverDelay(arg0) {
|
|
1988
|
+
wasm.__wbg_set_quoteresponse_maxAmount(this.__wbg_ptr, arg0);
|
|
1989
|
+
}
|
|
1990
|
+
/**
|
|
1991
|
+
* Server's VHTLC address
|
|
1992
|
+
* @returns {string}
|
|
1993
|
+
*/
|
|
1994
|
+
get serverVhtlcAddress() {
|
|
1995
|
+
let deferred1_0;
|
|
1996
|
+
let deferred1_1;
|
|
1997
|
+
try {
|
|
1998
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_serverVhtlcAddress(this.__wbg_ptr);
|
|
1999
|
+
deferred1_0 = ret[0];
|
|
2000
|
+
deferred1_1 = ret[1];
|
|
2001
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2002
|
+
} finally {
|
|
2003
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
/**
|
|
2007
|
+
* Server's VHTLC address
|
|
2008
|
+
* @param {string} arg0
|
|
2009
|
+
*/
|
|
2010
|
+
set serverVhtlcAddress(arg0) {
|
|
2011
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2012
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2013
|
+
wasm.__wbg_set_vtxoswapresponse_serverVhtlcAddress(this.__wbg_ptr, ptr0, len0);
|
|
2014
|
+
}
|
|
2015
|
+
/**
|
|
2016
|
+
* Amount server will fund in satoshis
|
|
2017
|
+
* @returns {bigint}
|
|
2018
|
+
*/
|
|
2019
|
+
get serverFundAmountSats() {
|
|
2020
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_serverFundAmountSats(this.__wbg_ptr);
|
|
2021
|
+
return ret;
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* Amount server will fund in satoshis
|
|
2025
|
+
* @param {bigint} arg0
|
|
2026
|
+
*/
|
|
2027
|
+
set serverFundAmountSats(arg0) {
|
|
2028
|
+
wasm.__wbg_set_vtxoswapresponse_serverFundAmountSats(this.__wbg_ptr, arg0);
|
|
2029
|
+
}
|
|
2030
|
+
/**
|
|
2031
|
+
* Server's public key
|
|
2032
|
+
* @returns {string}
|
|
2033
|
+
*/
|
|
2034
|
+
get serverPk() {
|
|
2035
|
+
let deferred1_0;
|
|
2036
|
+
let deferred1_1;
|
|
2037
|
+
try {
|
|
2038
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_serverPk(this.__wbg_ptr);
|
|
2039
|
+
deferred1_0 = ret[0];
|
|
2040
|
+
deferred1_1 = ret[1];
|
|
2041
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2042
|
+
} finally {
|
|
2043
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
/**
|
|
2047
|
+
* Server's public key
|
|
2048
|
+
* @param {string} arg0
|
|
2049
|
+
*/
|
|
2050
|
+
set serverPk(arg0) {
|
|
2051
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2052
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2053
|
+
wasm.__wbg_set_vtxoswapresponse_serverPk(this.__wbg_ptr, ptr0, len0);
|
|
2054
|
+
}
|
|
2055
|
+
/**
|
|
2056
|
+
* Server VHTLC locktime (Unix timestamp)
|
|
2057
|
+
* @returns {bigint}
|
|
2058
|
+
*/
|
|
2059
|
+
get serverLocktime() {
|
|
2060
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_serverLocktime(this.__wbg_ptr);
|
|
2061
|
+
return BigInt.asUintN(64, ret);
|
|
2062
|
+
}
|
|
2063
|
+
/**
|
|
2064
|
+
* Server VHTLC locktime (Unix timestamp)
|
|
2065
|
+
* @param {bigint} arg0
|
|
2066
|
+
*/
|
|
2067
|
+
set serverLocktime(arg0) {
|
|
2068
|
+
wasm.__wbg_set_vtxoswapresponse_serverLocktime(this.__wbg_ptr, arg0);
|
|
2069
|
+
}
|
|
2070
|
+
/**
|
|
2071
|
+
* Server claim delay in seconds
|
|
2072
|
+
* @returns {bigint}
|
|
2073
|
+
*/
|
|
2074
|
+
get serverUnilateralClaimDelay() {
|
|
2075
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_serverUnilateralClaimDelay(this.__wbg_ptr);
|
|
2076
|
+
return ret;
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* Server claim delay in seconds
|
|
2080
|
+
* @param {bigint} arg0
|
|
2081
|
+
*/
|
|
2082
|
+
set serverUnilateralClaimDelay(arg0) {
|
|
2083
|
+
wasm.__wbg_set_vtxoswapresponse_serverUnilateralClaimDelay(this.__wbg_ptr, arg0);
|
|
2084
|
+
}
|
|
2085
|
+
/**
|
|
2086
|
+
* Server refund delay in seconds
|
|
2087
|
+
* @returns {bigint}
|
|
2088
|
+
*/
|
|
2089
|
+
get serverUnilateralRefundDelay() {
|
|
2090
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_serverUnilateralRefundDelay(this.__wbg_ptr);
|
|
2091
|
+
return ret;
|
|
2092
|
+
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Server refund delay in seconds
|
|
2095
|
+
* @param {bigint} arg0
|
|
2096
|
+
*/
|
|
2097
|
+
set serverUnilateralRefundDelay(arg0) {
|
|
2098
|
+
wasm.__wbg_set_vtxoswapresponse_serverUnilateralRefundDelay(this.__wbg_ptr, arg0);
|
|
2099
|
+
}
|
|
2100
|
+
/**
|
|
2101
|
+
* Server refund without receiver delay in seconds
|
|
2102
|
+
* @returns {bigint}
|
|
2103
|
+
*/
|
|
2104
|
+
get serverUnilateralRefundWithoutReceiverDelay() {
|
|
2105
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_serverUnilateralRefundWithoutReceiverDelay(this.__wbg_ptr);
|
|
2106
|
+
return ret;
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* Server refund without receiver delay in seconds
|
|
2110
|
+
* @param {bigint} arg0
|
|
2111
|
+
*/
|
|
2112
|
+
set serverUnilateralRefundWithoutReceiverDelay(arg0) {
|
|
2113
|
+
wasm.__wbg_set_vtxoswapresponse_serverUnilateralRefundWithoutReceiverDelay(this.__wbg_ptr, arg0);
|
|
2114
|
+
}
|
|
2115
|
+
/**
|
|
2116
|
+
* Arkade server's public key
|
|
2117
|
+
* @returns {string}
|
|
2118
|
+
*/
|
|
2119
|
+
get arkadeServerPk() {
|
|
2120
|
+
let deferred1_0;
|
|
2121
|
+
let deferred1_1;
|
|
2122
|
+
try {
|
|
2123
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_arkadeServerPk(this.__wbg_ptr);
|
|
2124
|
+
deferred1_0 = ret[0];
|
|
2125
|
+
deferred1_1 = ret[1];
|
|
2126
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2127
|
+
} finally {
|
|
2128
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* Arkade server's public key
|
|
2133
|
+
* @param {string} arg0
|
|
2134
|
+
*/
|
|
2135
|
+
set arkadeServerPk(arg0) {
|
|
2136
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2137
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2138
|
+
wasm.__wbg_set_vtxoswapresponse_arkadeServerPk(this.__wbg_ptr, ptr0, len0);
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* The preimage hash (SHA256)
|
|
2142
|
+
* @returns {string}
|
|
2143
|
+
*/
|
|
2144
|
+
get preimageHash() {
|
|
2145
|
+
let deferred1_0;
|
|
2146
|
+
let deferred1_1;
|
|
2147
|
+
try {
|
|
2148
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_preimageHash(this.__wbg_ptr);
|
|
2149
|
+
deferred1_0 = ret[0];
|
|
2150
|
+
deferred1_1 = ret[1];
|
|
2151
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2152
|
+
} finally {
|
|
2153
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* The preimage hash (SHA256)
|
|
2158
|
+
* @param {string} arg0
|
|
2159
|
+
*/
|
|
2160
|
+
set preimageHash(arg0) {
|
|
2161
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2162
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2163
|
+
wasm.__wbg_set_vtxoswapresponse_preimageHash(this.__wbg_ptr, ptr0, len0);
|
|
2164
|
+
}
|
|
2165
|
+
/**
|
|
2166
|
+
* Fee in satoshis
|
|
2167
|
+
* @returns {bigint}
|
|
2168
|
+
*/
|
|
2169
|
+
get feeSats() {
|
|
2170
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_feeSats(this.__wbg_ptr);
|
|
2171
|
+
return ret;
|
|
2172
|
+
}
|
|
2173
|
+
/**
|
|
2174
|
+
* Fee in satoshis
|
|
2175
|
+
* @param {bigint} arg0
|
|
2176
|
+
*/
|
|
2177
|
+
set feeSats(arg0) {
|
|
2178
|
+
wasm.__wbg_set_vtxoswapresponse_feeSats(this.__wbg_ptr, arg0);
|
|
2179
|
+
}
|
|
2180
|
+
/**
|
|
2181
|
+
* Bitcoin network
|
|
2182
|
+
* @returns {string}
|
|
2183
|
+
*/
|
|
2184
|
+
get network() {
|
|
2185
|
+
let deferred1_0;
|
|
2186
|
+
let deferred1_1;
|
|
2187
|
+
try {
|
|
2188
|
+
const ret = wasm.__wbg_get_vtxoswapresponse_network(this.__wbg_ptr);
|
|
2189
|
+
deferred1_0 = ret[0];
|
|
2190
|
+
deferred1_1 = ret[1];
|
|
2191
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2192
|
+
} finally {
|
|
2193
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
/**
|
|
2197
|
+
* Bitcoin network
|
|
2198
|
+
* @param {string} arg0
|
|
2199
|
+
*/
|
|
2200
|
+
set network(arg0) {
|
|
2201
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2202
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2203
|
+
wasm.__wbg_set_vtxoswapresponse_network(this.__wbg_ptr, ptr0, len0);
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
if (Symbol.dispose) VtxoSwapResponse.prototype[Symbol.dispose] = VtxoSwapResponse.prototype.free;
|
|
2207
|
+
|
|
2208
|
+
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
2209
|
+
|
|
2210
|
+
async function __wbg_load(module, imports) {
|
|
2211
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
2212
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2213
|
+
try {
|
|
2214
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2215
|
+
|
|
2216
|
+
} catch (e) {
|
|
2217
|
+
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
2218
|
+
|
|
2219
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2220
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
2221
|
+
|
|
2222
|
+
} else {
|
|
2223
|
+
throw e;
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
const bytes = await module.arrayBuffer();
|
|
2229
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
2230
|
+
|
|
2231
|
+
} else {
|
|
2232
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
2233
|
+
|
|
2234
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
2235
|
+
return { instance, module };
|
|
2236
|
+
|
|
2237
|
+
} else {
|
|
2238
|
+
return instance;
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
function __wbg_get_imports() {
|
|
2244
|
+
const imports = {};
|
|
2245
|
+
imports.wbg = {};
|
|
2246
|
+
imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
2247
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
2248
|
+
return ret;
|
|
2249
|
+
};
|
|
2250
|
+
imports.wbg.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
|
|
2251
|
+
const ret = Number(arg0);
|
|
2252
|
+
return ret;
|
|
2253
|
+
};
|
|
2254
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
2255
|
+
const ret = String(arg1);
|
|
2256
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2257
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2258
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2259
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2260
|
+
};
|
|
2261
|
+
imports.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
|
|
2262
|
+
const v = arg1;
|
|
2263
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
2264
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
2265
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2266
|
+
};
|
|
2267
|
+
imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
|
|
2268
|
+
const v = arg0;
|
|
2269
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
2270
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
2271
|
+
};
|
|
2272
|
+
imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
2273
|
+
const ret = debugString(arg1);
|
|
2274
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2275
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2276
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2277
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2278
|
+
};
|
|
2279
|
+
imports.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
|
|
2280
|
+
const ret = arg0 in arg1;
|
|
2281
|
+
return ret;
|
|
2282
|
+
};
|
|
2283
|
+
imports.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
|
|
2284
|
+
const ret = typeof(arg0) === 'bigint';
|
|
2285
|
+
return ret;
|
|
2286
|
+
};
|
|
2287
|
+
imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
2288
|
+
const ret = typeof(arg0) === 'function';
|
|
2289
|
+
return ret;
|
|
2290
|
+
};
|
|
2291
|
+
imports.wbg.__wbg___wbindgen_is_null_5e69f72e906cc57c = function(arg0) {
|
|
2292
|
+
const ret = arg0 === null;
|
|
2293
|
+
return ret;
|
|
2294
|
+
};
|
|
2295
|
+
imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
2296
|
+
const val = arg0;
|
|
2297
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
2298
|
+
return ret;
|
|
2299
|
+
};
|
|
2300
|
+
imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
2301
|
+
const ret = typeof(arg0) === 'string';
|
|
2302
|
+
return ret;
|
|
2303
|
+
};
|
|
2304
|
+
imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
2305
|
+
const ret = arg0 === undefined;
|
|
2306
|
+
return ret;
|
|
2307
|
+
};
|
|
2308
|
+
imports.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
|
|
2309
|
+
const ret = arg0 === arg1;
|
|
2310
|
+
return ret;
|
|
2311
|
+
};
|
|
2312
|
+
imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
|
|
2313
|
+
const ret = arg0 == arg1;
|
|
2314
|
+
return ret;
|
|
2315
|
+
};
|
|
2316
|
+
imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
2317
|
+
const obj = arg1;
|
|
2318
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
2319
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
2320
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2321
|
+
};
|
|
2322
|
+
imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
2323
|
+
const obj = arg1;
|
|
2324
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
2325
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2326
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2327
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2328
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2329
|
+
};
|
|
2330
|
+
imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
2331
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2332
|
+
};
|
|
2333
|
+
imports.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9 = function(arg0) {
|
|
2334
|
+
arg0._wbg_cb_unref();
|
|
2335
|
+
};
|
|
2336
|
+
imports.wbg.__wbg_abort_28ad55c5825b004d = function(arg0, arg1) {
|
|
2337
|
+
arg0.abort(arg1);
|
|
2338
|
+
};
|
|
2339
|
+
imports.wbg.__wbg_abort_e7eb059f72f9ed0c = function(arg0) {
|
|
2340
|
+
arg0.abort();
|
|
2341
|
+
};
|
|
2342
|
+
imports.wbg.__wbg_append_45ddba58b0706f62 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
2343
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2344
|
+
}, arguments) };
|
|
2345
|
+
imports.wbg.__wbg_append_892c5e2d5bdd60ac = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
2346
|
+
arg0.append(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5));
|
|
2347
|
+
}, arguments) };
|
|
2348
|
+
imports.wbg.__wbg_append_b577eb3a177bc0fa = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
2349
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2350
|
+
}, arguments) };
|
|
2351
|
+
imports.wbg.__wbg_append_cb0bba4cf263a60b = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2352
|
+
arg0.append(getStringFromWasm0(arg1, arg2), arg3);
|
|
2353
|
+
}, arguments) };
|
|
2354
|
+
imports.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3 = function() { return handleError(function (arg0) {
|
|
2355
|
+
const ret = arg0.arrayBuffer();
|
|
2356
|
+
return ret;
|
|
2357
|
+
}, arguments) };
|
|
2358
|
+
imports.wbg.__wbg_assetpair_new = function(arg0) {
|
|
2359
|
+
const ret = AssetPair.__wrap(arg0);
|
|
2360
|
+
return ret;
|
|
2361
|
+
};
|
|
2362
|
+
imports.wbg.__wbg_buffer_ccc4520b36d3ccf4 = function(arg0) {
|
|
2363
|
+
const ret = arg0.buffer;
|
|
2364
|
+
return ret;
|
|
2365
|
+
};
|
|
2366
|
+
imports.wbg.__wbg_byobRequest_2344e6975f27456e = function(arg0) {
|
|
2367
|
+
const ret = arg0.byobRequest;
|
|
2368
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2369
|
+
};
|
|
2370
|
+
imports.wbg.__wbg_byteLength_bcd42e4025299788 = function(arg0) {
|
|
2371
|
+
const ret = arg0.byteLength;
|
|
2372
|
+
return ret;
|
|
2373
|
+
};
|
|
2374
|
+
imports.wbg.__wbg_byteOffset_ca3a6cf7944b364b = function(arg0) {
|
|
2375
|
+
const ret = arg0.byteOffset;
|
|
2376
|
+
return ret;
|
|
2377
|
+
};
|
|
2378
|
+
imports.wbg.__wbg_call_525440f72fbfc0ea = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2379
|
+
const ret = arg0.call(arg1, arg2);
|
|
2380
|
+
return ret;
|
|
2381
|
+
}, arguments) };
|
|
2382
|
+
imports.wbg.__wbg_call_e45d2cf9fc925fcf = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2383
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
2384
|
+
return ret;
|
|
2385
|
+
}, arguments) };
|
|
2386
|
+
imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
|
|
2387
|
+
const ret = arg0.call(arg1);
|
|
2388
|
+
return ret;
|
|
2389
|
+
}, arguments) };
|
|
2390
|
+
imports.wbg.__wbg_clearTimeout_7a42b49784aea641 = function(arg0) {
|
|
2391
|
+
const ret = clearTimeout(arg0);
|
|
2392
|
+
return ret;
|
|
2393
|
+
};
|
|
2394
|
+
imports.wbg.__wbg_close_5a6caed3231b68cd = function() { return handleError(function (arg0) {
|
|
2395
|
+
arg0.close();
|
|
2396
|
+
}, arguments) };
|
|
2397
|
+
imports.wbg.__wbg_close_6956df845478561a = function() { return handleError(function (arg0) {
|
|
2398
|
+
arg0.close();
|
|
2399
|
+
}, arguments) };
|
|
2400
|
+
imports.wbg.__wbg_createvtxoswapresult_new = function(arg0) {
|
|
2401
|
+
const ret = CreateVtxoSwapResult.__wrap(arg0);
|
|
2402
|
+
return ret;
|
|
2403
|
+
};
|
|
2404
|
+
imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
2405
|
+
const ret = arg0.crypto;
|
|
2406
|
+
return ret;
|
|
2407
|
+
};
|
|
2408
|
+
imports.wbg.__wbg_debug_e55e1461940eb14d = function(arg0, arg1, arg2, arg3) {
|
|
2409
|
+
console.debug(arg0, arg1, arg2, arg3);
|
|
2410
|
+
};
|
|
2411
|
+
imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
|
|
2412
|
+
const ret = arg0.done;
|
|
2413
|
+
return ret;
|
|
2414
|
+
};
|
|
2415
|
+
imports.wbg.__wbg_enqueue_7b18a650aec77898 = function() { return handleError(function (arg0, arg1) {
|
|
2416
|
+
arg0.enqueue(arg1);
|
|
2417
|
+
}, arguments) };
|
|
2418
|
+
imports.wbg.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
|
|
2419
|
+
const ret = Object.entries(arg0);
|
|
2420
|
+
return ret;
|
|
2421
|
+
};
|
|
2422
|
+
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
2423
|
+
let deferred0_0;
|
|
2424
|
+
let deferred0_1;
|
|
2425
|
+
try {
|
|
2426
|
+
deferred0_0 = arg0;
|
|
2427
|
+
deferred0_1 = arg1;
|
|
2428
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
2429
|
+
} finally {
|
|
2430
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2431
|
+
}
|
|
2432
|
+
};
|
|
2433
|
+
imports.wbg.__wbg_error_d8b22cf4e59a6791 = function(arg0, arg1, arg2, arg3) {
|
|
2434
|
+
console.error(arg0, arg1, arg2, arg3);
|
|
2435
|
+
};
|
|
2436
|
+
imports.wbg.__wbg_estimatevtxoswapresponse_new = function(arg0) {
|
|
2437
|
+
const ret = EstimateVtxoSwapResponse.__wrap(arg0);
|
|
2438
|
+
return ret;
|
|
2439
|
+
};
|
|
2440
|
+
imports.wbg.__wbg_fetch_74a3e84ebd2c9a0e = function(arg0) {
|
|
2441
|
+
const ret = fetch(arg0);
|
|
2442
|
+
return ret;
|
|
2443
|
+
};
|
|
2444
|
+
imports.wbg.__wbg_fetch_f8ba0e29a9d6de0d = function(arg0, arg1) {
|
|
2445
|
+
const ret = arg0.fetch(arg1);
|
|
2446
|
+
return ret;
|
|
2447
|
+
};
|
|
2448
|
+
imports.wbg.__wbg_getItem_89f57d6acc51a876 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2449
|
+
const ret = arg1.getItem(getStringFromWasm0(arg2, arg3));
|
|
2450
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2451
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2452
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2453
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2454
|
+
}, arguments) };
|
|
2455
|
+
imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
2456
|
+
arg0.getRandomValues(arg1);
|
|
2457
|
+
}, arguments) };
|
|
2458
|
+
imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
2459
|
+
const ret = arg0[arg1 >>> 0];
|
|
2460
|
+
return ret;
|
|
2461
|
+
};
|
|
2462
|
+
imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
|
|
2463
|
+
const ret = Reflect.get(arg0, arg1);
|
|
2464
|
+
return ret;
|
|
2465
|
+
}, arguments) };
|
|
2466
|
+
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
2467
|
+
const ret = arg0[arg1];
|
|
2468
|
+
return ret;
|
|
2469
|
+
};
|
|
2470
|
+
imports.wbg.__wbg_has_787fafc980c3ccdb = function() { return handleError(function (arg0, arg1) {
|
|
2471
|
+
const ret = Reflect.has(arg0, arg1);
|
|
2472
|
+
return ret;
|
|
2473
|
+
}, arguments) };
|
|
2474
|
+
imports.wbg.__wbg_headers_b87d7eaba61c3278 = function(arg0) {
|
|
2475
|
+
const ret = arg0.headers;
|
|
2476
|
+
return ret;
|
|
2477
|
+
};
|
|
2478
|
+
imports.wbg.__wbg_info_68cd5b51ef7e5137 = function(arg0, arg1, arg2, arg3) {
|
|
2479
|
+
console.info(arg0, arg1, arg2, arg3);
|
|
2480
|
+
};
|
|
2481
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
2482
|
+
let result;
|
|
2483
|
+
try {
|
|
2484
|
+
result = arg0 instanceof ArrayBuffer;
|
|
2485
|
+
} catch (_) {
|
|
2486
|
+
result = false;
|
|
2487
|
+
}
|
|
2488
|
+
const ret = result;
|
|
2489
|
+
return ret;
|
|
2490
|
+
};
|
|
2491
|
+
imports.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
2492
|
+
let result;
|
|
2493
|
+
try {
|
|
2494
|
+
result = arg0 instanceof Map;
|
|
2495
|
+
} catch (_) {
|
|
2496
|
+
result = false;
|
|
2497
|
+
}
|
|
2498
|
+
const ret = result;
|
|
2499
|
+
return ret;
|
|
2500
|
+
};
|
|
2501
|
+
imports.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef = function(arg0) {
|
|
2502
|
+
let result;
|
|
2503
|
+
try {
|
|
2504
|
+
result = arg0 instanceof Promise;
|
|
2505
|
+
} catch (_) {
|
|
2506
|
+
result = false;
|
|
2507
|
+
}
|
|
2508
|
+
const ret = result;
|
|
2509
|
+
return ret;
|
|
2510
|
+
};
|
|
2511
|
+
imports.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c = function(arg0) {
|
|
2512
|
+
let result;
|
|
2513
|
+
try {
|
|
2514
|
+
result = arg0 instanceof Response;
|
|
2515
|
+
} catch (_) {
|
|
2516
|
+
result = false;
|
|
2517
|
+
}
|
|
2518
|
+
const ret = result;
|
|
2519
|
+
return ret;
|
|
2520
|
+
};
|
|
2521
|
+
imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
2522
|
+
let result;
|
|
2523
|
+
try {
|
|
2524
|
+
result = arg0 instanceof Uint8Array;
|
|
2525
|
+
} catch (_) {
|
|
2526
|
+
result = false;
|
|
2527
|
+
}
|
|
2528
|
+
const ret = result;
|
|
2529
|
+
return ret;
|
|
2530
|
+
};
|
|
2531
|
+
imports.wbg.__wbg_instanceof_Window_4846dbb3de56c84c = function(arg0) {
|
|
2532
|
+
let result;
|
|
2533
|
+
try {
|
|
2534
|
+
result = arg0 instanceof Window;
|
|
2535
|
+
} catch (_) {
|
|
2536
|
+
result = false;
|
|
2537
|
+
}
|
|
2538
|
+
const ret = result;
|
|
2539
|
+
return ret;
|
|
2540
|
+
};
|
|
2541
|
+
imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
2542
|
+
const ret = Array.isArray(arg0);
|
|
2543
|
+
return ret;
|
|
2544
|
+
};
|
|
2545
|
+
imports.wbg.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
|
|
2546
|
+
const ret = Number.isSafeInteger(arg0);
|
|
2547
|
+
return ret;
|
|
2548
|
+
};
|
|
2549
|
+
imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
|
|
2550
|
+
const ret = Symbol.iterator;
|
|
2551
|
+
return ret;
|
|
2552
|
+
};
|
|
2553
|
+
imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
2554
|
+
const ret = arg0.length;
|
|
2555
|
+
return ret;
|
|
2556
|
+
};
|
|
2557
|
+
imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
2558
|
+
const ret = arg0.length;
|
|
2559
|
+
return ret;
|
|
2560
|
+
};
|
|
2561
|
+
imports.wbg.__wbg_localStorage_3034501cd2b3da3f = function() { return handleError(function (arg0) {
|
|
2562
|
+
const ret = arg0.localStorage;
|
|
2563
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2564
|
+
}, arguments) };
|
|
2565
|
+
imports.wbg.__wbg_log_45eb3a49e7cdcb64 = function(arg0, arg1, arg2, arg3) {
|
|
2566
|
+
console.log(arg0, arg1, arg2, arg3);
|
|
2567
|
+
};
|
|
2568
|
+
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
2569
|
+
const ret = arg0.msCrypto;
|
|
2570
|
+
return ret;
|
|
2571
|
+
};
|
|
2572
|
+
imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
|
|
2573
|
+
const ret = new Object();
|
|
2574
|
+
return ret;
|
|
2575
|
+
};
|
|
2576
|
+
imports.wbg.__wbg_new_2531773dac38ebb3 = function() { return handleError(function () {
|
|
2577
|
+
const ret = new AbortController();
|
|
2578
|
+
return ret;
|
|
2579
|
+
}, arguments) };
|
|
2580
|
+
imports.wbg.__wbg_new_3c3d849046688a66 = function(arg0, arg1) {
|
|
2581
|
+
try {
|
|
2582
|
+
var state0 = {a: arg0, b: arg1};
|
|
2583
|
+
var cb0 = (arg0, arg1) => {
|
|
2584
|
+
const a = state0.a;
|
|
2585
|
+
state0.a = 0;
|
|
2586
|
+
try {
|
|
2587
|
+
return wasm_bindgen__convert__closures_____invoke__h68e6792a5299b78b(a, state0.b, arg0, arg1);
|
|
2588
|
+
} finally {
|
|
2589
|
+
state0.a = a;
|
|
2590
|
+
}
|
|
2591
|
+
};
|
|
2592
|
+
const ret = new Promise(cb0);
|
|
2593
|
+
return ret;
|
|
2594
|
+
} finally {
|
|
2595
|
+
state0.a = state0.b = 0;
|
|
2596
|
+
}
|
|
2597
|
+
};
|
|
2598
|
+
imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
|
|
2599
|
+
const ret = new Uint8Array(arg0);
|
|
2600
|
+
return ret;
|
|
2601
|
+
};
|
|
2602
|
+
imports.wbg.__wbg_new_68651c719dcda04e = function() {
|
|
2603
|
+
const ret = new Map();
|
|
2604
|
+
return ret;
|
|
2605
|
+
};
|
|
2606
|
+
imports.wbg.__wbg_new_6f694bb0585846e0 = function() { return handleError(function () {
|
|
2607
|
+
const ret = new FormData();
|
|
2608
|
+
return ret;
|
|
2609
|
+
}, arguments) };
|
|
2610
|
+
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
2611
|
+
const ret = new Error();
|
|
2612
|
+
return ret;
|
|
2613
|
+
};
|
|
2614
|
+
imports.wbg.__wbg_new_9edf9838a2def39c = function() { return handleError(function () {
|
|
2615
|
+
const ret = new Headers();
|
|
2616
|
+
return ret;
|
|
2617
|
+
}, arguments) };
|
|
2618
|
+
imports.wbg.__wbg_new_a7442b4b19c1a356 = function(arg0, arg1) {
|
|
2619
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2620
|
+
return ret;
|
|
2621
|
+
};
|
|
2622
|
+
imports.wbg.__wbg_new_e17d9f43105b08be = function() {
|
|
2623
|
+
const ret = new Array();
|
|
2624
|
+
return ret;
|
|
2625
|
+
};
|
|
2626
|
+
imports.wbg.__wbg_new_from_slice_92f4d78ca282a2d2 = function(arg0, arg1) {
|
|
2627
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
2628
|
+
return ret;
|
|
2629
|
+
};
|
|
2630
|
+
imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
|
|
2631
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
2632
|
+
return ret;
|
|
2633
|
+
};
|
|
2634
|
+
imports.wbg.__wbg_new_with_byte_offset_and_length_46e3e6a5e9f9e89b = function(arg0, arg1, arg2) {
|
|
2635
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
2636
|
+
return ret;
|
|
2637
|
+
};
|
|
2638
|
+
imports.wbg.__wbg_new_with_length_01aa0dc35aa13543 = function(arg0) {
|
|
2639
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
2640
|
+
return ret;
|
|
2641
|
+
};
|
|
2642
|
+
imports.wbg.__wbg_new_with_str_and_init_0ae7728b6ec367b1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2643
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
2644
|
+
return ret;
|
|
2645
|
+
}, arguments) };
|
|
2646
|
+
imports.wbg.__wbg_new_with_u8_array_sequence_and_options_0c1d0bd56d93d25a = function() { return handleError(function (arg0, arg1) {
|
|
2647
|
+
const ret = new Blob(arg0, arg1);
|
|
2648
|
+
return ret;
|
|
2649
|
+
}, arguments) };
|
|
2650
|
+
imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
|
|
2651
|
+
const ret = arg0.next();
|
|
2652
|
+
return ret;
|
|
2653
|
+
}, arguments) };
|
|
2654
|
+
imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
2655
|
+
const ret = arg0.next;
|
|
2656
|
+
return ret;
|
|
2657
|
+
};
|
|
2658
|
+
imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
|
|
2659
|
+
const ret = arg0.node;
|
|
2660
|
+
return ret;
|
|
2661
|
+
};
|
|
2662
|
+
imports.wbg.__wbg_now_f5ba683d8ce2c571 = function(arg0) {
|
|
2663
|
+
const ret = arg0.now();
|
|
2664
|
+
return ret;
|
|
2665
|
+
};
|
|
2666
|
+
imports.wbg.__wbg_performance_e8315b5ae987e93f = function(arg0) {
|
|
2667
|
+
const ret = arg0.performance;
|
|
2668
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2669
|
+
};
|
|
2670
|
+
imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
|
|
2671
|
+
const ret = arg0.process;
|
|
2672
|
+
return ret;
|
|
2673
|
+
};
|
|
2674
|
+
imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
2675
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
2676
|
+
};
|
|
2677
|
+
imports.wbg.__wbg_push_df81a39d04db858c = function(arg0, arg1) {
|
|
2678
|
+
const ret = arg0.push(arg1);
|
|
2679
|
+
return ret;
|
|
2680
|
+
};
|
|
2681
|
+
imports.wbg.__wbg_queueMicrotask_34d692c25c47d05b = function(arg0) {
|
|
2682
|
+
const ret = arg0.queueMicrotask;
|
|
2683
|
+
return ret;
|
|
2684
|
+
};
|
|
2685
|
+
imports.wbg.__wbg_queueMicrotask_9d76cacb20c84d58 = function(arg0) {
|
|
2686
|
+
queueMicrotask(arg0);
|
|
2687
|
+
};
|
|
2688
|
+
imports.wbg.__wbg_quoteresponse_new = function(arg0) {
|
|
2689
|
+
const ret = QuoteResponse.__wrap(arg0);
|
|
2690
|
+
return ret;
|
|
2691
|
+
};
|
|
2692
|
+
imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
|
|
2693
|
+
arg0.randomFillSync(arg1);
|
|
2694
|
+
}, arguments) };
|
|
2695
|
+
imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
|
|
2696
|
+
const ret = module.require;
|
|
2697
|
+
return ret;
|
|
2698
|
+
}, arguments) };
|
|
2699
|
+
imports.wbg.__wbg_resolve_caf97c30b83f7053 = function(arg0) {
|
|
2700
|
+
const ret = Promise.resolve(arg0);
|
|
2701
|
+
return ret;
|
|
2702
|
+
};
|
|
2703
|
+
imports.wbg.__wbg_respond_0f4dbf5386f5c73e = function() { return handleError(function (arg0, arg1) {
|
|
2704
|
+
arg0.respond(arg1 >>> 0);
|
|
2705
|
+
}, arguments) };
|
|
2706
|
+
imports.wbg.__wbg_setItem_64dfb54d7b20d84c = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
2707
|
+
arg0.setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2708
|
+
}, arguments) };
|
|
2709
|
+
imports.wbg.__wbg_setTimeout_7bb3429662ab1e70 = function(arg0, arg1) {
|
|
2710
|
+
const ret = setTimeout(arg0, arg1);
|
|
2711
|
+
return ret;
|
|
2712
|
+
};
|
|
2713
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
2714
|
+
arg0[arg1] = arg2;
|
|
2715
|
+
};
|
|
2716
|
+
imports.wbg.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
|
|
2717
|
+
const ret = arg0.set(arg1, arg2);
|
|
2718
|
+
return ret;
|
|
2719
|
+
};
|
|
2720
|
+
imports.wbg.__wbg_set_9e6516df7b7d0f19 = function(arg0, arg1, arg2) {
|
|
2721
|
+
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
2722
|
+
};
|
|
2723
|
+
imports.wbg.__wbg_set_body_3c365989753d61f4 = function(arg0, arg1) {
|
|
2724
|
+
arg0.body = arg1;
|
|
2725
|
+
};
|
|
2726
|
+
imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
2727
|
+
arg0[arg1 >>> 0] = arg2;
|
|
2728
|
+
};
|
|
2729
|
+
imports.wbg.__wbg_set_cache_2f9deb19b92b81e3 = function(arg0, arg1) {
|
|
2730
|
+
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
2731
|
+
};
|
|
2732
|
+
imports.wbg.__wbg_set_credentials_f621cd2d85c0c228 = function(arg0, arg1) {
|
|
2733
|
+
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
2734
|
+
};
|
|
2735
|
+
imports.wbg.__wbg_set_headers_6926da238cd32ee4 = function(arg0, arg1) {
|
|
2736
|
+
arg0.headers = arg1;
|
|
2737
|
+
};
|
|
2738
|
+
imports.wbg.__wbg_set_method_c02d8cbbe204ac2d = function(arg0, arg1, arg2) {
|
|
2739
|
+
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
2740
|
+
};
|
|
2741
|
+
imports.wbg.__wbg_set_mode_52ef73cfa79639cb = function(arg0, arg1) {
|
|
2742
|
+
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
2743
|
+
};
|
|
2744
|
+
imports.wbg.__wbg_set_signal_dda2cf7ccb6bee0f = function(arg0, arg1) {
|
|
2745
|
+
arg0.signal = arg1;
|
|
2746
|
+
};
|
|
2747
|
+
imports.wbg.__wbg_set_type_63fa4c18251f6545 = function(arg0, arg1, arg2) {
|
|
2748
|
+
arg0.type = getStringFromWasm0(arg1, arg2);
|
|
2749
|
+
};
|
|
2750
|
+
imports.wbg.__wbg_signal_4db5aa055bf9eb9a = function(arg0) {
|
|
2751
|
+
const ret = arg0.signal;
|
|
2752
|
+
return ret;
|
|
2753
|
+
};
|
|
2754
|
+
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
2755
|
+
const ret = arg1.stack;
|
|
2756
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2757
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2758
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2759
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2760
|
+
};
|
|
2761
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {
|
|
2762
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
2763
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2764
|
+
};
|
|
2765
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {
|
|
2766
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
2767
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2768
|
+
};
|
|
2769
|
+
imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {
|
|
2770
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
2771
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2772
|
+
};
|
|
2773
|
+
imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {
|
|
2774
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
2775
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2776
|
+
};
|
|
2777
|
+
imports.wbg.__wbg_status_de7eed5a7a5bfd5d = function(arg0) {
|
|
2778
|
+
const ret = arg0.status;
|
|
2779
|
+
return ret;
|
|
2780
|
+
};
|
|
2781
|
+
imports.wbg.__wbg_stringify_b5fb28f6465d9c3e = function() { return handleError(function (arg0) {
|
|
2782
|
+
const ret = JSON.stringify(arg0);
|
|
2783
|
+
return ret;
|
|
2784
|
+
}, arguments) };
|
|
2785
|
+
imports.wbg.__wbg_subarray_480600f3d6a9f26c = function(arg0, arg1, arg2) {
|
|
2786
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2787
|
+
return ret;
|
|
2788
|
+
};
|
|
2789
|
+
imports.wbg.__wbg_text_dc33c15c17bdfb52 = function() { return handleError(function (arg0) {
|
|
2790
|
+
const ret = arg0.text();
|
|
2791
|
+
return ret;
|
|
2792
|
+
}, arguments) };
|
|
2793
|
+
imports.wbg.__wbg_then_4f46f6544e6b4a28 = function(arg0, arg1) {
|
|
2794
|
+
const ret = arg0.then(arg1);
|
|
2795
|
+
return ret;
|
|
2796
|
+
};
|
|
2797
|
+
imports.wbg.__wbg_then_70d05cf780a18d77 = function(arg0, arg1, arg2) {
|
|
2798
|
+
const ret = arg0.then(arg1, arg2);
|
|
2799
|
+
return ret;
|
|
2800
|
+
};
|
|
2801
|
+
imports.wbg.__wbg_tokeninfo_new = function(arg0) {
|
|
2802
|
+
const ret = TokenInfo.__wrap(arg0);
|
|
2803
|
+
return ret;
|
|
2804
|
+
};
|
|
2805
|
+
imports.wbg.__wbg_url_b36d2a5008eb056f = function(arg0, arg1) {
|
|
2806
|
+
const ret = arg1.url;
|
|
2807
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2808
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2809
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2810
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2811
|
+
};
|
|
2812
|
+
imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
|
|
2813
|
+
const ret = arg0.value;
|
|
2814
|
+
return ret;
|
|
2815
|
+
};
|
|
2816
|
+
imports.wbg.__wbg_version_new = function(arg0) {
|
|
2817
|
+
const ret = Version.__wrap(arg0);
|
|
2818
|
+
return ret;
|
|
2819
|
+
};
|
|
2820
|
+
imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
|
|
2821
|
+
const ret = arg0.versions;
|
|
2822
|
+
return ret;
|
|
2823
|
+
};
|
|
2824
|
+
imports.wbg.__wbg_view_f6c15ac9fed63bbd = function(arg0) {
|
|
2825
|
+
const ret = arg0.view;
|
|
2826
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2827
|
+
};
|
|
2828
|
+
imports.wbg.__wbg_vtxoswapresponse_new = function(arg0) {
|
|
2829
|
+
const ret = VtxoSwapResponse.__wrap(arg0);
|
|
2830
|
+
return ret;
|
|
2831
|
+
};
|
|
2832
|
+
imports.wbg.__wbg_warn_8f5b5437666d0885 = function(arg0, arg1, arg2, arg3) {
|
|
2833
|
+
console.warn(arg0, arg1, arg2, arg3);
|
|
2834
|
+
};
|
|
2835
|
+
imports.wbg.__wbindgen_cast_083ba3ce304d58ed = function(arg0, arg1) {
|
|
2836
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 570, function: Function { arguments: [], shim_idx: 571, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2837
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h19250ab695821211, wasm_bindgen__convert__closures_____invoke__h49d21def8d7e8715);
|
|
2838
|
+
return ret;
|
|
2839
|
+
};
|
|
2840
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
2841
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2842
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
2843
|
+
return ret;
|
|
2844
|
+
};
|
|
2845
|
+
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
2846
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
2847
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
2848
|
+
return ret;
|
|
2849
|
+
};
|
|
2850
|
+
imports.wbg.__wbindgen_cast_48cbc3748220f6e5 = function(arg0, arg1) {
|
|
2851
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 637, function: Function { arguments: [Externref], shim_idx: 638, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2852
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h5b1ee57da9b2ce1f, wasm_bindgen__convert__closures_____invoke__hf86cb6f5b134f7f7);
|
|
2853
|
+
return ret;
|
|
2854
|
+
};
|
|
2855
|
+
imports.wbg.__wbindgen_cast_53d45148ea4f5d79 = function(arg0, arg1) {
|
|
2856
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
2857
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
2858
|
+
// Cast intrinsic for `Vector(NamedExternref("TokenInfo")) -> Externref`.
|
|
2859
|
+
const ret = v0;
|
|
2860
|
+
return ret;
|
|
2861
|
+
};
|
|
2862
|
+
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
2863
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
2864
|
+
const ret = arg0;
|
|
2865
|
+
return ret;
|
|
2866
|
+
};
|
|
2867
|
+
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
2868
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
2869
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
2870
|
+
return ret;
|
|
2871
|
+
};
|
|
2872
|
+
imports.wbg.__wbindgen_cast_d1236da12498f6f5 = function(arg0, arg1) {
|
|
2873
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
2874
|
+
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
2875
|
+
// Cast intrinsic for `Vector(NamedExternref("AssetPair")) -> Externref`.
|
|
2876
|
+
const ret = v0;
|
|
2877
|
+
return ret;
|
|
2878
|
+
};
|
|
2879
|
+
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
2880
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
2881
|
+
const ret = arg0;
|
|
2882
|
+
return ret;
|
|
2883
|
+
};
|
|
2884
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
2885
|
+
const table = wasm.__wbindgen_externrefs;
|
|
2886
|
+
const offset = table.grow(4);
|
|
2887
|
+
table.set(0, undefined);
|
|
2888
|
+
table.set(offset + 0, undefined);
|
|
2889
|
+
table.set(offset + 1, null);
|
|
2890
|
+
table.set(offset + 2, true);
|
|
2891
|
+
table.set(offset + 3, false);
|
|
2892
|
+
;
|
|
2893
|
+
};
|
|
2894
|
+
|
|
2895
|
+
return imports;
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
function __wbg_finalize_init(instance, module) {
|
|
2899
|
+
wasm = instance.exports;
|
|
2900
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
2901
|
+
cachedDataViewMemory0 = null;
|
|
2902
|
+
cachedUint8ArrayMemory0 = null;
|
|
2903
|
+
|
|
2904
|
+
|
|
2905
|
+
wasm.__wbindgen_start();
|
|
2906
|
+
return wasm;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
function initSync(module) {
|
|
2910
|
+
if (wasm !== undefined) return wasm;
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
if (typeof module !== 'undefined') {
|
|
2914
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2915
|
+
({module} = module)
|
|
2916
|
+
} else {
|
|
2917
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
const imports = __wbg_get_imports();
|
|
2922
|
+
|
|
2923
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
2924
|
+
module = new WebAssembly.Module(module);
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
2928
|
+
|
|
2929
|
+
return __wbg_finalize_init(instance, module);
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
async function __wbg_init(module_or_path) {
|
|
2933
|
+
if (wasm !== undefined) return wasm;
|
|
2934
|
+
|
|
2935
|
+
|
|
2936
|
+
if (typeof module_or_path !== 'undefined') {
|
|
2937
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2938
|
+
({module_or_path} = module_or_path)
|
|
2939
|
+
} else {
|
|
2940
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
if (typeof module_or_path === 'undefined') {
|
|
2945
|
+
module_or_path = new URL('lendaswap_wasm_sdk_bg.wasm', import.meta.url);
|
|
2946
|
+
}
|
|
2947
|
+
const imports = __wbg_get_imports();
|
|
2948
|
+
|
|
2949
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2950
|
+
module_or_path = fetch(module_or_path);
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2953
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2954
|
+
|
|
2955
|
+
return __wbg_finalize_init(instance, module);
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
export { initSync };
|
|
2959
|
+
export default __wbg_init;
|