@cartridge/controller-wasm 0.7.14-3d082f2 → 0.7.14-44f18f37

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.
@@ -1,471 +1,6 @@
1
1
  import { Mutex } from './snippets/account-wasm-35da9c7350cbc3ae/src/wasm-mutex.js';
2
2
 
3
- let wasm;
4
- export function __wbg_set_wasm(val) {
5
- wasm = val;
6
- }
7
-
8
-
9
- let cachedUint8ArrayMemory0 = null;
10
-
11
- function getUint8ArrayMemory0() {
12
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
13
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
14
- }
15
- return cachedUint8ArrayMemory0;
16
- }
17
-
18
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
19
-
20
- cachedTextDecoder.decode();
21
-
22
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
23
- let numBytesDecoded = 0;
24
- function decodeText(ptr, len) {
25
- numBytesDecoded += len;
26
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
27
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
28
- cachedTextDecoder.decode();
29
- numBytesDecoded = len;
30
- }
31
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
32
- }
33
-
34
- function getStringFromWasm0(ptr, len) {
35
- ptr = ptr >>> 0;
36
- return decodeText(ptr, len);
37
- }
38
-
39
- let heap = new Array(128).fill(undefined);
40
-
41
- heap.push(undefined, null, true, false);
42
-
43
- let heap_next = heap.length;
44
-
45
- function addHeapObject(obj) {
46
- if (heap_next === heap.length) heap.push(heap.length + 1);
47
- const idx = heap_next;
48
- heap_next = heap[idx];
49
-
50
- heap[idx] = obj;
51
- return idx;
52
- }
53
-
54
- function getObject(idx) { return heap[idx]; }
55
-
56
- let WASM_VECTOR_LEN = 0;
57
-
58
- const cachedTextEncoder = new TextEncoder();
59
-
60
- if (!('encodeInto' in cachedTextEncoder)) {
61
- cachedTextEncoder.encodeInto = function (arg, view) {
62
- const buf = cachedTextEncoder.encode(arg);
63
- view.set(buf);
64
- return {
65
- read: arg.length,
66
- written: buf.length
67
- };
68
- }
69
- }
70
-
71
- function passStringToWasm0(arg, malloc, realloc) {
72
-
73
- if (realloc === undefined) {
74
- const buf = cachedTextEncoder.encode(arg);
75
- const ptr = malloc(buf.length, 1) >>> 0;
76
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
77
- WASM_VECTOR_LEN = buf.length;
78
- return ptr;
79
- }
80
-
81
- let len = arg.length;
82
- let ptr = malloc(len, 1) >>> 0;
83
-
84
- const mem = getUint8ArrayMemory0();
85
-
86
- let offset = 0;
87
-
88
- for (; offset < len; offset++) {
89
- const code = arg.charCodeAt(offset);
90
- if (code > 0x7F) break;
91
- mem[ptr + offset] = code;
92
- }
93
-
94
- if (offset !== len) {
95
- if (offset !== 0) {
96
- arg = arg.slice(offset);
97
- }
98
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
99
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
100
- const ret = cachedTextEncoder.encodeInto(arg, view);
101
-
102
- offset += ret.written;
103
- ptr = realloc(ptr, len, offset, 1) >>> 0;
104
- }
105
-
106
- WASM_VECTOR_LEN = offset;
107
- return ptr;
108
- }
109
-
110
- let cachedDataViewMemory0 = null;
111
-
112
- function getDataViewMemory0() {
113
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
114
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
115
- }
116
- return cachedDataViewMemory0;
117
- }
118
-
119
- function isLikeNone(x) {
120
- return x === undefined || x === null;
121
- }
122
-
123
- function debugString(val) {
124
- // primitive types
125
- const type = typeof val;
126
- if (type == 'number' || type == 'boolean' || val == null) {
127
- return `${val}`;
128
- }
129
- if (type == 'string') {
130
- return `"${val}"`;
131
- }
132
- if (type == 'symbol') {
133
- const description = val.description;
134
- if (description == null) {
135
- return 'Symbol';
136
- } else {
137
- return `Symbol(${description})`;
138
- }
139
- }
140
- if (type == 'function') {
141
- const name = val.name;
142
- if (typeof name == 'string' && name.length > 0) {
143
- return `Function(${name})`;
144
- } else {
145
- return 'Function';
146
- }
147
- }
148
- // objects
149
- if (Array.isArray(val)) {
150
- const length = val.length;
151
- let debug = '[';
152
- if (length > 0) {
153
- debug += debugString(val[0]);
154
- }
155
- for(let i = 1; i < length; i++) {
156
- debug += ', ' + debugString(val[i]);
157
- }
158
- debug += ']';
159
- return debug;
160
- }
161
- // Test for built-in
162
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
163
- let className;
164
- if (builtInMatches && builtInMatches.length > 1) {
165
- className = builtInMatches[1];
166
- } else {
167
- // Failed to match the standard '[object ClassName]'
168
- return toString.call(val);
169
- }
170
- if (className == 'Object') {
171
- // we're a user defined class or Object
172
- // JSON.stringify avoids problems with cycles, and is generally much
173
- // easier than looping through ownProperties of `val`.
174
- try {
175
- return 'Object(' + JSON.stringify(val) + ')';
176
- } catch (_) {
177
- return 'Object';
178
- }
179
- }
180
- // errors
181
- if (val instanceof Error) {
182
- return `${val.name}: ${val.message}\n${val.stack}`;
183
- }
184
- // TODO we could test for more things here, like `Set`s and `Map`s.
185
- return className;
186
- }
187
-
188
- function handleError(f, args) {
189
- try {
190
- return f.apply(this, args);
191
- } catch (e) {
192
- wasm.__wbindgen_export3(addHeapObject(e));
193
- }
194
- }
195
-
196
- function dropObject(idx) {
197
- if (idx < 132) return;
198
- heap[idx] = heap_next;
199
- heap_next = idx;
200
- }
201
-
202
- function takeObject(idx) {
203
- const ret = getObject(idx);
204
- dropObject(idx);
205
- return ret;
206
- }
207
-
208
- function getArrayU8FromWasm0(ptr, len) {
209
- ptr = ptr >>> 0;
210
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
211
- }
212
-
213
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
214
- ? { register: () => {}, unregister: () => {} }
215
- : new FinalizationRegistry(state => state.dtor(state.a, state.b));
216
-
217
- function makeClosure(arg0, arg1, dtor, f) {
218
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
219
- const real = (...args) => {
220
-
221
- // First up with a closure we increment the internal reference
222
- // count. This ensures that the Rust closure environment won't
223
- // be deallocated while we're invoking it.
224
- state.cnt++;
225
- try {
226
- return f(state.a, state.b, ...args);
227
- } finally {
228
- real._wbg_cb_unref();
229
- }
230
- };
231
- real._wbg_cb_unref = () => {
232
- if (--state.cnt === 0) {
233
- state.dtor(state.a, state.b);
234
- state.a = 0;
235
- CLOSURE_DTORS.unregister(state);
236
- }
237
- };
238
- CLOSURE_DTORS.register(real, state, state);
239
- return real;
240
- }
241
-
242
- function makeMutClosure(arg0, arg1, dtor, f) {
243
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
244
- const real = (...args) => {
245
-
246
- // First up with a closure we increment the internal reference
247
- // count. This ensures that the Rust closure environment won't
248
- // be deallocated while we're invoking it.
249
- state.cnt++;
250
- const a = state.a;
251
- state.a = 0;
252
- try {
253
- return f(a, state.b, ...args);
254
- } finally {
255
- state.a = a;
256
- real._wbg_cb_unref();
257
- }
258
- };
259
- real._wbg_cb_unref = () => {
260
- if (--state.cnt === 0) {
261
- state.dtor(state.a, state.b);
262
- state.a = 0;
263
- CLOSURE_DTORS.unregister(state);
264
- }
265
- };
266
- CLOSURE_DTORS.register(real, state, state);
267
- return real;
268
- }
269
-
270
- function passArrayJsValueToWasm0(array, malloc) {
271
- const ptr = malloc(array.length * 4, 4) >>> 0;
272
- const mem = getDataViewMemory0();
273
- for (let i = 0; i < array.length; i++) {
274
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
275
- }
276
- WASM_VECTOR_LEN = array.length;
277
- return ptr;
278
- }
279
- /**
280
- * Computes the Starknet contract address for a controller account without needing a full instance.
281
- *
282
- * # Arguments
283
- *
284
- * * `class_hash` - The class hash of the account contract (JsFelt).
285
- * * `owner` - The owner configuration for the account.
286
- * * `salt` - The salt used for address calculation (JsFelt).
287
- *
288
- * # Returns
289
- *
290
- * The computed Starknet contract address as a `JsFelt`.
291
- * @param {JsFelt} class_hash
292
- * @param {Owner} owner
293
- * @param {JsFelt} salt
294
- * @returns {JsFelt}
295
- */
296
- export function computeAccountAddress(class_hash, owner, salt) {
297
- try {
298
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
299
- wasm.computeAccountAddress(retptr, addHeapObject(class_hash), addHeapObject(owner), addHeapObject(salt));
300
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
301
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
302
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
303
- if (r2) {
304
- throw takeObject(r1);
305
- }
306
- return takeObject(r0);
307
- } finally {
308
- wasm.__wbindgen_add_to_stack_pointer(16);
309
- }
310
- }
311
-
312
- function _assertClass(instance, klass) {
313
- if (!(instance instanceof klass)) {
314
- throw new Error(`expected instance of ${klass.name}`);
315
- }
316
- }
317
-
318
- function getArrayJsValueFromWasm0(ptr, len) {
319
- ptr = ptr >>> 0;
320
- const mem = getDataViewMemory0();
321
- const result = [];
322
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
323
- result.push(takeObject(mem.getUint32(i, true)));
324
- }
325
- return result;
326
- }
327
- /**
328
- * Subscribes to the creation of a session for a given controller, session_key_guid and cartridge api url.
329
- * The goal of this function is to know from any place when the register session flow has been completed, and to
330
- * get the authorization.
331
- * @param {JsFelt} session_key_guid
332
- * @param {string} cartridge_api_url
333
- * @returns {Promise<JsSubscribeSessionResult>}
334
- */
335
- export function subscribeCreateSession(session_key_guid, cartridge_api_url) {
336
- const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
337
- const len0 = WASM_VECTOR_LEN;
338
- const ret = wasm.subscribeCreateSession(addHeapObject(session_key_guid), ptr0, len0);
339
- return takeObject(ret);
340
- }
341
-
342
- /**
343
- * @param {Signer} signer
344
- * @returns {JsFelt}
345
- */
346
- export function signerToGuid(signer) {
347
- try {
348
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
349
- wasm.signerToGuid(retptr, addHeapObject(signer));
350
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
351
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
352
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
353
- if (r2) {
354
- throw takeObject(r1);
355
- }
356
- return takeObject(r0);
357
- } finally {
358
- wasm.__wbindgen_add_to_stack_pointer(16);
359
- }
360
- }
361
-
362
- function __wasm_bindgen_func_elem_8834(arg0, arg1, arg2) {
363
- wasm.__wasm_bindgen_func_elem_8834(arg0, arg1, addHeapObject(arg2));
364
- }
365
-
366
- function __wasm_bindgen_func_elem_3186(arg0, arg1, arg2) {
367
- wasm.__wasm_bindgen_func_elem_3186(arg0, arg1, addHeapObject(arg2));
368
- }
369
-
370
- function __wasm_bindgen_func_elem_8690(arg0, arg1) {
371
- wasm.__wasm_bindgen_func_elem_8690(arg0, arg1);
372
- }
373
-
374
- function __wasm_bindgen_func_elem_10962(arg0, arg1, arg2, arg3) {
375
- wasm.__wasm_bindgen_func_elem_10962(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
376
- }
377
-
378
- /**
379
- * @enum {1 | 20 | 24 | 27 | 28 | 29 | 31 | 32 | 33 | 34 | 40 | 41 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 10 | 64 | 65 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146}
380
- */
381
- export const ErrorCode = Object.freeze({
382
- StarknetFailedToReceiveTransaction: 1, "1": "StarknetFailedToReceiveTransaction",
383
- StarknetContractNotFound: 20, "20": "StarknetContractNotFound",
384
- StarknetBlockNotFound: 24, "24": "StarknetBlockNotFound",
385
- StarknetInvalidTransactionIndex: 27, "27": "StarknetInvalidTransactionIndex",
386
- StarknetClassHashNotFound: 28, "28": "StarknetClassHashNotFound",
387
- StarknetTransactionHashNotFound: 29, "29": "StarknetTransactionHashNotFound",
388
- StarknetPageSizeTooBig: 31, "31": "StarknetPageSizeTooBig",
389
- StarknetNoBlocks: 32, "32": "StarknetNoBlocks",
390
- StarknetInvalidContinuationToken: 33, "33": "StarknetInvalidContinuationToken",
391
- StarknetTooManyKeysInFilter: 34, "34": "StarknetTooManyKeysInFilter",
392
- StarknetContractError: 40, "40": "StarknetContractError",
393
- StarknetTransactionExecutionError: 41, "41": "StarknetTransactionExecutionError",
394
- StarknetClassAlreadyDeclared: 51, "51": "StarknetClassAlreadyDeclared",
395
- StarknetInvalidTransactionNonce: 52, "52": "StarknetInvalidTransactionNonce",
396
- StarknetInsufficientMaxFee: 53, "53": "StarknetInsufficientMaxFee",
397
- StarknetInsufficientAccountBalance: 54, "54": "StarknetInsufficientAccountBalance",
398
- StarknetValidationFailure: 55, "55": "StarknetValidationFailure",
399
- StarknetCompilationFailed: 56, "56": "StarknetCompilationFailed",
400
- StarknetContractClassSizeIsTooLarge: 57, "57": "StarknetContractClassSizeIsTooLarge",
401
- StarknetNonAccount: 58, "58": "StarknetNonAccount",
402
- StarknetDuplicateTx: 59, "59": "StarknetDuplicateTx",
403
- StarknetCompiledClassHashMismatch: 60, "60": "StarknetCompiledClassHashMismatch",
404
- StarknetUnsupportedTxVersion: 61, "61": "StarknetUnsupportedTxVersion",
405
- StarknetUnsupportedContractClassVersion: 62, "62": "StarknetUnsupportedContractClassVersion",
406
- StarknetUnexpectedError: 63, "63": "StarknetUnexpectedError",
407
- StarknetNoTraceAvailable: 10, "10": "StarknetNoTraceAvailable",
408
- StarknetReplacementTransactionUnderpriced: 64, "64": "StarknetReplacementTransactionUnderpriced",
409
- StarknetFeeBelowMinimum: 65, "65": "StarknetFeeBelowMinimum",
410
- SignError: 101, "101": "SignError",
411
- StorageError: 102, "102": "StorageError",
412
- AccountFactoryError: 103, "103": "AccountFactoryError",
413
- PaymasterExecutionTimeNotReached: 104, "104": "PaymasterExecutionTimeNotReached",
414
- PaymasterExecutionTimePassed: 105, "105": "PaymasterExecutionTimePassed",
415
- PaymasterInvalidCaller: 106, "106": "PaymasterInvalidCaller",
416
- PaymasterRateLimitExceeded: 107, "107": "PaymasterRateLimitExceeded",
417
- PaymasterNotSupported: 108, "108": "PaymasterNotSupported",
418
- PaymasterHttp: 109, "109": "PaymasterHttp",
419
- PaymasterExcecution: 110, "110": "PaymasterExcecution",
420
- PaymasterSerialization: 111, "111": "PaymasterSerialization",
421
- CartridgeControllerNotDeployed: 112, "112": "CartridgeControllerNotDeployed",
422
- InsufficientBalance: 113, "113": "InsufficientBalance",
423
- OriginError: 114, "114": "OriginError",
424
- EncodingError: 115, "115": "EncodingError",
425
- SerdeWasmBindgenError: 116, "116": "SerdeWasmBindgenError",
426
- CairoSerdeError: 117, "117": "CairoSerdeError",
427
- CairoShortStringToFeltError: 118, "118": "CairoShortStringToFeltError",
428
- DeviceCreateCredential: 119, "119": "DeviceCreateCredential",
429
- DeviceGetAssertion: 120, "120": "DeviceGetAssertion",
430
- DeviceBadAssertion: 121, "121": "DeviceBadAssertion",
431
- DeviceChannel: 122, "122": "DeviceChannel",
432
- DeviceOrigin: 123, "123": "DeviceOrigin",
433
- AccountSigning: 124, "124": "AccountSigning",
434
- AccountProvider: 125, "125": "AccountProvider",
435
- AccountClassHashCalculation: 126, "126": "AccountClassHashCalculation",
436
- AccountFeeOutOfRange: 128, "128": "AccountFeeOutOfRange",
437
- ProviderRateLimited: 129, "129": "ProviderRateLimited",
438
- ProviderArrayLengthMismatch: 130, "130": "ProviderArrayLengthMismatch",
439
- ProviderOther: 131, "131": "ProviderOther",
440
- SessionAlreadyRegistered: 132, "132": "SessionAlreadyRegistered",
441
- UrlParseError: 133, "133": "UrlParseError",
442
- Base64DecodeError: 134, "134": "Base64DecodeError",
443
- CoseError: 135, "135": "CoseError",
444
- PolicyChainIdMismatch: 136, "136": "PolicyChainIdMismatch",
445
- InvalidOwner: 137, "137": "InvalidOwner",
446
- GasPriceTooHigh: 138, "138": "GasPriceTooHigh",
447
- TransactionTimeout: 139, "139": "TransactionTimeout",
448
- ConversionError: 140, "140": "ConversionError",
449
- InvalidChainId: 141, "141": "InvalidChainId",
450
- SessionRefreshRequired: 142, "142": "SessionRefreshRequired",
451
- ManualExecutionRequired: 143, "143": "ManualExecutionRequired",
452
- ForbiddenEntrypoint: 144, "144": "ForbiddenEntrypoint",
453
- GasAmountTooHigh: 145, "145": "GasAmountTooHigh",
454
- ApproveExecutionRequired: 146, "146": "ApproveExecutionRequired",
455
- });
456
-
457
- const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
458
-
459
- const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
460
-
461
- const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
462
-
463
- const CartridgeAccountFinalization = (typeof FinalizationRegistry === 'undefined')
464
- ? { register: () => {}, unregister: () => {} }
465
- : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccount_free(ptr >>> 0, 1));
466
-
467
3
  export class CartridgeAccount {
468
-
469
4
  static __wrap(ptr) {
470
5
  ptr = ptr >>> 0;
471
6
  const obj = Object.create(CartridgeAccount.prototype);
@@ -473,126 +8,36 @@ export class CartridgeAccount {
473
8
  CartridgeAccountFinalization.register(obj, obj.__wbg_ptr, obj);
474
9
  return obj;
475
10
  }
476
-
477
11
  __destroy_into_raw() {
478
12
  const ptr = this.__wbg_ptr;
479
13
  this.__wbg_ptr = 0;
480
14
  CartridgeAccountFinalization.unregister(this);
481
15
  return ptr;
482
16
  }
483
-
484
17
  free() {
485
18
  const ptr = this.__destroy_into_raw();
486
19
  wasm.__wbg_cartridgeaccount_free(ptr, 0);
487
20
  }
488
21
  /**
489
- * Creates a new `CartridgeAccount` instance.
490
- *
491
- * # Parameters
492
- * - `rpc_url`: The URL of the JSON-RPC endpoint.
493
- * - `address`: The blockchain address associated with the account.
494
- * - `username`: Username associated with the account.
495
- * - `owner`: A Owner struct containing the owner signer and associated data.
496
- * @param {JsFelt} class_hash
497
- * @param {string} rpc_url
498
- * @param {JsFelt} address
499
- * @param {string} username
500
- * @param {Owner} owner
501
- * @param {string} cartridge_api_url
502
- * @returns {Promise<CartridgeAccountWithMeta>}
503
- */
504
- static new(class_hash, rpc_url, address, username, owner, cartridge_api_url) {
505
- const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
506
- const len0 = WASM_VECTOR_LEN;
507
- const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
508
- const len1 = WASM_VECTOR_LEN;
509
- const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
510
- const len2 = WASM_VECTOR_LEN;
511
- const ret = wasm.cartridgeaccount_new(addHeapObject(class_hash), ptr0, len0, addHeapObject(address), ptr1, len1, addHeapObject(owner), ptr2, len2);
512
- return takeObject(ret);
513
- }
514
- /**
515
- * Creates a new `CartridgeAccount` instance with a randomly generated Starknet signer.
516
- * The controller address is computed internally based on the generated signer.
517
- *
518
- * # Parameters
519
- * - `rpc_url`: The URL of the JSON-RPC endpoint.
520
- * - `username`: Username associated with the account.
521
- * @param {JsFelt} class_hash
522
- * @param {string} rpc_url
523
- * @param {string} username
524
- * @param {string} cartridge_api_url
525
- * @returns {Promise<CartridgeAccountWithMeta>}
526
- */
527
- static newHeadless(class_hash, rpc_url, username, cartridge_api_url) {
528
- const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
529
- const len0 = WASM_VECTOR_LEN;
530
- const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
531
- const len1 = WASM_VECTOR_LEN;
532
- const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
533
- const len2 = WASM_VECTOR_LEN;
534
- const ret = wasm.cartridgeaccount_newHeadless(addHeapObject(class_hash), ptr0, len0, ptr1, len1, ptr2, len2);
535
- return takeObject(ret);
536
- }
537
- /**
538
- * @param {string} cartridge_api_url
539
- * @returns {Promise<CartridgeAccountWithMeta | undefined>}
540
- */
541
- static fromStorage(cartridge_api_url) {
542
- const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
543
- const len0 = WASM_VECTOR_LEN;
544
- const ret = wasm.cartridgeaccount_fromStorage(ptr0, len0);
545
- return takeObject(ret);
546
- }
547
- /**
22
+ * @param {Signer | null} [owner]
23
+ * @param {JsAddSignerInput | null} [signer_input]
24
+ * @param {string | null} [rp_id]
548
25
  * @returns {Promise<void>}
549
26
  */
550
- disconnect() {
551
- const ret = wasm.cartridgeaccount_disconnect(this.__wbg_ptr);
552
- return takeObject(ret);
553
- }
554
- /**
555
- * @param {string} app_id
556
- * @param {Policy[]} policies
557
- * @param {bigint} expires_at
558
- * @param {JsFelt} public_key
559
- * @param {JsFeeEstimate | null} [max_fee]
560
- * @returns {Promise<any>}
561
- */
562
- registerSession(app_id, policies, expires_at, public_key, max_fee) {
563
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
564
- const len0 = WASM_VECTOR_LEN;
565
- const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
566
- const len1 = WASM_VECTOR_LEN;
567
- const ret = wasm.cartridgeaccount_registerSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, addHeapObject(public_key), isLikeNone(max_fee) ? 0 : addHeapObject(max_fee));
27
+ addOwner(owner, signer_input, rp_id) {
28
+ var ptr0 = isLikeNone(rp_id) ? 0 : passStringToWasm0(rp_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
29
+ var len0 = WASM_VECTOR_LEN;
30
+ const ret = wasm.cartridgeaccount_addOwner(this.__wbg_ptr, isLikeNone(owner) ? 0 : addHeapObject(owner), isLikeNone(signer_input) ? 0 : addHeapObject(signer_input), ptr0, len0);
568
31
  return takeObject(ret);
569
32
  }
570
33
  /**
571
- * @param {Policy[]} policies
572
- * @param {bigint} expires_at
573
- * @param {JsFelt} public_key
574
- * @returns {Promise<any>}
34
+ * @param {string} rp_id
35
+ * @returns {Promise<JsAddSignerInput>}
575
36
  */
576
- registerSessionCalldata(policies, expires_at, public_key) {
577
- const ptr0 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
37
+ createPasskeySigner(rp_id) {
38
+ const ptr0 = passStringToWasm0(rp_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
578
39
  const len0 = WASM_VECTOR_LEN;
579
- const ret = wasm.cartridgeaccount_registerSessionCalldata(this.__wbg_ptr, ptr0, len0, expires_at, addHeapObject(public_key));
580
- return takeObject(ret);
581
- }
582
- /**
583
- * @param {JsFelt} new_class_hash
584
- * @returns {Promise<JsCall>}
585
- */
586
- upgrade(new_class_hash) {
587
- const ret = wasm.cartridgeaccount_upgrade(this.__wbg_ptr, addHeapObject(new_class_hash));
588
- return takeObject(ret);
589
- }
590
- /**
591
- * @param {JsRegister} register
592
- * @returns {Promise<JsRegisterResponse>}
593
- */
594
- register(register) {
595
- const ret = wasm.cartridgeaccount_register(this.__wbg_ptr, addHeapObject(register));
40
+ const ret = wasm.cartridgeaccount_createPasskeySigner(this.__wbg_ptr, ptr0, len0);
596
41
  return takeObject(ret);
597
42
  }
598
43
  /**
@@ -607,50 +52,29 @@ export class CartridgeAccount {
607
52
  const len0 = WASM_VECTOR_LEN;
608
53
  const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
609
54
  const len1 = WASM_VECTOR_LEN;
610
- const ret = wasm.cartridgeaccount_createSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, isLikeNone(authorize_user_execution) ? 0xFFFFFF : authorize_user_execution ? 1 : 0);
611
- return takeObject(ret);
612
- }
613
- /**
614
- * @param {string} app_id
615
- * @param {Policy[]} policies
616
- * @returns {Promise<void>}
617
- */
618
- skipSession(app_id, policies) {
619
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
620
- const len0 = WASM_VECTOR_LEN;
621
- const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
622
- const len1 = WASM_VECTOR_LEN;
623
- const ret = wasm.cartridgeaccount_skipSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
55
+ const ret = wasm.cartridgeaccount_createSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, isLikeNone(authorize_user_execution) ? 0xFFFFFF : authorize_user_execution ? 1 : 0);
624
56
  return takeObject(ret);
625
57
  }
626
58
  /**
627
- * @param {Signer | null} [owner]
628
- * @param {JsAddSignerInput | null} [signer_input]
629
- * @param {string | null} [rp_id]
630
- * @returns {Promise<void>}
59
+ * @returns {Promise<JsFelt>}
631
60
  */
632
- addOwner(owner, signer_input, rp_id) {
633
- var ptr0 = isLikeNone(rp_id) ? 0 : passStringToWasm0(rp_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
634
- var len0 = WASM_VECTOR_LEN;
635
- const ret = wasm.cartridgeaccount_addOwner(this.__wbg_ptr, isLikeNone(owner) ? 0 : addHeapObject(owner), isLikeNone(signer_input) ? 0 : addHeapObject(signer_input), ptr0, len0);
61
+ delegateAccount() {
62
+ const ret = wasm.cartridgeaccount_delegateAccount(this.__wbg_ptr);
636
63
  return takeObject(ret);
637
64
  }
638
65
  /**
639
- * @param {JsRemoveSignerInput} signer
640
- * @returns {Promise<void>}
66
+ * @param {JsFeeEstimate | null} [max_fee]
67
+ * @returns {Promise<any>}
641
68
  */
642
- removeOwner(signer) {
643
- const ret = wasm.cartridgeaccount_removeOwner(this.__wbg_ptr, addHeapObject(signer));
69
+ deploySelf(max_fee) {
70
+ const ret = wasm.cartridgeaccount_deploySelf(this.__wbg_ptr, isLikeNone(max_fee) ? 0 : addHeapObject(max_fee));
644
71
  return takeObject(ret);
645
72
  }
646
73
  /**
647
- * @param {string} rp_id
648
- * @returns {Promise<JsAddSignerInput>}
74
+ * @returns {Promise<void>}
649
75
  */
650
- createPasskeySigner(rp_id) {
651
- const ptr0 = passStringToWasm0(rp_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
652
- const len0 = WASM_VECTOR_LEN;
653
- const ret = wasm.cartridgeaccount_createPasskeySigner(this.__wbg_ptr, ptr0, len0);
76
+ disconnect() {
77
+ const ret = wasm.cartridgeaccount_disconnect(this.__wbg_ptr);
654
78
  return takeObject(ret);
655
79
  }
656
80
  /**
@@ -697,29 +121,81 @@ export class CartridgeAccount {
697
121
  const ret = wasm.cartridgeaccount_executeFromOutsideV3(this.__wbg_ptr, ptr0, len0, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
698
122
  return takeObject(ret);
699
123
  }
124
+ /**
125
+ * @param {string | null} [app_id]
126
+ * @returns {Promise<ImportedSessionMetadata | undefined>}
127
+ */
128
+ exportAuthorizedSession(app_id) {
129
+ var ptr0 = isLikeNone(app_id) ? 0 : passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
130
+ var len0 = WASM_VECTOR_LEN;
131
+ const ret = wasm.cartridgeaccount_exportAuthorizedSession(this.__wbg_ptr, ptr0, len0);
132
+ return takeObject(ret);
133
+ }
134
+ /**
135
+ * @returns {Promise<ImportedControllerMetadata>}
136
+ */
137
+ exportMetadata() {
138
+ const ret = wasm.cartridgeaccount_exportMetadata(this.__wbg_ptr);
139
+ return takeObject(ret);
140
+ }
141
+ /**
142
+ * @param {string} cartridge_api_url
143
+ * @returns {Promise<CartridgeAccountWithMeta | undefined>}
144
+ */
145
+ static fromStorage(cartridge_api_url) {
146
+ const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
147
+ const len0 = WASM_VECTOR_LEN;
148
+ const ret = wasm.cartridgeaccount_fromStorage(ptr0, len0);
149
+ return takeObject(ret);
150
+ }
151
+ /**
152
+ * @returns {Promise<any>}
153
+ */
154
+ getNonce() {
155
+ const ret = wasm.cartridgeaccount_getNonce(this.__wbg_ptr);
156
+ return takeObject(ret);
157
+ }
700
158
  /**
701
159
  * @param {string} app_id
702
160
  * @param {JsCall[]} calls
703
- * @param {JsFeeSource | null} [fee_source]
704
- * @returns {Promise<any>}
161
+ * @returns {Promise<boolean>}
705
162
  */
706
- trySessionExecute(app_id, calls, fee_source) {
163
+ hasAuthorizedPoliciesForCalls(app_id, calls) {
707
164
  const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
708
165
  const len0 = WASM_VECTOR_LEN;
709
166
  const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
710
167
  const len1 = WASM_VECTOR_LEN;
711
- const ret = wasm.cartridgeaccount_trySessionExecute(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
168
+ const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForCalls(this.__wbg_ptr, ptr0, len0, ptr1, len1);
712
169
  return takeObject(ret);
713
170
  }
714
171
  /**
715
- * @param {Policy[]} policies
716
- * @param {JsFelt | null} [public_key]
717
- * @returns {Promise<AuthorizedSession | undefined>}
172
+ * @param {string} app_id
173
+ * @param {string} typed_data
174
+ * @returns {Promise<boolean>}
718
175
  */
719
- isRegisteredSessionAuthorized(policies, public_key) {
720
- const ptr0 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
176
+ hasAuthorizedPoliciesForMessage(app_id, typed_data) {
177
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
721
178
  const len0 = WASM_VECTOR_LEN;
722
- const ret = wasm.cartridgeaccount_isRegisteredSessionAuthorized(this.__wbg_ptr, ptr0, len0, isLikeNone(public_key) ? 0 : addHeapObject(public_key));
179
+ const ptr1 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
180
+ const len1 = WASM_VECTOR_LEN;
181
+ const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForMessage(this.__wbg_ptr, ptr0, len0, ptr1, len1);
182
+ return takeObject(ret);
183
+ }
184
+ /**
185
+ * Checks if there are stored policies for a given app_id.
186
+ *
187
+ * # Parameters
188
+ * - `app_id`: The application identifier to check for stored policies
189
+ *
190
+ * # Returns
191
+ * `true` if policies exist for the given app_id, `false` otherwise
192
+ * @param {string} app_id
193
+ * @returns {Promise<boolean>}
194
+ */
195
+ hasPoliciesForAppId(app_id) {
196
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
197
+ const len0 = WASM_VECTOR_LEN;
198
+ const ret = wasm.cartridgeaccount_hasPoliciesForAppId(this.__wbg_ptr, ptr0, len0);
723
199
  return takeObject(ret);
724
200
  }
725
201
  /**
@@ -736,79 +212,133 @@ export class CartridgeAccount {
736
212
  return takeObject(ret);
737
213
  }
738
214
  /**
739
- * @param {JsRevokableSession} session
215
+ * @param {ImportedSessionMetadata} imported_session
740
216
  * @returns {Promise<void>}
741
217
  */
742
- revokeSession(session) {
743
- const ret = wasm.cartridgeaccount_revokeSession(this.__wbg_ptr, addHeapObject(session));
218
+ importSession(imported_session) {
219
+ const ret = wasm.cartridgeaccount_importSession(this.__wbg_ptr, addHeapObject(imported_session));
744
220
  return takeObject(ret);
745
221
  }
746
222
  /**
747
- * @param {JsRevokableSession[]} sessions
748
- * @returns {Promise<void>}
223
+ * @param {Policy[]} policies
224
+ * @param {JsFelt | null} [public_key]
225
+ * @returns {Promise<AuthorizedSession | undefined>}
749
226
  */
750
- revokeSessions(sessions) {
751
- const ptr0 = passArrayJsValueToWasm0(sessions, wasm.__wbindgen_export);
227
+ isRegisteredSessionAuthorized(policies, public_key) {
228
+ const ptr0 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
752
229
  const len0 = WASM_VECTOR_LEN;
753
- const ret = wasm.cartridgeaccount_revokeSessions(this.__wbg_ptr, ptr0, len0);
230
+ const ret = wasm.cartridgeaccount_isRegisteredSessionAuthorized(this.__wbg_ptr, ptr0, len0, isLikeNone(public_key) ? 0 : addHeapObject(public_key));
754
231
  return takeObject(ret);
755
232
  }
756
233
  /**
757
- * @param {string} typed_data
758
- * @returns {Promise<Felts>}
234
+ * Creates a new `CartridgeAccount` instance.
235
+ *
236
+ * # Parameters
237
+ * - `rpc_url`: The URL of the JSON-RPC endpoint.
238
+ * - `address`: The blockchain address associated with the account.
239
+ * - `username`: Username associated with the account.
240
+ * - `owner`: A Owner struct containing the owner signer and associated data.
241
+ * @param {JsFelt} class_hash
242
+ * @param {string} rpc_url
243
+ * @param {JsFelt} address
244
+ * @param {string} username
245
+ * @param {Owner} owner
246
+ * @param {string} cartridge_api_url
247
+ * @returns {Promise<CartridgeAccountWithMeta>}
759
248
  */
760
- signMessage(typed_data) {
761
- const ptr0 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
249
+ static new(class_hash, rpc_url, address, username, owner, cartridge_api_url) {
250
+ const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
762
251
  const len0 = WASM_VECTOR_LEN;
763
- const ret = wasm.cartridgeaccount_signMessage(this.__wbg_ptr, ptr0, len0);
252
+ const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
253
+ const len1 = WASM_VECTOR_LEN;
254
+ const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
255
+ const len2 = WASM_VECTOR_LEN;
256
+ const ret = wasm.cartridgeaccount_new(addHeapObject(class_hash), ptr0, len0, addHeapObject(address), ptr1, len1, addHeapObject(owner), ptr2, len2);
764
257
  return takeObject(ret);
765
258
  }
766
259
  /**
767
- * @returns {Promise<any>}
260
+ * Creates a new `CartridgeAccount` instance with a randomly generated Starknet signer.
261
+ * The controller address is computed internally based on the generated signer.
262
+ *
263
+ * # Parameters
264
+ * - `rpc_url`: The URL of the JSON-RPC endpoint.
265
+ * - `username`: Username associated with the account.
266
+ * @param {JsFelt} class_hash
267
+ * @param {string} rpc_url
268
+ * @param {string} username
269
+ * @param {string} cartridge_api_url
270
+ * @returns {Promise<CartridgeAccountWithMeta>}
768
271
  */
769
- getNonce() {
770
- const ret = wasm.cartridgeaccount_getNonce(this.__wbg_ptr);
272
+ static newHeadless(class_hash, rpc_url, username, cartridge_api_url) {
273
+ const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
274
+ const len0 = WASM_VECTOR_LEN;
275
+ const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
276
+ const len1 = WASM_VECTOR_LEN;
277
+ const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
278
+ const len2 = WASM_VECTOR_LEN;
279
+ const ret = wasm.cartridgeaccount_newHeadless(addHeapObject(class_hash), ptr0, len0, ptr1, len1, ptr2, len2);
280
+ return takeObject(ret);
281
+ }
282
+ /**
283
+ * @param {JsRegister} register
284
+ * @returns {Promise<JsRegisterResponse>}
285
+ */
286
+ register(register) {
287
+ const ret = wasm.cartridgeaccount_register(this.__wbg_ptr, addHeapObject(register));
771
288
  return takeObject(ret);
772
289
  }
773
290
  /**
291
+ * @param {string} app_id
292
+ * @param {Policy[]} policies
293
+ * @param {bigint} expires_at
294
+ * @param {JsFelt} public_key
774
295
  * @param {JsFeeEstimate | null} [max_fee]
775
296
  * @returns {Promise<any>}
776
297
  */
777
- deploySelf(max_fee) {
778
- const ret = wasm.cartridgeaccount_deploySelf(this.__wbg_ptr, isLikeNone(max_fee) ? 0 : addHeapObject(max_fee));
298
+ registerSession(app_id, policies, expires_at, public_key, max_fee) {
299
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
300
+ const len0 = WASM_VECTOR_LEN;
301
+ const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
302
+ const len1 = WASM_VECTOR_LEN;
303
+ const ret = wasm.cartridgeaccount_registerSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, addHeapObject(public_key), isLikeNone(max_fee) ? 0 : addHeapObject(max_fee));
779
304
  return takeObject(ret);
780
305
  }
781
306
  /**
782
- * @returns {Promise<JsFelt>}
307
+ * @param {Policy[]} policies
308
+ * @param {bigint} expires_at
309
+ * @param {JsFelt} public_key
310
+ * @returns {Promise<any>}
783
311
  */
784
- delegateAccount() {
785
- const ret = wasm.cartridgeaccount_delegateAccount(this.__wbg_ptr);
312
+ registerSessionCalldata(policies, expires_at, public_key) {
313
+ const ptr0 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
314
+ const len0 = WASM_VECTOR_LEN;
315
+ const ret = wasm.cartridgeaccount_registerSessionCalldata(this.__wbg_ptr, ptr0, len0, expires_at, addHeapObject(public_key));
786
316
  return takeObject(ret);
787
317
  }
788
318
  /**
789
- * @param {string} app_id
790
- * @param {JsCall[]} calls
791
- * @returns {Promise<boolean>}
319
+ * @param {JsRemoveSignerInput} signer
320
+ * @returns {Promise<void>}
792
321
  */
793
- hasAuthorizedPoliciesForCalls(app_id, calls) {
794
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
795
- const len0 = WASM_VECTOR_LEN;
796
- const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
797
- const len1 = WASM_VECTOR_LEN;
798
- const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForCalls(this.__wbg_ptr, ptr0, len0, ptr1, len1);
322
+ removeOwner(signer) {
323
+ const ret = wasm.cartridgeaccount_removeOwner(this.__wbg_ptr, addHeapObject(signer));
799
324
  return takeObject(ret);
800
325
  }
801
326
  /**
802
- * @param {string} app_id
803
- * @param {string} typed_data
804
- * @returns {Promise<boolean>}
327
+ * @param {JsRevokableSession} session
328
+ * @returns {Promise<void>}
805
329
  */
806
- hasAuthorizedPoliciesForMessage(app_id, typed_data) {
807
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
330
+ revokeSession(session) {
331
+ const ret = wasm.cartridgeaccount_revokeSession(this.__wbg_ptr, addHeapObject(session));
332
+ return takeObject(ret);
333
+ }
334
+ /**
335
+ * @param {JsRevokableSession[]} sessions
336
+ * @returns {Promise<void>}
337
+ */
338
+ revokeSessions(sessions) {
339
+ const ptr0 = passArrayJsValueToWasm0(sessions, wasm.__wbindgen_export);
808
340
  const len0 = WASM_VECTOR_LEN;
809
- const ptr1 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
810
- const len1 = WASM_VECTOR_LEN;
811
- const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForMessage(this.__wbg_ptr, ptr0, len0, ptr1, len1);
341
+ const ret = wasm.cartridgeaccount_revokeSessions(this.__wbg_ptr, ptr0, len0);
812
342
  return takeObject(ret);
813
343
  }
814
344
  /**
@@ -829,28 +359,53 @@ export class CartridgeAccount {
829
359
  return takeObject(ret);
830
360
  }
831
361
  /**
832
- * Checks if there are stored policies for a given app_id.
833
- *
834
- * # Parameters
835
- * - `app_id`: The application identifier to check for stored policies
836
- *
837
- * # Returns
838
- * `true` if policies exist for the given app_id, `false` otherwise
362
+ * @param {string} typed_data
363
+ * @returns {Promise<Felts>}
364
+ */
365
+ signMessage(typed_data) {
366
+ const ptr0 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
367
+ const len0 = WASM_VECTOR_LEN;
368
+ const ret = wasm.cartridgeaccount_signMessage(this.__wbg_ptr, ptr0, len0);
369
+ return takeObject(ret);
370
+ }
371
+ /**
839
372
  * @param {string} app_id
840
- * @returns {Promise<boolean>}
373
+ * @param {Policy[]} policies
374
+ * @returns {Promise<void>}
841
375
  */
842
- hasPoliciesForAppId(app_id) {
376
+ skipSession(app_id, policies) {
377
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
378
+ const len0 = WASM_VECTOR_LEN;
379
+ const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
380
+ const len1 = WASM_VECTOR_LEN;
381
+ const ret = wasm.cartridgeaccount_skipSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
382
+ return takeObject(ret);
383
+ }
384
+ /**
385
+ * @param {string} app_id
386
+ * @param {JsCall[]} calls
387
+ * @param {JsFeeSource | null} [fee_source]
388
+ * @returns {Promise<any>}
389
+ */
390
+ trySessionExecute(app_id, calls, fee_source) {
843
391
  const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
844
392
  const len0 = WASM_VECTOR_LEN;
845
- const ret = wasm.cartridgeaccount_hasPoliciesForAppId(this.__wbg_ptr, ptr0, len0);
393
+ const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
394
+ const len1 = WASM_VECTOR_LEN;
395
+ const ret = wasm.cartridgeaccount_trySessionExecute(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
396
+ return takeObject(ret);
397
+ }
398
+ /**
399
+ * @param {JsFelt} new_class_hash
400
+ * @returns {Promise<JsCall>}
401
+ */
402
+ upgrade(new_class_hash) {
403
+ const ret = wasm.cartridgeaccount_upgrade(this.__wbg_ptr, addHeapObject(new_class_hash));
846
404
  return takeObject(ret);
847
405
  }
848
406
  }
849
407
  if (Symbol.dispose) CartridgeAccount.prototype[Symbol.dispose] = CartridgeAccount.prototype.free;
850
408
 
851
- const CartridgeAccountMetaFinalization = (typeof FinalizationRegistry === 'undefined')
852
- ? { register: () => {}, unregister: () => {} }
853
- : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccountmeta_free(ptr >>> 0, 1));
854
409
  /**
855
410
  * A type for accessing fixed attributes of `CartridgeAccount`.
856
411
  *
@@ -865,7 +420,6 @@ const CartridgeAccountMetaFinalization = (typeof FinalizationRegistry === 'undef
865
420
  * be needed.
866
421
  */
867
422
  export class CartridgeAccountMeta {
868
-
869
423
  static __wrap(ptr) {
870
424
  ptr = ptr >>> 0;
871
425
  const obj = Object.create(CartridgeAccountMeta.prototype);
@@ -873,14 +427,12 @@ export class CartridgeAccountMeta {
873
427
  CartridgeAccountMetaFinalization.register(obj, obj.__wbg_ptr, obj);
874
428
  return obj;
875
429
  }
876
-
877
430
  __destroy_into_raw() {
878
431
  const ptr = this.__wbg_ptr;
879
432
  this.__wbg_ptr = 0;
880
433
  CartridgeAccountMetaFinalization.unregister(this);
881
434
  return ptr;
882
435
  }
883
-
884
436
  free() {
885
437
  const ptr = this.__destroy_into_raw();
886
438
  wasm.__wbg_cartridgeaccountmeta_free(ptr, 0);
@@ -888,12 +440,12 @@ export class CartridgeAccountMeta {
888
440
  /**
889
441
  * @returns {string}
890
442
  */
891
- username() {
443
+ address() {
892
444
  let deferred1_0;
893
445
  let deferred1_1;
894
446
  try {
895
447
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
896
- wasm.cartridgeaccountmeta_username(retptr, this.__wbg_ptr);
448
+ wasm.cartridgeaccountmeta_address(retptr, this.__wbg_ptr);
897
449
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
898
450
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
899
451
  deferred1_0 = r0;
@@ -907,12 +459,12 @@ export class CartridgeAccountMeta {
907
459
  /**
908
460
  * @returns {string}
909
461
  */
910
- address() {
462
+ chainId() {
911
463
  let deferred1_0;
912
464
  let deferred1_1;
913
465
  try {
914
466
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
915
- wasm.cartridgeaccountmeta_address(retptr, this.__wbg_ptr);
467
+ wasm.cartridgeaccountmeta_chainId(retptr, this.__wbg_ptr);
916
468
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
917
469
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
918
470
  deferred1_0 = r0;
@@ -942,6 +494,20 @@ export class CartridgeAccountMeta {
942
494
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
943
495
  }
944
496
  }
497
+ /**
498
+ * @returns {Owner}
499
+ */
500
+ owner() {
501
+ const ret = wasm.cartridgeaccountmeta_owner(this.__wbg_ptr);
502
+ return takeObject(ret);
503
+ }
504
+ /**
505
+ * @returns {JsFelt}
506
+ */
507
+ ownerGuid() {
508
+ const ret = wasm.cartridgeaccountmeta_ownerGuid(this.__wbg_ptr);
509
+ return takeObject(ret);
510
+ }
945
511
  /**
946
512
  * @returns {string}
947
513
  */
@@ -964,12 +530,12 @@ export class CartridgeAccountMeta {
964
530
  /**
965
531
  * @returns {string}
966
532
  */
967
- chainId() {
533
+ username() {
968
534
  let deferred1_0;
969
535
  let deferred1_1;
970
536
  try {
971
537
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
972
- wasm.cartridgeaccountmeta_chainId(retptr, this.__wbg_ptr);
538
+ wasm.cartridgeaccountmeta_username(retptr, this.__wbg_ptr);
973
539
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
974
540
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
975
541
  deferred1_0 = r0;
@@ -980,26 +546,9 @@ export class CartridgeAccountMeta {
980
546
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
981
547
  }
982
548
  }
983
- /**
984
- * @returns {Owner}
985
- */
986
- owner() {
987
- const ret = wasm.cartridgeaccountmeta_owner(this.__wbg_ptr);
988
- return takeObject(ret);
989
- }
990
- /**
991
- * @returns {JsFelt}
992
- */
993
- ownerGuid() {
994
- const ret = wasm.cartridgeaccountmeta_ownerGuid(this.__wbg_ptr);
995
- return takeObject(ret);
996
- }
997
549
  }
998
550
  if (Symbol.dispose) CartridgeAccountMeta.prototype[Symbol.dispose] = CartridgeAccountMeta.prototype.free;
999
551
 
1000
- const CartridgeAccountWithMetaFinalization = (typeof FinalizationRegistry === 'undefined')
1001
- ? { register: () => {}, unregister: () => {} }
1002
- : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccountwithmeta_free(ptr >>> 0, 1));
1003
552
  /**
1004
553
  * A type used as the return type for constructing `CartridgeAccount` to provide an extra,
1005
554
  * separately borrowable `meta` field for synchronously accessing fixed fields.
@@ -1008,7 +557,6 @@ const CartridgeAccountWithMetaFinalization = (typeof FinalizationRegistry === 'u
1008
557
  * don't implement `IntoWasmAbi` which is needed for crossing JS-WASM boundary.
1009
558
  */
1010
559
  export class CartridgeAccountWithMeta {
1011
-
1012
560
  static __wrap(ptr) {
1013
561
  ptr = ptr >>> 0;
1014
562
  const obj = Object.create(CartridgeAccountWithMeta.prototype);
@@ -1016,25 +564,16 @@ export class CartridgeAccountWithMeta {
1016
564
  CartridgeAccountWithMetaFinalization.register(obj, obj.__wbg_ptr, obj);
1017
565
  return obj;
1018
566
  }
1019
-
1020
567
  __destroy_into_raw() {
1021
568
  const ptr = this.__wbg_ptr;
1022
569
  this.__wbg_ptr = 0;
1023
570
  CartridgeAccountWithMetaFinalization.unregister(this);
1024
571
  return ptr;
1025
572
  }
1026
-
1027
573
  free() {
1028
574
  const ptr = this.__destroy_into_raw();
1029
575
  wasm.__wbg_cartridgeaccountwithmeta_free(ptr, 0);
1030
576
  }
1031
- /**
1032
- * @returns {CartridgeAccountMeta}
1033
- */
1034
- meta() {
1035
- const ret = wasm.cartridgeaccountwithmeta_meta(this.__wbg_ptr);
1036
- return CartridgeAccountMeta.__wrap(ret);
1037
- }
1038
577
  /**
1039
578
  * @returns {CartridgeAccount}
1040
579
  */
@@ -1043,26 +582,58 @@ export class CartridgeAccountWithMeta {
1043
582
  const ret = wasm.cartridgeaccountwithmeta_intoAccount(ptr);
1044
583
  return CartridgeAccount.__wrap(ret);
1045
584
  }
585
+ /**
586
+ * @returns {CartridgeAccountMeta}
587
+ */
588
+ meta() {
589
+ const ret = wasm.cartridgeaccountwithmeta_meta(this.__wbg_ptr);
590
+ return CartridgeAccountMeta.__wrap(ret);
591
+ }
1046
592
  }
1047
593
  if (Symbol.dispose) CartridgeAccountWithMeta.prototype[Symbol.dispose] = CartridgeAccountWithMeta.prototype.free;
1048
594
 
1049
- const ControllerFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
1050
- ? { register: () => {}, unregister: () => {} }
1051
- : new FinalizationRegistry(ptr => wasm.__wbg_controllerfactory_free(ptr >>> 0, 1));
1052
-
1053
595
  export class ControllerFactory {
1054
-
1055
596
  __destroy_into_raw() {
1056
597
  const ptr = this.__wbg_ptr;
1057
598
  this.__wbg_ptr = 0;
1058
599
  ControllerFactoryFinalization.unregister(this);
1059
600
  return ptr;
1060
601
  }
1061
-
1062
602
  free() {
1063
603
  const ptr = this.__destroy_into_raw();
1064
604
  wasm.__wbg_controllerfactory_free(ptr, 0);
1065
605
  }
606
+ /**
607
+ * This should only be used with webauthn signers
608
+ * @param {string} username
609
+ * @param {JsFelt} class_hash
610
+ * @param {string} rpc_url
611
+ * @param {JsFelt} address
612
+ * @param {Owner} owner
613
+ * @param {string} cartridge_api_url
614
+ * @returns {Promise<CartridgeAccountWithMeta>}
615
+ */
616
+ static apiLogin(username, class_hash, rpc_url, address, owner, cartridge_api_url) {
617
+ const ptr0 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
618
+ const len0 = WASM_VECTOR_LEN;
619
+ const ptr1 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
620
+ const len1 = WASM_VECTOR_LEN;
621
+ const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
622
+ const len2 = WASM_VECTOR_LEN;
623
+ const ret = wasm.controllerfactory_apiLogin(ptr0, len0, addHeapObject(class_hash), ptr1, len1, addHeapObject(address), addHeapObject(owner), ptr2, len2);
624
+ return takeObject(ret);
625
+ }
626
+ /**
627
+ * @param {ImportedControllerMetadata} metadata
628
+ * @param {string} cartridge_api_url
629
+ * @returns {Promise<CartridgeAccountWithMeta>}
630
+ */
631
+ static fromMetadata(metadata, cartridge_api_url) {
632
+ const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
633
+ const len0 = WASM_VECTOR_LEN;
634
+ const ret = wasm.controllerfactory_fromMetadata(addHeapObject(metadata), ptr0, len0);
635
+ return takeObject(ret);
636
+ }
1066
637
  /**
1067
638
  * @param {string} cartridge_api_url
1068
639
  * @returns {Promise<CartridgeAccountWithMeta | undefined>}
@@ -1124,55 +695,122 @@ export class ControllerFactory {
1124
695
  const ret = wasm.controllerfactory_login(ptr0, len0, addHeapObject(class_hash), ptr1, len1, addHeapObject(address), addHeapObject(owner), ptr2, len2, session_expires_at_s, isLikeNone(is_controller_registered) ? 0xFFFFFF : is_controller_registered ? 1 : 0, isLikeNone(create_wildcard_session) ? 0xFFFFFF : create_wildcard_session ? 1 : 0, ptr3, len3);
1125
696
  return takeObject(ret);
1126
697
  }
1127
- /**
1128
- * This should only be used with webauthn signers
1129
- * @param {string} username
1130
- * @param {JsFelt} class_hash
1131
- * @param {string} rpc_url
1132
- * @param {JsFelt} address
1133
- * @param {Owner} owner
1134
- * @param {string} cartridge_api_url
1135
- * @returns {Promise<CartridgeAccountWithMeta>}
1136
- */
1137
- static apiLogin(username, class_hash, rpc_url, address, owner, cartridge_api_url) {
1138
- const ptr0 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1139
- const len0 = WASM_VECTOR_LEN;
1140
- const ptr1 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1141
- const len1 = WASM_VECTOR_LEN;
1142
- const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1143
- const len2 = WASM_VECTOR_LEN;
1144
- const ret = wasm.controllerfactory_apiLogin(ptr0, len0, addHeapObject(class_hash), ptr1, len1, addHeapObject(address), addHeapObject(owner), ptr2, len2);
1145
- return takeObject(ret);
1146
- }
1147
698
  }
1148
699
  if (Symbol.dispose) ControllerFactory.prototype[Symbol.dispose] = ControllerFactory.prototype.free;
1149
700
 
1150
- const JsChainConfigFinalization = (typeof FinalizationRegistry === 'undefined')
1151
- ? { register: () => {}, unregister: () => {} }
1152
- : new FinalizationRegistry(ptr => wasm.__wbg_jschainconfig_free(ptr >>> 0, 1));
701
+ /**
702
+ * @enum {1 | 20 | 24 | 27 | 28 | 29 | 31 | 32 | 33 | 34 | 40 | 41 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 10 | 64 | 65 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146}
703
+ */
704
+ export const ErrorCode = Object.freeze({
705
+ StarknetFailedToReceiveTransaction: 1, "1": "StarknetFailedToReceiveTransaction",
706
+ StarknetContractNotFound: 20, "20": "StarknetContractNotFound",
707
+ StarknetBlockNotFound: 24, "24": "StarknetBlockNotFound",
708
+ StarknetInvalidTransactionIndex: 27, "27": "StarknetInvalidTransactionIndex",
709
+ StarknetClassHashNotFound: 28, "28": "StarknetClassHashNotFound",
710
+ StarknetTransactionHashNotFound: 29, "29": "StarknetTransactionHashNotFound",
711
+ StarknetPageSizeTooBig: 31, "31": "StarknetPageSizeTooBig",
712
+ StarknetNoBlocks: 32, "32": "StarknetNoBlocks",
713
+ StarknetInvalidContinuationToken: 33, "33": "StarknetInvalidContinuationToken",
714
+ StarknetTooManyKeysInFilter: 34, "34": "StarknetTooManyKeysInFilter",
715
+ StarknetContractError: 40, "40": "StarknetContractError",
716
+ StarknetTransactionExecutionError: 41, "41": "StarknetTransactionExecutionError",
717
+ StarknetClassAlreadyDeclared: 51, "51": "StarknetClassAlreadyDeclared",
718
+ StarknetInvalidTransactionNonce: 52, "52": "StarknetInvalidTransactionNonce",
719
+ StarknetInsufficientMaxFee: 53, "53": "StarknetInsufficientMaxFee",
720
+ StarknetInsufficientAccountBalance: 54, "54": "StarknetInsufficientAccountBalance",
721
+ StarknetValidationFailure: 55, "55": "StarknetValidationFailure",
722
+ StarknetCompilationFailed: 56, "56": "StarknetCompilationFailed",
723
+ StarknetContractClassSizeIsTooLarge: 57, "57": "StarknetContractClassSizeIsTooLarge",
724
+ StarknetNonAccount: 58, "58": "StarknetNonAccount",
725
+ StarknetDuplicateTx: 59, "59": "StarknetDuplicateTx",
726
+ StarknetCompiledClassHashMismatch: 60, "60": "StarknetCompiledClassHashMismatch",
727
+ StarknetUnsupportedTxVersion: 61, "61": "StarknetUnsupportedTxVersion",
728
+ StarknetUnsupportedContractClassVersion: 62, "62": "StarknetUnsupportedContractClassVersion",
729
+ StarknetUnexpectedError: 63, "63": "StarknetUnexpectedError",
730
+ StarknetNoTraceAvailable: 10, "10": "StarknetNoTraceAvailable",
731
+ StarknetReplacementTransactionUnderpriced: 64, "64": "StarknetReplacementTransactionUnderpriced",
732
+ StarknetFeeBelowMinimum: 65, "65": "StarknetFeeBelowMinimum",
733
+ SignError: 101, "101": "SignError",
734
+ StorageError: 102, "102": "StorageError",
735
+ AccountFactoryError: 103, "103": "AccountFactoryError",
736
+ PaymasterExecutionTimeNotReached: 104, "104": "PaymasterExecutionTimeNotReached",
737
+ PaymasterExecutionTimePassed: 105, "105": "PaymasterExecutionTimePassed",
738
+ PaymasterInvalidCaller: 106, "106": "PaymasterInvalidCaller",
739
+ PaymasterRateLimitExceeded: 107, "107": "PaymasterRateLimitExceeded",
740
+ PaymasterNotSupported: 108, "108": "PaymasterNotSupported",
741
+ PaymasterHttp: 109, "109": "PaymasterHttp",
742
+ PaymasterExcecution: 110, "110": "PaymasterExcecution",
743
+ PaymasterSerialization: 111, "111": "PaymasterSerialization",
744
+ CartridgeControllerNotDeployed: 112, "112": "CartridgeControllerNotDeployed",
745
+ InsufficientBalance: 113, "113": "InsufficientBalance",
746
+ OriginError: 114, "114": "OriginError",
747
+ EncodingError: 115, "115": "EncodingError",
748
+ SerdeWasmBindgenError: 116, "116": "SerdeWasmBindgenError",
749
+ CairoSerdeError: 117, "117": "CairoSerdeError",
750
+ CairoShortStringToFeltError: 118, "118": "CairoShortStringToFeltError",
751
+ DeviceCreateCredential: 119, "119": "DeviceCreateCredential",
752
+ DeviceGetAssertion: 120, "120": "DeviceGetAssertion",
753
+ DeviceBadAssertion: 121, "121": "DeviceBadAssertion",
754
+ DeviceChannel: 122, "122": "DeviceChannel",
755
+ DeviceOrigin: 123, "123": "DeviceOrigin",
756
+ AccountSigning: 124, "124": "AccountSigning",
757
+ AccountProvider: 125, "125": "AccountProvider",
758
+ AccountClassHashCalculation: 126, "126": "AccountClassHashCalculation",
759
+ AccountFeeOutOfRange: 128, "128": "AccountFeeOutOfRange",
760
+ ProviderRateLimited: 129, "129": "ProviderRateLimited",
761
+ ProviderArrayLengthMismatch: 130, "130": "ProviderArrayLengthMismatch",
762
+ ProviderOther: 131, "131": "ProviderOther",
763
+ SessionAlreadyRegistered: 132, "132": "SessionAlreadyRegistered",
764
+ UrlParseError: 133, "133": "UrlParseError",
765
+ Base64DecodeError: 134, "134": "Base64DecodeError",
766
+ CoseError: 135, "135": "CoseError",
767
+ PolicyChainIdMismatch: 136, "136": "PolicyChainIdMismatch",
768
+ InvalidOwner: 137, "137": "InvalidOwner",
769
+ GasPriceTooHigh: 138, "138": "GasPriceTooHigh",
770
+ TransactionTimeout: 139, "139": "TransactionTimeout",
771
+ ConversionError: 140, "140": "ConversionError",
772
+ InvalidChainId: 141, "141": "InvalidChainId",
773
+ SessionRefreshRequired: 142, "142": "SessionRefreshRequired",
774
+ ManualExecutionRequired: 143, "143": "ManualExecutionRequired",
775
+ ForbiddenEntrypoint: 144, "144": "ForbiddenEntrypoint",
776
+ GasAmountTooHigh: 145, "145": "GasAmountTooHigh",
777
+ ApproveExecutionRequired: 146, "146": "ApproveExecutionRequired",
778
+ });
779
+
1153
780
  /**
1154
781
  * JavaScript-friendly chain configuration
1155
782
  */
1156
783
  export class JsChainConfig {
1157
-
1158
784
  static __unwrap(jsValue) {
1159
785
  if (!(jsValue instanceof JsChainConfig)) {
1160
786
  return 0;
1161
787
  }
1162
788
  return jsValue.__destroy_into_raw();
1163
789
  }
1164
-
1165
790
  __destroy_into_raw() {
1166
791
  const ptr = this.__wbg_ptr;
1167
792
  this.__wbg_ptr = 0;
1168
793
  JsChainConfigFinalization.unregister(this);
1169
794
  return ptr;
1170
795
  }
1171
-
1172
796
  free() {
1173
797
  const ptr = this.__destroy_into_raw();
1174
798
  wasm.__wbg_jschainconfig_free(ptr, 0);
1175
799
  }
800
+ /**
801
+ * @returns {JsFelt | undefined}
802
+ */
803
+ get address() {
804
+ const ret = wasm.jschainconfig_address(this.__wbg_ptr);
805
+ return takeObject(ret);
806
+ }
807
+ /**
808
+ * @returns {JsFelt}
809
+ */
810
+ get class_hash() {
811
+ const ret = wasm.jschainconfig_class_hash(this.__wbg_ptr);
812
+ return takeObject(ret);
813
+ }
1176
814
  /**
1177
815
  * @param {JsFelt} class_hash
1178
816
  * @param {string} rpc_url
@@ -1188,10 +826,10 @@ export class JsChainConfig {
1188
826
  return this;
1189
827
  }
1190
828
  /**
1191
- * @returns {JsFelt}
829
+ * @returns {Owner}
1192
830
  */
1193
- get class_hash() {
1194
- const ret = wasm.jschainconfig_class_hash(this.__wbg_ptr);
831
+ get owner() {
832
+ const ret = wasm.jschainconfig_owner(this.__wbg_ptr);
1195
833
  return takeObject(ret);
1196
834
  }
1197
835
  /**
@@ -1208,49 +846,21 @@ export class JsChainConfig {
1208
846
  deferred1_0 = r0;
1209
847
  deferred1_1 = r1;
1210
848
  return getStringFromWasm0(r0, r1);
1211
- } finally {
1212
- wasm.__wbindgen_add_to_stack_pointer(16);
1213
- wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1214
- }
1215
- }
1216
- /**
1217
- * @returns {Owner}
1218
- */
1219
- get owner() {
1220
- const ret = wasm.jschainconfig_owner(this.__wbg_ptr);
1221
- return takeObject(ret);
1222
- }
1223
- /**
1224
- * @returns {JsFelt | undefined}
1225
- */
1226
- get address() {
1227
- const ret = wasm.jschainconfig_address(this.__wbg_ptr);
1228
- return takeObject(ret);
849
+ } finally {
850
+ wasm.__wbindgen_add_to_stack_pointer(16);
851
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
852
+ }
1229
853
  }
1230
854
  }
1231
855
  if (Symbol.dispose) JsChainConfig.prototype[Symbol.dispose] = JsChainConfig.prototype.free;
1232
856
 
1233
- const JsControllerErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1234
- ? { register: () => {}, unregister: () => {} }
1235
- : new FinalizationRegistry(ptr => wasm.__wbg_jscontrollererror_free(ptr >>> 0, 1));
1236
-
1237
857
  export class JsControllerError {
1238
-
1239
- static __wrap(ptr) {
1240
- ptr = ptr >>> 0;
1241
- const obj = Object.create(JsControllerError.prototype);
1242
- obj.__wbg_ptr = ptr;
1243
- JsControllerErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1244
- return obj;
1245
- }
1246
-
1247
858
  __destroy_into_raw() {
1248
859
  const ptr = this.__wbg_ptr;
1249
860
  this.__wbg_ptr = 0;
1250
861
  JsControllerErrorFinalization.unregister(this);
1251
862
  return ptr;
1252
863
  }
1253
-
1254
864
  free() {
1255
865
  const ptr = this.__destroy_into_raw();
1256
866
  wasm.__wbg_jscontrollererror_free(ptr, 0);
@@ -1263,10 +873,23 @@ export class JsControllerError {
1263
873
  return ret;
1264
874
  }
1265
875
  /**
1266
- * @param {ErrorCode} arg0
876
+ * @returns {string | undefined}
1267
877
  */
1268
- set code(arg0) {
1269
- wasm.__wbg_set_jscontrollererror_code(this.__wbg_ptr, arg0);
878
+ get data() {
879
+ try {
880
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
881
+ wasm.__wbg_get_jscontrollererror_data(retptr, this.__wbg_ptr);
882
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
883
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
884
+ let v1;
885
+ if (r0 !== 0) {
886
+ v1 = getStringFromWasm0(r0, r1).slice();
887
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
888
+ }
889
+ return v1;
890
+ } finally {
891
+ wasm.__wbindgen_add_to_stack_pointer(16);
892
+ }
1270
893
  }
1271
894
  /**
1272
895
  * @returns {string}
@@ -1288,31 +911,10 @@ export class JsControllerError {
1288
911
  }
1289
912
  }
1290
913
  /**
1291
- * @param {string} arg0
1292
- */
1293
- set message(arg0) {
1294
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1295
- const len0 = WASM_VECTOR_LEN;
1296
- wasm.__wbg_set_jscontrollererror_message(this.__wbg_ptr, ptr0, len0);
1297
- }
1298
- /**
1299
- * @returns {string | undefined}
914
+ * @param {ErrorCode} arg0
1300
915
  */
1301
- get data() {
1302
- try {
1303
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1304
- wasm.__wbg_get_jscontrollererror_data(retptr, this.__wbg_ptr);
1305
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1306
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1307
- let v1;
1308
- if (r0 !== 0) {
1309
- v1 = getStringFromWasm0(r0, r1).slice();
1310
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
1311
- }
1312
- return v1;
1313
- } finally {
1314
- wasm.__wbindgen_add_to_stack_pointer(16);
1315
- }
916
+ set code(arg0) {
917
+ wasm.__wbg_set_jscontrollererror_code(this.__wbg_ptr, arg0);
1316
918
  }
1317
919
  /**
1318
920
  * @param {string | null} [arg0]
@@ -1322,15 +924,18 @@ export class JsControllerError {
1322
924
  var len0 = WASM_VECTOR_LEN;
1323
925
  wasm.__wbg_set_jscontrollererror_data(this.__wbg_ptr, ptr0, len0);
1324
926
  }
927
+ /**
928
+ * @param {string} arg0
929
+ */
930
+ set message(arg0) {
931
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
932
+ const len0 = WASM_VECTOR_LEN;
933
+ wasm.__wbg_set_jscontrollererror_message(this.__wbg_ptr, ptr0, len0);
934
+ }
1325
935
  }
1326
936
  if (Symbol.dispose) JsControllerError.prototype[Symbol.dispose] = JsControllerError.prototype.free;
1327
937
 
1328
- const LoginResultFinalization = (typeof FinalizationRegistry === 'undefined')
1329
- ? { register: () => {}, unregister: () => {} }
1330
- : new FinalizationRegistry(ptr => wasm.__wbg_loginresult_free(ptr >>> 0, 1));
1331
-
1332
938
  export class LoginResult {
1333
-
1334
939
  static __wrap(ptr) {
1335
940
  ptr = ptr >>> 0;
1336
941
  const obj = Object.create(LoginResult.prototype);
@@ -1338,14 +943,12 @@ export class LoginResult {
1338
943
  LoginResultFinalization.register(obj, obj.__wbg_ptr, obj);
1339
944
  return obj;
1340
945
  }
1341
-
1342
946
  __destroy_into_raw() {
1343
947
  const ptr = this.__wbg_ptr;
1344
948
  this.__wbg_ptr = 0;
1345
949
  LoginResultFinalization.unregister(this);
1346
950
  return ptr;
1347
951
  }
1348
-
1349
952
  free() {
1350
953
  const ptr = this.__destroy_into_raw();
1351
954
  wasm.__wbg_loginresult_free(ptr, 0);
@@ -1361,14 +964,10 @@ export class LoginResult {
1361
964
  }
1362
965
  if (Symbol.dispose) LoginResult.prototype[Symbol.dispose] = LoginResult.prototype.free;
1363
966
 
1364
- const MultiChainAccountFinalization = (typeof FinalizationRegistry === 'undefined')
1365
- ? { register: () => {}, unregister: () => {} }
1366
- : new FinalizationRegistry(ptr => wasm.__wbg_multichainaccount_free(ptr >>> 0, 1));
1367
967
  /**
1368
968
  * WASM bindings for MultiChainController
1369
969
  */
1370
970
  export class MultiChainAccount {
1371
-
1372
971
  static __wrap(ptr) {
1373
972
  ptr = ptr >>> 0;
1374
973
  const obj = Object.create(MultiChainAccount.prototype);
@@ -1376,18 +975,36 @@ export class MultiChainAccount {
1376
975
  MultiChainAccountFinalization.register(obj, obj.__wbg_ptr, obj);
1377
976
  return obj;
1378
977
  }
1379
-
1380
978
  __destroy_into_raw() {
1381
979
  const ptr = this.__wbg_ptr;
1382
980
  this.__wbg_ptr = 0;
1383
981
  MultiChainAccountFinalization.unregister(this);
1384
982
  return ptr;
1385
983
  }
1386
-
1387
984
  free() {
1388
985
  const ptr = this.__destroy_into_raw();
1389
986
  wasm.__wbg_multichainaccount_free(ptr, 0);
1390
987
  }
988
+ /**
989
+ * Adds a new chain configuration
990
+ * @param {JsChainConfig} config
991
+ * @returns {Promise<void>}
992
+ */
993
+ addChain(config) {
994
+ _assertClass(config, JsChainConfig);
995
+ var ptr0 = config.__destroy_into_raw();
996
+ const ret = wasm.multichainaccount_addChain(this.__wbg_ptr, ptr0);
997
+ return takeObject(ret);
998
+ }
999
+ /**
1000
+ * Gets an account instance for a specific chain
1001
+ * @param {JsFelt} chain_id
1002
+ * @returns {Promise<CartridgeAccount>}
1003
+ */
1004
+ controller(chain_id) {
1005
+ const ret = wasm.multichainaccount_controller(this.__wbg_ptr, addHeapObject(chain_id));
1006
+ return takeObject(ret);
1007
+ }
1391
1008
  /**
1392
1009
  * Creates a new MultiChainAccount with multiple chain configurations
1393
1010
  * @param {string} username
@@ -1416,17 +1033,6 @@ export class MultiChainAccount {
1416
1033
  const ret = wasm.multichainaccount_fromStorage(ptr0, len0);
1417
1034
  return takeObject(ret);
1418
1035
  }
1419
- /**
1420
- * Adds a new chain configuration
1421
- * @param {JsChainConfig} config
1422
- * @returns {Promise<void>}
1423
- */
1424
- addChain(config) {
1425
- _assertClass(config, JsChainConfig);
1426
- var ptr0 = config.__destroy_into_raw();
1427
- const ret = wasm.multichainaccount_addChain(this.__wbg_ptr, ptr0);
1428
- return takeObject(ret);
1429
- }
1430
1036
  /**
1431
1037
  * Removes a chain configuration
1432
1038
  * @param {JsFelt} chain_id
@@ -1436,299 +1042,313 @@ export class MultiChainAccount {
1436
1042
  const ret = wasm.multichainaccount_removeChain(this.__wbg_ptr, addHeapObject(chain_id));
1437
1043
  return takeObject(ret);
1438
1044
  }
1439
- /**
1440
- * Gets an account instance for a specific chain
1441
- * @param {JsFelt} chain_id
1442
- * @returns {Promise<CartridgeAccount>}
1443
- */
1444
- controller(chain_id) {
1445
- const ret = wasm.multichainaccount_controller(this.__wbg_ptr, addHeapObject(chain_id));
1446
- return takeObject(ret);
1447
- }
1448
1045
  }
1449
1046
  if (Symbol.dispose) MultiChainAccount.prototype[Symbol.dispose] = MultiChainAccount.prototype.free;
1450
1047
 
1451
- const MultiChainAccountMetaFinalization = (typeof FinalizationRegistry === 'undefined')
1452
- ? { register: () => {}, unregister: () => {} }
1453
- : new FinalizationRegistry(ptr => wasm.__wbg_multichainaccountmeta_free(ptr >>> 0, 1));
1454
1048
  /**
1455
1049
  * Metadata for displaying multi-chain information
1456
1050
  */
1457
1051
  export class MultiChainAccountMeta {
1458
-
1459
1052
  __destroy_into_raw() {
1460
1053
  const ptr = this.__wbg_ptr;
1461
1054
  this.__wbg_ptr = 0;
1462
1055
  MultiChainAccountMetaFinalization.unregister(this);
1463
1056
  return ptr;
1464
1057
  }
1465
-
1466
1058
  free() {
1467
1059
  const ptr = this.__destroy_into_raw();
1468
1060
  wasm.__wbg_multichainaccountmeta_free(ptr, 0);
1469
1061
  }
1470
1062
  /**
1471
- * @returns {string}
1063
+ * @returns {JsFelt[]}
1472
1064
  */
1473
- get username() {
1474
- let deferred1_0;
1475
- let deferred1_1;
1065
+ get chains() {
1476
1066
  try {
1477
1067
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1478
- wasm.multichainaccountmeta_username(retptr, this.__wbg_ptr);
1068
+ wasm.multichainaccountmeta_chains(retptr, this.__wbg_ptr);
1479
1069
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1480
1070
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1481
- deferred1_0 = r0;
1482
- deferred1_1 = r1;
1483
- return getStringFromWasm0(r0, r1);
1071
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1072
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1073
+ return v1;
1484
1074
  } finally {
1485
1075
  wasm.__wbindgen_add_to_stack_pointer(16);
1486
- wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1487
1076
  }
1488
1077
  }
1489
1078
  /**
1490
- * @returns {JsFelt[]}
1079
+ * @returns {string}
1491
1080
  */
1492
- get chains() {
1081
+ get username() {
1082
+ let deferred1_0;
1083
+ let deferred1_1;
1493
1084
  try {
1494
1085
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1495
- wasm.multichainaccountmeta_chains(retptr, this.__wbg_ptr);
1086
+ wasm.multichainaccountmeta_username(retptr, this.__wbg_ptr);
1496
1087
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1497
1088
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1498
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1499
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
1500
- return v1;
1089
+ deferred1_0 = r0;
1090
+ deferred1_1 = r1;
1091
+ return getStringFromWasm0(r0, r1);
1501
1092
  } finally {
1502
1093
  wasm.__wbindgen_add_to_stack_pointer(16);
1094
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1503
1095
  }
1504
1096
  }
1505
1097
  }
1506
1098
  if (Symbol.dispose) MultiChainAccountMeta.prototype[Symbol.dispose] = MultiChainAccountMeta.prototype.free;
1507
1099
 
1508
- export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
1100
+ /**
1101
+ * Computes the Starknet contract address for a controller account without needing a full instance.
1102
+ *
1103
+ * # Arguments
1104
+ *
1105
+ * * `class_hash` - The class hash of the account contract (JsFelt).
1106
+ * * `owner` - The owner configuration for the account.
1107
+ * * `salt` - The salt used for address calculation (JsFelt).
1108
+ *
1109
+ * # Returns
1110
+ *
1111
+ * The computed Starknet contract address as a `JsFelt`.
1112
+ * @param {JsFelt} class_hash
1113
+ * @param {Owner} owner
1114
+ * @param {JsFelt} salt
1115
+ * @returns {JsFelt}
1116
+ */
1117
+ export function computeAccountAddress(class_hash, owner, salt) {
1118
+ try {
1119
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1120
+ wasm.computeAccountAddress(retptr, addHeapObject(class_hash), addHeapObject(owner), addHeapObject(salt));
1121
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1122
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1123
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1124
+ if (r2) {
1125
+ throw takeObject(r1);
1126
+ }
1127
+ return takeObject(r0);
1128
+ } finally {
1129
+ wasm.__wbindgen_add_to_stack_pointer(16);
1130
+ }
1131
+ }
1132
+
1133
+ /**
1134
+ * @param {Signer} signer
1135
+ * @returns {JsFelt}
1136
+ */
1137
+ export function signerToGuid(signer) {
1138
+ try {
1139
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1140
+ wasm.signerToGuid(retptr, addHeapObject(signer));
1141
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1142
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1143
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1144
+ if (r2) {
1145
+ throw takeObject(r1);
1146
+ }
1147
+ return takeObject(r0);
1148
+ } finally {
1149
+ wasm.__wbindgen_add_to_stack_pointer(16);
1150
+ }
1151
+ }
1152
+
1153
+ /**
1154
+ * Subscribes to the creation of a session for a given controller, session_key_guid and cartridge api url.
1155
+ * The goal of this function is to know from any place when the register session flow has been completed, and to
1156
+ * get the authorization.
1157
+ * @param {JsFelt} session_key_guid
1158
+ * @param {string} cartridge_api_url
1159
+ * @returns {Promise<JsSubscribeSessionResult>}
1160
+ */
1161
+ export function subscribeCreateSession(session_key_guid, cartridge_api_url) {
1162
+ const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1163
+ const len0 = WASM_VECTOR_LEN;
1164
+ const ret = wasm.subscribeCreateSession(addHeapObject(session_key_guid), ptr0, len0);
1165
+ return takeObject(ret);
1166
+ }
1167
+ export function __wbg_Error_83742b46f01ce22d(arg0, arg1) {
1509
1168
  const ret = Error(getStringFromWasm0(arg0, arg1));
1510
1169
  return addHeapObject(ret);
1511
- };
1512
-
1513
- export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
1170
+ }
1171
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
1514
1172
  const ret = String(getObject(arg1));
1515
1173
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1516
1174
  const len1 = WASM_VECTOR_LEN;
1517
1175
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1518
1176
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1519
- };
1520
-
1521
- export function __wbg___wbindgen_boolean_get_6d5a1ee65bab5f68(arg0) {
1177
+ }
1178
+ export function __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1(arg0) {
1522
1179
  const v = getObject(arg0);
1523
1180
  const ret = typeof(v) === 'boolean' ? v : undefined;
1524
1181
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1525
- };
1526
-
1527
- export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
1182
+ }
1183
+ export function __wbg___wbindgen_debug_string_5398f5bb970e0daa(arg0, arg1) {
1528
1184
  const ret = debugString(getObject(arg1));
1529
1185
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1530
1186
  const len1 = WASM_VECTOR_LEN;
1531
1187
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1532
1188
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1533
- };
1534
-
1535
- export function __wbg___wbindgen_in_bb933bd9e1b3bc0f(arg0, arg1) {
1189
+ }
1190
+ export function __wbg___wbindgen_in_41dbb8413020e076(arg0, arg1) {
1536
1191
  const ret = getObject(arg0) in getObject(arg1);
1537
1192
  return ret;
1538
- };
1539
-
1540
- export function __wbg___wbindgen_is_function_ee8a6c5833c90377(arg0) {
1193
+ }
1194
+ export function __wbg___wbindgen_is_function_3c846841762788c1(arg0) {
1541
1195
  const ret = typeof(getObject(arg0)) === 'function';
1542
1196
  return ret;
1543
- };
1544
-
1545
- export function __wbg___wbindgen_is_object_c818261d21f283a4(arg0) {
1197
+ }
1198
+ export function __wbg___wbindgen_is_object_781bc9f159099513(arg0) {
1546
1199
  const val = getObject(arg0);
1547
1200
  const ret = typeof(val) === 'object' && val !== null;
1548
1201
  return ret;
1549
- };
1550
-
1551
- export function __wbg___wbindgen_is_string_fbb76cb2940daafd(arg0) {
1202
+ }
1203
+ export function __wbg___wbindgen_is_string_7ef6b97b02428fae(arg0) {
1552
1204
  const ret = typeof(getObject(arg0)) === 'string';
1553
1205
  return ret;
1554
- };
1555
-
1556
- export function __wbg___wbindgen_is_undefined_2d472862bd29a478(arg0) {
1206
+ }
1207
+ export function __wbg___wbindgen_is_undefined_52709e72fb9f179c(arg0) {
1557
1208
  const ret = getObject(arg0) === undefined;
1558
1209
  return ret;
1559
- };
1560
-
1561
- export function __wbg___wbindgen_jsval_loose_eq_b664b38a2f582147(arg0, arg1) {
1210
+ }
1211
+ export function __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b(arg0, arg1) {
1562
1212
  const ret = getObject(arg0) == getObject(arg1);
1563
1213
  return ret;
1564
- };
1565
-
1566
- export function __wbg___wbindgen_number_get_a20bf9b85341449d(arg0, arg1) {
1214
+ }
1215
+ export function __wbg___wbindgen_number_get_34bb9d9dcfa21373(arg0, arg1) {
1567
1216
  const obj = getObject(arg1);
1568
1217
  const ret = typeof(obj) === 'number' ? obj : undefined;
1569
1218
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1570
1219
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1571
- };
1572
-
1573
- export function __wbg___wbindgen_string_get_e4f06c90489ad01b(arg0, arg1) {
1220
+ }
1221
+ export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
1574
1222
  const obj = getObject(arg1);
1575
1223
  const ret = typeof(obj) === 'string' ? obj : undefined;
1576
1224
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1577
1225
  var len1 = WASM_VECTOR_LEN;
1578
1226
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1579
1227
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1580
- };
1581
-
1582
- export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
1228
+ }
1229
+ export function __wbg___wbindgen_throw_6ddd609b62940d55(arg0, arg1) {
1583
1230
  throw new Error(getStringFromWasm0(arg0, arg1));
1584
- };
1585
-
1586
- export function __wbg__wbg_cb_unref_2454a539ea5790d9(arg0) {
1231
+ }
1232
+ export function __wbg__wbg_cb_unref_6b5b6b8576d35cb1(arg0) {
1587
1233
  getObject(arg0)._wbg_cb_unref();
1588
- };
1589
-
1590
- export function __wbg_abort_28ad55c5825b004d(arg0, arg1) {
1591
- getObject(arg0).abort(getObject(arg1));
1592
- };
1593
-
1594
- export function __wbg_abort_e7eb059f72f9ed0c(arg0) {
1234
+ }
1235
+ export function __wbg_abort_5ef96933660780b7(arg0) {
1595
1236
  getObject(arg0).abort();
1596
- };
1597
-
1598
- export function __wbg_addEventListener_7a418931447b2eae() { return handleError(function (arg0, arg1, arg2, arg3) {
1237
+ }
1238
+ export function __wbg_abort_6479c2d794ebf2ee(arg0, arg1) {
1239
+ getObject(arg0).abort(getObject(arg1));
1240
+ }
1241
+ export function __wbg_addEventListener_2d985aa8a656f6dc() { return handleError(function (arg0, arg1, arg2, arg3) {
1599
1242
  getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1600
- }, arguments) };
1601
-
1602
- export function __wbg_append_b577eb3a177bc0fa() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1243
+ }, arguments); }
1244
+ export function __wbg_append_608dfb635ee8998f() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1603
1245
  getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1604
- }, arguments) };
1605
-
1606
- export function __wbg_arrayBuffer_b375eccb84b4ddf3() { return handleError(function (arg0) {
1246
+ }, arguments); }
1247
+ export function __wbg_arrayBuffer_eb8e9ca620af2a19() { return handleError(function (arg0) {
1607
1248
  const ret = getObject(arg0).arrayBuffer();
1608
1249
  return addHeapObject(ret);
1609
- }, arguments) };
1610
-
1611
- export function __wbg_call_525440f72fbfc0ea() { return handleError(function (arg0, arg1, arg2) {
1250
+ }, arguments); }
1251
+ export function __wbg_call_2d781c1f4d5c0ef8() { return handleError(function (arg0, arg1, arg2) {
1612
1252
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1613
1253
  return addHeapObject(ret);
1614
- }, arguments) };
1615
-
1616
- export function __wbg_call_e762c39fa8ea36bf() { return handleError(function (arg0, arg1) {
1254
+ }, arguments); }
1255
+ export function __wbg_call_e133b57c9155d22c() { return handleError(function (arg0, arg1) {
1617
1256
  const ret = getObject(arg0).call(getObject(arg1));
1618
1257
  return addHeapObject(ret);
1619
- }, arguments) };
1620
-
1258
+ }, arguments); }
1621
1259
  export function __wbg_cartridgeaccount_new(arg0) {
1622
1260
  const ret = CartridgeAccount.__wrap(arg0);
1623
1261
  return addHeapObject(ret);
1624
- };
1625
-
1262
+ }
1626
1263
  export function __wbg_cartridgeaccountwithmeta_new(arg0) {
1627
1264
  const ret = CartridgeAccountWithMeta.__wrap(arg0);
1628
1265
  return addHeapObject(ret);
1629
- };
1630
-
1631
- export function __wbg_clearTimeout_7a42b49784aea641(arg0) {
1266
+ }
1267
+ export function __wbg_clearTimeout_6b8d9a38b9263d65(arg0) {
1632
1268
  const ret = clearTimeout(takeObject(arg0));
1633
1269
  return addHeapObject(ret);
1634
- };
1635
-
1636
- export function __wbg_clear_cb2a4a548aeda3df() { return handleError(function (arg0) {
1270
+ }
1271
+ export function __wbg_clear_f0a9edc1f780da4e() { return handleError(function (arg0) {
1637
1272
  getObject(arg0).clear();
1638
- }, arguments) };
1639
-
1640
- export function __wbg_create_00dd406d2e274297() { return handleError(function (arg0, arg1) {
1273
+ }, arguments); }
1274
+ export function __wbg_create_48a66894da5b46c4() { return handleError(function (arg0, arg1) {
1641
1275
  const ret = getObject(arg0).create(getObject(arg1));
1642
1276
  return addHeapObject(ret);
1643
- }, arguments) };
1644
-
1645
- export function __wbg_credentials_8cadf6cea6a4f922(arg0) {
1277
+ }, arguments); }
1278
+ export function __wbg_credentials_512715b843dae8c8(arg0) {
1646
1279
  const ret = getObject(arg0).credentials;
1647
1280
  return addHeapObject(ret);
1648
- };
1649
-
1650
- export function __wbg_crypto_574e78ad8b13b65f(arg0) {
1281
+ }
1282
+ export function __wbg_crypto_38df2bab126b63dc(arg0) {
1651
1283
  const ret = getObject(arg0).crypto;
1652
1284
  return addHeapObject(ret);
1653
- };
1654
-
1655
- export function __wbg_data_ee4306d069f24f2d(arg0) {
1285
+ }
1286
+ export function __wbg_data_a3d9ff9cdd801002(arg0) {
1656
1287
  const ret = getObject(arg0).data;
1657
1288
  return addHeapObject(ret);
1658
- };
1659
-
1660
- export function __wbg_done_2042aa2670fb1db1(arg0) {
1289
+ }
1290
+ export function __wbg_done_08ce71ee07e3bd17(arg0) {
1661
1291
  const ret = getObject(arg0).done;
1662
1292
  return ret;
1663
- };
1664
-
1665
- export function __wbg_error_a7f8fbb0523dae15(arg0) {
1293
+ }
1294
+ export function __wbg_error_8d9a8e04cd1d3588(arg0) {
1666
1295
  console.error(getObject(arg0));
1667
- };
1668
-
1669
- export function __wbg_fetch_74a3e84ebd2c9a0e(arg0) {
1670
- const ret = fetch(getObject(arg0));
1296
+ }
1297
+ export function __wbg_fetch_5550a88cf343aaa9(arg0, arg1) {
1298
+ const ret = getObject(arg0).fetch(getObject(arg1));
1671
1299
  return addHeapObject(ret);
1672
- };
1673
-
1674
- export function __wbg_fetch_f1856afdb49415d1(arg0) {
1300
+ }
1301
+ export function __wbg_fetch_9dad4fe911207b37(arg0) {
1675
1302
  const ret = fetch(getObject(arg0));
1676
1303
  return addHeapObject(ret);
1677
- };
1678
-
1679
- export function __wbg_fetch_f8ba0e29a9d6de0d(arg0, arg1) {
1680
- const ret = getObject(arg0).fetch(getObject(arg1));
1304
+ }
1305
+ export function __wbg_fetch_fda7bc27c982b1f3(arg0) {
1306
+ const ret = fetch(getObject(arg0));
1681
1307
  return addHeapObject(ret);
1682
- };
1683
-
1684
- export function __wbg_getClientExtensionResults_3fbb568c5f7347cf(arg0) {
1308
+ }
1309
+ export function __wbg_getClientExtensionResults_0c58ae7175717c3d(arg0) {
1685
1310
  const ret = getObject(arg0).getClientExtensionResults();
1686
1311
  return addHeapObject(ret);
1687
- };
1688
-
1689
- export function __wbg_getItem_89f57d6acc51a876() { return handleError(function (arg0, arg1, arg2, arg3) {
1312
+ }
1313
+ export function __wbg_getItem_a7cc1d4f154f2e6f() { return handleError(function (arg0, arg1, arg2, arg3) {
1690
1314
  const ret = getObject(arg1).getItem(getStringFromWasm0(arg2, arg3));
1691
1315
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1692
1316
  var len1 = WASM_VECTOR_LEN;
1693
1317
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1694
1318
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1695
- }, arguments) };
1696
-
1697
- export function __wbg_getRandomValues_b8f5dbd5f3995a9e() { return handleError(function (arg0, arg1) {
1319
+ }, arguments); }
1320
+ export function __wbg_getRandomValues_c44a50d8cfdaebeb() { return handleError(function (arg0, arg1) {
1698
1321
  getObject(arg0).getRandomValues(getObject(arg1));
1699
- }, arguments) };
1700
-
1701
- export function __wbg_getTime_14776bfb48a1bff9(arg0) {
1322
+ }, arguments); }
1323
+ export function __wbg_getTime_1dad7b5386ddd2d9(arg0) {
1702
1324
  const ret = getObject(arg0).getTime();
1703
1325
  return ret;
1704
- };
1705
-
1706
- export function __wbg_get_de97927282f5fc02() { return handleError(function (arg0, arg1) {
1326
+ }
1327
+ export function __wbg_get_2803136e052c1ea0() { return handleError(function (arg0, arg1) {
1707
1328
  const ret = getObject(arg0).get(getObject(arg1));
1708
1329
  return addHeapObject(ret);
1709
- }, arguments) };
1710
-
1711
- export function __wbg_get_efcb449f58ec27c2() { return handleError(function (arg0, arg1) {
1330
+ }, arguments); }
1331
+ export function __wbg_get_326e41e095fb2575() { return handleError(function (arg0, arg1) {
1712
1332
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1713
1333
  return addHeapObject(ret);
1714
- }, arguments) };
1715
-
1716
- export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
1334
+ }, arguments); }
1335
+ export function __wbg_get_3ef1eba1850ade27() { return handleError(function (arg0, arg1) {
1336
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1337
+ return addHeapObject(ret);
1338
+ }, arguments); }
1339
+ export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
1717
1340
  const ret = getObject(arg0)[getObject(arg1)];
1718
1341
  return addHeapObject(ret);
1719
- };
1720
-
1721
- export function __wbg_has_787fafc980c3ccdb() { return handleError(function (arg0, arg1) {
1342
+ }
1343
+ export function __wbg_has_926ef2ff40b308cf() { return handleError(function (arg0, arg1) {
1722
1344
  const ret = Reflect.has(getObject(arg0), getObject(arg1));
1723
1345
  return ret;
1724
- }, arguments) };
1725
-
1726
- export function __wbg_headers_b87d7eaba61c3278(arg0) {
1346
+ }, arguments); }
1347
+ export function __wbg_headers_eb2234545f9ff993(arg0) {
1727
1348
  const ret = getObject(arg0).headers;
1728
1349
  return addHeapObject(ret);
1729
- };
1730
-
1731
- export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
1350
+ }
1351
+ export function __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6(arg0) {
1732
1352
  let result;
1733
1353
  try {
1734
1354
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -1737,9 +1357,8 @@ export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
1737
1357
  }
1738
1358
  const ret = result;
1739
1359
  return ret;
1740
- };
1741
-
1742
- export function __wbg_instanceof_Object_10bb762262230c68(arg0) {
1360
+ }
1361
+ export function __wbg_instanceof_Object_be1962063fcc0c9f(arg0) {
1743
1362
  let result;
1744
1363
  try {
1745
1364
  result = getObject(arg0) instanceof Object;
@@ -1748,9 +1367,8 @@ export function __wbg_instanceof_Object_10bb762262230c68(arg0) {
1748
1367
  }
1749
1368
  const ret = result;
1750
1369
  return ret;
1751
- };
1752
-
1753
- export function __wbg_instanceof_Response_f4f3e87e07f3135c(arg0) {
1370
+ }
1371
+ export function __wbg_instanceof_Response_9b4d9fd451e051b1(arg0) {
1754
1372
  let result;
1755
1373
  try {
1756
1374
  result = getObject(arg0) instanceof Response;
@@ -1759,9 +1377,8 @@ export function __wbg_instanceof_Response_f4f3e87e07f3135c(arg0) {
1759
1377
  }
1760
1378
  const ret = result;
1761
1379
  return ret;
1762
- };
1763
-
1764
- export function __wbg_instanceof_Uint8Array_20c8e73002f7af98(arg0) {
1380
+ }
1381
+ export function __wbg_instanceof_Uint8Array_740438561a5b956d(arg0) {
1765
1382
  let result;
1766
1383
  try {
1767
1384
  result = getObject(arg0) instanceof Uint8Array;
@@ -1770,9 +1387,8 @@ export function __wbg_instanceof_Uint8Array_20c8e73002f7af98(arg0) {
1770
1387
  }
1771
1388
  const ret = result;
1772
1389
  return ret;
1773
- };
1774
-
1775
- export function __wbg_instanceof_Window_4846dbb3de56c84c(arg0) {
1390
+ }
1391
+ export function __wbg_instanceof_Window_23e677d2c6843922(arg0) {
1776
1392
  let result;
1777
1393
  try {
1778
1394
  result = getObject(arg0) instanceof Window;
@@ -1781,9 +1397,8 @@ export function __wbg_instanceof_Window_4846dbb3de56c84c(arg0) {
1781
1397
  }
1782
1398
  const ret = result;
1783
1399
  return ret;
1784
- };
1785
-
1786
- export function __wbg_instanceof_WorkerGlobalScope_e31f49b6d33fcadd(arg0) {
1400
+ }
1401
+ export function __wbg_instanceof_WorkerGlobalScope_de6976d00cb213c6(arg0) {
1787
1402
  let result;
1788
1403
  try {
1789
1404
  result = getObject(arg0) instanceof WorkerGlobalScope;
@@ -1792,90 +1407,123 @@ export function __wbg_instanceof_WorkerGlobalScope_e31f49b6d33fcadd(arg0) {
1792
1407
  }
1793
1408
  const ret = result;
1794
1409
  return ret;
1795
- };
1796
-
1797
- export function __wbg_iterator_e5822695327a3c39() {
1410
+ }
1411
+ export function __wbg_iterator_d8f549ec8fb061b1() {
1798
1412
  const ret = Symbol.iterator;
1799
1413
  return addHeapObject(ret);
1800
- };
1801
-
1414
+ }
1802
1415
  export function __wbg_jschainconfig_unwrap(arg0) {
1803
- const ret = JsChainConfig.__unwrap(takeObject(arg0));
1416
+ const ret = JsChainConfig.__unwrap(getObject(arg0));
1804
1417
  return ret;
1805
- };
1806
-
1807
- export function __wbg_jscontrollererror_new(arg0) {
1808
- const ret = JsControllerError.__wrap(arg0);
1809
- return addHeapObject(ret);
1810
- };
1811
-
1812
- export function __wbg_length_69bca3cb64fc8748(arg0) {
1418
+ }
1419
+ export function __wbg_key_84733a6ee7e4d63e() { return handleError(function (arg0, arg1, arg2) {
1420
+ const ret = getObject(arg1).key(arg2 >>> 0);
1421
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1422
+ var len1 = WASM_VECTOR_LEN;
1423
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1424
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1425
+ }, arguments); }
1426
+ export function __wbg_length_8632bd8b5ab30449() { return handleError(function (arg0) {
1813
1427
  const ret = getObject(arg0).length;
1814
1428
  return ret;
1815
- };
1816
-
1817
- export function __wbg_localStorage_3034501cd2b3da3f() { return handleError(function (arg0) {
1429
+ }, arguments); }
1430
+ export function __wbg_length_ea16607d7b61445b(arg0) {
1431
+ const ret = getObject(arg0).length;
1432
+ return ret;
1433
+ }
1434
+ export function __wbg_localStorage_51c38b3b222e1ed2() { return handleError(function (arg0) {
1818
1435
  const ret = getObject(arg0).localStorage;
1819
1436
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1820
- }, arguments) };
1821
-
1822
- export function __wbg_location_ef1665506d996dd9(arg0) {
1437
+ }, arguments); }
1438
+ export function __wbg_location_fc8d47802682dd93(arg0) {
1823
1439
  const ret = getObject(arg0).location;
1824
1440
  return addHeapObject(ret);
1825
- };
1826
-
1827
- export function __wbg_log_8cec76766b8c0e33(arg0) {
1441
+ }
1442
+ export function __wbg_log_524eedafa26daa59(arg0) {
1828
1443
  console.log(getObject(arg0));
1829
- };
1830
-
1444
+ }
1831
1445
  export function __wbg_loginresult_new(arg0) {
1832
1446
  const ret = LoginResult.__wrap(arg0);
1833
1447
  return addHeapObject(ret);
1834
- };
1835
-
1836
- export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
1448
+ }
1449
+ export function __wbg_msCrypto_bd5a034af96bcba6(arg0) {
1837
1450
  const ret = getObject(arg0).msCrypto;
1838
1451
  return addHeapObject(ret);
1839
- };
1840
-
1452
+ }
1841
1453
  export function __wbg_multichainaccount_new(arg0) {
1842
1454
  const ret = MultiChainAccount.__wrap(arg0);
1843
1455
  return addHeapObject(ret);
1844
- };
1845
-
1846
- export function __wbg_navigator_971384882e8ea23a(arg0) {
1456
+ }
1457
+ export function __wbg_navigator_9cebf56f28aa719b(arg0) {
1847
1458
  const ret = getObject(arg0).navigator;
1848
1459
  return addHeapObject(ret);
1849
- };
1850
-
1851
- export function __wbg_new_0_f9740686d739025c() {
1460
+ }
1461
+ export function __wbg_new_0837727332ac86ba() { return handleError(function () {
1462
+ const ret = new Headers();
1463
+ return addHeapObject(ret);
1464
+ }, arguments); }
1465
+ export function __wbg_new_0_1dcafdf5e786e876() {
1852
1466
  const ret = new Date();
1853
1467
  return addHeapObject(ret);
1854
- };
1855
-
1856
- export function __wbg_new_1acc0b6eea89d040() {
1468
+ }
1469
+ export function __wbg_new_49d5571bd3f0c4d4() {
1470
+ const ret = new Map();
1471
+ return addHeapObject(ret);
1472
+ }
1473
+ export function __wbg_new_5f486cdf45a04d78(arg0) {
1474
+ const ret = new Uint8Array(getObject(arg0));
1475
+ return addHeapObject(ret);
1476
+ }
1477
+ export function __wbg_new_8f7f8d552bd2ab6d() {
1478
+ const ret = new Mutex();
1479
+ return addHeapObject(ret);
1480
+ }
1481
+ export function __wbg_new_a70fbab9066b301f() {
1482
+ const ret = new Array();
1483
+ return addHeapObject(ret);
1484
+ }
1485
+ export function __wbg_new_ab79df5bd7c26067() {
1857
1486
  const ret = new Object();
1858
1487
  return addHeapObject(ret);
1859
- };
1860
-
1861
- export function __wbg_new_2531773dac38ebb3() { return handleError(function () {
1488
+ }
1489
+ export function __wbg_new_c518c60af666645b() { return handleError(function () {
1862
1490
  const ret = new AbortController();
1863
1491
  return addHeapObject(ret);
1864
- }, arguments) };
1865
-
1866
- export function __wbg_new_2658d63118834d8e() {
1867
- const ret = new Mutex();
1492
+ }, arguments); }
1493
+ export function __wbg_new_d098e265629cd10f(arg0, arg1) {
1494
+ try {
1495
+ var state0 = {a: arg0, b: arg1};
1496
+ var cb0 = (arg0, arg1) => {
1497
+ const a = state0.a;
1498
+ state0.a = 0;
1499
+ try {
1500
+ return __wasm_bindgen_func_elem_11254(a, state0.b, arg0, arg1);
1501
+ } finally {
1502
+ state0.a = a;
1503
+ }
1504
+ };
1505
+ const ret = new Promise(cb0);
1506
+ return addHeapObject(ret);
1507
+ } finally {
1508
+ state0.a = state0.b = 0;
1509
+ }
1510
+ }
1511
+ export function __wbg_new_d15cb560a6a0e5f0(arg0, arg1) {
1512
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1868
1513
  return addHeapObject(ret);
1869
- };
1870
-
1871
- export function __wbg_new_3c3d849046688a66(arg0, arg1) {
1514
+ }
1515
+ export function __wbg_new_from_slice_22da9388ac046e50(arg0, arg1) {
1516
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1517
+ return addHeapObject(ret);
1518
+ }
1519
+ export function __wbg_new_typed_aaaeaf29cf802876(arg0, arg1) {
1872
1520
  try {
1873
1521
  var state0 = {a: arg0, b: arg1};
1874
1522
  var cb0 = (arg0, arg1) => {
1875
1523
  const a = state0.a;
1876
1524
  state0.a = 0;
1877
1525
  try {
1878
- return __wasm_bindgen_func_elem_10962(a, state0.b, arg0, arg1);
1526
+ return __wasm_bindgen_func_elem_11254(a, state0.b, arg0, arg1);
1879
1527
  } finally {
1880
1528
  state0.a = a;
1881
1529
  }
@@ -1885,376 +1533,652 @@ export function __wbg_new_3c3d849046688a66(arg0, arg1) {
1885
1533
  } finally {
1886
1534
  state0.a = state0.b = 0;
1887
1535
  }
1888
- };
1889
-
1890
- export function __wbg_new_5a79be3ab53b8aa5(arg0) {
1891
- const ret = new Uint8Array(getObject(arg0));
1536
+ }
1537
+ export function __wbg_new_typed_bccac67128ed885a() {
1538
+ const ret = new Array();
1892
1539
  return addHeapObject(ret);
1893
- };
1894
-
1895
- export function __wbg_new_68651c719dcda04e() {
1896
- const ret = new Map();
1540
+ }
1541
+ export function __wbg_new_with_length_825018a1616e9e55(arg0) {
1542
+ const ret = new Uint8Array(arg0 >>> 0);
1897
1543
  return addHeapObject(ret);
1898
- };
1899
-
1900
- export function __wbg_new_9edf9838a2def39c() { return handleError(function () {
1901
- const ret = new Headers();
1544
+ }
1545
+ export function __wbg_new_with_str_and_init_b4b54d1a819bc724() { return handleError(function (arg0, arg1, arg2) {
1546
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1902
1547
  return addHeapObject(ret);
1903
- }, arguments) };
1904
-
1905
- export function __wbg_new_e17d9f43105b08be() {
1906
- const ret = new Array();
1548
+ }, arguments); }
1549
+ export function __wbg_next_11b99ee6237339e3() { return handleError(function (arg0) {
1550
+ const ret = getObject(arg0).next();
1907
1551
  return addHeapObject(ret);
1908
- };
1909
-
1910
- export function __wbg_new_from_slice_92f4d78ca282a2d2(arg0, arg1) {
1911
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1552
+ }, arguments); }
1553
+ export function __wbg_next_e01a967809d1aa68(arg0) {
1554
+ const ret = getObject(arg0).next;
1912
1555
  return addHeapObject(ret);
1913
- };
1914
-
1915
- export function __wbg_new_no_args_ee98eee5275000a4(arg0, arg1) {
1916
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1556
+ }
1557
+ export function __wbg_node_84ea875411254db1(arg0) {
1558
+ const ret = getObject(arg0).node;
1917
1559
  return addHeapObject(ret);
1918
- };
1919
-
1920
- export function __wbg_new_with_length_01aa0dc35aa13543(arg0) {
1921
- const ret = new Uint8Array(arg0 >>> 0);
1560
+ }
1561
+ export function __wbg_now_16f0c993d5dd6c27() {
1562
+ const ret = Date.now();
1563
+ return ret;
1564
+ }
1565
+ export function __wbg_obtain_513d6156ff4b4fb7(arg0) {
1566
+ const ret = getObject(arg0).obtain();
1922
1567
  return addHeapObject(ret);
1923
- };
1924
-
1925
- export function __wbg_new_with_str_and_init_0ae7728b6ec367b1() { return handleError(function (arg0, arg1, arg2) {
1926
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1568
+ }
1569
+ export function __wbg_open_891ac0b929710544() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1570
+ const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6));
1571
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1572
+ }, arguments); }
1573
+ export function __wbg_origin_3a929219cb000f49(arg0, arg1) {
1574
+ const ret = getObject(arg1).origin;
1575
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1576
+ const len1 = WASM_VECTOR_LEN;
1577
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1578
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1579
+ }
1580
+ export function __wbg_origin_bac5c3119fe40a90() { return handleError(function (arg0, arg1) {
1581
+ const ret = getObject(arg1).origin;
1582
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1583
+ const len1 = WASM_VECTOR_LEN;
1584
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1585
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1586
+ }, arguments); }
1587
+ export function __wbg_parse_d8e59ac01c35b18b(arg0, arg1) {
1588
+ let deferred0_0;
1589
+ let deferred0_1;
1590
+ try {
1591
+ deferred0_0 = arg0;
1592
+ deferred0_1 = arg1;
1593
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1594
+ return addHeapObject(ret);
1595
+ } finally {
1596
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1597
+ }
1598
+ }
1599
+ export function __wbg_process_44c7a14e11e9f69e(arg0) {
1600
+ const ret = getObject(arg0).process;
1601
+ return addHeapObject(ret);
1602
+ }
1603
+ export function __wbg_prototypesetcall_d62e5099504357e6(arg0, arg1, arg2) {
1604
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1605
+ }
1606
+ export function __wbg_push_e87b0e732085a946(arg0, arg1) {
1607
+ const ret = getObject(arg0).push(getObject(arg1));
1608
+ return ret;
1609
+ }
1610
+ export function __wbg_queueMicrotask_0c399741342fb10f(arg0) {
1611
+ const ret = getObject(arg0).queueMicrotask;
1612
+ return addHeapObject(ret);
1613
+ }
1614
+ export function __wbg_queueMicrotask_a082d78ce798393e(arg0) {
1615
+ queueMicrotask(getObject(arg0));
1616
+ }
1617
+ export function __wbg_randomFillSync_6c25eac9869eb53c() { return handleError(function (arg0, arg1) {
1618
+ getObject(arg0).randomFillSync(takeObject(arg1));
1619
+ }, arguments); }
1620
+ export function __wbg_removeEventListener_d27694700fc0df8b() { return handleError(function (arg0, arg1, arg2, arg3) {
1621
+ getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1622
+ }, arguments); }
1623
+ export function __wbg_removeItem_95c258b9afdd7580() { return handleError(function (arg0, arg1, arg2) {
1624
+ getObject(arg0).removeItem(getStringFromWasm0(arg1, arg2));
1625
+ }, arguments); }
1626
+ export function __wbg_require_b4edbdcf3e2a1ef0() { return handleError(function () {
1627
+ const ret = module.require;
1628
+ return addHeapObject(ret);
1629
+ }, arguments); }
1630
+ export function __wbg_resolve_ae8d83246e5bcc12(arg0) {
1631
+ const ret = Promise.resolve(getObject(arg0));
1632
+ return addHeapObject(ret);
1633
+ }
1634
+ export function __wbg_setItem_5f84aeef0d7f3c17() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1635
+ getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1636
+ }, arguments); }
1637
+ export function __wbg_setTimeout_7f7035ad0b026458() { return handleError(function (arg0, arg1, arg2) {
1638
+ const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
1639
+ return ret;
1640
+ }, arguments); }
1641
+ export function __wbg_setTimeout_c8336cac3e6a81ea() { return handleError(function (arg0, arg1, arg2) {
1642
+ const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
1643
+ return ret;
1644
+ }, arguments); }
1645
+ export function __wbg_setTimeout_f757f00851f76c42(arg0, arg1) {
1646
+ const ret = setTimeout(getObject(arg0), arg1);
1647
+ return addHeapObject(ret);
1648
+ }
1649
+ export function __wbg_set_282384002438957f(arg0, arg1, arg2) {
1650
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1651
+ }
1652
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
1653
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1654
+ }
1655
+ export function __wbg_set_7eaa4f96924fd6b3() { return handleError(function (arg0, arg1, arg2) {
1656
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1657
+ return ret;
1658
+ }, arguments); }
1659
+ export function __wbg_set_bf7251625df30a02(arg0, arg1, arg2) {
1660
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1661
+ return addHeapObject(ret);
1662
+ }
1663
+ export function __wbg_set_body_a3d856b097dfda04(arg0, arg1) {
1664
+ getObject(arg0).body = getObject(arg1);
1665
+ }
1666
+ export function __wbg_set_cache_ec7e430c6056ebda(arg0, arg1) {
1667
+ getObject(arg0).cache = __wbindgen_enum_RequestCache[arg1];
1668
+ }
1669
+ export function __wbg_set_credentials_ed63183445882c65(arg0, arg1) {
1670
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
1671
+ }
1672
+ export function __wbg_set_d1cb61e9f39c870f(arg0, arg1, arg2) {
1673
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1674
+ }
1675
+ export function __wbg_set_headers_3c8fecc693b75327(arg0, arg1) {
1676
+ getObject(arg0).headers = getObject(arg1);
1677
+ }
1678
+ export function __wbg_set_method_8c015e8bcafd7be1(arg0, arg1, arg2) {
1679
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
1680
+ }
1681
+ export function __wbg_set_mode_5a87f2c809cf37c2(arg0, arg1) {
1682
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
1683
+ }
1684
+ export function __wbg_set_signal_0cebecb698f25d21(arg0, arg1) {
1685
+ getObject(arg0).signal = getObject(arg1);
1686
+ }
1687
+ export function __wbg_signMessage_a4d5bd6a6a624a40() { return handleError(function (arg0, arg1, arg2, arg3) {
1688
+ let deferred0_0;
1689
+ let deferred0_1;
1690
+ let deferred1_0;
1691
+ let deferred1_1;
1692
+ try {
1693
+ deferred0_0 = arg0;
1694
+ deferred0_1 = arg1;
1695
+ deferred1_0 = arg2;
1696
+ deferred1_1 = arg3;
1697
+ const ret = window.keychain_wallets.signMessage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
1698
+ return addHeapObject(ret);
1699
+ } finally {
1700
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1701
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1702
+ }
1703
+ }, arguments); }
1704
+ export function __wbg_signal_166e1da31adcac18(arg0) {
1705
+ const ret = getObject(arg0).signal;
1927
1706
  return addHeapObject(ret);
1928
- }, arguments) };
1929
-
1930
- export function __wbg_next_020810e0ae8ebcb0() { return handleError(function (arg0) {
1931
- const ret = getObject(arg0).next();
1707
+ }
1708
+ export function __wbg_static_accessor_GLOBAL_8adb955bd33fac2f() {
1709
+ const ret = typeof global === 'undefined' ? null : global;
1710
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1711
+ }
1712
+ export function __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913() {
1713
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1714
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1715
+ }
1716
+ export function __wbg_static_accessor_SELF_f207c857566db248() {
1717
+ const ret = typeof self === 'undefined' ? null : self;
1718
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1719
+ }
1720
+ export function __wbg_static_accessor_WINDOW_bb9f1ba69d61b386() {
1721
+ const ret = typeof window === 'undefined' ? null : window;
1722
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1723
+ }
1724
+ export function __wbg_status_318629ab93a22955(arg0) {
1725
+ const ret = getObject(arg0).status;
1726
+ return ret;
1727
+ }
1728
+ export function __wbg_stringify_26436a2becff957e(arg0, arg1) {
1729
+ const ret = JSON.stringify(getObject(arg1));
1730
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1731
+ var len1 = WASM_VECTOR_LEN;
1732
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1733
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1734
+ }
1735
+ export function __wbg_stringify_5ae93966a84901ac() { return handleError(function (arg0) {
1736
+ const ret = JSON.stringify(getObject(arg0));
1932
1737
  return addHeapObject(ret);
1933
- }, arguments) };
1934
-
1935
- export function __wbg_next_2c826fe5dfec6b6a(arg0) {
1936
- const ret = getObject(arg0).next;
1738
+ }, arguments); }
1739
+ export function __wbg_subarray_a068d24e39478a8a(arg0, arg1, arg2) {
1740
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1937
1741
  return addHeapObject(ret);
1938
- };
1939
-
1940
- export function __wbg_node_905d3e251edff8a2(arg0) {
1941
- const ret = getObject(arg0).node;
1742
+ }
1743
+ export function __wbg_text_372f5b91442c50f9() { return handleError(function (arg0) {
1744
+ const ret = getObject(arg0).text();
1942
1745
  return addHeapObject(ret);
1943
- };
1944
-
1945
- export function __wbg_now_793306c526e2e3b6() {
1946
- const ret = Date.now();
1947
- return ret;
1948
- };
1949
-
1950
- export function __wbg_obtain_a9626b3b96e6dc2c(arg0) {
1951
- const ret = getObject(arg0).obtain();
1746
+ }, arguments); }
1747
+ export function __wbg_then_098abe61755d12f6(arg0, arg1) {
1748
+ const ret = getObject(arg0).then(getObject(arg1));
1952
1749
  return addHeapObject(ret);
1953
- };
1954
-
1955
- export function __wbg_open_fb2ffe46992a06d3() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1956
- const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6));
1957
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1958
- }, arguments) };
1959
-
1960
- export function __wbg_origin_2b5e7986f349f4f3() { return handleError(function (arg0, arg1) {
1961
- const ret = getObject(arg1).origin;
1750
+ }
1751
+ export function __wbg_then_9e335f6dd892bc11(arg0, arg1, arg2) {
1752
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1753
+ return addHeapObject(ret);
1754
+ }
1755
+ export function __wbg_url_7fefc1820fba4e0c(arg0, arg1) {
1756
+ const ret = getObject(arg1).url;
1962
1757
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1963
1758
  const len1 = WASM_VECTOR_LEN;
1964
1759
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1965
1760
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1966
- }, arguments) };
1967
-
1968
- export function __wbg_origin_fe3e49d24e97a343(arg0, arg1) {
1969
- const ret = getObject(arg1).origin;
1761
+ }
1762
+ export function __wbg_userAgent_161a5f2d2a8dee61() { return handleError(function (arg0, arg1) {
1763
+ const ret = getObject(arg1).userAgent;
1970
1764
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1971
1765
  const len1 = WASM_VECTOR_LEN;
1972
1766
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1973
1767
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1974
- };
1975
-
1976
- export function __wbg_parse_41503dcdc1dc43f2(arg0, arg1) {
1977
- let deferred0_0;
1978
- let deferred0_1;
1979
- try {
1980
- deferred0_0 = arg0;
1981
- deferred0_1 = arg1;
1982
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1983
- return addHeapObject(ret);
1984
- } finally {
1985
- wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1986
- }
1987
- };
1988
-
1989
- export function __wbg_process_dc0fbacc7c1c06f7(arg0) {
1990
- const ret = getObject(arg0).process;
1768
+ }, arguments); }
1769
+ export function __wbg_value_21fc78aab0322612(arg0) {
1770
+ const ret = getObject(arg0).value;
1991
1771
  return addHeapObject(ret);
1992
- };
1993
-
1994
- export function __wbg_prototypesetcall_2a6620b6922694b2(arg0, arg1, arg2) {
1995
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1996
- };
1997
-
1998
- export function __wbg_push_df81a39d04db858c(arg0, arg1) {
1999
- const ret = getObject(arg0).push(getObject(arg1));
2000
- return ret;
2001
- };
2002
-
2003
- export function __wbg_queueMicrotask_34d692c25c47d05b(arg0) {
2004
- const ret = getObject(arg0).queueMicrotask;
1772
+ }
1773
+ export function __wbg_versions_276b2795b1c6a219(arg0) {
1774
+ const ret = getObject(arg0).versions;
1775
+ return addHeapObject(ret);
1776
+ }
1777
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
1778
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1044, function: Function { arguments: [], shim_idx: 1045, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1779
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8966, __wasm_bindgen_func_elem_8975);
1780
+ return addHeapObject(ret);
1781
+ }
1782
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
1783
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1078, function: Function { arguments: [Externref], shim_idx: 1209, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1784
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_9110, __wasm_bindgen_func_elem_11243);
1785
+ return addHeapObject(ret);
1786
+ }
1787
+ export function __wbindgen_cast_0000000000000003(arg0, arg1) {
1788
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 15, function: Function { arguments: [NamedExternref("Function")], shim_idx: 17, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1789
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_768, __wasm_bindgen_func_elem_3395);
1790
+ return addHeapObject(ret);
1791
+ }
1792
+ export function __wbindgen_cast_0000000000000004(arg0, arg1) {
1793
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 15, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 16, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1794
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_768, __wasm_bindgen_func_elem_3394);
1795
+ return addHeapObject(ret);
1796
+ }
1797
+ export function __wbindgen_cast_0000000000000005(arg0) {
1798
+ // Cast intrinsic for `F64 -> Externref`.
1799
+ const ret = arg0;
1800
+ return addHeapObject(ret);
1801
+ }
1802
+ export function __wbindgen_cast_0000000000000006(arg0) {
1803
+ // Cast intrinsic for `I64 -> Externref`.
1804
+ const ret = arg0;
1805
+ return addHeapObject(ret);
1806
+ }
1807
+ export function __wbindgen_cast_0000000000000007(arg0, arg1) {
1808
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1809
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1810
+ return addHeapObject(ret);
1811
+ }
1812
+ export function __wbindgen_cast_0000000000000008(arg0, arg1) {
1813
+ // Cast intrinsic for `Ref(String) -> Externref`.
1814
+ const ret = getStringFromWasm0(arg0, arg1);
1815
+ return addHeapObject(ret);
1816
+ }
1817
+ export function __wbindgen_object_clone_ref(arg0) {
1818
+ const ret = getObject(arg0);
2005
1819
  return addHeapObject(ret);
2006
- };
1820
+ }
1821
+ export function __wbindgen_object_drop_ref(arg0) {
1822
+ takeObject(arg0);
1823
+ }
1824
+ function __wasm_bindgen_func_elem_8975(arg0, arg1) {
1825
+ wasm.__wasm_bindgen_func_elem_8975(arg0, arg1);
1826
+ }
2007
1827
 
2008
- export function __wbg_queueMicrotask_9d76cacb20c84d58(arg0) {
2009
- queueMicrotask(getObject(arg0));
2010
- };
1828
+ function __wasm_bindgen_func_elem_3394(arg0, arg1, arg2) {
1829
+ wasm.__wasm_bindgen_func_elem_3394(arg0, arg1, addHeapObject(arg2));
1830
+ }
2011
1831
 
2012
- export function __wbg_randomFillSync_ac0988aba3254290() { return handleError(function (arg0, arg1) {
2013
- getObject(arg0).randomFillSync(takeObject(arg1));
2014
- }, arguments) };
1832
+ function __wasm_bindgen_func_elem_11243(arg0, arg1, arg2) {
1833
+ try {
1834
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1835
+ wasm.__wasm_bindgen_func_elem_11243(retptr, arg0, arg1, addHeapObject(arg2));
1836
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1837
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1838
+ if (r1) {
1839
+ throw takeObject(r0);
1840
+ }
1841
+ } finally {
1842
+ wasm.__wbindgen_add_to_stack_pointer(16);
1843
+ }
1844
+ }
2015
1845
 
2016
- export function __wbg_removeEventListener_aa21ef619e743518() { return handleError(function (arg0, arg1, arg2, arg3) {
2017
- getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
2018
- }, arguments) };
1846
+ function __wasm_bindgen_func_elem_3395(arg0, arg1, arg2) {
1847
+ try {
1848
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1849
+ wasm.__wasm_bindgen_func_elem_3395(retptr, arg0, arg1, addHeapObject(arg2));
1850
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1851
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1852
+ if (r1) {
1853
+ throw takeObject(r0);
1854
+ }
1855
+ } finally {
1856
+ wasm.__wbindgen_add_to_stack_pointer(16);
1857
+ }
1858
+ }
2019
1859
 
2020
- export function __wbg_removeItem_0e1e70f1687b5304() { return handleError(function (arg0, arg1, arg2) {
2021
- getObject(arg0).removeItem(getStringFromWasm0(arg1, arg2));
2022
- }, arguments) };
1860
+ function __wasm_bindgen_func_elem_11254(arg0, arg1, arg2, arg3) {
1861
+ wasm.__wasm_bindgen_func_elem_11254(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1862
+ }
2023
1863
 
2024
- export function __wbg_require_60cc747a6bc5215a() { return handleError(function () {
2025
- const ret = module.require;
2026
- return addHeapObject(ret);
2027
- }, arguments) };
2028
1864
 
2029
- export function __wbg_resolve_caf97c30b83f7053(arg0) {
2030
- const ret = Promise.resolve(getObject(arg0));
2031
- return addHeapObject(ret);
2032
- };
1865
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
2033
1866
 
2034
- export function __wbg_setItem_64dfb54d7b20d84c() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2035
- getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2036
- }, arguments) };
2037
1867
 
2038
- export function __wbg_setTimeout_780ac15e3df4c663() { return handleError(function (arg0, arg1, arg2) {
2039
- const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
2040
- return ret;
2041
- }, arguments) };
1868
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
2042
1869
 
2043
- export function __wbg_setTimeout_7bb3429662ab1e70(arg0, arg1) {
2044
- const ret = setTimeout(getObject(arg0), arg1);
2045
- return addHeapObject(ret);
2046
- };
2047
1870
 
2048
- export function __wbg_setTimeout_d673afe2a3649259() { return handleError(function (arg0, arg1, arg2) {
2049
- const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
2050
- return ret;
2051
- }, arguments) };
1871
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1872
+ const CartridgeAccountFinalization = (typeof FinalizationRegistry === 'undefined')
1873
+ ? { register: () => {}, unregister: () => {} }
1874
+ : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccount_free(ptr >>> 0, 1));
1875
+ const CartridgeAccountMetaFinalization = (typeof FinalizationRegistry === 'undefined')
1876
+ ? { register: () => {}, unregister: () => {} }
1877
+ : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccountmeta_free(ptr >>> 0, 1));
1878
+ const CartridgeAccountWithMetaFinalization = (typeof FinalizationRegistry === 'undefined')
1879
+ ? { register: () => {}, unregister: () => {} }
1880
+ : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccountwithmeta_free(ptr >>> 0, 1));
1881
+ const ControllerFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
1882
+ ? { register: () => {}, unregister: () => {} }
1883
+ : new FinalizationRegistry(ptr => wasm.__wbg_controllerfactory_free(ptr >>> 0, 1));
1884
+ const JsChainConfigFinalization = (typeof FinalizationRegistry === 'undefined')
1885
+ ? { register: () => {}, unregister: () => {} }
1886
+ : new FinalizationRegistry(ptr => wasm.__wbg_jschainconfig_free(ptr >>> 0, 1));
1887
+ const JsControllerErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1888
+ ? { register: () => {}, unregister: () => {} }
1889
+ : new FinalizationRegistry(ptr => wasm.__wbg_jscontrollererror_free(ptr >>> 0, 1));
1890
+ const LoginResultFinalization = (typeof FinalizationRegistry === 'undefined')
1891
+ ? { register: () => {}, unregister: () => {} }
1892
+ : new FinalizationRegistry(ptr => wasm.__wbg_loginresult_free(ptr >>> 0, 1));
1893
+ const MultiChainAccountFinalization = (typeof FinalizationRegistry === 'undefined')
1894
+ ? { register: () => {}, unregister: () => {} }
1895
+ : new FinalizationRegistry(ptr => wasm.__wbg_multichainaccount_free(ptr >>> 0, 1));
1896
+ const MultiChainAccountMetaFinalization = (typeof FinalizationRegistry === 'undefined')
1897
+ ? { register: () => {}, unregister: () => {} }
1898
+ : new FinalizationRegistry(ptr => wasm.__wbg_multichainaccountmeta_free(ptr >>> 0, 1));
2052
1899
 
2053
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
2054
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2055
- };
1900
+ function addHeapObject(obj) {
1901
+ if (heap_next === heap.length) heap.push(heap.length + 1);
1902
+ const idx = heap_next;
1903
+ heap_next = heap[idx];
2056
1904
 
2057
- export function __wbg_set_3fda3bac07393de4(arg0, arg1, arg2) {
2058
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2059
- };
1905
+ heap[idx] = obj;
1906
+ return idx;
1907
+ }
2060
1908
 
2061
- export function __wbg_set_907fb406c34a251d(arg0, arg1, arg2) {
2062
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2063
- return addHeapObject(ret);
2064
- };
1909
+ function _assertClass(instance, klass) {
1910
+ if (!(instance instanceof klass)) {
1911
+ throw new Error(`expected instance of ${klass.name}`);
1912
+ }
1913
+ }
2065
1914
 
2066
- export function __wbg_set_body_3c365989753d61f4(arg0, arg1) {
2067
- getObject(arg0).body = getObject(arg1);
2068
- };
1915
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1916
+ ? { register: () => {}, unregister: () => {} }
1917
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
2069
1918
 
2070
- export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
2071
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2072
- };
1919
+ function debugString(val) {
1920
+ // primitive types
1921
+ const type = typeof val;
1922
+ if (type == 'number' || type == 'boolean' || val == null) {
1923
+ return `${val}`;
1924
+ }
1925
+ if (type == 'string') {
1926
+ return `"${val}"`;
1927
+ }
1928
+ if (type == 'symbol') {
1929
+ const description = val.description;
1930
+ if (description == null) {
1931
+ return 'Symbol';
1932
+ } else {
1933
+ return `Symbol(${description})`;
1934
+ }
1935
+ }
1936
+ if (type == 'function') {
1937
+ const name = val.name;
1938
+ if (typeof name == 'string' && name.length > 0) {
1939
+ return `Function(${name})`;
1940
+ } else {
1941
+ return 'Function';
1942
+ }
1943
+ }
1944
+ // objects
1945
+ if (Array.isArray(val)) {
1946
+ const length = val.length;
1947
+ let debug = '[';
1948
+ if (length > 0) {
1949
+ debug += debugString(val[0]);
1950
+ }
1951
+ for(let i = 1; i < length; i++) {
1952
+ debug += ', ' + debugString(val[i]);
1953
+ }
1954
+ debug += ']';
1955
+ return debug;
1956
+ }
1957
+ // Test for built-in
1958
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1959
+ let className;
1960
+ if (builtInMatches && builtInMatches.length > 1) {
1961
+ className = builtInMatches[1];
1962
+ } else {
1963
+ // Failed to match the standard '[object ClassName]'
1964
+ return toString.call(val);
1965
+ }
1966
+ if (className == 'Object') {
1967
+ // we're a user defined class or Object
1968
+ // JSON.stringify avoids problems with cycles, and is generally much
1969
+ // easier than looping through ownProperties of `val`.
1970
+ try {
1971
+ return 'Object(' + JSON.stringify(val) + ')';
1972
+ } catch (_) {
1973
+ return 'Object';
1974
+ }
1975
+ }
1976
+ // errors
1977
+ if (val instanceof Error) {
1978
+ return `${val.name}: ${val.message}\n${val.stack}`;
1979
+ }
1980
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1981
+ return className;
1982
+ }
2073
1983
 
2074
- export function __wbg_set_c2abbebe8b9ebee1() { return handleError(function (arg0, arg1, arg2) {
2075
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2076
- return ret;
2077
- }, arguments) };
1984
+ function dropObject(idx) {
1985
+ if (idx < 1028) return;
1986
+ heap[idx] = heap_next;
1987
+ heap_next = idx;
1988
+ }
2078
1989
 
2079
- export function __wbg_set_cache_2f9deb19b92b81e3(arg0, arg1) {
2080
- getObject(arg0).cache = __wbindgen_enum_RequestCache[arg1];
2081
- };
1990
+ function getArrayJsValueFromWasm0(ptr, len) {
1991
+ ptr = ptr >>> 0;
1992
+ const mem = getDataViewMemory0();
1993
+ const result = [];
1994
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1995
+ result.push(takeObject(mem.getUint32(i, true)));
1996
+ }
1997
+ return result;
1998
+ }
2082
1999
 
2083
- export function __wbg_set_credentials_f621cd2d85c0c228(arg0, arg1) {
2084
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
2085
- };
2000
+ function getArrayU8FromWasm0(ptr, len) {
2001
+ ptr = ptr >>> 0;
2002
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2003
+ }
2086
2004
 
2087
- export function __wbg_set_headers_6926da238cd32ee4(arg0, arg1) {
2088
- getObject(arg0).headers = getObject(arg1);
2089
- };
2005
+ let cachedDataViewMemory0 = null;
2006
+ function getDataViewMemory0() {
2007
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
2008
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2009
+ }
2010
+ return cachedDataViewMemory0;
2011
+ }
2090
2012
 
