@breeztech/breez-sdk-spark 0.0.1-dev2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +403 -0
- package/bundler/breez_sdk_spark_wasm.js +5 -0
- package/bundler/breez_sdk_spark_wasm_bg.js +1301 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +65 -0
- package/bundler/package.json +17 -0
- package/bundler/snippets/wasm-array-cp-201e2a98f0e691f7/copy.min.js +1 -0
- package/deno/breez_sdk_spark_wasm.d.ts +403 -0
- package/deno/breez_sdk_spark_wasm.js +1178 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +65 -0
- package/deno/snippets/wasm-array-cp-201e2a98f0e691f7/copy.min.js +1 -0
- package/nodejs/breez_sdk_spark_wasm.d.ts +403 -0
- package/nodejs/breez_sdk_spark_wasm.js +1312 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +65 -0
- package/nodejs/package.json +11 -0
- package/nodejs/snippets/wasm-array-cp-201e2a98f0e691f7/copy.min.js +1 -0
- package/package.json +33 -0
- package/web/breez_sdk_spark_wasm.d.ts +492 -0
- package/web/breez_sdk_spark_wasm.js +1269 -0
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +65 -0
- package/web/package.json +15 -0
- package/web/snippets/wasm-array-cp-201e2a98f0e691f7/copy.min.js +1 -0
|
@@ -0,0 +1,1178 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
4
|
+
|
|
5
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
6
|
+
|
|
7
|
+
let cachedUint8ArrayMemory0 = null;
|
|
8
|
+
|
|
9
|
+
function getUint8ArrayMemory0() {
|
|
10
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
11
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
+
}
|
|
13
|
+
return cachedUint8ArrayMemory0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getStringFromWasm0(ptr, len) {
|
|
17
|
+
ptr = ptr >>> 0;
|
|
18
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function addToExternrefTable0(obj) {
|
|
22
|
+
const idx = wasm.__externref_table_alloc();
|
|
23
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
24
|
+
return idx;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function handleError(f, args) {
|
|
28
|
+
try {
|
|
29
|
+
return f.apply(this, args);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
const idx = addToExternrefTable0(e);
|
|
32
|
+
wasm.__wbindgen_exn_store(idx);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function isLikeNone(x) {
|
|
37
|
+
return x === undefined || x === null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
41
|
+
ptr = ptr >>> 0;
|
|
42
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let cachedDataViewMemory0 = null;
|
|
46
|
+
|
|
47
|
+
function getDataViewMemory0() {
|
|
48
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
49
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
50
|
+
}
|
|
51
|
+
return cachedDataViewMemory0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let WASM_VECTOR_LEN = 0;
|
|
55
|
+
|
|
56
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
57
|
+
|
|
58
|
+
const encodeString = function (arg, view) {
|
|
59
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
63
|
+
|
|
64
|
+
if (realloc === undefined) {
|
|
65
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
66
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
67
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
68
|
+
WASM_VECTOR_LEN = buf.length;
|
|
69
|
+
return ptr;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let len = arg.length;
|
|
73
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
74
|
+
|
|
75
|
+
const mem = getUint8ArrayMemory0();
|
|
76
|
+
|
|
77
|
+
let offset = 0;
|
|
78
|
+
|
|
79
|
+
for (; offset < len; offset++) {
|
|
80
|
+
const code = arg.charCodeAt(offset);
|
|
81
|
+
if (code > 0x7F) break;
|
|
82
|
+
mem[ptr + offset] = code;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (offset !== len) {
|
|
86
|
+
if (offset !== 0) {
|
|
87
|
+
arg = arg.slice(offset);
|
|
88
|
+
}
|
|
89
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
90
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
91
|
+
const ret = encodeString(arg, view);
|
|
92
|
+
|
|
93
|
+
offset += ret.written;
|
|
94
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
WASM_VECTOR_LEN = offset;
|
|
98
|
+
return ptr;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
102
|
+
? { register: () => {}, unregister: () => {} }
|
|
103
|
+
: new FinalizationRegistry(state => {
|
|
104
|
+
wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b)
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
108
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
109
|
+
const real = (...args) => {
|
|
110
|
+
// First up with a closure we increment the internal reference
|
|
111
|
+
// count. This ensures that the Rust closure environment won't
|
|
112
|
+
// be deallocated while we're invoking it.
|
|
113
|
+
state.cnt++;
|
|
114
|
+
const a = state.a;
|
|
115
|
+
state.a = 0;
|
|
116
|
+
try {
|
|
117
|
+
return f(a, state.b, ...args);
|
|
118
|
+
} finally {
|
|
119
|
+
if (--state.cnt === 0) {
|
|
120
|
+
wasm.__wbindgen_export_5.get(state.dtor)(a, state.b);
|
|
121
|
+
CLOSURE_DTORS.unregister(state);
|
|
122
|
+
} else {
|
|
123
|
+
state.a = a;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
real.original = state;
|
|
128
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
129
|
+
return real;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function debugString(val) {
|
|
133
|
+
// primitive types
|
|
134
|
+
const type = typeof val;
|
|
135
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
136
|
+
return `${val}`;
|
|
137
|
+
}
|
|
138
|
+
if (type == 'string') {
|
|
139
|
+
return `"${val}"`;
|
|
140
|
+
}
|
|
141
|
+
if (type == 'symbol') {
|
|
142
|
+
const description = val.description;
|
|
143
|
+
if (description == null) {
|
|
144
|
+
return 'Symbol';
|
|
145
|
+
} else {
|
|
146
|
+
return `Symbol(${description})`;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (type == 'function') {
|
|
150
|
+
const name = val.name;
|
|
151
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
152
|
+
return `Function(${name})`;
|
|
153
|
+
} else {
|
|
154
|
+
return 'Function';
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// objects
|
|
158
|
+
if (Array.isArray(val)) {
|
|
159
|
+
const length = val.length;
|
|
160
|
+
let debug = '[';
|
|
161
|
+
if (length > 0) {
|
|
162
|
+
debug += debugString(val[0]);
|
|
163
|
+
}
|
|
164
|
+
for(let i = 1; i < length; i++) {
|
|
165
|
+
debug += ', ' + debugString(val[i]);
|
|
166
|
+
}
|
|
167
|
+
debug += ']';
|
|
168
|
+
return debug;
|
|
169
|
+
}
|
|
170
|
+
// Test for built-in
|
|
171
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
172
|
+
let className;
|
|
173
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
174
|
+
className = builtInMatches[1];
|
|
175
|
+
} else {
|
|
176
|
+
// Failed to match the standard '[object ClassName]'
|
|
177
|
+
return toString.call(val);
|
|
178
|
+
}
|
|
179
|
+
if (className == 'Object') {
|
|
180
|
+
// we're a user defined class or Object
|
|
181
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
182
|
+
// easier than looping through ownProperties of `val`.
|
|
183
|
+
try {
|
|
184
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
185
|
+
} catch (_) {
|
|
186
|
+
return 'Object';
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// errors
|
|
190
|
+
if (val instanceof Error) {
|
|
191
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
192
|
+
}
|
|
193
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
194
|
+
return className;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function takeFromExternrefTable0(idx) {
|
|
198
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
199
|
+
wasm.__externref_table_dealloc(idx);
|
|
200
|
+
return value;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @param {Logger} logger
|
|
204
|
+
* @param {string | null} [filter]
|
|
205
|
+
* @returns {Promise<void>}
|
|
206
|
+
*/
|
|
207
|
+
export function initLogging(logger, filter) {
|
|
208
|
+
var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
209
|
+
var len0 = WASM_VECTOR_LEN;
|
|
210
|
+
const ret = wasm.initLogging(logger, ptr0, len0);
|
|
211
|
+
return ret;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @param {Network} network
|
|
216
|
+
* @returns {Config}
|
|
217
|
+
*/
|
|
218
|
+
export function defaultConfig(network) {
|
|
219
|
+
const ret = wasm.defaultConfig(network);
|
|
220
|
+
return ret;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @param {string} input
|
|
225
|
+
* @returns {Promise<InputType>}
|
|
226
|
+
*/
|
|
227
|
+
export function parse(input) {
|
|
228
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
229
|
+
const len0 = WASM_VECTOR_LEN;
|
|
230
|
+
const ret = wasm.parse(ptr0, len0);
|
|
231
|
+
return ret;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Entry point invoked by JavaScript in a worker.
|
|
236
|
+
* @param {number} ptr
|
|
237
|
+
*/
|
|
238
|
+
export function task_worker_entry_point(ptr) {
|
|
239
|
+
const ret = wasm.task_worker_entry_point(ptr);
|
|
240
|
+
if (ret[1]) {
|
|
241
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function __wbg_adapter_32(arg0, arg1) {
|
|
246
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hba09e218ab7e6d49(arg0, arg1);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function __wbg_adapter_35(arg0, arg1, arg2) {
|
|
250
|
+
wasm.closure3753_externref_shim(arg0, arg1, arg2);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function __wbg_adapter_252(arg0, arg1, arg2, arg3) {
|
|
254
|
+
wasm.closure4035_externref_shim(arg0, arg1, arg2, arg3);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
258
|
+
|
|
259
|
+
const __wbindgen_enum_ReferrerPolicy = ["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "unsafe-url", "same-origin", "strict-origin", "strict-origin-when-cross-origin"];
|
|
260
|
+
|
|
261
|
+
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
262
|
+
|
|
263
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
264
|
+
|
|
265
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
266
|
+
|
|
267
|
+
const __wbindgen_enum_RequestRedirect = ["follow", "error", "manual"];
|
|
268
|
+
|
|
269
|
+
const BreezSdkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
270
|
+
? { register: () => {}, unregister: () => {} }
|
|
271
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_breezsdk_free(ptr >>> 0, 1));
|
|
272
|
+
|
|
273
|
+
export class BreezSdk {
|
|
274
|
+
|
|
275
|
+
static __wrap(ptr) {
|
|
276
|
+
ptr = ptr >>> 0;
|
|
277
|
+
const obj = Object.create(BreezSdk.prototype);
|
|
278
|
+
obj.__wbg_ptr = ptr;
|
|
279
|
+
BreezSdkFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
280
|
+
return obj;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
__destroy_into_raw() {
|
|
284
|
+
const ptr = this.__wbg_ptr;
|
|
285
|
+
this.__wbg_ptr = 0;
|
|
286
|
+
BreezSdkFinalization.unregister(this);
|
|
287
|
+
return ptr;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
free() {
|
|
291
|
+
const ptr = this.__destroy_into_raw();
|
|
292
|
+
wasm.__wbg_breezsdk_free(ptr, 0);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* @param {EventListener} listener
|
|
296
|
+
* @returns {string}
|
|
297
|
+
*/
|
|
298
|
+
addEventListener(listener) {
|
|
299
|
+
let deferred1_0;
|
|
300
|
+
let deferred1_1;
|
|
301
|
+
try {
|
|
302
|
+
const ret = wasm.breezsdk_addEventListener(this.__wbg_ptr, listener);
|
|
303
|
+
deferred1_0 = ret[0];
|
|
304
|
+
deferred1_1 = ret[1];
|
|
305
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
306
|
+
} finally {
|
|
307
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* @param {string} id
|
|
312
|
+
* @returns {boolean}
|
|
313
|
+
*/
|
|
314
|
+
removeEventListener(id) {
|
|
315
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
316
|
+
const len0 = WASM_VECTOR_LEN;
|
|
317
|
+
const ret = wasm.breezsdk_removeEventListener(this.__wbg_ptr, ptr0, len0);
|
|
318
|
+
return ret !== 0;
|
|
319
|
+
}
|
|
320
|
+
disconnect() {
|
|
321
|
+
const ret = wasm.breezsdk_disconnect(this.__wbg_ptr);
|
|
322
|
+
if (ret[1]) {
|
|
323
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* @param {GetInfoRequest} request
|
|
328
|
+
* @returns {GetInfoResponse}
|
|
329
|
+
*/
|
|
330
|
+
getInfo(request) {
|
|
331
|
+
const ret = wasm.breezsdk_getInfo(this.__wbg_ptr, request);
|
|
332
|
+
if (ret[2]) {
|
|
333
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
334
|
+
}
|
|
335
|
+
return takeFromExternrefTable0(ret[0]);
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* @param {PrepareReceivePaymentRequest} request
|
|
339
|
+
* @returns {PrepareReceivePaymentResponse}
|
|
340
|
+
*/
|
|
341
|
+
prepareReceivePayment(request) {
|
|
342
|
+
const ret = wasm.breezsdk_prepareReceivePayment(this.__wbg_ptr, request);
|
|
343
|
+
if (ret[2]) {
|
|
344
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
345
|
+
}
|
|
346
|
+
return takeFromExternrefTable0(ret[0]);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* @param {ReceivePaymentRequest} request
|
|
350
|
+
* @returns {Promise<ReceivePaymentResponse>}
|
|
351
|
+
*/
|
|
352
|
+
receivePayment(request) {
|
|
353
|
+
const ret = wasm.breezsdk_receivePayment(this.__wbg_ptr, request);
|
|
354
|
+
return ret;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* @param {PrepareSendPaymentRequest} request
|
|
358
|
+
* @returns {Promise<PrepareSendPaymentResponse>}
|
|
359
|
+
*/
|
|
360
|
+
prepareSendPayment(request) {
|
|
361
|
+
const ret = wasm.breezsdk_prepareSendPayment(this.__wbg_ptr, request);
|
|
362
|
+
return ret;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* @param {PrepareLnurlPayRequest} request
|
|
366
|
+
* @returns {Promise<PrepareLnurlPayResponse>}
|
|
367
|
+
*/
|
|
368
|
+
prepareLnurlPay(request) {
|
|
369
|
+
const ret = wasm.breezsdk_prepareLnurlPay(this.__wbg_ptr, request);
|
|
370
|
+
return ret;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* @param {LnurlPayRequest} request
|
|
374
|
+
* @returns {Promise<LnurlPayResponse>}
|
|
375
|
+
*/
|
|
376
|
+
lnurlPay(request) {
|
|
377
|
+
const ret = wasm.breezsdk_lnurlPay(this.__wbg_ptr, request);
|
|
378
|
+
return ret;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* @param {SendPaymentRequest} request
|
|
382
|
+
* @returns {Promise<SendPaymentResponse>}
|
|
383
|
+
*/
|
|
384
|
+
sendPayment(request) {
|
|
385
|
+
const ret = wasm.breezsdk_sendPayment(this.__wbg_ptr, request);
|
|
386
|
+
return ret;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* @param {SyncWalletRequest} request
|
|
390
|
+
* @returns {SyncWalletResponse}
|
|
391
|
+
*/
|
|
392
|
+
syncWallet(request) {
|
|
393
|
+
const ret = wasm.breezsdk_syncWallet(this.__wbg_ptr, request);
|
|
394
|
+
if (ret[2]) {
|
|
395
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
396
|
+
}
|
|
397
|
+
return takeFromExternrefTable0(ret[0]);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* @param {ListPaymentsRequest} request
|
|
401
|
+
* @returns {ListPaymentsResponse}
|
|
402
|
+
*/
|
|
403
|
+
listPayments(request) {
|
|
404
|
+
const ret = wasm.breezsdk_listPayments(this.__wbg_ptr, request);
|
|
405
|
+
if (ret[2]) {
|
|
406
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
407
|
+
}
|
|
408
|
+
return takeFromExternrefTable0(ret[0]);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @param {GetPaymentRequest} request
|
|
412
|
+
* @returns {GetPaymentResponse}
|
|
413
|
+
*/
|
|
414
|
+
getPayment(request) {
|
|
415
|
+
const ret = wasm.breezsdk_getPayment(this.__wbg_ptr, request);
|
|
416
|
+
if (ret[2]) {
|
|
417
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
418
|
+
}
|
|
419
|
+
return takeFromExternrefTable0(ret[0]);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
424
|
+
? { register: () => {}, unregister: () => {} }
|
|
425
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
|
|
426
|
+
|
|
427
|
+
export class IntoUnderlyingByteSource {
|
|
428
|
+
|
|
429
|
+
__destroy_into_raw() {
|
|
430
|
+
const ptr = this.__wbg_ptr;
|
|
431
|
+
this.__wbg_ptr = 0;
|
|
432
|
+
IntoUnderlyingByteSourceFinalization.unregister(this);
|
|
433
|
+
return ptr;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
free() {
|
|
437
|
+
const ptr = this.__destroy_into_raw();
|
|
438
|
+
wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* @returns {ReadableStreamType}
|
|
442
|
+
*/
|
|
443
|
+
get type() {
|
|
444
|
+
const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
|
|
445
|
+
return __wbindgen_enum_ReadableStreamType[ret];
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* @returns {number}
|
|
449
|
+
*/
|
|
450
|
+
get autoAllocateChunkSize() {
|
|
451
|
+
const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
|
|
452
|
+
return ret >>> 0;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* @param {ReadableByteStreamController} controller
|
|
456
|
+
*/
|
|
457
|
+
start(controller) {
|
|
458
|
+
wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* @param {ReadableByteStreamController} controller
|
|
462
|
+
* @returns {Promise<any>}
|
|
463
|
+
*/
|
|
464
|
+
pull(controller) {
|
|
465
|
+
const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
|
|
466
|
+
return ret;
|
|
467
|
+
}
|
|
468
|
+
cancel() {
|
|
469
|
+
const ptr = this.__destroy_into_raw();
|
|
470
|
+
wasm.intounderlyingbytesource_cancel(ptr);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
475
|
+
? { register: () => {}, unregister: () => {} }
|
|
476
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
|
|
477
|
+
|
|
478
|
+
export class IntoUnderlyingSink {
|
|
479
|
+
|
|
480
|
+
__destroy_into_raw() {
|
|
481
|
+
const ptr = this.__wbg_ptr;
|
|
482
|
+
this.__wbg_ptr = 0;
|
|
483
|
+
IntoUnderlyingSinkFinalization.unregister(this);
|
|
484
|
+
return ptr;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
free() {
|
|
488
|
+
const ptr = this.__destroy_into_raw();
|
|
489
|
+
wasm.__wbg_intounderlyingsink_free(ptr, 0);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* @param {any} chunk
|
|
493
|
+
* @returns {Promise<any>}
|
|
494
|
+
*/
|
|
495
|
+
write(chunk) {
|
|
496
|
+
const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
|
|
497
|
+
return ret;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* @returns {Promise<any>}
|
|
501
|
+
*/
|
|
502
|
+
close() {
|
|
503
|
+
const ptr = this.__destroy_into_raw();
|
|
504
|
+
const ret = wasm.intounderlyingsink_close(ptr);
|
|
505
|
+
return ret;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* @param {any} reason
|
|
509
|
+
* @returns {Promise<any>}
|
|
510
|
+
*/
|
|
511
|
+
abort(reason) {
|
|
512
|
+
const ptr = this.__destroy_into_raw();
|
|
513
|
+
const ret = wasm.intounderlyingsink_abort(ptr, reason);
|
|
514
|
+
return ret;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
519
|
+
? { register: () => {}, unregister: () => {} }
|
|
520
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
|
|
521
|
+
|
|
522
|
+
export class IntoUnderlyingSource {
|
|
523
|
+
|
|
524
|
+
__destroy_into_raw() {
|
|
525
|
+
const ptr = this.__wbg_ptr;
|
|
526
|
+
this.__wbg_ptr = 0;
|
|
527
|
+
IntoUnderlyingSourceFinalization.unregister(this);
|
|
528
|
+
return ptr;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
free() {
|
|
532
|
+
const ptr = this.__destroy_into_raw();
|
|
533
|
+
wasm.__wbg_intounderlyingsource_free(ptr, 0);
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* @param {ReadableStreamDefaultController} controller
|
|
537
|
+
* @returns {Promise<any>}
|
|
538
|
+
*/
|
|
539
|
+
pull(controller) {
|
|
540
|
+
const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
|
|
541
|
+
return ret;
|
|
542
|
+
}
|
|
543
|
+
cancel() {
|
|
544
|
+
const ptr = this.__destroy_into_raw();
|
|
545
|
+
wasm.intounderlyingsource_cancel(ptr);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const SdkBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
550
|
+
? { register: () => {}, unregister: () => {} }
|
|
551
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sdkbuilder_free(ptr >>> 0, 1));
|
|
552
|
+
|
|
553
|
+
export class SdkBuilder {
|
|
554
|
+
|
|
555
|
+
static __wrap(ptr) {
|
|
556
|
+
ptr = ptr >>> 0;
|
|
557
|
+
const obj = Object.create(SdkBuilder.prototype);
|
|
558
|
+
obj.__wbg_ptr = ptr;
|
|
559
|
+
SdkBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
560
|
+
return obj;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
__destroy_into_raw() {
|
|
564
|
+
const ptr = this.__wbg_ptr;
|
|
565
|
+
this.__wbg_ptr = 0;
|
|
566
|
+
SdkBuilderFinalization.unregister(this);
|
|
567
|
+
return ptr;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
free() {
|
|
571
|
+
const ptr = this.__destroy_into_raw();
|
|
572
|
+
wasm.__wbg_sdkbuilder_free(ptr, 0);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* @param {Config} config
|
|
576
|
+
* @param {string} mnemonic
|
|
577
|
+
* @param {string} data_dir
|
|
578
|
+
* @returns {SdkBuilder}
|
|
579
|
+
*/
|
|
580
|
+
static new(config, mnemonic, data_dir) {
|
|
581
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
582
|
+
const len0 = WASM_VECTOR_LEN;
|
|
583
|
+
const ptr1 = passStringToWasm0(data_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
584
|
+
const len1 = WASM_VECTOR_LEN;
|
|
585
|
+
const ret = wasm.sdkbuilder_new(config, ptr0, len0, ptr1, len1);
|
|
586
|
+
if (ret[2]) {
|
|
587
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
588
|
+
}
|
|
589
|
+
return SdkBuilder.__wrap(ret[0]);
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* @param {string} url
|
|
593
|
+
* @param {Credentials | null} [credentials]
|
|
594
|
+
* @returns {SdkBuilder}
|
|
595
|
+
*/
|
|
596
|
+
withRestChainService(url, credentials) {
|
|
597
|
+
const ptr = this.__destroy_into_raw();
|
|
598
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
599
|
+
const len0 = WASM_VECTOR_LEN;
|
|
600
|
+
const ret = wasm.sdkbuilder_withRestChainService(ptr, ptr0, len0, isLikeNone(credentials) ? 0 : addToExternrefTable0(credentials));
|
|
601
|
+
return SdkBuilder.__wrap(ret);
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* @returns {Promise<BreezSdk>}
|
|
605
|
+
*/
|
|
606
|
+
build() {
|
|
607
|
+
const ptr = this.__destroy_into_raw();
|
|
608
|
+
const ret = wasm.sdkbuilder_build(ptr);
|
|
609
|
+
return ret;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
const imports = {
|
|
614
|
+
__wbindgen_placeholder__: {
|
|
615
|
+
__wbg_abort_410ec47a64ac6117: function(arg0, arg1) {
|
|
616
|
+
arg0.abort(arg1);
|
|
617
|
+
},
|
|
618
|
+
__wbg_abort_775ef1d17fc65868: function(arg0) {
|
|
619
|
+
arg0.abort();
|
|
620
|
+
},
|
|
621
|
+
__wbg_append_8c7dd8d641a5f01b: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
622
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
623
|
+
}, arguments) },
|
|
624
|
+
__wbg_arrayBuffer_d1b44c4390db422f: function() { return handleError(function (arg0) {
|
|
625
|
+
const ret = arg0.arrayBuffer();
|
|
626
|
+
return ret;
|
|
627
|
+
}, arguments) },
|
|
628
|
+
__wbg_body_0b8fd1fe671660df: function(arg0) {
|
|
629
|
+
const ret = arg0.body;
|
|
630
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
631
|
+
},
|
|
632
|
+
__wbg_breezsdk_new: function(arg0) {
|
|
633
|
+
const ret = BreezSdk.__wrap(arg0);
|
|
634
|
+
return ret;
|
|
635
|
+
},
|
|
636
|
+
__wbg_buffer_09165b52af8c5237: function(arg0) {
|
|
637
|
+
const ret = arg0.buffer;
|
|
638
|
+
return ret;
|
|
639
|
+
},
|
|
640
|
+
__wbg_buffer_609cc3eee51ed158: function(arg0) {
|
|
641
|
+
const ret = arg0.buffer;
|
|
642
|
+
return ret;
|
|
643
|
+
},
|
|
644
|
+
__wbg_byobRequest_77d9adf63337edfb: function(arg0) {
|
|
645
|
+
const ret = arg0.byobRequest;
|
|
646
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
647
|
+
},
|
|
648
|
+
__wbg_byteLength_e674b853d9c77e1d: function(arg0) {
|
|
649
|
+
const ret = arg0.byteLength;
|
|
650
|
+
return ret;
|
|
651
|
+
},
|
|
652
|
+
__wbg_byteOffset_fd862df290ef848d: function(arg0) {
|
|
653
|
+
const ret = arg0.byteOffset;
|
|
654
|
+
return ret;
|
|
655
|
+
},
|
|
656
|
+
__wbg_call_672a4d21634d4a24: function() { return handleError(function (arg0, arg1) {
|
|
657
|
+
const ret = arg0.call(arg1);
|
|
658
|
+
return ret;
|
|
659
|
+
}, arguments) },
|
|
660
|
+
__wbg_call_7cccdd69e0791ae2: function() { return handleError(function (arg0, arg1, arg2) {
|
|
661
|
+
const ret = arg0.call(arg1, arg2);
|
|
662
|
+
return ret;
|
|
663
|
+
}, arguments) },
|
|
664
|
+
__wbg_cancel_8a308660caa6cadf: function(arg0) {
|
|
665
|
+
const ret = arg0.cancel();
|
|
666
|
+
return ret;
|
|
667
|
+
},
|
|
668
|
+
__wbg_catch_a6e601879b2610e9: function(arg0, arg1) {
|
|
669
|
+
const ret = arg0.catch(arg1);
|
|
670
|
+
return ret;
|
|
671
|
+
},
|
|
672
|
+
__wbg_clearTimeout_0b53d391c1b94dda: function(arg0) {
|
|
673
|
+
const ret = clearTimeout(arg0);
|
|
674
|
+
return ret;
|
|
675
|
+
},
|
|
676
|
+
__wbg_close_304cc1fef3466669: function() { return handleError(function (arg0) {
|
|
677
|
+
arg0.close();
|
|
678
|
+
}, arguments) },
|
|
679
|
+
__wbg_close_5ce03e29be453811: function() { return handleError(function (arg0) {
|
|
680
|
+
arg0.close();
|
|
681
|
+
}, arguments) },
|
|
682
|
+
__wbg_crypto_574e78ad8b13b65f: function(arg0) {
|
|
683
|
+
const ret = arg0.crypto;
|
|
684
|
+
return ret;
|
|
685
|
+
},
|
|
686
|
+
__wbg_done_769e5ede4b31c67b: function(arg0) {
|
|
687
|
+
const ret = arg0.done;
|
|
688
|
+
return ret;
|
|
689
|
+
},
|
|
690
|
+
__wbg_enqueue_bb16ba72f537dc9e: function() { return handleError(function (arg0, arg1) {
|
|
691
|
+
arg0.enqueue(arg1);
|
|
692
|
+
}, arguments) },
|
|
693
|
+
__wbg_error_e98c298703cffa97: function(arg0, arg1) {
|
|
694
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
695
|
+
},
|
|
696
|
+
__wbg_fetch_07cd86dd296a5a63: function(arg0, arg1, arg2) {
|
|
697
|
+
const ret = arg0.fetch(arg1, arg2);
|
|
698
|
+
return ret;
|
|
699
|
+
},
|
|
700
|
+
__wbg_fetch_11bff8299d0ecd2b: function(arg0) {
|
|
701
|
+
const ret = fetch(arg0);
|
|
702
|
+
return ret;
|
|
703
|
+
},
|
|
704
|
+
__wbg_fetch_509096533071c657: function(arg0, arg1) {
|
|
705
|
+
const ret = arg0.fetch(arg1);
|
|
706
|
+
return ret;
|
|
707
|
+
},
|
|
708
|
+
__wbg_fetch_769f3df592e37b75: function(arg0, arg1) {
|
|
709
|
+
const ret = fetch(arg0, arg1);
|
|
710
|
+
return ret;
|
|
711
|
+
},
|
|
712
|
+
__wbg_getDate_ef336e14594b35ce: function(arg0) {
|
|
713
|
+
const ret = arg0.getDate();
|
|
714
|
+
return ret;
|
|
715
|
+
},
|
|
716
|
+
__wbg_getDay_3da98b461c969439: function(arg0) {
|
|
717
|
+
const ret = arg0.getDay();
|
|
718
|
+
return ret;
|
|
719
|
+
},
|
|
720
|
+
__wbg_getFullYear_17d3c9e4db748eb7: function(arg0) {
|
|
721
|
+
const ret = arg0.getFullYear();
|
|
722
|
+
return ret;
|
|
723
|
+
},
|
|
724
|
+
__wbg_getHours_70451b8de3ce8638: function(arg0) {
|
|
725
|
+
const ret = arg0.getHours();
|
|
726
|
+
return ret;
|
|
727
|
+
},
|
|
728
|
+
__wbg_getMinutes_e793d718371e18f7: function(arg0) {
|
|
729
|
+
const ret = arg0.getMinutes();
|
|
730
|
+
return ret;
|
|
731
|
+
},
|
|
732
|
+
__wbg_getMonth_d37edcd23642c97d: function(arg0) {
|
|
733
|
+
const ret = arg0.getMonth();
|
|
734
|
+
return ret;
|
|
735
|
+
},
|
|
736
|
+
__wbg_getRandomValues_8e6341dd77432a34: function() { return handleError(function (arg0, arg1) {
|
|
737
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
738
|
+
}, arguments) },
|
|
739
|
+
__wbg_getRandomValues_b8f5dbd5f3995a9e: function() { return handleError(function (arg0, arg1) {
|
|
740
|
+
arg0.getRandomValues(arg1);
|
|
741
|
+
}, arguments) },
|
|
742
|
+
__wbg_getRandomValues_e14bd3de0db61032: function() { return handleError(function (arg0, arg1) {
|
|
743
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
744
|
+
}, arguments) },
|
|
745
|
+
__wbg_getReader_48e00749fe3f6089: function() { return handleError(function (arg0) {
|
|
746
|
+
const ret = arg0.getReader();
|
|
747
|
+
return ret;
|
|
748
|
+
}, arguments) },
|
|
749
|
+
__wbg_getSeconds_755197b634cca692: function(arg0) {
|
|
750
|
+
const ret = arg0.getSeconds();
|
|
751
|
+
return ret;
|
|
752
|
+
},
|
|
753
|
+
__wbg_getTime_46267b1c24877e30: function(arg0) {
|
|
754
|
+
const ret = arg0.getTime();
|
|
755
|
+
return ret;
|
|
756
|
+
},
|
|
757
|
+
__wbg_getTimezoneOffset_6b5752021c499c47: function(arg0) {
|
|
758
|
+
const ret = arg0.getTimezoneOffset();
|
|
759
|
+
return ret;
|
|
760
|
+
},
|
|
761
|
+
__wbg_get_67b2ba62fc30de12: function() { return handleError(function (arg0, arg1) {
|
|
762
|
+
const ret = Reflect.get(arg0, arg1);
|
|
763
|
+
return ret;
|
|
764
|
+
}, arguments) },
|
|
765
|
+
__wbg_get_b9b93047fe3cf45b: function(arg0, arg1) {
|
|
766
|
+
const ret = arg0[arg1 >>> 0];
|
|
767
|
+
return ret;
|
|
768
|
+
},
|
|
769
|
+
__wbg_getdone_d47073731acd3e74: function(arg0) {
|
|
770
|
+
const ret = arg0.done;
|
|
771
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
772
|
+
},
|
|
773
|
+
__wbg_getvalue_009dcd63692bee1f: function(arg0) {
|
|
774
|
+
const ret = arg0.value;
|
|
775
|
+
return ret;
|
|
776
|
+
},
|
|
777
|
+
__wbg_has_a5ea9117f258a0ec: function() { return handleError(function (arg0, arg1) {
|
|
778
|
+
const ret = Reflect.has(arg0, arg1);
|
|
779
|
+
return ret;
|
|
780
|
+
}, arguments) },
|
|
781
|
+
__wbg_headers_9cb51cfd2ac780a4: function(arg0) {
|
|
782
|
+
const ret = arg0.headers;
|
|
783
|
+
return ret;
|
|
784
|
+
},
|
|
785
|
+
__wbg_instanceof_Response_f2cc20d9f7dfd644: function(arg0) {
|
|
786
|
+
let result;
|
|
787
|
+
try {
|
|
788
|
+
result = arg0 instanceof Response;
|
|
789
|
+
} catch (_) {
|
|
790
|
+
result = false;
|
|
791
|
+
}
|
|
792
|
+
const ret = result;
|
|
793
|
+
return ret;
|
|
794
|
+
},
|
|
795
|
+
__wbg_iterator_9a24c88df860dc65: function() {
|
|
796
|
+
const ret = Symbol.iterator;
|
|
797
|
+
return ret;
|
|
798
|
+
},
|
|
799
|
+
__wbg_length_a446193dc22c12f8: function(arg0) {
|
|
800
|
+
const ret = arg0.length;
|
|
801
|
+
return ret;
|
|
802
|
+
},
|
|
803
|
+
__wbg_length_d56737991078581b: function(arg0) {
|
|
804
|
+
const ret = arg0.length;
|
|
805
|
+
return ret;
|
|
806
|
+
},
|
|
807
|
+
__wbg_log_62b3ddcc89229688: function(arg0, arg1) {
|
|
808
|
+
arg0.log(arg1);
|
|
809
|
+
},
|
|
810
|
+
__wbg_msCrypto_a61aeb35a24c1329: function(arg0) {
|
|
811
|
+
const ret = arg0.msCrypto;
|
|
812
|
+
return ret;
|
|
813
|
+
},
|
|
814
|
+
__wbg_new0_f788a2397c7ca929: function() {
|
|
815
|
+
const ret = new Date();
|
|
816
|
+
return ret;
|
|
817
|
+
},
|
|
818
|
+
__wbg_new_018dcc2d6c8c2f6a: function() { return handleError(function () {
|
|
819
|
+
const ret = new Headers();
|
|
820
|
+
return ret;
|
|
821
|
+
}, arguments) },
|
|
822
|
+
__wbg_new_23a2665fac83c611: function(arg0, arg1) {
|
|
823
|
+
try {
|
|
824
|
+
var state0 = {a: arg0, b: arg1};
|
|
825
|
+
var cb0 = (arg0, arg1) => {
|
|
826
|
+
const a = state0.a;
|
|
827
|
+
state0.a = 0;
|
|
828
|
+
try {
|
|
829
|
+
return __wbg_adapter_252(a, state0.b, arg0, arg1);
|
|
830
|
+
} finally {
|
|
831
|
+
state0.a = a;
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
const ret = new Promise(cb0);
|
|
835
|
+
return ret;
|
|
836
|
+
} finally {
|
|
837
|
+
state0.a = state0.b = 0;
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
__wbg_new_31a97dac4f10fab7: function(arg0) {
|
|
841
|
+
const ret = new Date(arg0);
|
|
842
|
+
return ret;
|
|
843
|
+
},
|
|
844
|
+
__wbg_new_405e22f390576ce2: function() {
|
|
845
|
+
const ret = new Object();
|
|
846
|
+
return ret;
|
|
847
|
+
},
|
|
848
|
+
__wbg_new_a12002a7f91c75be: function(arg0) {
|
|
849
|
+
const ret = new Uint8Array(arg0);
|
|
850
|
+
return ret;
|
|
851
|
+
},
|
|
852
|
+
__wbg_new_c68d7209be747379: function(arg0, arg1) {
|
|
853
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
854
|
+
return ret;
|
|
855
|
+
},
|
|
856
|
+
__wbg_new_e25e5aab09ff45db: function() { return handleError(function () {
|
|
857
|
+
const ret = new AbortController();
|
|
858
|
+
return ret;
|
|
859
|
+
}, arguments) },
|
|
860
|
+
__wbg_newnoargs_105ed471475aaf50: function(arg0, arg1) {
|
|
861
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
862
|
+
return ret;
|
|
863
|
+
},
|
|
864
|
+
__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a: function(arg0, arg1, arg2) {
|
|
865
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
866
|
+
return ret;
|
|
867
|
+
},
|
|
868
|
+
__wbg_newwithlength_a381634e90c276d4: function(arg0) {
|
|
869
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
870
|
+
return ret;
|
|
871
|
+
},
|
|
872
|
+
__wbg_newwithstrandinit_06c535e0a867c635: function() { return handleError(function (arg0, arg1, arg2) {
|
|
873
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
874
|
+
return ret;
|
|
875
|
+
}, arguments) },
|
|
876
|
+
__wbg_newwithyearmonthday_03748851282a850d: function(arg0, arg1, arg2) {
|
|
877
|
+
const ret = new Date(arg0 >>> 0, arg1, arg2);
|
|
878
|
+
return ret;
|
|
879
|
+
},
|
|
880
|
+
__wbg_next_25feadfc0913fea9: function(arg0) {
|
|
881
|
+
const ret = arg0.next;
|
|
882
|
+
return ret;
|
|
883
|
+
},
|
|
884
|
+
__wbg_next_6574e1a8a62d1055: function() { return handleError(function (arg0) {
|
|
885
|
+
const ret = arg0.next();
|
|
886
|
+
return ret;
|
|
887
|
+
}, arguments) },
|
|
888
|
+
__wbg_node_905d3e251edff8a2: function(arg0) {
|
|
889
|
+
const ret = arg0.node;
|
|
890
|
+
return ret;
|
|
891
|
+
},
|
|
892
|
+
__wbg_now_2c95c9de01293173: function(arg0) {
|
|
893
|
+
const ret = arg0.now();
|
|
894
|
+
return ret;
|
|
895
|
+
},
|
|
896
|
+
__wbg_now_2f0bbf3fd348701f: function(arg0) {
|
|
897
|
+
const ret = globalThis.performance.now();
|
|
898
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
899
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
900
|
+
},
|
|
901
|
+
__wbg_now_6af59e24f5a53ad4: function() { return handleError(function () {
|
|
902
|
+
const ret = Date.now();
|
|
903
|
+
return ret;
|
|
904
|
+
}, arguments) },
|
|
905
|
+
__wbg_now_807e54c39636c349: function() {
|
|
906
|
+
const ret = Date.now();
|
|
907
|
+
return ret;
|
|
908
|
+
},
|
|
909
|
+
__wbg_onEvent_3a18bdd7cfd911cb: function(arg0, arg1) {
|
|
910
|
+
arg0.onEvent(arg1);
|
|
911
|
+
},
|
|
912
|
+
__wbg_parse_def2e24ef1252aff: function() { return handleError(function (arg0, arg1) {
|
|
913
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
914
|
+
return ret;
|
|
915
|
+
}, arguments) },
|
|
916
|
+
__wbg_performance_7a3ffd0b17f663ad: function(arg0) {
|
|
917
|
+
const ret = arg0.performance;
|
|
918
|
+
return ret;
|
|
919
|
+
},
|
|
920
|
+
__wbg_postMessage_83a8d58d3fcb6c13: function() { return handleError(function (arg0, arg1) {
|
|
921
|
+
arg0.postMessage(arg1);
|
|
922
|
+
}, arguments) },
|
|
923
|
+
__wbg_process_dc0fbacc7c1c06f7: function(arg0) {
|
|
924
|
+
const ret = arg0.process;
|
|
925
|
+
return ret;
|
|
926
|
+
},
|
|
927
|
+
__wbg_queueMicrotask_97d92b4fcc8a61c5: function(arg0) {
|
|
928
|
+
queueMicrotask(arg0);
|
|
929
|
+
},
|
|
930
|
+
__wbg_queueMicrotask_d3219def82552485: function(arg0) {
|
|
931
|
+
const ret = arg0.queueMicrotask;
|
|
932
|
+
return ret;
|
|
933
|
+
},
|
|
934
|
+
__wbg_randomFillSync_ac0988aba3254290: function() { return handleError(function (arg0, arg1) {
|
|
935
|
+
arg0.randomFillSync(arg1);
|
|
936
|
+
}, arguments) },
|
|
937
|
+
__wbg_random_3ad904d98382defe: function() {
|
|
938
|
+
const ret = Math.random();
|
|
939
|
+
return ret;
|
|
940
|
+
},
|
|
941
|
+
__wbg_read_a2434af1186cb56c: function(arg0) {
|
|
942
|
+
const ret = arg0.read();
|
|
943
|
+
return ret;
|
|
944
|
+
},
|
|
945
|
+
__wbg_releaseLock_091899af97991d2e: function(arg0) {
|
|
946
|
+
arg0.releaseLock();
|
|
947
|
+
},
|
|
948
|
+
__wbg_require_60cc747a6bc5215a: function() { return handleError(function () {
|
|
949
|
+
const ret = module.require;
|
|
950
|
+
return ret;
|
|
951
|
+
}, arguments) },
|
|
952
|
+
__wbg_resolve_4851785c9c5f573d: function(arg0) {
|
|
953
|
+
const ret = Promise.resolve(arg0);
|
|
954
|
+
return ret;
|
|
955
|
+
},
|
|
956
|
+
__wbg_respond_1f279fa9f8edcb1c: function() { return handleError(function (arg0, arg1) {
|
|
957
|
+
arg0.respond(arg1 >>> 0);
|
|
958
|
+
}, arguments) },
|
|
959
|
+
__wbg_setTimeout_73ce8df12de4f2f2: function(arg0, arg1) {
|
|
960
|
+
const ret = setTimeout(arg0, arg1);
|
|
961
|
+
return ret;
|
|
962
|
+
},
|
|
963
|
+
__wbg_setTimeout_8f06012fba12034e: function(arg0, arg1) {
|
|
964
|
+
globalThis.setTimeout(arg0, arg1);
|
|
965
|
+
},
|
|
966
|
+
__wbg_set_65595bdd868b3009: function(arg0, arg1, arg2) {
|
|
967
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
968
|
+
},
|
|
969
|
+
__wbg_setbody_5923b78a95eedf29: function(arg0, arg1) {
|
|
970
|
+
arg0.body = arg1;
|
|
971
|
+
},
|
|
972
|
+
__wbg_setcache_12f17c3a980650e4: function(arg0, arg1) {
|
|
973
|
+
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
974
|
+
},
|
|
975
|
+
__wbg_setcredentials_c3a22f1cd105a2c6: function(arg0, arg1) {
|
|
976
|
+
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
977
|
+
},
|
|
978
|
+
__wbg_setheaders_834c0bdb6a8949ad: function(arg0, arg1) {
|
|
979
|
+
arg0.headers = arg1;
|
|
980
|
+
},
|
|
981
|
+
__wbg_setintegrity_564a2397cf837760: function(arg0, arg1, arg2) {
|
|
982
|
+
arg0.integrity = getStringFromWasm0(arg1, arg2);
|
|
983
|
+
},
|
|
984
|
+
__wbg_setmethod_3c5280fe5d890842: function(arg0, arg1, arg2) {
|
|
985
|
+
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
986
|
+
},
|
|
987
|
+
__wbg_setmode_5dc300b865044b65: function(arg0, arg1) {
|
|
988
|
+
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
989
|
+
},
|
|
990
|
+
__wbg_setredirect_40e6a7f717a2f86a: function(arg0, arg1) {
|
|
991
|
+
arg0.redirect = __wbindgen_enum_RequestRedirect[arg1];
|
|
992
|
+
},
|
|
993
|
+
__wbg_setreferrer_fea46c1230e5e29a: function(arg0, arg1, arg2) {
|
|
994
|
+
arg0.referrer = getStringFromWasm0(arg1, arg2);
|
|
995
|
+
},
|
|
996
|
+
__wbg_setreferrerpolicy_b73612479f761b6f: function(arg0, arg1) {
|
|
997
|
+
arg0.referrerPolicy = __wbindgen_enum_ReferrerPolicy[arg1];
|
|
998
|
+
},
|
|
999
|
+
__wbg_setsignal_75b21ef3a81de905: function(arg0, arg1) {
|
|
1000
|
+
arg0.signal = arg1;
|
|
1001
|
+
},
|
|
1002
|
+
__wbg_signal_aaf9ad74119f20a4: function(arg0) {
|
|
1003
|
+
const ret = arg0.signal;
|
|
1004
|
+
return ret;
|
|
1005
|
+
},
|
|
1006
|
+
__wbg_slice_972c243648c9fd2e: function(arg0, arg1, arg2) {
|
|
1007
|
+
const ret = arg0.slice(arg1 >>> 0, arg2 >>> 0);
|
|
1008
|
+
return ret;
|
|
1009
|
+
},
|
|
1010
|
+
__wbg_static_accessor_GLOBAL_88a902d13a557d07: function() {
|
|
1011
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1012
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1013
|
+
},
|
|
1014
|
+
__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0: function() {
|
|
1015
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1016
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1017
|
+
},
|
|
1018
|
+
__wbg_static_accessor_SELF_37c5d418e4bf5819: function() {
|
|
1019
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1020
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1021
|
+
},
|
|
1022
|
+
__wbg_static_accessor_WINDOW_5de37043a91a9c40: function() {
|
|
1023
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1024
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1025
|
+
},
|
|
1026
|
+
__wbg_status_f6360336ca686bf0: function(arg0) {
|
|
1027
|
+
const ret = arg0.status;
|
|
1028
|
+
return ret;
|
|
1029
|
+
},
|
|
1030
|
+
__wbg_stringify_f7ed6987935b4a24: function() { return handleError(function (arg0) {
|
|
1031
|
+
const ret = JSON.stringify(arg0);
|
|
1032
|
+
return ret;
|
|
1033
|
+
}, arguments) },
|
|
1034
|
+
__wbg_subarray_aa9065fa9dc5df96: function(arg0, arg1, arg2) {
|
|
1035
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1036
|
+
return ret;
|
|
1037
|
+
},
|
|
1038
|
+
__wbg_text_7805bea50de2af49: function() { return handleError(function (arg0) {
|
|
1039
|
+
const ret = arg0.text();
|
|
1040
|
+
return ret;
|
|
1041
|
+
}, arguments) },
|
|
1042
|
+
__wbg_then_44b73946d2fb3e7d: function(arg0, arg1) {
|
|
1043
|
+
const ret = arg0.then(arg1);
|
|
1044
|
+
return ret;
|
|
1045
|
+
},
|
|
1046
|
+
__wbg_then_48b406749878a531: function(arg0, arg1, arg2) {
|
|
1047
|
+
const ret = arg0.then(arg1, arg2);
|
|
1048
|
+
return ret;
|
|
1049
|
+
},
|
|
1050
|
+
__wbg_toString_5285597960676b7b: function(arg0) {
|
|
1051
|
+
const ret = arg0.toString();
|
|
1052
|
+
return ret;
|
|
1053
|
+
},
|
|
1054
|
+
__wbg_toString_ba82658ec370add0: function() { return handleError(function (arg0, arg1) {
|
|
1055
|
+
const ret = arg0.toString(arg1);
|
|
1056
|
+
return ret;
|
|
1057
|
+
}, arguments) },
|
|
1058
|
+
__wbg_url_ae10c34ca209681d: function(arg0, arg1) {
|
|
1059
|
+
const ret = arg1.url;
|
|
1060
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1061
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1062
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1063
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1064
|
+
},
|
|
1065
|
+
__wbg_value_cd1ffa7b1ab794f1: function(arg0) {
|
|
1066
|
+
const ret = arg0.value;
|
|
1067
|
+
return ret;
|
|
1068
|
+
},
|
|
1069
|
+
__wbg_versions_c01dfd4722a88165: function(arg0) {
|
|
1070
|
+
const ret = arg0.versions;
|
|
1071
|
+
return ret;
|
|
1072
|
+
},
|
|
1073
|
+
__wbg_view_fd8a56e8983f448d: function(arg0) {
|
|
1074
|
+
const ret = arg0.view;
|
|
1075
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1076
|
+
},
|
|
1077
|
+
__wbindgen_cb_drop: function(arg0) {
|
|
1078
|
+
const obj = arg0.original;
|
|
1079
|
+
if (obj.cnt-- == 1) {
|
|
1080
|
+
obj.a = 0;
|
|
1081
|
+
return true;
|
|
1082
|
+
}
|
|
1083
|
+
const ret = false;
|
|
1084
|
+
return ret;
|
|
1085
|
+
},
|
|
1086
|
+
__wbindgen_closure_wrapper11718: function(arg0, arg1, arg2) {
|
|
1087
|
+
const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_32);
|
|
1088
|
+
return ret;
|
|
1089
|
+
},
|
|
1090
|
+
__wbindgen_closure_wrapper11751: function(arg0, arg1, arg2) {
|
|
1091
|
+
const ret = makeMutClosure(arg0, arg1, 3754, __wbg_adapter_35);
|
|
1092
|
+
return ret;
|
|
1093
|
+
},
|
|
1094
|
+
__wbindgen_debug_string: function(arg0, arg1) {
|
|
1095
|
+
const ret = debugString(arg1);
|
|
1096
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1097
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1098
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1099
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1100
|
+
},
|
|
1101
|
+
__wbindgen_error_new: function(arg0, arg1) {
|
|
1102
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1103
|
+
return ret;
|
|
1104
|
+
},
|
|
1105
|
+
__wbindgen_init_externref_table: function() {
|
|
1106
|
+
const table = wasm.__wbindgen_export_2;
|
|
1107
|
+
const offset = table.grow(4);
|
|
1108
|
+
table.set(0, undefined);
|
|
1109
|
+
table.set(offset + 0, undefined);
|
|
1110
|
+
table.set(offset + 1, null);
|
|
1111
|
+
table.set(offset + 2, true);
|
|
1112
|
+
table.set(offset + 3, false);
|
|
1113
|
+
;
|
|
1114
|
+
},
|
|
1115
|
+
__wbindgen_is_function: function(arg0) {
|
|
1116
|
+
const ret = typeof(arg0) === 'function';
|
|
1117
|
+
return ret;
|
|
1118
|
+
},
|
|
1119
|
+
__wbindgen_is_object: function(arg0) {
|
|
1120
|
+
const val = arg0;
|
|
1121
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1122
|
+
return ret;
|
|
1123
|
+
},
|
|
1124
|
+
__wbindgen_is_string: function(arg0) {
|
|
1125
|
+
const ret = typeof(arg0) === 'string';
|
|
1126
|
+
return ret;
|
|
1127
|
+
},
|
|
1128
|
+
__wbindgen_is_undefined: function(arg0) {
|
|
1129
|
+
const ret = arg0 === undefined;
|
|
1130
|
+
return ret;
|
|
1131
|
+
},
|
|
1132
|
+
__wbindgen_memory: function() {
|
|
1133
|
+
const ret = wasm.memory;
|
|
1134
|
+
return ret;
|
|
1135
|
+
},
|
|
1136
|
+
__wbindgen_number_new: function(arg0) {
|
|
1137
|
+
const ret = arg0;
|
|
1138
|
+
return ret;
|
|
1139
|
+
},
|
|
1140
|
+
__wbindgen_string_get: function(arg0, arg1) {
|
|
1141
|
+
const obj = arg1;
|
|
1142
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1143
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1144
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1145
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1146
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1147
|
+
},
|
|
1148
|
+
__wbindgen_string_new: function(arg0, arg1) {
|
|
1149
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1150
|
+
return ret;
|
|
1151
|
+
},
|
|
1152
|
+
__wbindgen_throw: function(arg0, arg1) {
|
|
1153
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1154
|
+
},
|
|
1155
|
+
},
|
|
1156
|
+
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
const wasm_url = new URL('breez_sdk_spark_wasm_bg.wasm', import.meta.url);
|
|
1160
|
+
let wasmCode = '';
|
|
1161
|
+
switch (wasm_url.protocol) {
|
|
1162
|
+
case 'file:':
|
|
1163
|
+
wasmCode = await Deno.readFile(wasm_url);
|
|
1164
|
+
break
|
|
1165
|
+
case 'https:':
|
|
1166
|
+
case 'http:':
|
|
1167
|
+
wasmCode = await (await fetch(wasm_url)).arrayBuffer();
|
|
1168
|
+
break
|
|
1169
|
+
default:
|
|
1170
|
+
throw new Error(`Unsupported protocol: ${wasm_url.protocol}`);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
const wasmInstance = (await WebAssembly.instantiate(wasmCode, imports)).instance;
|
|
1174
|
+
const wasm = wasmInstance.exports;
|
|
1175
|
+
export const __wasm = wasm;
|
|
1176
|
+
|
|
1177
|
+
wasm.__wbindgen_start();
|
|
1178
|
+
|