2091
- export function __wbg_set_method_c02d8cbbe204ac2d(arg0, arg1, arg2) {
2092
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
2093
- };
2013
+ function getStringFromWasm0(ptr, len) {
2014
+ ptr = ptr >>> 0;
2015
+ return decodeText(ptr, len);
2016
+ }
2094
2017
 
2095
- export function __wbg_set_mode_52ef73cfa79639cb(arg0, arg1) {
2096
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
2097
- };
2018
+ let cachedUint8ArrayMemory0 = null;
2019
+ function getUint8ArrayMemory0() {
2020
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2021
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2022
+ }
2023
+ return cachedUint8ArrayMemory0;
2024
+ }
2098
2025
 
2099
- export function __wbg_set_signal_dda2cf7ccb6bee0f(arg0, arg1) {
2100
- getObject(arg0).signal = getObject(arg1);
2101
- };
2026
+ function getObject(idx) { return heap[idx]; }
2102
2027
 
2103
- export function __wbg_signMessage_c732ea9d998cac79() { return handleError(function (arg0, arg1, arg2, arg3) {
2104
- let deferred0_0;
2105
- let deferred0_1;
2106
- let deferred1_0;
2107
- let deferred1_1;
2028
+ function handleError(f, args) {
2108
2029
  try {
2109
- deferred0_0 = arg0;
2110
- deferred0_1 = arg1;
2111
- deferred1_0 = arg2;
2112
- deferred1_1 = arg3;
2113
- const ret = window.keychain_wallets.signMessage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
2114
- return addHeapObject(ret);
2115
- } finally {
2116
- wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
2117
- wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2030
+ return f.apply(this, args);
2031
+ } catch (e) {
2032
+ wasm.__wbindgen_export3(addHeapObject(e));
2118
2033
  }
2119
- }, arguments) };
2120
-
2121
- export function __wbg_signal_4db5aa055bf9eb9a(arg0) {
2122
- const ret = getObject(arg0).signal;
2123
- return addHeapObject(ret);
2124
- };
2125
-
2126
- export function __wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e() {
2127
- const ret = typeof global === 'undefined' ? null : global;
2128
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2129
- };
2130
-
2131
- export function __wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac() {
2132
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
2133
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2134
- };
2135
-
2136
- export function __wbg_static_accessor_SELF_6fdf4b64710cc91b() {
2137
- const ret = typeof self === 'undefined' ? null : self;
2138
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2139
- };
2034
+ }
2140
2035
 
2141
- export function __wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2() {
2142
- const ret = typeof window === 'undefined' ? null : window;
2143
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2144
- };
2036
+ let heap = new Array(1024).fill(undefined);
2037
+ heap.push(undefined, null, true, false);
2145
2038
 
2146
- export function __wbg_status_de7eed5a7a5bfd5d(arg0) {
2147
- const ret = getObject(arg0).status;
2148
- return ret;
2149
- };
2039
+ let heap_next = heap.length;
2150
2040
 
2151
- export function __wbg_stringify_404baa47f2ce77aa(arg0, arg1) {
2152
- const ret = JSON.stringify(getObject(arg1));
2153
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2154
- var len1 = WASM_VECTOR_LEN;
2155
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2156
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2157
- };
2041
+ function isLikeNone(x) {
2042
+ return x === undefined || x === null;
2043
+ }
2158
2044
 
2159
- export function __wbg_stringify_b5fb28f6465d9c3e() { return handleError(function (arg0) {
2160
- const ret = JSON.stringify(getObject(arg0));
2161
- return addHeapObject(ret);
2162
- }, arguments) };
2045
+ function makeClosure(arg0, arg1, dtor, f) {
2046
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
2047
+ const real = (...args) => {
2163
2048
 
2164
- export function __wbg_subarray_480600f3d6a9f26c(arg0, arg1, arg2) {
2165
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2166
- return addHeapObject(ret);
2167
- };
2049
+ // First up with a closure we increment the internal reference
2050
+ // count. This ensures that the Rust closure environment won't
2051
+ // be deallocated while we're invoking it.
2052
+ state.cnt++;
2053
+ try {
2054
+ return f(state.a, state.b, ...args);
2055
+ } finally {
2056
+ real._wbg_cb_unref();
2057
+ }
2058
+ };
2059
+ real._wbg_cb_unref = () => {
2060
+ if (--state.cnt === 0) {
2061
+ state.dtor(state.a, state.b);
2062
+ state.a = 0;
2063
+ CLOSURE_DTORS.unregister(state);
2064
+ }
2065
+ };
2066
+ CLOSURE_DTORS.register(real, state, state);
2067
+ return real;
2068
+ }
2168
2069
 
2169
- export function __wbg_text_dc33c15c17bdfb52() { return handleError(function (arg0) {
2170
- const ret = getObject(arg0).text();
2171
- return addHeapObject(ret);
2172
- }, arguments) };
2070
+ function makeMutClosure(arg0, arg1, dtor, f) {
2071
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
2072
+ const real = (...args) => {
2173
2073
 
2174
- export function __wbg_then_4f46f6544e6b4a28(arg0, arg1) {
2175
- const ret = getObject(arg0).then(getObject(arg1));
2176
- return addHeapObject(ret);
2177
- };
2074
+ // First up with a closure we increment the internal reference
2075
+ // count. This ensures that the Rust closure environment won't
2076
+ // be deallocated while we're invoking it.
2077
+ state.cnt++;
2078
+ const a = state.a;
2079
+ state.a = 0;
2080
+ try {
2081
+ return f(a, state.b, ...args);
2082
+ } finally {
2083
+ state.a = a;
2084
+ real._wbg_cb_unref();
2085
+ }
2086
+ };
2087
+ real._wbg_cb_unref = () => {
2088
+ if (--state.cnt === 0) {
2089
+ state.dtor(state.a, state.b);
2090
+ state.a = 0;
2091
+ CLOSURE_DTORS.unregister(state);
2092
+ }
2093
+ };
2094
+ CLOSURE_DTORS.register(real, state, state);
2095
+ return real;
2096
+ }
2178
2097
 
2179
- export function __wbg_then_70d05cf780a18d77(arg0, arg1, arg2) {
2180
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2181
- return addHeapObject(ret);
2182
- };
2098
+ function passArrayJsValueToWasm0(array, malloc) {
2099
+ const ptr = malloc(array.length * 4, 4) >>> 0;
2100
+ const mem = getDataViewMemory0();
2101
+ for (let i = 0; i < array.length; i++) {
2102
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
2103
+ }
2104
+ WASM_VECTOR_LEN = array.length;
2105
+ return ptr;
2106
+ }
2183
2107
 
2184
- export function __wbg_url_b36d2a5008eb056f(arg0, arg1) {
2185
- const ret = getObject(arg1).url;
2186
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2187
- const len1 = WASM_VECTOR_LEN;
2188
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2189
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2190
- };
2108
+ function passStringToWasm0(arg, malloc, realloc) {
2109
+ if (realloc === undefined) {
2110
+ const buf = cachedTextEncoder.encode(arg);
2111
+ const ptr = malloc(buf.length, 1) >>> 0;
2112
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
2113
+ WASM_VECTOR_LEN = buf.length;
2114
+ return ptr;
2115
+ }
2191
2116
 
2192
- export function __wbg_userAgent_b20949aa6be940a6() { return handleError(function (arg0, arg1) {
2193
- const ret = getObject(arg1).userAgent;
2194
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2195
- const len1 = WASM_VECTOR_LEN;
2196
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2197
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2198
- }, arguments) };
2117
+ let len = arg.length;
2118
+ let ptr = malloc(len, 1) >>> 0;
2199
2119
 
2200
- export function __wbg_value_692627309814bb8c(arg0) {
2201
- const ret = getObject(arg0).value;
2202
- return addHeapObject(ret);
2203
- };
2120
+ const mem = getUint8ArrayMemory0();
2204
2121
 
2205
- export function __wbg_versions_c01dfd4722a88165(arg0) {
2206
- const ret = getObject(arg0).versions;
2207
- return addHeapObject(ret);
2208
- };
2122
+ let offset = 0;
2209
2123
 
2210
- export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
2211
- // Cast intrinsic for `Ref(String) -> Externref`.
2212
- const ret = getStringFromWasm0(arg0, arg1);
2213
- return addHeapObject(ret);
2214
- };
2124
+ for (; offset < len; offset++) {
2125
+ const code = arg.charCodeAt(offset);
2126
+ if (code > 0x7F) break;
2127
+ mem[ptr + offset] = code;
2128
+ }
2129
+ if (offset !== len) {
2130
+ if (offset !== 0) {
2131
+ arg = arg.slice(offset);
2132
+ }
2133
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2134
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2135
+ const ret = cachedTextEncoder.encodeInto(arg, view);
2215
2136
 
2216
- export function __wbindgen_cast_4082834687a71a5d(arg0, arg1) {
2217
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
2218
- const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_225, __wasm_bindgen_func_elem_3186);
2219
- return addHeapObject(ret);
2220
- };
2137
+ offset += ret.written;
2138
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
2139
+ }
2221
2140
 
2222
- export function __wbindgen_cast_838747baf6b6553b(arg0, arg1) {
2223
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1004, function: Function { arguments: [Externref], shim_idx: 1005, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2224
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8819, __wasm_bindgen_func_elem_8834);
2225
- return addHeapObject(ret);
2226
- };
2141
+ WASM_VECTOR_LEN = offset;
2142
+ return ptr;
2143
+ }
2227
2144
 
2228
- export function __wbindgen_cast_9ae0607507abb057(arg0) {
2229
- // Cast intrinsic for `I64 -> Externref`.
2230
- const ret = arg0;
2231
- return addHeapObject(ret);
2232
- };
2145
+ function takeObject(idx) {
2146
+ const ret = getObject(idx);
2147
+ dropObject(idx);
2148
+ return ret;
2149
+ }
2233
2150
 
2234
- export function __wbindgen_cast_a572ca3f1306512c(arg0, arg1) {
2235
- // Cast intrinsic for `Closure(Closure { dtor_idx: 971, function: Function { arguments: [], shim_idx: 972, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2236
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8681, __wasm_bindgen_func_elem_8690);
2237
- return addHeapObject(ret);
2238
- };
2151
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2152
+ cachedTextDecoder.decode();
2153
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
2154
+ let numBytesDecoded = 0;
2155
+ function decodeText(ptr, len) {
2156
+ numBytesDecoded += len;
2157
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
2158
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2159
+ cachedTextDecoder.decode();
2160
+ numBytesDecoded = len;
2161
+ }
2162
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2163
+ }
2239
2164
 
2240
- export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
2241
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
2242
- const ret = getArrayU8FromWasm0(arg0, arg1);
2243
- return addHeapObject(ret);
2244
- };
2165
+ const cachedTextEncoder = new TextEncoder();
2245
2166
 
2246
- export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
2247
- // Cast intrinsic for `F64 -> Externref`.
2248
- const ret = arg0;
2249
- return addHeapObject(ret);
2250
- };
2167
+ if (!('encodeInto' in cachedTextEncoder)) {
2168
+ cachedTextEncoder.encodeInto = function (arg, view) {
2169
+ const buf = cachedTextEncoder.encode(arg);
2170
+ view.set(buf);
2171
+ return {
2172
+ read: arg.length,
2173
+ written: buf.length
2174
+ };
2175
+ };
2176
+ }
2251
2177
 
2252
- export function __wbindgen_object_clone_ref(arg0) {
2253
- const ret = getObject(arg0);
2254
- return addHeapObject(ret);
2255
- };
2178
+ let WASM_VECTOR_LEN = 0;
2256
2179
 
2257
- export function __wbindgen_object_drop_ref(arg0) {
2258
- takeObject(arg0);
2259
- };
2260
2180
 
2181
+ let wasm;
2182
+ export function __wbg_set_wasm(val) {
2183
+ wasm = val;
2184
+ }